|
@@ -5,6 +5,7 @@ import { getShopInfo, wxMiniLogin } from '@/utils/auth'
|
|
|
import { postWxCode, getDictionaries } from '@/api/mini'
|
|
import { postWxCode, getDictionaries } from '@/api/mini'
|
|
|
import { getStaffApi,hasTokenAutoLogin } from '@/api/common'
|
|
import { getStaffApi,hasTokenAutoLogin } from '@/api/common'
|
|
|
import { codePay} from "@/api/order/index";
|
|
import { codePay} from "@/api/order/index";
|
|
|
|
|
+import { allProduct } from "@/api/product"
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
@@ -110,6 +111,9 @@ export default {
|
|
|
})
|
|
})
|
|
|
store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
|
|
store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
|
|
|
this.skCustomId = subRes.data.skCustomId
|
|
this.skCustomId = subRes.data.skCustomId
|
|
|
|
|
+
|
|
|
|
|
+ this.listenPDAkd()
|
|
|
|
|
+
|
|
|
this.setUserShopAll()
|
|
this.setUserShopAll()
|
|
|
if (this.init) {
|
|
if (this.init) {
|
|
|
this.init()
|
|
this.init()
|
|
@@ -130,6 +134,34 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
...mapActions(['setUserShopAll']),
|
|
...mapActions(['setUserShopAll']),
|
|
|
|
|
+ //监听pda扫码开单
|
|
|
|
|
+ listenPDAkd(){
|
|
|
|
|
+ //PDA扫码开单前准备好所有花材
|
|
|
|
|
+ allProduct().then(res=>{
|
|
|
|
|
+ this.allProduct = res.data.list
|
|
|
|
|
+ })
|
|
|
|
|
+ let that = this
|
|
|
|
|
+ //新大陆PDA
|
|
|
|
|
+ if(plus.device.vendor == 'Newland'){
|
|
|
|
|
+ var main = plus.android.runtimeMainActivity(); //获取activity
|
|
|
|
|
+ var receiver = plus.android.implements('io.dcloud.feature.internal.reflect.BroadcastReceiver', {
|
|
|
|
|
+ onReceive: that.listenPDAkdReceive
|
|
|
|
|
+ });
|
|
|
|
|
+ var IntentFilter = plus.android.importClass('android.content.IntentFilter');
|
|
|
|
|
+ var filter = new IntentFilter();
|
|
|
|
|
+ filter.addAction("nlscan.action.SCANNER_RESULT"); //监听扫描
|
|
|
|
|
+ main.registerReceiver(receiver, filter); //注册监听
|
|
|
|
|
+ console.log('!!!!!!!!!!!!!!!!!!!!!!!PDA发起监听!!!!!!!!!!!!!!!!!!!!!!')
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ //接收pda扫码
|
|
|
|
|
+ listenPDAkdReceive(context, intent) {
|
|
|
|
|
+ //通过intent实例引入intent类,方便以后的'.'操作
|
|
|
|
|
+ plus.android.importClass(intent)
|
|
|
|
|
+ var productIdCode = intent.getStringExtra("SCAN_BARCODE1")
|
|
|
|
|
+ this.$msg(productIdCode)
|
|
|
|
|
+ console.log(productIdCode)
|
|
|
|
|
+ },
|
|
|
//付款码付款
|
|
//付款码付款
|
|
|
requestCodePay(authCode){
|
|
requestCodePay(authCode){
|
|
|
let that = this
|
|
let that = this
|