weapps-plugin-jingtong-verify 1.5.4 → 1.5.6

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.5.3
2
+ 1.5.6
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.5.4",
5
+ "version": "1.5.6",
6
6
  "description": "",
7
7
  "main": "sdk.js",
8
8
  "author": "tongyirenzheng",
@@ -44,6 +44,8 @@ Page({
44
44
  '553': 9,
45
45
  '700': 3
46
46
  },
47
+ showLoginFailTipModal: false, // 登录失败次数锁定
48
+ showLoginFailTipTitle: '', // 登录失败次数锁定
47
49
  },
48
50
 
49
51
  /**
@@ -118,10 +120,14 @@ Page({
118
120
  // TODO: 执行判断失败次数是否大于等于5次
119
121
  if(failCount >= 5){
120
122
  // 点击确定出现该提示
121
- wx.showToast({
122
- title: '1小时内连续错误5次,已锁定账号,1小时后重试',
123
- icon: 'none',
124
- duration: 2000
123
+ // wx.showToast({
124
+ // title: '1小时内连续错误5次,已锁定账号,1小时后重试',
125
+ // icon: 'none',
126
+ // duration: 2000
127
+ // })
128
+ this.setData({
129
+ showLoginFailTipModal: true,
130
+ showLoginFailTipTitle:'1小时内连续错误5次,已锁定账号,1小时后重试'
125
131
  })
126
132
  return
127
133
  }
@@ -136,10 +142,14 @@ Page({
136
142
 
137
143
  } else{
138
144
  // 点击确定出现该提示
139
- wx.showToast({
140
- title: '当天累计错误超10次,已锁定账号,24小时后重试',
141
- icon: 'none',
142
- duration: 2000
145
+ // wx.showToast({
146
+ // title: '当天累计错误超10次,已锁定账号,24小时后重试',
147
+ // icon: 'none',
148
+ // duration: 2000
149
+ // })
150
+ this.setData({
151
+ showLoginFailTipModal: true,
152
+ showLoginFailTipTitle: '当天累计错误超10次,已锁定账号,24小时后重试'
143
153
  })
144
154
  return
145
155
  }
@@ -208,11 +218,14 @@ Page({
208
218
  constantVals.setStorageWithExpire(constantVals.bank_card_login_fail_time, Date.now())
209
219
  }
210
220
  // 点击确定出现该提示
211
- wx.showToast({
212
- title: errmsg,
213
- icon: 'none',
214
- duration: 2000
221
+ this.setData({
222
+ showLoginFailTipTitle: errmsg
215
223
  })
224
+ // wx.showToast({
225
+ // title: errmsg,
226
+ // icon: 'none',
227
+ // duration: 2000
228
+ // })
216
229
  } else{
217
230
  console.log('直接账密登录-登录成功')
218
231
  console.log(session)
@@ -437,6 +450,11 @@ Page({
437
450
  login_validity_period: this.data.formData.verify_expire_time / 24 || '' // 免登录时间
438
451
  })
439
452
  },
453
+ handleModalOk(){
454
+ this.setData({
455
+ showLoginFailTipModal: false
456
+ })
457
+ },
440
458
  /**
441
459
  * 生命周期函数--监听页面初次渲染完成
442
460
  */
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "usingComponents": {
3
3
  "g-form": "../../components/gsd-ui/g-form/index",
4
- "g-input": "../../components/gsd-ui/g-input/index"
4
+ "g-input": "../../components/gsd-ui/g-input/index",
5
+ "tip-modal": "../../components/tip-modal/tip-modal"
5
6
  },
6
7
  "navigationBarTitleText": "账密登录"
7
8
  }
@@ -70,4 +70,10 @@
70
70
  </view>
71
71
  </view>
72
72
  </view>
73
- </view>
73
+ </view>
74
+ <!-- 登录失败次数锁定提示 -->
75
+ <tip-modal
76
+ visible="{{ showLoginFailTipModal }}"
77
+ bind:cancel="handleModalOk"
78
+ desc1="{{showLoginFailTipTitle}}"
79
+ ></tip-modal>
@@ -650,9 +650,9 @@ Page({
650
650
  console.log(res)
651
651
  const { errcode }= res
652
652
  if(errcode === 0){
653
- wx.hideLoading()
654
653
  // 判断type,1为信息确认,2为信息确认并获取手机号尾号,目前业务不需要走type=2
655
654
  if(type === 1) {
655
+ wx.hideLoading()
656
656
  this.setData({
657
657
  set_type: 3
658
658
  })
@@ -663,6 +663,7 @@ Page({
663
663
  isIdCardSuccess: true
664
664
  })
665
665
  this.sendVerificationCode()
666
+ wx.hideLoading()
666
667
  // this.toGetTailNumber(value)
667
668
  }
668
669
  } else {
@@ -756,6 +757,9 @@ Page({
756
757
  * 发送验证码
757
758
  */
758
759
  sendVerificationCode () {
760
+ wx.showLoading({
761
+ title: '发送中',
762
+ })
759
763
  if(!this.data.isIdCardSuccess){
760
764
  wx.showToast({
761
765
  title: '身份证号码验证没有通过,请重新填写',
@@ -768,13 +772,13 @@ Page({
768
772
  }
769
773
 
770
774
  // 检查重试次数
771
- if (this.data.retryCount >= this.data.maxRetryCount) {
772
- wx.showToast({
773
- title: '今日发送次数已达上限',
774
- icon: 'none'
775
- });
776
- return;
777
- }
775
+ // if (this.data.retryCount >= this.data.maxRetryCount) {
776
+ // wx.showToast({
777
+ // title: '今日发送次数已达上限',
778
+ // icon: 'none'
779
+ // });
780
+ // return;
781
+ // }
778
782
  console.log(this.data.formSafeData)
779
783
  console.log(this.data.formSafeData.phone_number)
780
784
  const { phone_number } = this.data.formSafeData
@@ -833,14 +837,15 @@ Page({
833
837
  this.startCountdown();
834
838
  this.setData({
835
839
  isSendSms: true,
836
- retryCount: this.data.retryCount + 1,
840
+ // retryCount: this.data.retryCount + 1,
837
841
  formSafeDataCode: data.code,
838
842
  getFormSafeDataCodeTime: Date.now()
839
843
  });
840
844
  } else {
841
845
  wx.showToast({
842
846
  title: errmsg || '发送失败,稍后请重试',
843
- icon: 'none'
847
+ icon: 'none',
848
+ duration: 2500
844
849
  });
845
850
  }
846
851
  })
@@ -334,7 +334,7 @@
334
334
  .password-strength-indicator {
335
335
  display: flex;
336
336
  align-items: center;
337
- gap: 50rpx;
337
+ gap: 25rpx;
338
338
  }
339
339
 
340
340
  .strength-bar {
@@ -365,6 +365,7 @@
365
365
  .strength-text {
366
366
  font-size: 28rpx;
367
367
  font-weight: bold;
368
+ padding-right: 20rpx;
368
369
  }
369
370
 
370
371
  .strength-text.weak {
@@ -185,7 +185,7 @@
185
185
  .password-strength-indicator {
186
186
  display: flex;
187
187
  align-items: center;
188
- gap: 50rpx;
188
+ gap: 25rpx;
189
189
  }
190
190
 
191
191
  .strength-bar {
@@ -216,6 +216,7 @@
216
216
  .strength-text {
217
217
  font-size: 28rpx;
218
218
  font-weight: bold;
219
+ padding-right: 20rpx;
219
220
  }
220
221
 
221
222
  .strength-text.weak {
@@ -217,18 +217,18 @@ Page({
217
217
  } else {
218
218
  lastMsg = customValid.msg
219
219
  }
220
- this.showCuntomErrTip(lastMsg)
221
- this.data.submitMode = ''
222
- this.data.isSubmitting = false
223
- wx.hideLoading()
224
220
  this.setData({
221
+ submitMode: '',
225
222
  isSubmitting: false
226
223
  })
224
+ this.showCuntomErrTip(lastMsg)
225
+ wx.hideLoading()
227
226
  return
228
227
  }
229
228
  this.setData({
230
229
  formData: { ...this.data.formData, verification_code: tempCode },
231
- submitMode: ''
230
+ submitMode: '',
231
+ isSubmitting: false
232
232
  })
233
233
  this.sendVerificationCode()
234
234
  return
@@ -657,13 +657,13 @@ Page({
657
657
  }
658
658
 
659
659
  // 检查重试次数
660
- if (this.data.retryCount >= this.data.maxRetryCount) {
661
- wx.showToast({
662
- title: '今日发送次数已达上限',
663
- icon: 'none'
664
- });
665
- return;
666
- }
660
+ // if (this.data.retryCount >= this.data.maxRetryCount) {
661
+ // wx.showToast({
662
+ // title: '今日发送次数已达上限',
663
+ // icon: 'none'
664
+ // });
665
+ // return;
666
+ // }
667
667
  const { formData } = this.data
668
668
  if(formData.bank_phone === ''){
669
669
  wx.showToast({
@@ -703,13 +703,13 @@ Page({
703
703
  this.startCountdown();
704
704
  this.setData({
705
705
  isSendSms: true,
706
- retryCount: this.data.retryCount + 1,
707
706
  formDataVerificationCode: data.code
708
707
  });
709
708
  } else {
710
709
  wx.showToast({
711
710
  title: errmsg || '发送失败,稍后请重试',
712
- icon: 'none'
711
+ icon: 'none',
712
+ duration: 2500
713
713
  });
714
714
  }
715
715
  })
@@ -195,6 +195,7 @@ Page({
195
195
  // 防重复点击标记 - 基于接口返回状态
196
196
  isSubmitting: false,
197
197
  checkType: 1, // 1:无密码和手机号,2:无密码有手机号,3:无手机号有密码
198
+ showOtherWayTipModal: false, // 提示
198
199
  },
199
200
 
200
201
  /**
@@ -1392,7 +1393,8 @@ Page({
1392
1393
  showFaceModal: false,
1393
1394
  showLockFaceModal: false,
1394
1395
  showCardModal: false,
1395
- showTipModal: false
1396
+ showTipModal: false,
1397
+ showOtherWayTipModal: false
1396
1398
  })
1397
1399
  },
1398
1400
 
@@ -1594,7 +1596,21 @@ Page({
1594
1596
  // 验证是否在锁定期内,在的话,直接弹窗提示,并返回
1595
1597
  let bankCardFailTime = constantVal.getStorageWithExpire(constantVal.bank_card_verify_fail_time)
1596
1598
  if(bankCardFailTime){
1599
+ // 当前时间
1600
+ const now = Date.now()
1597
1601
 
1602
+ // 判断是否在30分钟内(1小时 = 3600 * 1000 毫秒)
1603
+ const isWithinOneHour = (now - bankCardFailTime) < (30 * 60 * 1000)
1604
+ if(isWithinOneHour){
1605
+ console.log('当前仍在10分钟限制内')
1606
+ this.setData({
1607
+ showOtherWayTipModal: true
1608
+ })
1609
+ wx.showToast({
1610
+ title: '还存在银行卡验证失败锁定期内,请稍后再试',
1611
+ })
1612
+ return
1613
+ }
1598
1614
  }
1599
1615
  // 身份二要素校验
1600
1616
  const { name, id_card_number } = this.data.formData
@@ -514,3 +514,9 @@
514
514
  bind:CancelBtn="cancelFaceErrorModal"
515
515
  bind:ConfirmBtn="okFaceErrorModal"
516
516
  ></face-error-modal>
517
+ <!-- 其他方式锁定提示 -->
518
+ <tip-modal
519
+ visible="{{ showOtherWayTipModal }}"
520
+ bind:cancel="handleModalOk"
521
+ desc1="因您多次人脸识别验证未能通过,为保障账户安全,人脸识别的验证方式已暂时锁定,待锁定时效(10分钟)结束后,重新尝试人脸识别验证。"
522
+ ></tip-modal>
@@ -20,7 +20,8 @@ Page({
20
20
  24: '1天免登录',
21
21
  168: '7天免登录',
22
22
  720: '30天免登录'
23
- }
23
+ },
24
+ isShowUpdatePwd: false
24
25
  },
25
26
 
26
27
  /**
@@ -63,6 +64,7 @@ Page({
63
64
  loginWay: loginWay
64
65
  })
65
66
  }
67
+ this.getShowUpdatePwd(cid)
66
68
  // if (cid_type === '516') {
67
69
  // this.setData({
68
70
  // exitHmSession: true,
@@ -82,6 +84,37 @@ Page({
82
84
  }
83
85
  })
84
86
  },
87
+ getShowUpdatePwd(value) {
88
+ jingtongVerifyRequest.checkPhonePwd(value).then(res => {
89
+ const { errmsg, errcode } = res
90
+ if(errcode === 0){
91
+ if(!res.data.is_new){
92
+ this.setData({
93
+ isShowUpdatePwd: true
94
+ })
95
+ } else {
96
+ this.setData({
97
+ isShowUpdatePwd: false
98
+ })
99
+ }
100
+ } else {
101
+ wx.showToast({
102
+ title: errmsg,
103
+ icon: 'none',
104
+ duration: 2000,
105
+ })
106
+ }
107
+ }).catch(error => {
108
+ console.log('异常')
109
+ console.log(error)
110
+ const { errmsg } = error
111
+ wx.showToast({
112
+ title: errmsg,
113
+ icon: 'none',
114
+ duration: 2000,
115
+ })
116
+ })
117
+ },
85
118
  // 跳转登录管理页面
86
119
  goToLoginWag() {
87
120
  // 上报事件
@@ -7,7 +7,7 @@
7
7
  <image src="../../images/Vector.png" mode="" class="img" wx:if="{{ loginWay }}"/>
8
8
  </view>
9
9
  </view>
10
- <view class="cell" catchtap="goToUpdatePwd">
10
+ <view class="cell" catchtap="goToUpdatePwd" wx:if="{{isShowUpdatePwd}}">
11
11
  <view class="label">
12
12
  修改登录密码
13
13
  </view>