|
@@ -5,6 +5,10 @@ import { getUser, uniLoginFn } from '@/utils/auth'
|
|
|
import { postWxCode, getDictionaries } from '@/api/mini'
|
|
import { postWxCode, getDictionaries } from '@/api/mini'
|
|
|
import { getStaffApi,appReGetLoginInfo } from '@/api/common'
|
|
import { getStaffApi,appReGetLoginInfo } from '@/api/common'
|
|
|
import { allProduct } from '@/api/product'
|
|
import { allProduct } from '@/api/product'
|
|
|
|
|
+// #ifdef APP-PLUS
|
|
|
|
|
+const shangMiPrint = uni.requireNativePlugin('G5KJ-ShangMiPrint')
|
|
|
|
|
+const globalEvent = uni.requireNativePlugin('globalEvent')
|
|
|
|
|
+// #endif
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -137,9 +141,7 @@ export default {
|
|
|
//监听pda扫码开单
|
|
//监听pda扫码开单
|
|
|
listenPDAkd(){
|
|
listenPDAkd(){
|
|
|
|
|
|
|
|
- console.log('!!!!!!!!!!!!!!!!!!!!!!!PDA扫码发起了一次监听动作!!!!!!!!!!!!!!!!!!!!!')
|
|
|
|
|
-
|
|
|
|
|
- //pda扫码开单前准备好所有花材
|
|
|
|
|
|
|
+ //PDA扫码开单前准备好所有花材
|
|
|
allProduct().then(res=>{
|
|
allProduct().then(res=>{
|
|
|
this.allProduct = res.data.list
|
|
this.allProduct = res.data.list
|
|
|
})
|
|
})
|
|
@@ -147,25 +149,48 @@ export default {
|
|
|
this.checkStock = true
|
|
this.checkStock = true
|
|
|
|
|
|
|
|
let that = this
|
|
let that = this
|
|
|
- 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); //注册监听
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //商米D1s收银台
|
|
|
|
|
+ if(plus.device.vendor == 'SUNMI' && plus.device.model == 'D1s'){
|
|
|
|
|
+ //https://ext.dcloud.net.cn/plugin?id=3514
|
|
|
|
|
+ //初始化
|
|
|
|
|
+ shangMiPrint.init()
|
|
|
|
|
+ //扫码返回
|
|
|
|
|
+ globalEvent.addEventListener('scancode',function(e){
|
|
|
|
|
+ if(e.code == 'ok'){
|
|
|
|
|
+ let productIdCode = e.data
|
|
|
|
|
+ that.globalPDAKd(productIdCode)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ console.log('!!!!!!!!!!!!!!!!!!!!!!!商米收银台发起监听!!!!!!!!!!!!!!!!!!!!!')
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //新大陆PDA
|
|
|
|
|
+ if(plus.device.vendor == 'Newland' && plus.device.model == 'NLS-MT90'){
|
|
|
|
|
+ //PDA
|
|
|
|
|
+ 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扫码
|
|
//接收pda扫码
|
|
|
listenPDAkdReceive(context, intent) {
|
|
listenPDAkdReceive(context, intent) {
|
|
|
-
|
|
|
|
|
//通过intent实例引入intent类,方便以后的'.'操作
|
|
//通过intent实例引入intent类,方便以后的'.'操作
|
|
|
plus.android.importClass(intent)
|
|
plus.android.importClass(intent)
|
|
|
var productIdCode = intent.getStringExtra("SCAN_BARCODE1")
|
|
var productIdCode = intent.getStringExtra("SCAN_BARCODE1")
|
|
|
|
|
+ this.globalPDAKd(productIdCode)
|
|
|
|
|
+ },
|
|
|
|
|
+ globalPDAKd(productIdCode){
|
|
|
let that = this
|
|
let that = this
|
|
|
this.allProduct.forEach(function(product,index,array){
|
|
this.allProduct.forEach(function(product,index,array){
|
|
|
- if(product.id == productIdCode){
|
|
|
|
|
|
|
+ if(Number(product.id) == Number(productIdCode)){
|
|
|
that.kdType = 'PDA'
|
|
that.kdType = 'PDA'
|
|
|
product.userPrice = product.bigPrice
|
|
product.userPrice = product.bigPrice
|
|
|
|
|
|
|
@@ -193,9 +218,9 @@ export default {
|
|
|
var pages = getCurrentPages()
|
|
var pages = getCurrentPages()
|
|
|
let currentRoute = pages[pages.length-1].route;
|
|
let currentRoute = pages[pages.length-1].route;
|
|
|
if(currentRoute != 'admin/billing/affirm'){
|
|
if(currentRoute != 'admin/billing/affirm'){
|
|
|
- this.$util.pageTo({url: "/admin/billing/affirm",query:{customId:that.skCustomId,kdType:'PDA'}})
|
|
|
|
|
|
|
+ that.$util.pageTo({url: "/admin/billing/affirm",query:{customId:that.skCustomId,kdType:'PDA'}})
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
|
|
+ },
|
|
|
// #endif
|
|
// #endif
|
|
|
|
|
|
|
|
toFreeApply_HOME () {
|
|
toFreeApply_HOME () {
|