init
This commit is contained in:
42
xhs-mini-demos/component-case/camera/camera.xhsml
Normal file
42
xhs-mini-demos/component-case/camera/camera.xhsml
Normal file
@@ -0,0 +1,42 @@
|
||||
<view class="container">
|
||||
<view class="page-body">
|
||||
<view class="page-body-wrapper">
|
||||
<view style="margin-bottom: 10px"> camera 组件 </view>
|
||||
<camera
|
||||
flash="off"
|
||||
device-position="{{position}}"
|
||||
binderror="error"
|
||||
>
|
||||
</camera>
|
||||
<view xhs:if="{{showCanvas}}" class="info-container">
|
||||
<view style="margin: 10px 0">使用实时数据帧在 canvas 组件的展示</view>
|
||||
<view>
|
||||
帧高度:{{ frameHeight }} 帧宽度:{{ frameWidth }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn-area first-btn">
|
||||
<button bindtap="handleShowCanvas" type="primary">{{showCanvas ? "关闭实时帧数据模式": "开启实时帧数据模式"}}</button>
|
||||
</view>
|
||||
<view class="btn-area">
|
||||
<button type="primary" bindtap="togglePosition">切换摄像头</button>
|
||||
</view>
|
||||
<view class="btn-area">
|
||||
<button type="primary" bindtap="takePhoto">拍照</button>
|
||||
</view>
|
||||
<view class="btn-area">
|
||||
<button type="primary" bindtap="startRecord">开始录像</button>
|
||||
</view>
|
||||
<view class="btn-area">
|
||||
<button type="primary" bindtap="stopRecord">结束录像</button>
|
||||
</view>
|
||||
<view class="btn-area">
|
||||
<navigator url="/page/component/pages/camera-scan-code/camera-scan-code" hover-class="none">
|
||||
<button type="primary">扫描一维码</button>
|
||||
</navigator>
|
||||
</view>
|
||||
<view class="preview-tips">点击录像或拍照即可在下方预览效果</view>
|
||||
<image xhs:if="{{src}}" mode="widthFix" class="photo" src="{{src}}"></image>
|
||||
<video xhs:if="{{videoSrc}}" class="video" src="{{videoSrc}}"></video>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
Reference in New Issue
Block a user