Commit 88506646 by 修福龙

把轮询支付分状态改至后端查询

parent 284eddc7
...@@ -427,29 +427,25 @@ class FacePage extends Component { ...@@ -427,29 +427,25 @@ class FacePage extends Component {
// 刷脸开通支付分 // 刷脸开通支付分
openPayScore = async action => { openPayScore = async action => {
let openPayScore = false;
const {orderId, code} = await this.getPayScoreStatus(); const {orderId, code} = await this.getPayScoreStatus();
if (orderId && code) { if (orderId && code) {
for (let i = 0; i < 10; i++) { const {data} = await this.props.dispatch({
// 查询用户支付分状态与服务授权状态 type: 'goods/payscoreCheck',
await delay(1000); userId: this.userId,
const {data} = await this.props.dispatch({ orderId,
type: 'goods/payscoreCheck', code,
userId: this.userId, });
orderId, if (data.code === 1) {
code, await this.wxdoor();
}); } else {
if (data.code === 1 && data.data.payscoreState) { const tipText = '请扫码开通支付分';
openPayScore = true; Speech.speak(tipText);
await this.wxdoor(); this.setQrcode({action, tip: tipText, qrcode: true}); // 扫码开通支付分
break;
}
} }
} } else {
if (!openPayScore) {
const tipText = '请扫码开通支付分'; const tipText = '请扫码开通支付分';
Speech.speak(tipText); Speech.speak(tipText);
this.setQrcode({action: action, tip: tipText, qrcode: true}); // 扫码开通支付分 this.setQrcode({action, tip: tipText, qrcode: true}); // 扫码开通支付分
} }
}; };
......
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