|
|
@@ -1,5 +1,6 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
+ <keyboard-listener @keyup="onKeyup" @keydown="onKeydown"></keyboard-listener>
|
|
|
<block v-if="loginStyle == 0">
|
|
|
<!-- #ifdef MP-WEIXIN -->
|
|
|
<view style="width:100vw;height:400upx;display:flex;align-items:center;justify-content:center;position:relative;">
|
|
|
@@ -165,6 +166,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import keyboardListener from "@/components/keyboard-listener/keyboard-listener";
|
|
|
const Uhf53Helper = uni.requireNativePlugin("Uhf53Helper");
|
|
|
import { mapGetters,mapActions } from "vuex";
|
|
|
import { getShopInfo } from "@/utils/auth";
|
|
|
@@ -180,7 +182,7 @@ import { getErrorPrice } from "@/api/item"
|
|
|
import { getStaffInfo } from "@/api/shop-admin"
|
|
|
export default {
|
|
|
name: "admin-workbench",
|
|
|
- components: { },
|
|
|
+ components: { keyboardListener },
|
|
|
mixins: [productMins,autoUpdateMixins],
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -220,7 +222,8 @@ export default {
|
|
|
loginStyle :0,
|
|
|
errorPirceList:[],
|
|
|
lookMoney:1,
|
|
|
- notifyNum:0
|
|
|
+ notifyNum:0,
|
|
|
+ switch:0
|
|
|
};
|
|
|
},
|
|
|
onShareAppMessage(res) {
|
|
|
@@ -275,6 +278,26 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['setUserShopAll']),
|
|
|
+ onKeydown(event) {
|
|
|
+ if(this.switch == 1){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (event.keyCode == 115 && event.type == 'keydown') {
|
|
|
+ console.log('已开启')
|
|
|
+ this.switch = 1
|
|
|
+ Uhf53Helper.startScan();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onKeyup(event) {
|
|
|
+ if(this.switch == 0){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (event.keyCode == 115 && event.type == 'keyup') {
|
|
|
+ console.log('已关闭')
|
|
|
+ this.switch = 0
|
|
|
+ Uhf53Helper.stopScan();
|
|
|
+ }
|
|
|
+ },
|
|
|
start() {
|
|
|
Uhf53Helper.startScan();
|
|
|
},
|