Commit daa61daf by 黄日华

收银程序刷脸启动失败自动刷新

parent de618f1d
......@@ -10,6 +10,9 @@ import Speech from '../utils/Speech';
import Toast from './Toast';
import Smilepay from '../utils/Smilepay';
import KeyEvent from 'react-native-keyevent';
import Restart from '../utils/Restart';
window.restart = Restart.restartApp;
const {width, height} = Dimensions.get('screen');
const paidTime = 30; // 支付完成等待时间 30s
......@@ -223,7 +226,11 @@ class Settles extends React.Component {
}
await this.alipayinfo();
if (!this.alipayInfo || !this.alipayInfo.metaInfo) {
this.props.speak('刷脸支付启动失败,请重新刷脸或扫码支付', true);
this.props.speak(
'刷脸支付启动失败,正在重新启动应用进行修复,请稍等...',
true,
);
Restart.restartApp();
return;
}
const {data} = await this.props.dispatch({
......
......@@ -24,6 +24,9 @@ import Smilepay from '../utils/Smilepay';
import Speech from '../utils/Speech';
import validity from '../utils/validity';
import WxFacepay from '../utils/WxFacepay';
import Restart from '../utils/Restart';
window.restart = Restart.restartApp;
const wait = t => new Promise(resolve => setTimeout(resolve, t));
......@@ -785,7 +788,8 @@ class FacePage extends Component {
if (!params) {
if (this.faceRetry) {
this.faceRetry = false;
Speech.speak('刷脸支付启动失败,请重新刷脸或扫码支付');
Speech.speak('刷脸支付启动失败,正在重新启动应用进行修复,请稍等...');
Restart.restartApp();
} else {
this.faceRetry = true;
await this.wxFacepay(); // 重试
......@@ -808,7 +812,8 @@ class FacePage extends Component {
smilepay = async () => {
await this.alipayinfo();
if (!this.alipayInfo || !this.alipayInfo.metaInfo) {
Speech.speak('刷脸支付启动失败,请重新刷脸或扫码支付');
Speech.speak('刷脸支付启动失败,正在重新启动应用进行修复,请稍等...');
Restart.restartApp();
return;
}
const {data} = await this.props.dispatch({
......
......@@ -332,7 +332,11 @@ class VerticalPage extends Component {
}
await this.alipayinfo();
if (!this.alipayInfo || !this.alipayInfo.metaInfo) {
this.props.speak('刷脸支付启动失败,请重新刷脸或扫码支付', true);
this.props.speak(
'刷脸支付启动失败,正在重新启动应用进行修复,请稍等...',
true,
);
Restart.restartApp();
return;
}
const {data} = await this.props.dispatch({
......
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