weapps-plugin-jingtong-verify 1.3.9 → 1.4.1-dev

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 (187) hide show
  1. package/README.md +2 -1
  2. package/app.json +33 -33
  3. package/package.json +20 -20
  4. package/sdk.js +289 -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 -0
  37. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.json +4 -0
  38. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.wxml +13 -0
  39. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.wxss +1 -0
  40. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-button-group/index.js +44 -44
  41. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-button-group/index.json +5 -5
  42. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-button-group/index.wxml +28 -28
  43. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.js +30 -0
  44. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.json +7 -0
  45. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.wxml +42 -0
  46. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.wxss +1 -0
  47. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-date-picker-en/index.js +418 -414
  48. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-date-picker-en/index.json +5 -5
  49. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-date-picker-en/index.wxml +29 -29
  50. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-dropdown/index.js +11 -11
  51. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-dropdown/index.json +3 -3
  52. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-dropdown/index.wxml +4 -4
  53. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form/index.js +179 -179
  54. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form/index.json +6 -6
  55. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form/index.wxml +16 -16
  56. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-cell/index.js +92 -92
  57. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-cell/index.json +6 -6
  58. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-cell/index.wxml +12 -12
  59. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-cell/index.wxss +2 -2
  60. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-item/index.js +49 -48
  61. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-item/index.json +3 -3
  62. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-item/index.wxml +14 -13
  63. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-icon/index.js +33 -33
  64. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-icon/index.json +3 -3
  65. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-icon/index.wxml +2 -2
  66. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-index-list/index.js +108 -108
  67. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-index-list/index.json +6 -6
  68. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-index-list/index.wxml +53 -53
  69. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-input/index.js +237 -233
  70. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-input/index.json +8 -8
  71. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-input/index.wxml +49 -49
  72. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-picker/index.js +328 -324
  73. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-picker/index.json +6 -6
  74. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-picker/index.wxml +26 -26
  75. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-popover/index.js +159 -159
  76. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-popover/index.json +3 -3
  77. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-popover/index.wxml +10 -10
  78. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-search/index.js +112 -112
  79. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-search/index.json +5 -5
  80. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-search/index.wxml +21 -21
  81. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.js +21 -0
  82. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.json +7 -0
  83. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.wxml +16 -0
  84. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.wxss +1 -0
  85. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-tips/index.js +50 -50
  86. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-tips/index.json +5 -5
  87. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-tips/index.wxml +27 -27
  88. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/add.svg +13 -13
  89. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/arrow.svg +14 -14
  90. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/delete.svg +16 -16
  91. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/preview.svg +21 -21
  92. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/user.svg +13 -13
  93. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-agree.wxss +147 -147
  94. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-badge.wxss +41 -0
  95. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-button-group.wxss +244 -244
  96. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-cell.wxss +220 -0
  97. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-dropdown.wxss +115 -115
  98. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-form-cell.wxss +101 -101
  99. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-form-item.wxss +174 -167
  100. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-form.wxss +101 -101
  101. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-icon.wxss +268 -268
  102. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-index-list.wxss +206 -206
  103. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-input.wxss +206 -206
  104. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-picker.wxss +139 -139
  105. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-popover.wxss +129 -129
  106. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-search.wxss +171 -171
  107. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-switch.wxss +176 -0
  108. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-tips.wxss +173 -173
  109. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/icon/iconfont.wxss +160 -160
  110. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/main.wxss +283 -283
  111. package/weapps-plugin-jingtong-verify/components/gsd-ui/utils/helper.js +55 -55
  112. package/weapps-plugin-jingtong-verify/components/gsd-ui/utils/validType.js +117 -117
  113. package/weapps-plugin-jingtong-verify/components/gsd-ui/utils/validator.js +106 -106
  114. package/weapps-plugin-jingtong-verify/components/lock-face-modal/lock-face-modal.js +32 -32
  115. package/weapps-plugin-jingtong-verify/components/lock-face-modal/lock-face-modal.json +3 -3
  116. package/weapps-plugin-jingtong-verify/components/lock-face-modal/lock-face-modal.wxml +8 -8
  117. package/weapps-plugin-jingtong-verify/components/lock-face-modal/lock-face-modal.wxss +57 -57
  118. package/weapps-plugin-jingtong-verify/components/modal/modal.js +32 -32
  119. package/weapps-plugin-jingtong-verify/components/modal/modal.json +3 -3
  120. package/weapps-plugin-jingtong-verify/components/modal/modal.wxml +28 -28
  121. package/weapps-plugin-jingtong-verify/components/modal/modal.wxss +84 -84
  122. package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.js +82 -82
  123. package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.json +3 -3
  124. package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.wxml +18 -18
  125. package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.wxss +72 -71
  126. package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.js +39 -35
  127. package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.json +3 -3
  128. package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.wxml +9 -9
  129. package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.wxss +51 -51
  130. package/weapps-plugin-jingtong-verify/i18n/index.js +7 -7
  131. package/weapps-plugin-jingtong-verify/i18n/logout.js +10 -10
  132. package/weapps-plugin-jingtong-verify/i18n/rules.js +202 -189
  133. package/weapps-plugin-jingtong-verify/images/close-circle.png +0 -0
  134. package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.js +86 -86
  135. package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.json +6 -6
  136. package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.wxml +20 -17
  137. package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.wxss +51 -38
  138. package/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone.js +167 -167
  139. package/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone.json +3 -3
  140. package/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone.wxml +30 -30
  141. package/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone.wxss +91 -91
  142. package/weapps-plugin-jingtong-verify/pages/face-error-reason/face-error-reason.js +79 -79
  143. package/weapps-plugin-jingtong-verify/pages/face-error-reason/face-error-reason.json +5 -5
  144. package/weapps-plugin-jingtong-verify/pages/face-error-reason/face-error-reason.wxml +19 -19
  145. package/weapps-plugin-jingtong-verify/pages/face-error-reason/face-error-reason.wxss +44 -44
  146. package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.js +1382 -1286
  147. package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.json +16 -15
  148. package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxml +494 -410
  149. package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxss +116 -76
  150. package/weapps-plugin-jingtong-verify/pages/log-off/log-off.js +127 -126
  151. package/weapps-plugin-jingtong-verify/pages/log-off/log-off.json +5 -5
  152. package/weapps-plugin-jingtong-verify/pages/log-off/log-off.wxml +36 -36
  153. package/weapps-plugin-jingtong-verify/pages/log-off/log-off.wxss +60 -60
  154. package/weapps-plugin-jingtong-verify/pages/login-manage/login-manage.js +106 -106
  155. package/weapps-plugin-jingtong-verify/pages/login-manage/login-manage.json +3 -3
  156. package/weapps-plugin-jingtong-verify/pages/login-manage/login-manage.wxml +29 -29
  157. package/weapps-plugin-jingtong-verify/pages/login-manage/login-manage.wxss +68 -68
  158. package/weapps-plugin-jingtong-verify/pages/logoff-success/logoff-success.js +24 -24
  159. package/weapps-plugin-jingtong-verify/pages/logoff-success/logoff-success.json +3 -3
  160. package/weapps-plugin-jingtong-verify/pages/logoff-success/logoff-success.wxml +12 -12
  161. package/weapps-plugin-jingtong-verify/pages/logoff-success/logoff-success.wxss +33 -33
  162. package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.js +110 -97
  163. package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.json +6 -6
  164. package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.wxml +9 -9
  165. package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.wxss +1 -1
  166. package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.js +641 -641
  167. package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.json +10 -10
  168. package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.wxml +152 -152
  169. package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.wxss +47 -47
  170. package/weapps-plugin-jingtong-verify/pages/setting/setting.js +328 -328
  171. package/weapps-plugin-jingtong-verify/pages/setting/setting.json +5 -5
  172. package/weapps-plugin-jingtong-verify/pages/setting/setting.wxml +91 -91
  173. package/weapps-plugin-jingtong-verify/pages/setting/setting.wxss +69 -69
  174. package/weapps-plugin-jingtong-verify/pages/user-info/user-info.js +306 -159
  175. package/weapps-plugin-jingtong-verify/pages/user-info/user-info.json +7 -6
  176. package/weapps-plugin-jingtong-verify/pages/user-info/user-info.wxml +142 -61
  177. package/weapps-plugin-jingtong-verify/pages/user-info/user-info.wxss +110 -64
  178. package/weapps-plugin-jingtong-verify/style/page.wxss +13 -13
  179. package/weapps-plugin-jingtong-verify/utils/QDTrackerNew/QDTracker.js +15 -15
  180. package/weapps-plugin-jingtong-verify/utils/QDTrackerNew/QDTrackerMain.js +59 -59
  181. package/weapps-plugin-jingtong-verify/utils/country.js +209 -203
  182. package/weapps-plugin-jingtong-verify/utils/index.js +306 -306
  183. package/weapps-plugin-jingtong-verify/utils/jsencrypt.min.js +1 -1
  184. package/weapps-plugin-jingtong-verify/utils/request.js +89 -24
  185. package/weapps-plugin-jingtong-verify/utils/rules.js +258 -162
  186. package/weapps-plugin-jingtong-verify/utils/tifadmin_config.js +61 -61
  187. package/weapps-plugin-jingtong-verify/utils/validate.js +772 -754
@@ -1,160 +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
- name: '',
14
- star_name: '',
15
- sex: '',
16
- cid: '',
17
- star_cid: '',
18
- phone: '',
19
- star_phone: '',
20
- showModal: false,
21
- showEye: false,
22
- authExpired: false,
23
- showTipModal: false
24
- },
25
-
26
- /**
27
- * 生命周期函数--监听页面加载
28
- */
29
- onLoad() {
30
- wx.hideShareMenu()
31
-
32
- wx.showLoading({
33
- mask: true,
34
- title: '加载中…'
35
- })
36
- jingtongVerifyRequest.getSession({
37
- success: (res) => {
38
- let { star_name, star_cid, phone, name, cid, face_time, realname_time, cid_type, openid } = res
39
- let pho = /(\d{3})\d*(\d{4})/
40
- let sex = '未知'
41
- let authExpired = (!face_time && !realname_time) || !cid
42
- // let Gender = res.sex
43
- // let Age = ''
44
-
45
- // 设置用户账号信息
46
- setAccountInfo(openid)
47
-
48
- if (star_cid && cid_type === '111') {
49
- sex = utils.parseIDCard(cid).sexZh
50
- // Gender = utils.parseIDCard(cid).sex
51
- // Age = utils.parseIDCard(cid).age
52
- } else {
53
- let resSex = res.sex
54
- if (resSex == 1) {
55
- sex = '男'
56
- } else if (resSex == 2) {
57
- sex = '女'
58
- }
59
- }
60
- this.setData({
61
- star_name,
62
- name,
63
- sex,
64
- star_cid,
65
- cid,
66
- star_phone: phone ? phone.replace(pho, '$1****$2') : '',
67
- phone,
68
- authExpired
69
- }, () => {
70
- wx.hideLoading()
71
- })
72
- },
73
- fail: () => {
74
- wx.hideLoading()
75
- }
76
- })
77
- },
78
-
79
- // 显示换绑手机号码弹窗
80
- showModal() {
81
- if (!this.data.authExpired) {
82
- // 上报事件
83
- SDKTrack('function_btn_click', {
84
- item_type: '9', // 业务分类
85
- item_code: '110000000000511211993408000000', // 事项ID
86
- item_access: '19', // 业务入口
87
- })
88
-
89
- this.setData({
90
- showModal: true
91
- })
92
- } else {
93
- wx.showToast({
94
- title: '请先登录,再进行换绑手机号码操作',
95
- icon: 'none',
96
- duration: 3000
97
- })
98
- }
99
- },
100
-
101
- // 切换显隐
102
- changeEye() {
103
- this.setData({
104
- showEye: !this.data.showEye
105
- })
106
- },
107
-
108
- // 弹框确认
109
- confirmModal() {
110
- this.setData({
111
- showModal: false
112
- })
113
- },
114
-
115
- // 获取手机号码
116
- getPhoneNumberFun(e) {
117
- const params = Object.assign(e.detail, {
118
- source: '1'
119
- })
120
- jingtongVerifyRequest.loginPhone(params).then(session => {
121
- wx.showToast({
122
- title: '换绑成功',
123
- icon: 'none',
124
- duration: 3000,
125
- mask: true
126
- })
127
-
128
- // 登录成功回调 => 业务侧操作事项
129
- wx.$_ServiceConfiguration && wx.$_ServiceConfiguration.methods && wx.$_ServiceConfiguration.methods._loginSuccessCallBack && wx.$_ServiceConfiguration.methods._loginSuccessCallBack(session)
130
-
131
- let phone = session.phone
132
- let pho = /(\d{3})\d*(\d{4})/
133
-
134
- this.setData({
135
- phone: wx.getStorageSync('tif.realPhone') || '',
136
- star_phone: phone ? phone.replace(pho, '$1****$2') : ''
137
- })
138
- }).catch(err => {
139
- console.log(err, '换绑手机号码')
140
- wx.showToast({
141
- title: err.errmsg || '换绑失败,请稍后再试',
142
- icon: 'none'
143
- })
144
- })
145
- },
146
-
147
- // 显示弹窗
148
- showTip() {
149
- this.setData({
150
- showTipModal: true
151
- })
152
- },
153
-
154
- // 关闭弹窗
155
- handleCloseModal() {
156
- this.setData({
157
- showTipModal: false
158
- })
159
- }
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
+ }
160
307
  })
@@ -1,7 +1,8 @@
1
- {
2
- "usingComponents": {
3
- "my-modal": "../../components/my-modal/my-modal",
4
- "tip-modal": "../../components/tip-modal/tip-modal"
5
- },
6
- "navigationBarTitleText": "个人信息维护"
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
7
8
  }