camera.wxml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <import src="../../../common/head.wxml" />
  2. <import src="../../../common/foot.wxml" />
  3. <view class="container">
  4. <template is="head" data="{{title: 'camera'}}"/>
  5. <view class="page-body">
  6. <view class="page-body-wrapper">
  7. <camera
  8. flash="off"
  9. device-position="{{position}}"
  10. binderror="error"
  11. >
  12. </camera>
  13. <view class="btn-area first-btn">
  14. <button type="primary" bindtap="togglePosition">切换摄像头</button>
  15. </view>
  16. <view class="btn-area">
  17. <button type="primary" bindtap="takePhoto">拍照</button>
  18. </view>
  19. <view class="btn-area">
  20. <button type="primary" bindtap="startRecord">开始录像</button>
  21. </view>
  22. <view class="btn-area">
  23. <button type="primary" bindtap="stopRecord">结束录像</button>
  24. </view>
  25. <view class="btn-area">
  26. <navigator url="/page/component/pages/camera-scan-code/camera-scan-code">
  27. <button type="primary">扫描一维码</button>
  28. </navigator>
  29. </view>
  30. <view class="preview-tips">预览</view>
  31. <image wx:if="{{src}}" mode="widthFix" class="photo" src="{{src}}"></image>
  32. <video wx:if="{{videoSrc}}" class="video" src="{{videoSrc}}"></video>
  33. </view>
  34. </view>
  35. <template is="foot" />
  36. </view>