You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
1.9 KiB

1 year ago
<template>
<view class="">
<uni-popup ref="popup" @change="change">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="">
扫描{{title}}
</view>
<view class="">
<image class=" icons_scan_close" src="@/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="false">
</win-com-scan>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import winComScan from '@/mycomponents/scan/winComScan.vue'
export default {
name: 'winScanItem',
components: {
winComScan
},
11 months ago
emits: ["getScanCode"],
1 year ago
props: {
title: {
type: String,
default: ''
},
isShowRecord: {
type: Boolean,
default: true
}
},
data() {
return {
code: '',
11 months ago
result: {},
1 year ago
isShow: false,
expand: false,
scanList: [],
expendIcon: 'arrow-down'
}
},
created() {
},
methods: {
openScanPopup() {
this.$refs.popup.open('bottom')
},
closeScanPopup() {
this.$refs.popup.close()
},
getfocus() {
if (this.isShow) {
this.$refs.scan.getfocus()
}
},
scanClick() {
this.$refs.scan.clickScanMsg();
},
cancelClick() {
this.$refs.scan.clearScanValue();
},
getScanResult(result) {
11 months ago
this.result = result;
1 year ago
if (result.label.barType == "QRCode") {
this.code = result.label.itemCode;
} else if (result.label.barType == "BarCode") {
this.code = result.label.code;
}
this.callBack();
},
callBack() {
this.$refs.scan.clear();
this.$emit("getScanCode", this.code);
11 months ago
this.$emit("getScanResult", this.code, this.result);
1 year ago
},
change(e) {
this.isShow = e.show
}
}
}
</script>
<style>
</style>