Commit 08a8949a authored by jiangjiantao's avatar jiangjiantao

直接收款

parent e3108493
{ {
"pages": [ "pages": [
"pages/poster/poster",
"pages/index/index", "pages/index/index",
"pages/poster/poster",
"pages/home/home", "pages/home/home",
"pages/waitoperate/waitoperate", "pages/waitoperate/waitoperate",
"pages/landscan/landscan", "pages/landscan/landscan",
......
...@@ -30,3 +30,6 @@ export const ACTION_GO_HOME = "ACTION_GO_HOME"; ...@@ -30,3 +30,6 @@ export const ACTION_GO_HOME = "ACTION_GO_HOME";
//获取账户信息 //获取账户信息
export const ACTION_GET_ACCOUNT = "ACTION_GET_ACCOUNT"; export const ACTION_GET_ACCOUNT = "ACTION_GET_ACCOUNT";
//直接收款
export const ACTION_DIRECT_PAYMENT = "ACTION_DIRECT_PAYMENT";
...@@ -259,6 +259,37 @@ Page({ ...@@ -259,6 +259,37 @@ Page({
}); });
}, },
//直接收银
directPayment(e) {
this.setData({scene:3})
},
//发生直接收银事件
sendPaymentToFront(payment) {
var commonRequest = {
action: ACTION_DIRECT_PAYMENT,
data: payment
};
let context = this;
my.ix.sendBuddyMessage({
target: getApp().globalData.frontScreenAppId,
data: commonRequest,
success: (res) => {
console.log("发送直接收款事件到前屏小程序 成功 ===》" + JSON.stringify(res));
//跳转到结算页面
},
fail: (res) => {
console.log("发送收款事件到前屏小程序 失败 ===》 " + JSON.stringify(res));
my.showToast({
type: 'fail',
content: '操作失败',
duration: 3000,
success: () => {
},
});
},
});
},
/**landscan页面逻辑方法 */ /**landscan页面逻辑方法 */
//把所有的商品数据发送到后屏 //把所有的商品数据发送到后屏
...@@ -284,10 +315,17 @@ Page({ ...@@ -284,10 +315,17 @@ Page({
//键盘完成 //键盘完成
onKeyBordFinished(barcode) { onKeyBordFinished(result) {
this.onKeyBordClose(); this.onKeyBordClose();
if(this.data.scene == 3){
this.sendPaymentToFront(result)
}else if(this.data.scene == 1){
this.sendGoodsInfoToFront(result)
}
},
//把手输条码发生到前屏
sendGoodsInfoToFront(barcode) {
my.showLoading({}); my.showLoading({});
var commonRequest = { var commonRequest = {
action: ACTION_REQUEST_GOOD_INFO, action: ACTION_REQUEST_GOOD_INFO,
...@@ -304,15 +342,19 @@ Page({ ...@@ -304,15 +342,19 @@ Page({
my.hideLoading(); my.hideLoading();
my.showToast({ my.showToast({
type: 'fail', type: 'fail',
content: '发送商品条码到后屏失败', content: '操作失败',
duration: 3000, duration: 3000,
success: () => { success: () => {
}, },
}); });
} }
}) })
}, },
// 键盘关闭 // 键盘关闭
onKeyBordClose() { onKeyBordClose() {
this.setData({ scene: 0 }) this.setData({ scene: 0 })
......
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