Commit 08a8949a authored by jiangjiantao's avatar jiangjiantao

直接收款

parent e3108493
{
"pages": [
"pages/poster/poster",
"pages/index/index",
"pages/poster/poster",
"pages/home/home",
"pages/waitoperate/waitoperate",
"pages/landscan/landscan",
......
......@@ -30,3 +30,6 @@ export const ACTION_GO_HOME = "ACTION_GO_HOME";
//获取账户信息
export const ACTION_GET_ACCOUNT = "ACTION_GET_ACCOUNT";
//直接收款
export const ACTION_DIRECT_PAYMENT = "ACTION_DIRECT_PAYMENT";
......@@ -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页面逻辑方法 */
//把所有的商品数据发送到后屏
......@@ -284,10 +315,17 @@ Page({
//键盘完成
onKeyBordFinished(barcode) {
onKeyBordFinished(result) {
this.onKeyBordClose();
if(this.data.scene == 3){
this.sendPaymentToFront(result)
}else if(this.data.scene == 1){
this.sendGoodsInfoToFront(result)
}
},
//把手输条码发生到前屏
sendGoodsInfoToFront(barcode) {
my.showLoading({});
var commonRequest = {
action: ACTION_REQUEST_GOOD_INFO,
......@@ -304,15 +342,19 @@ Page({
my.hideLoading();
my.showToast({
type: 'fail',
content: '发送商品条码到后屏失败',
content: '操作失败',
duration: 3000,
success: () => {
},
});
}
})
},
// 键盘关闭
onKeyBordClose() {
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