Commit ac7a9c06 authored by pengguangpu's avatar pengguangpu

调换打印上一单的打印中状态重置顺序;

parent 081e8e35
...@@ -318,21 +318,24 @@ Page({ ...@@ -318,21 +318,24 @@ Page({
//打印上一单结果返回 //打印上一单结果返回
//获取到打印结果 //获取到打印结果
var printLastOrderResult = res.data; var printLastOrderResult = res.data;
context.setData({
printLastOrderIsPrinting: false
});
if (printLastOrderResult.code == 0) { if (printLastOrderResult.code == 0) {
//打印成功 //打印成功
context.setData({ context.setData({
printLastOrderIsPrintSuccess: true, printLastOrderIsPrintSuccess: true,
printLastOrderPrintStatusHint: "打印完成" printLastOrderPrintStatusHint: "打印完成"
}); });
context.setData({
printLastOrderIsPrinting: false
});
} else { } else {
//打印失败 //打印失败
context.setData({ context.setData({
printLastOrderIsPrintSuccess: false, printLastOrderIsPrintSuccess: false,
printLastOrderPrintStatusHint: "打印失败" printLastOrderPrintStatusHint: "打印失败"
}); });
context.setData({
printLastOrderIsPrinting: false
});
} }
} else if (res.action == ACTION_GET_CUR_AD) { } else if (res.action == ACTION_GET_CUR_AD) {
//拿到当前显示的图片url //拿到当前显示的图片url
...@@ -523,6 +526,7 @@ Page({ ...@@ -523,6 +526,7 @@ Page({
if (this.data.printEnabled != true) { if (this.data.printEnabled != true) {
return; return;
} }
let context = this;
//发送指令至前屏 //发送指令至前屏
//通知前屏重新打印 //通知前屏重新打印
my.ix.sendBuddyMessage({ my.ix.sendBuddyMessage({
...@@ -533,14 +537,15 @@ Page({ ...@@ -533,14 +537,15 @@ Page({
data: null data: null
}, },
success: (res) => { success: (res) => {
console.info(`sendBuddyMessage success: ${JSON.stringify(res)}`); console.info(`onHomePrintLastOrderClicked sendBuddyMessage success: ${JSON.stringify(res)}`);
//跳转至打印上一单页面
context.goPage('printlastorder');
}, },
fail: (res) => { fail: (res) => {
console.info(`sendBuddyMessage failed: ${JSON.stringify(res)}`); console.info(`sendBuddyMessage failed: ${JSON.stringify(res)}`);
context.showToast("发送指令失败");
} }
}); });
//跳转至打印上一单页面
this.goPage('printlastorder');
}, },
/** /**
...@@ -962,7 +967,7 @@ Page({ ...@@ -962,7 +967,7 @@ Page({
goPay(e) { goPay(e) {
//购物车不能为空 //购物车不能为空
if (this.data.goods.length == 0) { if (this.data.goods.length == 0) {
this.showToast("等待收银员录入商品",3000) this.showToast("等待收银员录入商品", 3000)
return return
} }
...@@ -988,7 +993,7 @@ Page({ ...@@ -988,7 +993,7 @@ Page({
//后屏跳转 //后屏跳转
this.goPage('waitoperate'); this.goPage('waitoperate');
var miyapay = require("/utils/miyapay4.js"); var miyapay = require("/utils/miyapay4.js");
var amount = miyapay.fen2Yuan(miyapay.yuan2Fen(this.data.totalPrice)-miyapay.yuan2Fen(this.data.discCouponPrice)); var amount = miyapay.fen2Yuan(miyapay.yuan2Fen(this.data.totalPrice) - miyapay.yuan2Fen(this.data.discCouponPrice));
this.setData({ this.setData({
waitOperateAmount: amount, waitOperateAmount: amount,
}); });
......
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