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