weapps-plugin-jingtong-verify 1.6.1 → 1.6.2-beta

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.
Files changed (183) hide show
  1. package/README.md +1 -2
  2. package/app.json +33 -33
  3. package/package.json +20 -20
  4. package/sdk.js +309 -289
  5. package/weapps-plugin-jingtong-verify/components/card-modal/card-modal.js +31 -31
  6. package/weapps-plugin-jingtong-verify/components/card-modal/card-modal.json +3 -3
  7. package/weapps-plugin-jingtong-verify/components/card-modal/card-modal.wxml +9 -9
  8. package/weapps-plugin-jingtong-verify/components/card-modal/card-modal.wxss +65 -65
  9. package/weapps-plugin-jingtong-verify/components/face-error-modal/face-error-modal.js +37 -37
  10. package/weapps-plugin-jingtong-verify/components/face-error-modal/face-error-modal.json +3 -3
  11. package/weapps-plugin-jingtong-verify/components/face-error-modal/face-error-modal.wxml +30 -30
  12. package/weapps-plugin-jingtong-verify/components/face-error-modal/face-error-modal.wxss +79 -79
  13. package/weapps-plugin-jingtong-verify/components/face-modal/face-modal.js +32 -32
  14. package/weapps-plugin-jingtong-verify/components/face-modal/face-modal.json +3 -3
  15. package/weapps-plugin-jingtong-verify/components/face-modal/face-modal.wxml +16 -16
  16. package/weapps-plugin-jingtong-verify/components/face-modal/face-modal.wxss +57 -57
  17. package/weapps-plugin-jingtong-verify/components/gsd-lib/anim/anim.min.js +1 -1
  18. package/weapps-plugin-jingtong-verify/components/gsd-lib/crypto/crypto.js +37 -37
  19. package/weapps-plugin-jingtong-verify/components/gsd-lib/crypto/index.js +44 -44
  20. package/weapps-plugin-jingtong-verify/components/gsd-lib/dayjs/index.js +351 -351
  21. package/weapps-plugin-jingtong-verify/components/gsd-lib/event/index.js +117 -117
  22. package/weapps-plugin-jingtong-verify/components/gsd-lib/index.js +63 -63
  23. package/weapps-plugin-jingtong-verify/components/gsd-lib/map/index.js +10 -10
  24. package/weapps-plugin-jingtong-verify/components/gsd-lib/map/qmap.js +6 -6
  25. package/weapps-plugin-jingtong-verify/components/gsd-lib/storage/index.js +114 -114
  26. package/weapps-plugin-jingtong-verify/components/gsd-lib/utils/index.js +218 -218
  27. package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/formCheck.js +72 -72
  28. package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/formController.js +47 -47
  29. package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/icon.js +11 -11
  30. package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/list.js +16 -16
  31. package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/navigator.js +33 -33
  32. package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/primarySecondButton.js +18 -18
  33. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-agree/index.js +12 -12
  34. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-agree/index.json +5 -5
  35. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-agree/index.wxml +15 -15
  36. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.js +47 -47
  37. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.json +3 -3
  38. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.wxml +13 -13
  39. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-button-group/index.js +44 -44
  40. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-button-group/index.json +5 -5
  41. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-button-group/index.wxml +28 -28
  42. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.js +30 -30
  43. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.json +6 -6
  44. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.wxml +42 -42
  45. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.wxss +1 -1
  46. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-date-picker-en/index.js +418 -418
  47. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-date-picker-en/index.json +5 -5
  48. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-date-picker-en/index.wxml +29 -29
  49. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-dropdown/index.js +11 -11
  50. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-dropdown/index.json +3 -3
  51. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-dropdown/index.wxml +4 -4
  52. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form/index.js +179 -179
  53. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form/index.json +6 -6
  54. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form/index.wxml +16 -16
  55. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-cell/index.js +92 -92
  56. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-cell/index.json +6 -6
  57. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-cell/index.wxml +12 -12
  58. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-cell/index.wxss +2 -2
  59. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-item/index.js +49 -49
  60. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-item/index.json +3 -3
  61. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-item/index.wxml +14 -14
  62. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-icon/index.js +33 -33
  63. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-icon/index.json +3 -3
  64. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-icon/index.wxml +2 -2
  65. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-index-list/index.js +108 -108
  66. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-index-list/index.json +6 -6
  67. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-index-list/index.wxml +53 -53
  68. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-input/index.js +236 -236
  69. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-input/index.json +8 -8
  70. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-input/index.wxml +49 -49
  71. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-picker/index.js +328 -328
  72. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-picker/index.json +6 -6
  73. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-picker/index.wxml +26 -26
  74. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-popover/index.js +159 -159
  75. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-popover/index.json +3 -3
  76. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-popover/index.wxml +10 -10
  77. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-search/index.js +112 -112
  78. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-search/index.json +5 -5
  79. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-search/index.wxml +21 -21
  80. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.js +21 -21
  81. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.json +7 -7
  82. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.wxml +16 -16
  83. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-tips/index.js +50 -50
  84. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-tips/index.json +5 -5
  85. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-tips/index.wxml +27 -27
  86. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/add.svg +13 -13
  87. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/arrow.svg +14 -14
  88. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/delete.svg +16 -16
  89. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/preview.svg +21 -21
  90. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/user.svg +13 -13
  91. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-agree.wxss +147 -147
  92. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-badge.wxss +41 -41
  93. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-button-group.wxss +244 -244
  94. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-cell.wxss +220 -220
  95. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-dropdown.wxss +115 -115
  96. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-form-cell.wxss +101 -101
  97. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-form-item.wxss +174 -174
  98. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-form.wxss +101 -101
  99. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-icon.wxss +268 -268
  100. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-index-list.wxss +206 -206
  101. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-input.wxss +206 -206
  102. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-picker.wxss +139 -139
  103. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-popover.wxss +129 -129
  104. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-search.wxss +171 -171
  105. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-switch.wxss +176 -176
  106. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-tips.wxss +173 -173
  107. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/icon/iconfont.wxss +160 -160
  108. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/main.wxss +283 -283
  109. package/weapps-plugin-jingtong-verify/components/gsd-ui/utils/helper.js +55 -55
  110. package/weapps-plugin-jingtong-verify/components/gsd-ui/utils/validType.js +117 -117
  111. package/weapps-plugin-jingtong-verify/components/gsd-ui/utils/validator.js +106 -106
  112. package/weapps-plugin-jingtong-verify/components/lock-face-modal/lock-face-modal.js +32 -32
  113. package/weapps-plugin-jingtong-verify/components/lock-face-modal/lock-face-modal.json +3 -3
  114. package/weapps-plugin-jingtong-verify/components/lock-face-modal/lock-face-modal.wxml +8 -8
  115. package/weapps-plugin-jingtong-verify/components/lock-face-modal/lock-face-modal.wxss +57 -57
  116. package/weapps-plugin-jingtong-verify/components/modal/modal.js +32 -32
  117. package/weapps-plugin-jingtong-verify/components/modal/modal.json +3 -3
  118. package/weapps-plugin-jingtong-verify/components/modal/modal.wxml +28 -28
  119. package/weapps-plugin-jingtong-verify/components/modal/modal.wxss +84 -84
  120. package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.js +82 -82
  121. package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.json +3 -3
  122. package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.wxml +18 -18
  123. package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.wxss +72 -72
  124. package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.js +39 -39
  125. package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.json +3 -3
  126. package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.wxml +9 -9
  127. package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.wxss +51 -51
  128. package/weapps-plugin-jingtong-verify/i18n/index.js +7 -7
  129. package/weapps-plugin-jingtong-verify/i18n/logout.js +10 -10
  130. package/weapps-plugin-jingtong-verify/i18n/rules.js +262 -262
  131. package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.js +86 -86
  132. package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.json +6 -6
  133. package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.wxml +20 -20
  134. package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.wxss +51 -51
  135. package/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone.js +167 -167
  136. package/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone.json +3 -3
  137. package/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone.wxml +30 -30
  138. package/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone.wxss +91 -91
  139. package/weapps-plugin-jingtong-verify/pages/face-error-reason/face-error-reason.js +79 -79
  140. package/weapps-plugin-jingtong-verify/pages/face-error-reason/face-error-reason.json +5 -5
  141. package/weapps-plugin-jingtong-verify/pages/face-error-reason/face-error-reason.wxml +19 -19
  142. package/weapps-plugin-jingtong-verify/pages/face-error-reason/face-error-reason.wxss +44 -44
  143. package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.js +1557 -1547
  144. package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.json +17 -17
  145. package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxml +504 -504
  146. package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxss +133 -133
  147. package/weapps-plugin-jingtong-verify/pages/log-off/log-off.js +127 -127
  148. package/weapps-plugin-jingtong-verify/pages/log-off/log-off.json +5 -5
  149. package/weapps-plugin-jingtong-verify/pages/log-off/log-off.wxml +36 -36
  150. package/weapps-plugin-jingtong-verify/pages/log-off/log-off.wxss +60 -60
  151. package/weapps-plugin-jingtong-verify/pages/login-manage/login-manage.js +106 -106
  152. package/weapps-plugin-jingtong-verify/pages/login-manage/login-manage.json +3 -3
  153. package/weapps-plugin-jingtong-verify/pages/login-manage/login-manage.wxml +29 -29
  154. package/weapps-plugin-jingtong-verify/pages/login-manage/login-manage.wxss +68 -68
  155. package/weapps-plugin-jingtong-verify/pages/logoff-success/logoff-success.js +24 -24
  156. package/weapps-plugin-jingtong-verify/pages/logoff-success/logoff-success.json +3 -3
  157. package/weapps-plugin-jingtong-verify/pages/logoff-success/logoff-success.wxml +12 -12
  158. package/weapps-plugin-jingtong-verify/pages/logoff-success/logoff-success.wxss +33 -33
  159. package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.js +120 -120
  160. package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.json +6 -6
  161. package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.wxml +9 -9
  162. package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.wxss +1 -1
  163. package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.js +864 -854
  164. package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.json +11 -11
  165. package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.wxml +162 -162
  166. package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.wxss +64 -64
  167. package/weapps-plugin-jingtong-verify/pages/setting/setting.js +328 -328
  168. package/weapps-plugin-jingtong-verify/pages/setting/setting.json +5 -5
  169. package/weapps-plugin-jingtong-verify/pages/setting/setting.wxml +91 -91
  170. package/weapps-plugin-jingtong-verify/pages/setting/setting.wxss +69 -69
  171. package/weapps-plugin-jingtong-verify/pages/user-info/user-info.js +306 -306
  172. package/weapps-plugin-jingtong-verify/pages/user-info/user-info.json +7 -7
  173. package/weapps-plugin-jingtong-verify/pages/user-info/user-info.wxml +142 -142
  174. package/weapps-plugin-jingtong-verify/pages/user-info/user-info.wxss +110 -110
  175. package/weapps-plugin-jingtong-verify/style/page.wxss +13 -13
  176. package/weapps-plugin-jingtong-verify/utils/QDTrackerNew/QDTracker.js +15 -15
  177. package/weapps-plugin-jingtong-verify/utils/QDTrackerNew/QDTrackerMain.js +59 -59
  178. package/weapps-plugin-jingtong-verify/utils/country.js +209 -209
  179. package/weapps-plugin-jingtong-verify/utils/index.js +306 -306
  180. package/weapps-plugin-jingtong-verify/utils/jsencrypt.min.js +1 -1
  181. package/weapps-plugin-jingtong-verify/utils/rules.js +301 -301
  182. package/weapps-plugin-jingtong-verify/utils/tifadmin_config.js +61 -61
  183. package/weapps-plugin-jingtong-verify/utils/validate.js +772 -772
@@ -1,307 +1,307 @@
1
- // weapps-plugin-jingtong-verify/pages/user-info/user-info.js
2
- const jingtongVerifyRequest = require('../../utils/request')
3
- const utils = require("../../utils/index")
4
-
5
- import { SDKTrack, setAccountInfo } from '../../utils/QDTrackerNew/QDTrackerMain'
6
-
7
- Page({
8
-
9
- /**
10
- * 页面的初始数据
11
- */
12
- data: {
13
- showPage: true,
14
- name: '',
15
- star_name: '',
16
- sex: '',
17
- cid: '',
18
- star_cid: '',
19
- phone: '',
20
- star_phone: '',
21
- phoneModal: false,
22
- showEye: false,
23
- authExpired: false,
24
- showTipModal: false,
25
- birthday: '',
26
- canSave: false,
27
- showFullInfoModal: false,
28
- sexIndex: -1,
29
- sexRangeZH: [
30
- { name: '男', value: 1 },
31
- { name: '女', value: 2 }
32
- ],
33
- fourTypeCert: false, // 港澳/台通行证、华侨护照和外国护照四类证件
34
- showSBModal: false,
35
- sbDesc: '',
36
- showLeaveModal: false
37
- },
38
-
39
- /**
40
- * 生命周期函数--监听页面加载
41
- */
42
- onLoad() {
43
- wx.hideShareMenu()
44
-
45
- wx.showLoading({
46
- mask: true,
47
- title: '加载中…'
48
- })
49
- jingtongVerifyRequest.getSession({
50
- success: (res) => {
51
- let { star_name, star_cid, phone, name, cid, face_time, realname_time, cid_type, openid, birth_date = '' } = res
52
- let pho = /(\d{3})\d*(\d{4})/
53
- let sex = '未知'
54
- let authExpired = (!face_time && !realname_time) || !cid
55
- // let Gender = res.sex
56
- // let Age = ''
57
-
58
- // 设置用户账号信息
59
- setAccountInfo(openid)
60
-
61
- if (star_cid && cid_type === '111') {
62
- sex = utils.parseIDCard(cid).sexZh
63
- // Gender = utils.parseIDCard(cid).sex
64
- // Age = utils.parseIDCard(cid).age
65
- } else {
66
- let resSex = res.sex
67
- if (resSex === '1') {
68
- sex = '男'
69
- } else if (resSex === '2') {
70
- sex = '女'
71
- }
72
- }
73
- // 港澳/台通行证、华侨护照三类证件
74
- const fourTypeCertList = ['516', '511', '414']
75
- const fourTypeCert = fourTypeCertList.includes(cid_type) || false
76
-
77
- // 获取弹窗时间戳
78
- let nowTimestamp = Date.now()
79
- const stamp = wx.getStorageSync('tif.fullInfoModalStamp') || 0
80
-
81
- let birthday = ''
82
- if (birth_date) {
83
- birthday = birth_date.slice(0, 4) + '-' + birth_date.slice(4, 6) + '-' + birth_date.slice(6, 8);
84
- }
85
- this.setData({
86
- cid_type,
87
- sexIndex: sex === '未知' ? 0 : Number(res.sex) - 1,
88
- birthday,
89
- fourTypeCert,
90
- showFullInfoModal: (fourTypeCert && (sex === '未知' || !birthday) && nowTimestamp > stamp) || false,
91
- star_name,
92
- name,
93
- sex,
94
- star_cid,
95
- cid,
96
- star_phone: phone ? phone.replace(pho, '$1****$2') : '',
97
- phone,
98
- authExpired
99
- }, () => {
100
- wx.hideLoading()
101
- })
102
- },
103
- fail: () => {
104
- wx.hideLoading()
105
- }
106
- })
107
- },
108
-
109
- // 显示换绑手机号码弹窗
110
- showPhoneModal() {
111
- if (!this.data.authExpired) {
112
- // 上报事件
113
- SDKTrack('function_btn_click', {
114
- item_type: '9', // 业务分类
115
- item_code: '110000000000511211993408000000', // 事项ID
116
- item_access: '19', // 业务入口
117
- })
118
- this.setData({
119
- phoneModal: true
120
- })
121
- } else {
122
- wx.showToast({
123
- title: '请先登录,再进行换绑手机号码操作',
124
- icon: 'none',
125
- duration: 3000
126
- })
127
- }
128
- },
129
-
130
- // 切换显隐
131
- changeEye() {
132
- this.setData({
133
- showEye: !this.data.showEye
134
- })
135
- },
136
-
137
- // 弹框确认
138
- confirmPhoneModal() {
139
- this.setData({
140
- phoneModal: false
141
- })
142
- },
143
-
144
- // 获取手机号码
145
- async getPhoneNumberFun(e) {
146
- const params = Object.assign(e.detail, {
147
- source: '1'
148
- })
149
- const [err, session] = await utils.awaitTo(jingtongVerifyRequest.loginPhone(params))
150
- if (err) {
151
- console.log(err, '换绑手机号码')
152
- wx.showToast({
153
- title: err.errmsg || '换绑失败,请稍后再试',
154
- icon: 'none'
155
- })
156
- return
157
- }
158
- wx.showToast({
159
- title: '换绑成功',
160
- icon: 'none',
161
- duration: 3000,
162
- mask: true
163
- })
164
-
165
- // 登录成功回调 => 业务侧操作事项
166
- wx.$_ServiceConfiguration && wx.$_ServiceConfiguration.methods && wx.$_ServiceConfiguration.methods._loginSuccessCallBack && wx.$_ServiceConfiguration.methods._loginSuccessCallBack(session)
167
-
168
- let phone = session.phone
169
- let pho = /(\d{3})\d*(\d{4})/
170
-
171
- this.setData({
172
- phone: wx.getStorageSync('tif.realPhone') || '',
173
- star_phone: phone ? phone.replace(pho, '$1****$2') : ''
174
- })
175
- },
176
-
177
- // 显示弹窗
178
- showTip() {
179
- this.setData({
180
- showTipModal: true
181
- })
182
- },
183
-
184
- // 关闭弹窗
185
- handleCloseModal() {
186
- this.setData({
187
- showTipModal: false,
188
- showSBModal: false,
189
- showLeaveModal: false
190
- })
191
- },
192
-
193
- // 关闭弹窗+记录10个自然日
194
- handleFullInfoModalOk() {
195
- this.setData({
196
- showFullInfoModal: false
197
- })
198
- // 计算10个自然日后的时间戳
199
- let nowTimestamp = Date.now()
200
- let futureDate = new Date(nowTimestamp)
201
- futureDate.setDate(futureDate.getDate() + 10)
202
- let futureTimestamp = futureDate.getTime()
203
- wx.setStorageSync('tif.fullInfoModalStamp', futureTimestamp)
204
- },
205
-
206
- // 性别
207
- bindSexChange(e) {
208
- const sexIndex = e.detail.value
209
- this.setData({
210
- sex: this.data.sexRangeZH[sexIndex].name,
211
- sexIndex,
212
- canSave: true
213
- })
214
- },
215
-
216
- // 出生日期
217
- bindBirthChange(e) {
218
- this.setData({
219
- birthday: e.detail.value,
220
- canSave: true
221
- })
222
- },
223
-
224
- // 保存信息
225
- async toSave() {
226
- const sex = this.data.sex
227
- const birthday = this.data.birthday
228
- if (sex === '未知') {
229
- this.setData({
230
- sbDesc: '您的性别信息尚未完善, ',
231
- showSBModal: true
232
- })
233
- return
234
- } else if (!birthday) {
235
- this.setData({
236
- sbDesc: '您的出生日期尚未完善, ',
237
- showSBModal: true
238
- })
239
- return
240
- }
241
-
242
- const [err, data] = await utils.awaitTo(jingtongVerifyRequest.updateSB({
243
- sex: this.data.sexRangeZH[this.data.sexIndex].value || '',
244
- birthday
245
- }))
246
- if (err) {
247
- console.log(err, '保存信息')
248
- wx.showToast({
249
- title: err.errmsg || '保存失败,请稍后再试',
250
- icon: 'none'
251
- })
252
- return
253
- }
254
- console.log('更新信息', data)
255
- wx.showToast({
256
- title: '保存成功',
257
- icon: 'none',
258
- duration: 2000,
259
- mask: true
260
- })
261
-
262
- this.setData({
263
- canSave: false
264
- })
265
- },
266
-
267
- onBeforeLeave() {
268
- console.log('监听到返回上一页', this.data.canSave)
269
- // 返回上一页的逻辑处理
270
- if (this.data.canSave) {
271
- this.setData({
272
- showLeaveModal: true
273
- })
274
- } else {
275
- console.log('返回上一页')
276
- this.setData({
277
- showPage: false
278
- }, () => {
279
- setTimeout(() => {
280
- wx.navigateBack()
281
- }, 10)
282
- })
283
- }
284
- },
285
-
286
- toBack() {
287
- this.setData({
288
- showLeaveModal: false
289
- }, () => {
290
- setTimeout(() => {
291
- wx.navigateBack()
292
- }, 10)
293
- })
294
- },
295
-
296
- stopBack() {
297
- this.setData({
298
- showLeaveModal: false,
299
- showPage: true
300
- })
301
- },
302
-
303
- preventSwipe() {
304
- /* 空函数阻止默认滑动 */
305
- console.log('空函数阻止默认滑动')
306
- }
1
+ // weapps-plugin-jingtong-verify/pages/user-info/user-info.js
2
+ const jingtongVerifyRequest = require('../../utils/request')
3
+ const utils = require("../../utils/index")
4
+
5
+ import { SDKTrack, setAccountInfo } from '../../utils/QDTrackerNew/QDTrackerMain'
6
+
7
+ Page({
8
+
9
+ /**
10
+ * 页面的初始数据
11
+ */
12
+ data: {
13
+ showPage: true,
14
+ name: '',
15
+ star_name: '',
16
+ sex: '',
17
+ cid: '',
18
+ star_cid: '',
19
+ phone: '',
20
+ star_phone: '',
21
+ phoneModal: false,
22
+ showEye: false,
23
+ authExpired: false,
24
+ showTipModal: false,
25
+ birthday: '',
26
+ canSave: false,
27
+ showFullInfoModal: false,
28
+ sexIndex: -1,
29
+ sexRangeZH: [
30
+ { name: '男', value: 1 },
31
+ { name: '女', value: 2 }
32
+ ],
33
+ fourTypeCert: false, // 港澳/台通行证、华侨护照和外国护照四类证件
34
+ showSBModal: false,
35
+ sbDesc: '',
36
+ showLeaveModal: false
37
+ },
38
+
39
+ /**
40
+ * 生命周期函数--监听页面加载
41
+ */
42
+ onLoad() {
43
+ wx.hideShareMenu()
44
+
45
+ wx.showLoading({
46
+ mask: true,
47
+ title: '加载中…'
48
+ })
49
+ jingtongVerifyRequest.getSession({
50
+ success: (res) => {
51
+ let { star_name, star_cid, phone, name, cid, face_time, realname_time, cid_type, openid, birth_date = '' } = res
52
+ let pho = /(\d{3})\d*(\d{4})/
53
+ let sex = '未知'
54
+ let authExpired = (!face_time && !realname_time) || !cid
55
+ // let Gender = res.sex
56
+ // let Age = ''
57
+
58
+ // 设置用户账号信息
59
+ setAccountInfo(openid)
60
+
61
+ if (star_cid && cid_type === '111') {
62
+ sex = utils.parseIDCard(cid).sexZh
63
+ // Gender = utils.parseIDCard(cid).sex
64
+ // Age = utils.parseIDCard(cid).age
65
+ } else {
66
+ let resSex = res.sex
67
+ if (resSex === '1') {
68
+ sex = '男'
69
+ } else if (resSex === '2') {
70
+ sex = '女'
71
+ }
72
+ }
73
+ // 港澳/台通行证、华侨护照三类证件
74
+ const fourTypeCertList = ['516', '511', '414']
75
+ const fourTypeCert = fourTypeCertList.includes(cid_type) || false
76
+
77
+ // 获取弹窗时间戳
78
+ let nowTimestamp = Date.now()
79
+ const stamp = wx.getStorageSync('tif.fullInfoModalStamp') || 0
80
+
81
+ let birthday = ''
82
+ if (birth_date) {
83
+ birthday = birth_date.slice(0, 4) + '-' + birth_date.slice(4, 6) + '-' + birth_date.slice(6, 8);
84
+ }
85
+ this.setData({
86
+ cid_type,
87
+ sexIndex: sex === '未知' ? 0 : Number(res.sex) - 1,
88
+ birthday,
89
+ fourTypeCert,
90
+ showFullInfoModal: (fourTypeCert && (sex === '未知' || !birthday) && nowTimestamp > stamp) || false,
91
+ star_name,
92
+ name,
93
+ sex,
94
+ star_cid,
95
+ cid,
96
+ star_phone: phone ? phone.replace(pho, '$1****$2') : '',
97
+ phone,
98
+ authExpired
99
+ }, () => {
100
+ wx.hideLoading()
101
+ })
102
+ },
103
+ fail: () => {
104
+ wx.hideLoading()
105
+ }
106
+ })
107
+ },
108
+
109
+ // 显示换绑手机号码弹窗
110
+ showPhoneModal() {
111
+ if (!this.data.authExpired) {
112
+ // 上报事件
113
+ SDKTrack('function_btn_click', {
114
+ item_type: '9', // 业务分类
115
+ item_code: '110000000000511211993408000000', // 事项ID
116
+ item_access: '19', // 业务入口
117
+ })
118
+ this.setData({
119
+ phoneModal: true
120
+ })
121
+ } else {
122
+ wx.showToast({
123
+ title: '请先登录,再进行换绑手机号码操作',
124
+ icon: 'none',
125
+ duration: 3000
126
+ })
127
+ }
128
+ },
129
+
130
+ // 切换显隐
131
+ changeEye() {
132
+ this.setData({
133
+ showEye: !this.data.showEye
134
+ })
135
+ },
136
+
137
+ // 弹框确认
138
+ confirmPhoneModal() {
139
+ this.setData({
140
+ phoneModal: false
141
+ })
142
+ },
143
+
144
+ // 获取手机号码
145
+ async getPhoneNumberFun(e) {
146
+ const params = Object.assign(e.detail, {
147
+ source: '1'
148
+ })
149
+ const [err, session] = await utils.awaitTo(jingtongVerifyRequest.loginPhone(params))
150
+ if (err) {
151
+ console.log(err, '换绑手机号码')
152
+ wx.showToast({
153
+ title: err.errmsg || '换绑失败,请稍后再试',
154
+ icon: 'none'
155
+ })
156
+ return
157
+ }
158
+ wx.showToast({
159
+ title: '换绑成功',
160
+ icon: 'none',
161
+ duration: 3000,
162
+ mask: true
163
+ })
164
+
165
+ // 登录成功回调 => 业务侧操作事项
166
+ wx.$_ServiceConfiguration && wx.$_ServiceConfiguration.methods && wx.$_ServiceConfiguration.methods._loginSuccessCallBack && wx.$_ServiceConfiguration.methods._loginSuccessCallBack(session)
167
+
168
+ let phone = session.phone
169
+ let pho = /(\d{3})\d*(\d{4})/
170
+
171
+ this.setData({
172
+ phone: wx.getStorageSync('tif.realPhone') || '',
173
+ star_phone: phone ? phone.replace(pho, '$1****$2') : ''
174
+ })
175
+ },
176
+
177
+ // 显示弹窗
178
+ showTip() {
179
+ this.setData({
180
+ showTipModal: true
181
+ })
182
+ },
183
+
184
+ // 关闭弹窗
185
+ handleCloseModal() {
186
+ this.setData({
187
+ showTipModal: false,
188
+ showSBModal: false,
189
+ showLeaveModal: false
190
+ })
191
+ },
192
+
193
+ // 关闭弹窗+记录10个自然日
194
+ handleFullInfoModalOk() {
195
+ this.setData({
196
+ showFullInfoModal: false
197
+ })
198
+ // 计算10个自然日后的时间戳
199
+ let nowTimestamp = Date.now()
200
+ let futureDate = new Date(nowTimestamp)
201
+ futureDate.setDate(futureDate.getDate() + 10)
202
+ let futureTimestamp = futureDate.getTime()
203
+ wx.setStorageSync('tif.fullInfoModalStamp', futureTimestamp)
204
+ },
205
+
206
+ // 性别
207
+ bindSexChange(e) {
208
+ const sexIndex = e.detail.value
209
+ this.setData({
210
+ sex: this.data.sexRangeZH[sexIndex].name,
211
+ sexIndex,
212
+ canSave: true
213
+ })
214
+ },
215
+
216
+ // 出生日期
217
+ bindBirthChange(e) {
218
+ this.setData({
219
+ birthday: e.detail.value,
220
+ canSave: true
221
+ })
222
+ },
223
+
224
+ // 保存信息
225
+ async toSave() {
226
+ const sex = this.data.sex
227
+ const birthday = this.data.birthday
228
+ if (sex === '未知') {
229
+ this.setData({
230
+ sbDesc: '您的性别信息尚未完善, ',
231
+ showSBModal: true
232
+ })
233
+ return
234
+ } else if (!birthday) {
235
+ this.setData({
236
+ sbDesc: '您的出生日期尚未完善, ',
237
+ showSBModal: true
238
+ })
239
+ return
240
+ }
241
+
242
+ const [err, data] = await utils.awaitTo(jingtongVerifyRequest.updateSB({
243
+ sex: this.data.sexRangeZH[this.data.sexIndex].value || '',
244
+ birthday
245
+ }))
246
+ if (err) {
247
+ console.log(err, '保存信息')
248
+ wx.showToast({
249
+ title: err.errmsg || '保存失败,请稍后再试',
250
+ icon: 'none'
251
+ })
252
+ return
253
+ }
254
+ console.log('更新信息', data)
255
+ wx.showToast({
256
+ title: '保存成功',
257
+ icon: 'none',
258
+ duration: 2000,
259
+ mask: true
260
+ })
261
+
262
+ this.setData({
263
+ canSave: false
264
+ })
265
+ },
266
+
267
+ onBeforeLeave() {
268
+ console.log('监听到返回上一页', this.data.canSave)
269
+ // 返回上一页的逻辑处理
270
+ if (this.data.canSave) {
271
+ this.setData({
272
+ showLeaveModal: true
273
+ })
274
+ } else {
275
+ console.log('返回上一页')
276
+ this.setData({
277
+ showPage: false
278
+ }, () => {
279
+ setTimeout(() => {
280
+ wx.navigateBack()
281
+ }, 10)
282
+ })
283
+ }
284
+ },
285
+
286
+ toBack() {
287
+ this.setData({
288
+ showLeaveModal: false
289
+ }, () => {
290
+ setTimeout(() => {
291
+ wx.navigateBack()
292
+ }, 10)
293
+ })
294
+ },
295
+
296
+ stopBack() {
297
+ this.setData({
298
+ showLeaveModal: false,
299
+ showPage: true
300
+ })
301
+ },
302
+
303
+ preventSwipe() {
304
+ /* 空函数阻止默认滑动 */
305
+ console.log('空函数阻止默认滑动')
306
+ }
307
307
  })
@@ -1,8 +1,8 @@
1
- {
2
- "usingComponents": {
3
- "my-modal": "../../components/my-modal/my-modal",
4
- "tip-modal": "../../components/tip-modal/tip-modal"
5
- },
6
- "navigationBarTitleText": "个人信息维护",
7
- "disableSwipeBack": true
1
+ {
2
+ "usingComponents": {
3
+ "my-modal": "../../components/my-modal/my-modal",
4
+ "tip-modal": "../../components/tip-modal/tip-modal"
5
+ },
6
+ "navigationBarTitleText": "个人信息维护",
7
+ "disableSwipeBack": true
8
8
  }