Browse Source

卡支付逻辑再整理

pull/1/head
Stormeye Wu 5 years ago
parent
commit
ab22b67152
1 changed files with 19 additions and 9 deletions
  1. +19
    -9
      pages/scanPay/scanPay.js

+ 19
- 9
pages/scanPay/scanPay.js View File

@@ -61,7 +61,7 @@ Page({
let that = this;
const startSoterAuthentication = () => {
wx.startSoterAuthentication({
requestAuthModes: ["fingerPrint"],
requestAuthModes: [AUTH_MODE],
challenge: 'test',
authContent: '请验证已有的指纹以继续',
success: (res) => {
@@ -79,6 +79,13 @@ Page({
remainingAmount: that.data.remainingAmounts
})
if(err.errCode==90008||err.errCode == 90009){
// 90009 指纹验证失败
// 90008 用户已取消
wx.showModal({
title: '提示',
showCancel: false,
content: '指纹验证后才能支付'
})
}else{
that.gotoPay();
}
@@ -98,20 +105,23 @@ Page({
},
fail: (err) => {
console.error(err)
that.gotoPay();
}
})
}
wx.checkIsSupportSoterAuthentication({
success: (res) => {
console.log(res)
if (res.supportMode == []) {
that.gotoPay();
} else if (res.supportMode == ['fingerPrint']) {
checkIsEnrolled();
} else if (res.supportMode == ['fingerPrint', 'facial']) {
checkIsEnrolled();
}else{
that.gotoPay();
var bfingprint = false
for (var i in res.supportMode) {
if (res.supportMode[i] == AUTH_MODE) {
bfingprint = true
}
}
if (bfingprint) {
checkIsEnrolled()
} else {
that.gotoPay()
}
},
fail: (err) => {


Loading…
Cancel
Save