扫码
This commit is contained in:
@@ -55,18 +55,35 @@ uni-button:after {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
.icon_scan {
|
.icon_scan {
|
||||||
font-size: 48rpx;
|
width: 42rpx;
|
||||||
line-height: 70rpx;
|
height: 48rpx;
|
||||||
|
font-size: 40rpx;
|
||||||
|
line-height: 48rpx;
|
||||||
color: #323232;
|
color: #323232;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.icon_phone {
|
||||||
|
width: 48rpx;
|
||||||
|
height: 48rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
line-height: 48rpx;
|
||||||
|
color: #323232;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
.icon_del {
|
.icon_del {
|
||||||
font-size: 48rpx;
|
width: 46rpx;
|
||||||
line-height: 70rpx;
|
height: 48rpx;
|
||||||
|
font-size: 46rpx;
|
||||||
|
line-height: 48rpx;
|
||||||
color: #323232;
|
color: #323232;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
.icon_search {
|
.icon_search {
|
||||||
|
width: 48rpx;
|
||||||
|
height: 48rpx;
|
||||||
|
font-size: 40rpx;
|
||||||
color: #323232;
|
color: #323232;
|
||||||
line-height: 70rpx;
|
line-height: 48rpx;
|
||||||
}
|
}
|
||||||
.cancel_icon::before {
|
.cancel_icon::before {
|
||||||
content: "\e6dc";
|
content: "\e6dc";
|
||||||
|
|||||||
@@ -8,9 +8,10 @@
|
|||||||
@blur="handleBlur($event)"
|
@blur="handleBlur($event)"
|
||||||
@input="handleChange($event)">
|
@input="handleChange($event)">
|
||||||
<view class="buttons_wraper">
|
<view class="buttons_wraper">
|
||||||
<span class="iconfont icon-del" @tap="toDel"></span>
|
<view class="iconfont icon_del" @tap="toDel"></view>
|
||||||
<span class="iconfont icon_scan" :class="{'icon_scan_active': focusState === true}" @tap="toScan"></span>
|
<view class="iconfont icon_scan" :class="{'icon_scan_active': focusState === true}" @tap="toScan"></view>
|
||||||
<span v-show="seaShow" class="iconfont icon_search" @tap="toSearch"></span>
|
<view class="iconfont icon_phone" @tap="toPhone"></view>
|
||||||
|
<view v-show="seaShow" class="iconfont icon_search" @tap="toSearch"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -72,49 +73,49 @@
|
|||||||
}, 300)
|
}, 300)
|
||||||
this.cur = ''
|
this.cur = ''
|
||||||
this.$emit('input', '')
|
this.$emit('input', '')
|
||||||
|
},
|
||||||
|
async toPhone() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
let status = await this.checkPermission();
|
||||||
|
if (status !== 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
uni.scanCode({
|
||||||
|
success: (res) => {
|
||||||
|
this.$emit('input', res.result)
|
||||||
|
this.$emit('handleChange', res.result)
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: '出错',
|
||||||
|
// icon: 'none'
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// async toScan() {
|
// #ifdef APP-PLUS
|
||||||
// // #ifdef APP-PLUS
|
,
|
||||||
// let status = await this.checkPermission();
|
async checkPermission(code) {
|
||||||
// if (status !== 1) {
|
let status = permision.isIOS ? await permision.requestIOS('camera') :
|
||||||
// return;
|
await permision.requestAndroid('android.permission.CAMERA');
|
||||||
// }
|
|
||||||
// // #endif
|
|
||||||
// uni.scanCode({
|
|
||||||
// success: (res) => {
|
|
||||||
// this.$emit('input', res.result)
|
|
||||||
// this.$emit('handleChange', res.result)
|
|
||||||
// },
|
|
||||||
// fail: (err) => {
|
|
||||||
// // uni.showToast({
|
|
||||||
// // title: '出错',
|
|
||||||
// // icon: 'none'
|
|
||||||
// // })
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// // #ifdef APP-PLUS
|
|
||||||
// ,
|
|
||||||
// async checkPermission(code) {
|
|
||||||
// let status = permision.isIOS ? await permision.requestIOS('camera') :
|
|
||||||
// await permision.requestAndroid('android.permission.CAMERA');
|
|
||||||
|
|
||||||
// if (status === null || status === 1) {
|
if (status === null || status === 1) {
|
||||||
// status = 1;
|
status = 1;
|
||||||
// } else {
|
} else {
|
||||||
// uni.showModal({
|
uni.showModal({
|
||||||
// content: "需要相机权限",
|
content: "需要相机权限",
|
||||||
// confirmText: "设置",
|
confirmText: "设置",
|
||||||
// success: function(res) {
|
success: function(res) {
|
||||||
// if (res.confirm) {
|
if (res.confirm) {
|
||||||
// permision.gotoAppSetting();
|
permision.gotoAppSetting();
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// })
|
})
|
||||||
// }
|
}
|
||||||
// return status;
|
return status;
|
||||||
// }
|
}
|
||||||
// // #endif
|
// #endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -129,8 +130,9 @@
|
|||||||
.buttons_wraper
|
.buttons_wraper
|
||||||
position absolute
|
position absolute
|
||||||
top 0
|
top 0
|
||||||
right 0
|
right 10rpx
|
||||||
_wh(auto, 70rpx)
|
_wh(auto, 70rpx)
|
||||||
|
_fj(flex-end)
|
||||||
.icon_scan_active
|
.icon_scan_active
|
||||||
color $red
|
color $red
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user