weapps-plugin-jingtong-verify 1.4.8 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,2 +1,2 @@
1
1
  # SDK #
2
- 1.4.5
2
+ 1.5.0
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "weapps-plugin-jingtong-verify",
3
3
  "pluginName": "weapps-plugin-jingtong-verify",
4
4
  "pluginType": "mp",
5
- "version": "1.4.8",
5
+ "version": "1.5.0",
6
6
  "description": "",
7
7
  "main": "sdk.js",
8
8
  "author": "tongyirenzheng",
@@ -166,6 +166,10 @@ Page({
166
166
  * 获取手机号尾号并设置证件号码
167
167
  */
168
168
  getTailNumber (e) {
169
+ let value = e.detail.value
170
+ if(value === '' || value === null){
171
+ return
172
+ }
169
173
  const { formData, formSafeData } = this.data
170
174
  let params = {
171
175
  "cid_type": formData.cid_type, // 证件类型
@@ -179,12 +183,11 @@ Page({
179
183
  console.log('结果')
180
184
  console.log(this.toOtherWay(params, 2, value))
181
185
 
182
- let value = e.detail.value
183
186
  this.toOtherWay(params, 2, value)
184
- setTimeout(() => {
185
- console.log(this.data.isIdCardSuccess)
186
- // this.toGetTailNumber(value)
187
- }, 100)
187
+ // setTimeout(() => {
188
+ // console.log(this.data.isIdCardSuccess)
189
+ // // this.toGetTailNumber(value)
190
+ // }, 100)
188
191
  },
189
192
  toGetTailNumber (value) {
190
193
  const { isIdCardSuccess } = this.data
@@ -359,15 +362,15 @@ Page({
359
362
  console.log('获取人脸识别失败次数结果')
360
363
  console.log(res)
361
364
  console.log(res.data)
362
- console.log(res.data)
363
- if(res.errcode === 4054 || res.data.times >= 3) {
364
- // 人脸错误次数大于3次,提示
365
- this.setData({
366
- showToOtherModal: true
367
- })
368
- return
369
- }
370
- if (res.data.errcode === 0) {
365
+ if(res.errcode === 0 ) {
366
+ const { data } = res
367
+ if(data.times >= 3){
368
+ // 人脸错误次数大于3次,提示
369
+ this.setData({
370
+ showToOtherModal: true
371
+ })
372
+ return
373
+ }
371
374
  jingtongVerifyRequest.verifyIdcard(this.data.formData).then(res => {
372
375
  console.log('获取身份证二要素核验结果')
373
376
  console.log(res)
@@ -701,7 +704,17 @@ Page({
701
704
  });
702
705
  return;
703
706
  }
707
+ // 判断手机尾号是否一致
704
708
  const { formSafeDataCodeMobile } = this.data
709
+ const phoneEndNumber = phone_number.slice(-4)
710
+ if(phoneEndNumber !== formSafeDataCodeMobile) {
711
+ wx.showToast({
712
+ title: '手机号码与绑定号码不一致,请重新输入',
713
+ icon: 'none',
714
+ duration: 2000
715
+ })
716
+ return
717
+ }
705
718
  if(formSafeDataCodeMobile === ''){
706
719
  wx.showToast({
707
720
  title: '手机号码与绑定手机号码不一致,请检查后输入',
@@ -168,7 +168,7 @@
168
168
  <!-- 设置登录密码 -->
169
169
  <view class="form-item-wrap">
170
170
  <view class="form-item-header">
171
- <text class="form-label">设置新密码*</text>
171
+ <text class="form-label">设置新密码<text class="required-star">*</text></text>
172
172
  <view class="password-strength-indicator">
173
173
  <view class="strength-bar">
174
174
  <view class="strength-segment weak {{ passwordStrength >= 1 ? 'active' : '' }}"></view>
@@ -386,4 +386,10 @@
386
386
  /* 保持图标可点击 */
387
387
  .readonly-input .input__icon__container {
388
388
  pointer-events: auto !important;
389
+ }
390
+ .required-star {
391
+ color: #f13939;
392
+ margin-left: 2rpx;
393
+ font-size: 30rpx;
394
+ font-weight: bold;
389
395
  }
@@ -209,21 +209,29 @@ Page({
209
209
  // 接口验证有没有超出限制次数
210
210
  jingtongVerifyRequest.getVerifyLimit(param).then(res => {
211
211
  console.log(res)
212
- const { data } = res
213
- if(data.errcode === 4054){
214
- this.setData({
215
- showToOtherModal: true
216
- })
217
- } else if (data.errcode === 0){
218
- console.log(idCardType)
219
- console.log(idCardType[formData.cid_type])
220
- console.log('来源类型')
221
- console.log(source_type)
222
- if(source_type === '2'){
223
- this.forgotVerify()
212
+ if (res.errcode === 0){
213
+ const { data } = res
214
+ if(data.times >= 3){
215
+ this.setData({
216
+ showToOtherModal: true
217
+ })
224
218
  } else {
225
- this.setPwdVerify()
219
+ console.log(idCardType)
220
+ console.log(idCardType[formData.cid_type])
221
+ console.log('来源类型')
222
+ console.log(source_type)
223
+ if(source_type === '2'){
224
+ this.forgotVerify()
225
+ } else {
226
+ this.setPwdVerify()
227
+ }
226
228
  }
229
+ } else {
230
+ wx.showToast({
231
+ title: res.timeLimit,
232
+ icon: 'none',
233
+ duration: 1500
234
+ })
227
235
  }
228
236
  })
229
237
  }, 100)
@@ -1457,9 +1457,9 @@ function _getVerifyLimit(options) {
1457
1457
  success: res => {
1458
1458
  let { errcode, data } = res.data
1459
1459
  if (errcode !== 0) {
1460
- return reject(JSON.stringify(res.data))
1460
+ return resolve(res.data)
1461
1461
  }
1462
- return resolve(res)
1462
+ return resolve(res.data)
1463
1463
  },
1464
1464
  fail: err => {
1465
1465
  return reject(JSON.stringify(err.data))