Commit a4b5e9b8 authored by jiangjiantao's avatar jiangjiantao

前屏扫商品前后联动

parent 7974e4e2
...@@ -8,4 +8,8 @@ export const ACTION_REPRINT = "ACTION_REPRINT"; ...@@ -8,4 +8,8 @@ export const ACTION_REPRINT = "ACTION_REPRINT";
export const ACTION_GOODS = "ACTION_GOODS"; 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({ ...@@ -50,7 +50,11 @@ Page({
}else if(res.action == ACTION_GO_BALANCE){ }else if(res.action == ACTION_GO_BALANCE){
//去结算页面 //去结算页面
context.goBalance(); context.goBalance();
}else if(res.action == ACTION_REQUEST_GOOD_INFO){
//去结算页面
context.getGoodInfoByBarcode(res.data);
} }
} }
}); });
}, },
...@@ -178,9 +182,14 @@ Page({ ...@@ -178,9 +182,14 @@ Page({
//把所有的商品数据发送到后屏 //把所有的商品数据发送到后屏
sendGoodInfoToBack() { sendGoodInfoToBack() {
let context = this; let context = this;
var commonRequest = {
action:ACTION_GOODS,
data:this.data
};
my.ix.sendBuddyMessage({ my.ix.sendBuddyMessage({
target: getApp().globalData.backScreenAppId, target: getApp().globalData.backScreenAppId,
data: context.data, data: commonRequest,
success: (res) => { success: (res) => {
console.log("发送商品数据到后屏小程序成功 ===》"+JSON.stringify(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