weapps-plugin-jingtong-verify 1.6.3 → 1.7.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.6.3
2
+ 1.7.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.6.3",
5
+ "version": "1.7.0",
6
6
  "description": "",
7
7
  "main": "sdk.js",
8
8
  "author": "tongyirenzheng",
@@ -11,6 +11,10 @@ Component({
11
11
  isKidsOrOld: {
12
12
  type: Boolean,
13
13
  value: false
14
+ },
15
+ times: {
16
+ type: Number,
17
+ value: 0
14
18
  }
15
19
  },
16
20
 
@@ -4,13 +4,14 @@
4
4
  <view class="title">温馨提示</view>
5
5
  <view class="mb50">
6
6
  <view>为确保人脸识别结果准确,请注意:</view>
7
- <view>1.请<text class="desc-red">正面对准摄像头</text>进行人脸识别</view>
8
- <view>2.请确保周围<text class="desc-red">环境光线充足</text></view>
9
- <view>3.请<text class="desc-red">勿佩戴遮挡脸部物品</text>,包括口罩/墨镜等</view>
10
- <view>4.请确保<text class="desc-red">摄像头清洁且避免被遮挡</text></view>
7
+ <view>1.请<text class="desc-red">正面对准摄像头</text>进行人脸识别,<text class="desc-red">勿佩戴遮挡脸部物品</text>包括口罩、墨镜、帽子等。</view>
8
+ <view>2.请确保使用有效的身份证件信息进行人脸识别,如未办理身份证将无法完成人脸识别。</view>
9
+ <view>3.确保摄像头清洁、无遮挡且<text class="desc-red">环境光线充足。</text></view>
10
+ <view>4.如您因年龄、手术、蓄须等原因导致人脸变化较大,可使用带NFC功能的手机下载国家网络身份认证APP,申领网络身份认证凭证后再尝试登录。</view>
11
+ <view>5.请确保您的微信APP更新为最新版本。</view>
11
12
  </view>
12
- <view class="mb50"><text class="desc-red">您已连续认证失败{{ isKidsOrOld ? '6' : '3' }}次</text>,请您检查人脸识别时是否有上述情况,若确认无误可再次尝试进行人脸识别。</view>
13
- <view class="desc-red">注:如您连续认证失败{{ isKidsOrOld ? '18' : '6' }}次,将临时锁定您的权限,请您切换至京通小程序支付宝或百度端进行尝试,或您可以明天再进行尝试。</view>
13
+ <view class="mb50"><text class="desc-red">您已连续认证失败{{ times }}次</text>,请您检查人脸识别时是否有上述情况,若确认无误可再次尝试进行人脸识别。</view>
14
+ <view class="desc-red">注:如您连续认证失败{{ isKidsOrOld ? '18' : '6' }}次,将临时锁定您的认证权限,请您切换至京通小程序支付宝端进行尝试,或您可以明天再进行尝试。</view>
14
15
  </view>
15
16
  <view class="btn-view" catch:tap="handleOk">我知道了</view>
16
17
  </view>
@@ -2,7 +2,7 @@
2
2
  <view class="modal-box">
3
3
  <view class="content">
4
4
  <view class="title">温馨提示</view>
5
- <view><text class="desc-red">您已连续认证失败{{ isKidsOrOld ? '18' : '6' }}次</text>,将临时锁定您的权限,您可以切换至京通小程序支付宝或百度端进行尝试,或您可以明天再进行尝试。</view>
5
+ <view><text class="desc-red">您已连续认证失败6次</text>,将临时锁定您的权限,您可以切换至京通小程序支付宝端进行尝试,或您可以明天再进行尝试</view>
6
6
  </view>
7
7
  <view class="btn-view" catch:tap="handleOk">我知道了</view>
8
8
  </view>
@@ -145,6 +145,7 @@ Page({
145
145
  cidExpireMinDate: [new Date().getFullYear(), (new Date().getMonth() + 1), new Date().getDate()],
146
146
  // 老/小6次、成人3次 人脸报错提示弹窗
147
147
  showFaceModal: false,
148
+ showFaceModalTimes: 0,
148
149
  isKidsOrOld: false,
149
150
  // 老/小18次、成人6次 人脸报错提示弹窗
150
151
  showLockFaceModal: false,
@@ -330,47 +331,74 @@ Page({
330
331
  jingtongVerifyRequest.operateFaceFailCount({
331
332
  count,
332
333
  cid,
333
- age
334
+ age: 20 // 不再区分用户年龄(如老人、小孩),所以传20
334
335
  }).then(res => {
335
336
  console.log('获取人脸失败次数res', res)
336
337
  const times = Number(res.times) || 0
337
338
 
338
339
  // 老人/小孩:累计刷脸失败6次后,弹长窗提示
339
- if (count && isKidsOrOld && times === 6) {
340
- console.log('==============老人/小孩 -- 累计刷脸失败6次:弹长窗===============')
341
- this.setData({
342
- showFaceModal: true
343
- })
344
- }
340
+ // if (count && isKidsOrOld && times === 6) {
341
+ // console.log('==============老人/小孩 -- 累计刷脸失败6次:弹长窗===============')
342
+ // this.setData({
343
+ // showFaceModal: true
344
+ // })
345
+ // }
345
346
 
346
347
  // 成人:累计刷脸失败3次后,弹长窗提示
347
- if (count && !isKidsOrOld && times === 3) {
348
- console.log('==============成人 -- 累计刷脸失败3次:弹长窗===============')
348
+ // if (count && !isKidsOrOld && times === 3) {
349
+ // console.log('==============成人 -- 累计刷脸失败3次:弹长窗===============')
350
+ // this.setData({
351
+ // showFaceModal: true,
352
+ // })
353
+ // }
354
+
355
+ // 老/小18次锁定人脸
356
+ // if (isKidsOrOld && times >= 18) {
357
+ // console.log('==============老人/小孩 -- 累计刷脸失败18次:弹短窗===============')
358
+ // wx.hideLoading()
359
+ // this.setData({
360
+ // showLockFaceModal: true
361
+ // })
362
+ // // 人脸识别异常温馨提示弹窗
363
+ // count && this.handleFaceError(errCode)
364
+ // return
365
+ // }
366
+
367
+ // 成人6次 锁定人脸
368
+ // if (!isKidsOrOld && times >= 6) {
369
+ // console.log('==============成人 -- 累计刷脸失败6次:弹短窗===============')
370
+ // wx.hideLoading()
371
+ // this.setData({
372
+ // showLockFaceModal: true
373
+ // })
374
+ // // 人脸识别异常温馨提示弹窗
375
+ // count && this.handleFaceError(errCode)
376
+ // return
377
+ // }
378
+
379
+
380
+ if (3 <= times && time <= 5) {
381
+ console.log('==============累计刷脸失败超过3次,小于6次===============')
349
382
  this.setData({
350
- showFaceModal: true
383
+ showFaceModal: true,
384
+ showFaceModalTimes: time
351
385
  })
352
- }
353
-
354
- // 老/小18次、成人6次 锁定人脸
355
- if (isKidsOrOld && times >= 18) {
356
- console.log('==============老人/小孩 -- 累计刷脸失败18次:弹短窗===============')
386
+ } else if (times >= 6) {
387
+ console.log('==============累计刷脸失败达到6次===============')
357
388
  wx.hideLoading()
358
389
  this.setData({
359
- showLockFaceModal: true
390
+ showLockFaceModal: true,
391
+ showFaceModalTimes: time
360
392
  })
361
393
  // 人脸识别异常温馨提示弹窗
362
394
  count && this.handleFaceError(errCode)
363
395
  return
364
- } else if (!isKidsOrOld && times >= 6) {
365
- console.log('==============成人 -- 累计刷脸失败6次:弹短窗===============')
366
- wx.hideLoading()
396
+ } else {
367
397
  this.setData({
368
- showLockFaceModal: true
398
+ showFaceModalTimes: time
369
399
  })
370
- // 人脸识别异常温馨提示弹窗
371
- count && this.handleFaceError(errCode)
372
- return
373
400
  }
401
+
374
402
  resolve()
375
403
  }).catch(err => {
376
404
  console.log(err, '获取人脸失败次数err')
@@ -479,7 +479,7 @@
479
479
  <jt-modal visible="{{ showModal }}" status="{{ modalStatus }}" bind:ok="handleModalOk"></jt-modal>
480
480
 
481
481
  <!-- 老/小6次、成人3次 人脸报错提示弹窗 -->
482
- <face-modal visible="{{ showFaceModal }}" isKidsOrOld="{{ isKidsOrOld }}" bind:ok="handleModalOk"></face-modal>
482
+ <face-modal visible="{{ showFaceModal }}" isKidsOrOld="{{ isKidsOrOld }}" times="{{ showFaceModalTimes }}" bind:ok="handleModalOk"></face-modal>
483
483
 
484
484
  <!-- 老/小18次、成人6次 人脸报错提示弹窗 -->
485
485
  <lock-face-modal visible="{{ showLockFaceModal }}" isKidsOrOld="{{ isKidsOrOld }}" bind:ok="handleModalOk"></lock-face-modal>
@@ -480,15 +480,11 @@ function _getSession(options) {
480
480
  url: tifhost + '/tif/sys/session',
481
481
  tifEncrypt: true,
482
482
  success: res => {
483
+ console.log('request _getSession success: ', res)
483
484
  const { errcode, data } = res.data
484
485
  if (errcode === 0) {
485
- console.log('获取到的session信息', data)
486
-
487
- console.log('解密', DecrtptAES('700d435bf4c1ff6fbce7f8af99e8c1a9'))
488
-
489
486
  const { name = '', cid = '', phone = '', caPhone = '', passport_number = '' } = data
490
487
  if (name && name.indexOf('tif_') >= 0) {
491
- console.log('解密name')
492
488
  try {
493
489
  data.name = DecrtptAES(name.split('tif_')[1])
494
490
  } catch(err) {
@@ -497,7 +493,6 @@ function _getSession(options) {
497
493
  }
498
494
  }
499
495
  if (cid && cid.indexOf('tif_') >= 0) {
500
- console.log('解密cid')
501
496
  try {
502
497
  data.cid = DecrtptAES(cid.split('tif_')[1])
503
498
  } catch(err) {
@@ -506,7 +501,6 @@ function _getSession(options) {
506
501
  }
507
502
  }
508
503
  if (phone && phone.indexOf('tif_') >= 0) {
509
- console.log('解密phone')
510
504
  try {
511
505
  data.phone = DecrtptAES(phone.split('tif_')[1])
512
506
  } catch(err) {
@@ -515,7 +509,6 @@ function _getSession(options) {
515
509
  }
516
510
  }
517
511
  if (caPhone && caPhone.indexOf('tif_') >= 0) {
518
- console.log('解密caPhone')
519
512
  try {
520
513
  data.caPhone = DecrtptAES(caPhone.split('tif_')[1])
521
514
  } catch(err) {
@@ -524,7 +517,6 @@ function _getSession(options) {
524
517
  }
525
518
  }
526
519
  if (passport_number && passport_number.indexOf('tif_') >= 0) {
527
- console.log('解密passport_number')
528
520
  try {
529
521
  data.passport_number = DecrtptAES(passport_number.split('tif_')[1])
530
522
  } catch(err) {
@@ -532,7 +524,6 @@ function _getSession(options) {
532
524
  data.passport_number = passport_number
533
525
  }
534
526
  }
535
-
536
527
  wx.setStorageSync('tif.openid', data.openid)
537
528
  wx.setStorageSync('tif.phone', data.phone.replace(/(\d{3})\d*(\d{4})/, '$1****$2'))
538
529
  wx.setStorageSync('tif.realPhone', data.phone)
@@ -540,7 +531,6 @@ function _getSession(options) {
540
531
  wx.setStorageSync('tif.has_phone', data.has_phone)
541
532
  wx.setStorageSync('tif.tel_confirm_time', data.tel_confirm_time)
542
533
  setTimeout(() => {
543
- console.log('====session信息====3', data)
544
534
  options && options.success && options.success(data)
545
535
  }, 200)
546
536
  } else {
@@ -548,6 +538,12 @@ function _getSession(options) {
548
538
  }
549
539
  },
550
540
  fail: err => {
541
+ wx.showToast({
542
+ title: '当前访问人数过多,请您稍后再试,也可通过京通支付宝端登录。',
543
+ icon: 'none',
544
+ duration: 2000
545
+ })
546
+ console.log('request _getSession fail: ', res)
551
547
  options && options.fail && options.fail(JSON.stringify(err))
552
548
  }
553
549
  })