Commit 40d50d43 by 黄日华

修复刷脸支付和扫码支付后开门离店提示时间

parent 079755f7
...@@ -382,6 +382,7 @@ const CounterMixins = ComposeComponent => { ...@@ -382,6 +382,7 @@ const CounterMixins = ComposeComponent => {
orderId, // 订单号, orderId, // 订单号,
}); });
if (order.code === 1 && order.data === 1) { if (order.code === 1 && order.data === 1) {
this.setState({voiceModal: false});
this.successPay(); this.successPay();
clearInterval(this.payInter); // 清除定时查询订单 clearInterval(this.payInter); // 清除定时查询订单
this.isPaid = true; // 支付成功,暂停检测秤的重量 this.isPaid = true; // 支付成功,暂停检测秤的重量
...@@ -462,7 +463,7 @@ const CounterMixins = ComposeComponent => { ...@@ -462,7 +463,7 @@ const CounterMixins = ComposeComponent => {
return '门店设置已解锁'; return '门店设置已解锁';
}; };
successPay = async balance => { successPay = async facepay => {
Toast.hide(); Toast.hide();
const {goodsArr} = this.state; const {goodsArr} = this.state;
// let total = 0; // let total = 0;
...@@ -482,7 +483,9 @@ const CounterMixins = ComposeComponent => { ...@@ -482,7 +483,9 @@ const CounterMixins = ComposeComponent => {
step: 3, step: 3,
}); });
// this.setState({voiceModal: true, voiceTitle: msg}); // this.setState({voiceModal: true, voiceTitle: msg});
if (!facepay) {
Speech.speak('付款成功'); Speech.speak('付款成功');
}
if (this.state.stype === 'guard') { if (this.state.stype === 'guard') {
this.showLeaveModal(); this.showLeaveModal();
} else { } else {
...@@ -904,7 +907,13 @@ const CounterMixins = ComposeComponent => { ...@@ -904,7 +907,13 @@ const CounterMixins = ComposeComponent => {
Speech.speak(voiceTitle); Speech.speak(voiceTitle);
this.setState({voiceTitle}); this.setState({voiceTitle});
} else { } else {
if (facepay) {
setTimeout(() => {
this.successPay(facepay);
}, 2000);
} else {
this.successPay(); this.successPay();
}
successPay = true; successPay = true;
await wait(3000); await wait(3000);
// await wait(res.data.timeout); // await wait(res.data.timeout);
...@@ -921,6 +930,7 @@ const CounterMixins = ComposeComponent => { ...@@ -921,6 +930,7 @@ const CounterMixins = ComposeComponent => {
orderId: res.data.orderId, // 订单号, orderId: res.data.orderId, // 订单号,
}); });
if (status.code === 1 && status.data === 1) { if (status.code === 1 && status.data === 1) {
console.warn('刷脸支付');
this.successPay(); this.successPay();
successPay = true; successPay = true;
await wait(3000); await wait(3000);
...@@ -957,7 +967,11 @@ const CounterMixins = ComposeComponent => { ...@@ -957,7 +967,11 @@ const CounterMixins = ComposeComponent => {
if (data.code === 1) { if (data.code === 1) {
// 付款成功 // 付款成功
this.orderId = data.data.orderId; this.orderId = data.data.orderId;
if (openid) {
this.successPay(true); this.successPay(true);
} else {
this.successPay();
}
await AutoClick.clickBackKey(); await AutoClick.clickBackKey();
await wait(3000); await wait(3000);
await this.setState({voiceModal: false}); await this.setState({voiceModal: false});
......
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