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.
67 lines
1.2 KiB
67 lines
1.2 KiB
2 years ago
|
<template>
|
||
|
<uni-popup ref="popup">
|
||
|
<view class="popup_box">
|
||
|
<view class="pop_title">
|
||
|
扫描信息
|
||
|
<text class="fr" @click="closeScanPopup()">关闭</text>
|
||
|
</view>
|
||
|
<view class="pop_tab">
|
||
|
<view class="uni-flex uni-row">
|
||
|
<view class="tab_tit tab_tit_active">{{title}}</view>
|
||
|
</view>
|
||
|
<view class="tab_info">
|
||
|
<win-com-scan @getScanResult="getScanResult" :placeholder='title'></win-com-scan>
|
||
|
</view>
|
||
|
</view>
|
||
|
</view>
|
||
|
</uni-popup>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import winComScan from '@/mycomponents/wincom/winComScan.vue'
|
||
|
export default {
|
||
|
name: 'winScanByCode',
|
||
|
components: {
|
||
|
winComScan
|
||
|
},
|
||
|
props: {
|
||
|
title: {
|
||
|
type: String,
|
||
|
default: ''
|
||
|
},
|
||
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
code: ''
|
||
|
}
|
||
|
},
|
||
|
|
||
|
created() {
|
||
|
|
||
|
},
|
||
|
methods: {
|
||
|
openScanPopup() {
|
||
|
this.$refs.popup.open('bottom')
|
||
|
},
|
||
|
closeScanPopup() {
|
||
|
this.$refs.popup.close()
|
||
|
},
|
||
|
getScanResult(result) {
|
||
|
if (result.data.scanType === 'qrcode') {
|
||
|
this.code = result.data.itemCode;
|
||
|
} else if (result.data.scanType === 'barcode') {
|
||
|
this.code = result.data.code;
|
||
|
}
|
||
|
this.callBack();
|
||
|
},
|
||
|
callBack() {
|
||
|
this.closeScanPopup();
|
||
|
this.$emit("getLocationCode", this.code);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style>
|
||
|
</style>
|