This commit is contained in:
2025-09-14 00:21:54 +08:00
commit d40b3bbd62
766 changed files with 36275 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
camera {
height: 250px;
}
.btn-area {
margin-top: 0;
}
form {
margin-top: 15px;
}
.weui-cell__bd {
display: flex;
justify-content: flex-start;
align-items: center;
padding: 10px 0;
min-height: 30px;
}

View File

@@ -0,0 +1,31 @@
Page({
onShareAppMessage() {
return {
title: 'camera',
path: 'page/component/pages/camera-scan-code/camera-scan-code',
};
},
data: {
result: {},
},
onReady() {
xhs.showModal({
title: '提示',
content: '将摄像头对准一维码即可扫描',
showCancel: false,
});
},
scanCode(e) {
console.log('scanCode:', e);
this.setData({
result: e.detail,
});
},
navigateBack() {
xhs.navigateBack();
},
error(e) {
console.log(e.detail);
},
});

View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "camera"
}

View File

@@ -0,0 +1,40 @@
<view class="container">
<view class="page-body">
<view class="page-body-wrapper">
<camera
mode="scanCode"
flash="off"
bindscancode="scanCode"
binderror="error"
>
</camera>
<view class="btn-area">
<button type="primary" bindtap="navigateBack">
返回正常模式
</button>
</view>
<form>
<view class="page-section">
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell weui-cell_input">
<view class="weui-cell__hd">
<view class="weui-label">类型</view>
</view>
<view class="weui-cell__bd">
{{ result.type }}
</view>
</view>
<view class="weui-cell weui-cell_input">
<view class="weui-cell__hd">
<view class="weui-label">结果</view>
</view>
<view class="weui-cell__bd">
{{ result.result }}
</view>
</view>
</view>
</view>
</form>
</view>
</view>
</view>