Commit c6ccf236 by zeven

优化刷脸支付分判断

parent 8639732b
...@@ -49,6 +49,7 @@ class FacePage extends Component { ...@@ -49,6 +49,7 @@ class FacePage extends Component {
}; };
phone = ''; // 监听用户输入手机 phone = ''; // 监听用户输入手机
// sense = true; // 测试即拿刷脸设备
async componentWillMount() { async componentWillMount() {
this.storeKey = await AsyncStorage.getItem('KEY'); this.storeKey = await AsyncStorage.getItem('KEY');
...@@ -69,14 +70,7 @@ class FacePage extends Component { ...@@ -69,14 +70,7 @@ class FacePage extends Component {
await AutoClick.clickBackKey(); await AutoClick.clickBackKey();
if (this.faceBusy) return; if (this.faceBusy) return;
this.faceBusy = true; this.faceBusy = true;
// await this.wechatFace(); // 点击开通重新调用 await this.face(); // 点击开通重新调用
if (WxFacepay.getUserPayScoreStatus) {
// 开通支付分
await this.payscore();
} else {
// 微信刷脸
await this.wechatFace();
}
this.faceBusy = false; this.faceBusy = false;
}); });
// 监听微信输入手机号事件 // 监听微信输入手机号事件
...@@ -245,7 +239,7 @@ class FacePage extends Component { ...@@ -245,7 +239,7 @@ class FacePage extends Component {
face = () => { face = () => {
const {faceType} = this.state; const {faceType} = this.state;
if (faceType === 'wxpay') { if (faceType === 'wxpay') {
if (WxFacepay.getUserPayScoreStatus && this.sense) { if (this.sense) {
// 开通支付分 // 开通支付分
this.payscore(); this.payscore();
} else { } else {
...@@ -428,10 +422,18 @@ class FacePage extends Component { ...@@ -428,10 +422,18 @@ class FacePage extends Component {
// 出现订单弹窗,不做人脸识别 // 出现订单弹窗,不做人脸识别
return; return;
} }
const tipText = !this.payscoreEnable let tipText = !this.payscoreEnable
? '正在人脸识别,请看向屏幕,靠中间站稳' ? '正在人脸识别,请看向屏幕,靠中间站稳'
: '正在开通支付分,请看向屏幕'; : '正在开通支付分,请看向屏幕';
if (!WxFacepay.getUserPayScoreStatus) {
tipText = '请扫码确认';
if (this.sense) tipText = '请扫码开通支付分进店';
}
Speech.speak(tipText); Speech.speak(tipText);
if (!WxFacepay.getUserPayScoreStatus) {
this.setQrcode({action: this.action, tip: tipText, qrcode: true});
return;
}
const data = await this.payscoreinfo(); const data = await this.payscoreinfo();
if (data.code === 1) { if (data.code === 1) {
const out_trade_no = data.data.orderId; const out_trade_no = data.data.orderId;
......
...@@ -13,4 +13,6 @@ NativeModules.WxFacepay.initialize = ms => { ...@@ -13,4 +13,6 @@ NativeModules.WxFacepay.initialize = ms => {
return Promise.race([init, timeout(ms)]); return Promise.race([init, timeout(ms)]);
}; };
// delete NativeModules.WxFacepay.getUserPayScoreStatus; // 测试刷脸支付分兼容问题
export default NativeModules.WxFacepay; export default NativeModules.WxFacepay;
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