Commit daa61daf by 黄日华

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

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