Commit a4b5e9b8 authored by jiangjiantao's avatar jiangjiantao

前屏扫商品前后联动

parent 7974e4e2
......@@ -8,4 +8,8 @@ export const ACTION_REPRINT = "ACTION_REPRINT";
export const ACTION_GOODS = "ACTION_GOODS";
//去结算页面
export const ACTION_GOODS = "ACTION_GO_BALANCE";
export const ACTION_GO_BALANCE = "ACTION_GO_BALANCE";
//请求商品条码
export const ACTION_REQUEST_GOOD_INFO = "ACTION_REQUEST_GOOD_INFO";
......@@ -50,7 +50,11 @@ Page({
}else if(res.action == ACTION_GO_BALANCE){
//去结算页面
context.goBalance();
}
}else if(res.action == ACTION_REQUEST_GOOD_INFO){
//去结算页面
context.getGoodInfoByBarcode(res.data);
}
}
});
},
......@@ -168,7 +172,7 @@ Page({
//汇总
this.setData({ totalQuantity: totalQuantityTemp,
totalPrice: totalPriceTemp,
totalPrice: totalPriceTemp,
})
//同步信息到后端
......@@ -178,9 +182,14 @@ Page({
//把所有的商品数据发送到后屏
sendGoodInfoToBack() {
let context = this;
var commonRequest = {
action:ACTION_GOODS,
data:this.data
};
my.ix.sendBuddyMessage({
target: getApp().globalData.backScreenAppId,
data: context.data,
data: commonRequest,
success: (res) => {
console.log("发送商品数据到后屏小程序成功 ===》"+JSON.stringify(res));
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment