fix:添加扫码测试
This commit is contained in:
parent
f8ad4a7e09
commit
b810a01c31
|
|
@ -15,6 +15,11 @@
|
|||
<div v-if="currentM == '二维码'">
|
||||
<scQrCode text="xxxx"></scQrCode>
|
||||
</div>
|
||||
<div v-if="currentM == 'scanner'">
|
||||
<h1>扫描二维码</h1>
|
||||
<el-button @click="scanCode">扫码</el-button>
|
||||
<p>扫描结果:{{ scannedResult }}</p>
|
||||
</div>
|
||||
<div v-if="currentM == 'ehsSelect'">
|
||||
<ehsSelect
|
||||
:apiObj="apiObj"
|
||||
|
|
@ -125,6 +130,7 @@ export default {
|
|||
return {
|
||||
menu: [
|
||||
"二维码",
|
||||
"scanner",
|
||||
"xtSelect",
|
||||
"ehsSelect",
|
||||
"scEcharts",
|
||||
|
|
@ -163,7 +169,7 @@ export default {
|
|||
],
|
||||
x2sf: 10,
|
||||
x2sfs: [10, 20],
|
||||
|
||||
scannedResult:"",
|
||||
chartOption: {
|
||||
textStyle: {
|
||||
fontFamily: 'Inter, "Helvetica Neue", Arial, sans-serif',
|
||||
|
|
@ -212,7 +218,9 @@ export default {
|
|||
},
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
mounted() {
|
||||
window.onScanResult = this.onScanResult;
|
||||
},
|
||||
methods: {
|
||||
getMember(data) {
|
||||
console.log(data);
|
||||
|
|
@ -220,6 +228,16 @@ export default {
|
|||
showx2() {
|
||||
// console.log(this.x2)
|
||||
},
|
||||
scanCode(){
|
||||
if (window.Android) {
|
||||
window.Android.openScanner();
|
||||
} else {
|
||||
alert("当前环境不支持扫码");
|
||||
}
|
||||
},
|
||||
onScanResult(data) {
|
||||
this.scannedResult = data;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue