Commit f7704876 authored by jiangjiantao's avatar jiangjiantao

toast替换

parent cf2a3e20
...@@ -769,13 +769,7 @@ Page({ ...@@ -769,13 +769,7 @@ Page({
}, },
fail: (res) => { fail: (res) => {
console.log("发送收款事件到前屏小程序 失败 ===》 " + JSON.stringify(res)); console.log("发送收款事件到前屏小程序 失败 ===》 " + JSON.stringify(res));
my.showToast({ context.showToast("操作失败");
type: 'fail',
content: '操作失败',
duration: 3000,
success: () => {
},
});
}, },
}); });
}, },
...@@ -819,6 +813,7 @@ Page({ ...@@ -819,6 +813,7 @@ Page({
//把手输条码发生到前屏 //把手输条码发生到前屏
sendGoodsInfoToFront(barcode) { sendGoodsInfoToFront(barcode) {
let context = this;
my.showLoading({}); my.showLoading({});
var commonRequest = { var commonRequest = {
action: ACTION_REQUEST_GOOD_INFO, action: ACTION_REQUEST_GOOD_INFO,
...@@ -833,13 +828,7 @@ Page({ ...@@ -833,13 +828,7 @@ Page({
fail: (res) => { fail: (res) => {
console.log("发送商品条码到前屏小程序 失败 ===》 " + JSON.stringify(res)); console.log("发送商品条码到前屏小程序 失败 ===》 " + JSON.stringify(res));
my.hideLoading(); my.hideLoading();
my.showToast({ context.showToast("操作失败");
type: 'fail',
content: '操作失败',
duration: 3000,
success: () => {
},
});
} }
}) })
}, },
...@@ -973,13 +962,7 @@ Page({ ...@@ -973,13 +962,7 @@ Page({
goPay(e) { goPay(e) {
//购物车不能为空 //购物车不能为空
if (this.data.goods.length == 0) { if (this.data.goods.length == 0) {
my.showToast({ this.showToast("等待收银员录入商品",3000)
type: 'fail',
content: '等待收银员录入商品',
duration: 3000,
success: () => {
},
});
return return
} }
...@@ -998,13 +981,7 @@ Page({ ...@@ -998,13 +981,7 @@ Page({
}, },
fail: (res) => { fail: (res) => {
console.log("通知前屏跳转到结算页面 失败 ===》 " + JSON.stringify(res)); console.log("通知前屏跳转到结算页面 失败 ===》 " + JSON.stringify(res));
my.showToast({ context.showToast('结算失败');
type: 'fail',
content: '结算失败',
duration: 3000,
success: () => {
},
});
} }
}); });
...@@ -1022,6 +999,7 @@ Page({ ...@@ -1022,6 +999,7 @@ Page({
this.operateResultClose(); this.operateResultClose();
} else if (this.data.flowType == FLOW_COLLECTIONS) { } else if (this.data.flowType == FLOW_COLLECTIONS) {
this.goPage('landscan'); this.goPage('landscan');
let context = this;
my.ix.sendBuddyMessage({ my.ix.sendBuddyMessage({
target: getApp().globalData.frontScreenAppId, target: getApp().globalData.frontScreenAppId,
data: { data: {
...@@ -1033,13 +1011,7 @@ Page({ ...@@ -1033,13 +1011,7 @@ Page({
}, },
fail: (res) => { fail: (res) => {
console.log("通知前屏跳转到结算页面 失败 ===》 " + JSON.stringify(res)); console.log("通知前屏跳转到结算页面 失败 ===》 " + JSON.stringify(res));
my.showToast({ context.showToast('结算失败');
type: 'fail',
content: '结算失败',
duration: 3000,
success: () => {
},
});
} }
}) })
} else if (this.data.flowType == FLOW_DIRECT_PAYMENT) { } else if (this.data.flowType == FLOW_DIRECT_PAYMENT) {
...@@ -1182,6 +1154,7 @@ Page({ ...@@ -1182,6 +1154,7 @@ Page({
var miyapay = require("/utils/miyapay4.js"); var miyapay = require("/utils/miyapay4.js");
var refundAmount = miyapay.yuan2Fen(amount); var refundAmount = miyapay.yuan2Fen(amount);
console.log("amount" + refundAmount); console.log("amount" + refundAmount);
let context = this;
my.ix.sendBuddyMessage({ my.ix.sendBuddyMessage({
target: getApp().globalData.frontScreenAppId, target: getApp().globalData.frontScreenAppId,
data: { data: {
...@@ -1193,13 +1166,7 @@ Page({ ...@@ -1193,13 +1166,7 @@ Page({
console.log("发送退款金额到前屏小程序成功 ===》" + JSON.stringify(res)); console.log("发送退款金额到前屏小程序成功 ===》" + JSON.stringify(res));
}, },
fail: (res) => { fail: (res) => {
my.showToast({ context.showToast("操作失败");
type: 'fail',
content: '发送退款金额到前屏失败',
duration: 3000,
success: () => {
},
});
} }
}) })
}, },
...@@ -1249,6 +1216,7 @@ Page({ ...@@ -1249,6 +1216,7 @@ Page({
this.setData({ this.setData({
flowType: FLOW_IDLE, flowType: FLOW_IDLE,
}) })
let context = this;
my.ix.sendBuddyMessage({ my.ix.sendBuddyMessage({
target: getApp().globalData.frontScreenAppId, target: getApp().globalData.frontScreenAppId,
data: { data: {
...@@ -1260,13 +1228,7 @@ Page({ ...@@ -1260,13 +1228,7 @@ Page({
console.log("发送退款金额到前屏小程序成功 ===》" + JSON.stringify(res)); console.log("发送退款金额到前屏小程序成功 ===》" + JSON.stringify(res));
}, },
fail: (res) => { fail: (res) => {
my.showToast({ context.showToast("操作失败");
type: 'fail',
content: '发送关闭前屏操作结果页失败',
duration: 3000,
success: () => {
},
});
} }
}) })
}, },
......
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