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

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 (184) hide show
  1. package/README.md +1 -2
  2. package/app.json +33 -33
  3. package/package.json +20 -20
  4. package/sdk.js +313 -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 +865 -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/request.js +1 -1
  182. package/weapps-plugin-jingtong-verify/utils/rules.js +301 -301
  183. package/weapps-plugin-jingtong-verify/utils/tifadmin_config.js +61 -61
  184. package/weapps-plugin-jingtong-verify/utils/validate.js +772 -772
@@ -1,329 +1,329 @@
1
- // weapps-plugin-jingtong-verify/pages/setting/setting.js
2
- const jingtongVerifyRequest = require('../../utils/request')
3
- const { flow } = require("@wecity/weda-plugin-utils");
4
- const utils = require("../../utils/index")
5
- const { logout } = require("../../i18n/index");
6
-
7
- import { SDKTrack, setAccountInfo } from '../../utils/QDTrackerNew/QDTrackerMain'
8
-
9
- Page({
10
-
11
- /**
12
- * 页面的初始数据
13
- */
14
- data: {
15
- sessionInfo: {
16
- name: '',
17
- cid: '',
18
- cid_type: '',
19
- Age: '',
20
- Gender: '',
21
- certType: ''
22
- },
23
- authExpired: true,
24
- showModal: false,
25
- phone: '',
26
- star_phone: ''
27
- },
28
-
29
- onLoad() {
30
- wx.hideShareMenu()
31
-
32
- let Gender = ''
33
- let Age = ''
34
- jingtongVerifyRequest.getSession({
35
- success: res => {
36
- let { cid, cid_type, sex, phone, face_time, realname_time, openid } = res
37
- Gender = sex
38
- if (cid_type === '111' && cid) {
39
- Gender = utils.parseIDCard(cid).sex
40
- Age = utils.parseIDCard(cid).age
41
- }
42
- let pho = /(\d{3})\d*(\d{4})/
43
- let sessionInfo = Object.assign(res, {
44
- Gender,
45
- Age
46
- })
47
- this.setData({
48
- sessionInfo,
49
- authExpired: (!face_time && !realname_time) || !cid,
50
- phone,
51
- star_phone: phone ? phone.replace(pho, '$1****$2') : ''
52
- })
53
-
54
- // 设置用户账号信息
55
- setAccountInfo(openid)
56
- }
57
- })
58
- },
59
-
60
- // 同意协议和隐私政策
61
- viewPrivacy(e) {
62
- const { name, file, track } = e.currentTarget.dataset
63
- console.log('文件地址', `https://js.jt.beijing.gov.cn/jt/tiffile/${file}.pdf`)
64
-
65
- const trackMap = {
66
- '1': '110000000000511111993403800000', // 帮助指引
67
- '2': '110000000000511111993403900000', // 隐私政策
68
- '3': '110000000000511111993404000000' // 用户服务协议
69
- }
70
-
71
- // 上报事件
72
- SDKTrack('function_btn_click', {
73
- item_type: '8', // 业务分类
74
- item_code: trackMap[track], // 事项ID
75
- item_access: '', // 业务入口
76
- })
77
-
78
- utils.openDoc({
79
- url: `https://js.jt.beijing.gov.cn/jt/tiffile/${file}.pdf`,
80
- fileType: 'pdf',
81
- name,
82
- successFn: () => {
83
- console.log('文档打开成功回调')
84
- }
85
- })
86
- },
87
-
88
- // 退出登录
89
- loginOut() {
90
- wx.showModal({
91
- title: '温馨提示',
92
- content: '是否确定退出登录?',
93
- confirmColor: '#ce0022',
94
- cancelColor: '#27282E',
95
- success: res => {
96
- if (res.confirm) {
97
- this.toLoginOut()
98
- }
99
- }
100
- })
101
- },
102
-
103
- // 确认退出登录
104
- toLoginOut() {
105
- wx.showLoading({
106
- mask: true,
107
- title: '加载中…'
108
- })
109
-
110
- // 上报事件
111
- SDKTrack('function_btn_click', {
112
- item_type: '8', // 业务分类
113
- item_code: '110000000000511111993405000000', // 事项ID
114
- item_access: '', // 业务入口
115
- })
116
-
117
- jingtongVerifyRequest.logOut().then(() => {
118
- wx.showToast({
119
- title: `${logout.logOutSuccess['zh_CN']}`,
120
- icon: 'none',
121
- duration: 1000,
122
- mask: true
123
- })
124
- wx.removeStorageSync('tif.sid')
125
- wx.removeStorageSync('tif.uid')
126
-
127
- wx.removeStorageSync('tif.phone')
128
- wx.removeStorageSync('tif.realPhone')
129
- wx.removeStorageSync('tif.caPhone')
130
- wx.removeStorageSync('tif.has_phone')
131
- wx.removeStorageSync('tif.tel_confirm_time')
132
- wx.removeStorageSync('tif.CAUniqueId')
133
- wx.removeStorageSync('tif.lastLoginTime')
134
-
135
-
136
- // 退出登录,执行业务侧回调清除本地缓存
137
- wx.$_ServiceConfiguration && wx.$_ServiceConfiguration.methods && wx.$_ServiceConfiguration.methods._loginOutCallBack && wx.$_ServiceConfiguration.methods._loginOutCallBack(wx.$_ServiceConfiguration)
138
-
139
- let formDataSuccess = wx.getStorageSync('tif.formDataSuccess') || ''
140
- // 非人脸登录,清除身份信息
141
- if (formDataSuccess && formDataSuccess.cid_type !== '111') {
142
- wx.removeStorageSync('tif.formDataSuccess')
143
- }
144
- setTimeout(() => {
145
- flow.resolve({
146
- hasLoginOut: true
147
- })
148
- }, 800)
149
- }).catch(err => {
150
- console.log(err, '退出登录失败err')
151
- wx.hideLoading();
152
- wx.showToast({
153
- title: JSON.parse(err).errmsg || '退出失败,请稍后再试',
154
- icon: 'none',
155
- duration: 1500
156
- })
157
- })
158
- },
159
-
160
- // 跳转登录管理页面
161
- goToLoginManage() {
162
- // 上报事件
163
- SDKTrack('function_btn_click', {
164
- item_type: '8', // 业务分类
165
- item_code: '110000000000511111993403700000', // 事项ID
166
- item_access: '', // 业务入口
167
- })
168
-
169
- flow.navigateTo({
170
- url: '../../pages/login-manage/login-manage'
171
- })
172
- },
173
-
174
- // 跳转个人信息页面
175
- goToUserInfo() {
176
- flow.navigateTo({
177
- url: '../../pages/user-info/user-info'
178
- })
179
- },
180
-
181
- // 显示换绑手机号码弹窗
182
- showModal() {
183
- if (!this.data.authExpired) {
184
- // 上报事件
185
- SDKTrack('function_btn_click', {
186
- item_type: '9', // 业务分类
187
- item_code: '110000000000511211993408000000', // 事项ID
188
- item_access: '19', // 业务入口
189
- })
190
-
191
- this.setData({
192
- showModal: true
193
- })
194
- } else {
195
- wx.showToast({
196
- title: '请先登录,再进行换绑手机号码操作',
197
- icon: 'none',
198
- duration: 3000
199
- })
200
- }
201
- },
202
-
203
- // 弹框确认
204
- confirmModal() {
205
- this.setData({
206
- showModal: false
207
- })
208
- },
209
-
210
- // 获取手机号码
211
- getPhoneNumberFun(e) {
212
- const params = Object.assign(e.detail, {
213
- source: '2'
214
- })
215
- jingtongVerifyRequest.loginPhone(params).then(session => {
216
- wx.showToast({
217
- title: '换绑成功',
218
- icon: 'none',
219
- duration: 3000,
220
- mask: true
221
- })
222
-
223
- // 登录成功回调 => 业务侧操作事项
224
- wx.$_ServiceConfiguration && wx.$_ServiceConfiguration.methods && wx.$_ServiceConfiguration.methods._loginSuccessCallBack && wx.$_ServiceConfiguration.methods._loginSuccessCallBack(session)
225
-
226
- let phone = session.phone
227
- let pho = /(\d{3})\d*(\d{4})/
228
-
229
- this.setData({
230
- phone: wx.getStorageSync('tif.realPhone') || '',
231
- star_phone: phone ? phone.replace(pho, '$1****$2') : ''
232
- })
233
- }).catch(err => {
234
- console.log(err, '换绑手机号码')
235
- wx.showToast({
236
- title: err.errmsg || '换绑失败,请稍后再试',
237
- icon: 'none'
238
- })
239
- })
240
- },
241
-
242
- // 数据保护设置
243
- toDataProtection() {
244
- // 执行业务侧回调
245
- wx.$_ServiceConfiguration && wx.$_ServiceConfiguration.methods && wx.$_ServiceConfiguration.methods._dataProtectionCallBack && wx.$_ServiceConfiguration.methods._dataProtectionCallBack(wx.$_ServiceConfiguration)
246
- },
247
-
248
- // 跳转注销页面
249
- goToLogOff() {
250
- wx.showLoading({
251
- mask: true,
252
- title: '加载中…'
253
- })
254
-
255
- let { name, cid, cid_type } = this.data.sessionInfo
256
-
257
- if (!name || !cid || !cid_type) {
258
- wx.showToast({
259
- title: '请先登录,再进行账号注销操作',
260
- icon: 'none',
261
- duration: 3000
262
- })
263
- } else {
264
- // 上报事件
265
- SDKTrack('function_btn_click', {
266
- item_type: '8', // 业务分类
267
- item_code: '110000000000511111993404800000', // 事项ID
268
- item_access: '', // 业务入口
269
- })
270
-
271
- if (cid_type === '111') {
272
- // 进行微信人脸识别
273
- this.toWxFace(name, cid)
274
- } else {
275
- flow.navigateTo({
276
- url: `../../pages/log-off/log-off?sessionInfo=${JSON.stringify(this.data.sessionInfo)}`
277
- })
278
- }
279
- wx.hideLoading()
280
- }
281
- },
282
-
283
- // 进行微信人脸识别
284
- toWxFace(name, idCardNumber) {
285
- let sessionInfo = this.data.sessionInfo
286
- wx.startFacialRecognitionVerify({
287
- name,
288
- idCardNumber,
289
- checkAliveType: '2',
290
- success(res) {
291
- console.log('刷脸认证结果: ', res)
292
- if (res.errCode !== 0) {
293
- wx.showToast({
294
- title: '人脸识别失败,请稍后再试',
295
- icon: 'none'
296
- })
297
- return
298
- } else {
299
- flow.navigateTo({
300
- url: `../../pages/log-off/log-off?sessionInfo=${JSON.stringify(sessionInfo)}&verify_result=${res.verifyResult}`
301
- })
302
- }
303
- },
304
- fail: err => {
305
- console.log('人脸识别err', err)
306
- let { errmsg, errMsg, errCode } = err
307
- if (errCode && errCode === 90100) {
308
- wx.showToast({
309
- title: '您已取消人脸识别',
310
- icon: 'none',
311
- duration: 3000
312
- })
313
- } else if (errCode && errCode === 10004) {
314
- wx.showToast({
315
- title: '人脸与身份信息不匹配',
316
- icon: 'none',
317
- duration: 3000
318
- })
319
- } else {
320
- wx.showToast({
321
- title: errmsg || errMsg || '人脸识别失败,请稍后再试',
322
- icon: 'none',
323
- duration: 3000
324
- })
325
- }
326
- }
327
- })
328
- }
1
+ // weapps-plugin-jingtong-verify/pages/setting/setting.js
2
+ const jingtongVerifyRequest = require('../../utils/request')
3
+ const { flow } = require("@wecity/weda-plugin-utils");
4
+ const utils = require("../../utils/index")
5
+ const { logout } = require("../../i18n/index");
6
+
7
+ import { SDKTrack, setAccountInfo } from '../../utils/QDTrackerNew/QDTrackerMain'
8
+
9
+ Page({
10
+
11
+ /**
12
+ * 页面的初始数据
13
+ */
14
+ data: {
15
+ sessionInfo: {
16
+ name: '',
17
+ cid: '',
18
+ cid_type: '',
19
+ Age: '',
20
+ Gender: '',
21
+ certType: ''
22
+ },
23
+ authExpired: true,
24
+ showModal: false,
25
+ phone: '',
26
+ star_phone: ''
27
+ },
28
+
29
+ onLoad() {
30
+ wx.hideShareMenu()
31
+
32
+ let Gender = ''
33
+ let Age = ''
34
+ jingtongVerifyRequest.getSession({
35
+ success: res => {
36
+ let { cid, cid_type, sex, phone, face_time, realname_time, openid } = res
37
+ Gender = sex
38
+ if (cid_type === '111' && cid) {
39
+ Gender = utils.parseIDCard(cid).sex
40
+ Age = utils.parseIDCard(cid).age
41
+ }
42
+ let pho = /(\d{3})\d*(\d{4})/
43
+ let sessionInfo = Object.assign(res, {
44
+ Gender,
45
+ Age
46
+ })
47
+ this.setData({
48
+ sessionInfo,
49
+ authExpired: (!face_time && !realname_time) || !cid,
50
+ phone,
51
+ star_phone: phone ? phone.replace(pho, '$1****$2') : ''
52
+ })
53
+
54
+ // 设置用户账号信息
55
+ setAccountInfo(openid)
56
+ }
57
+ })
58
+ },
59
+
60
+ // 同意协议和隐私政策
61
+ viewPrivacy(e) {
62
+ const { name, file, track } = e.currentTarget.dataset
63
+ console.log('文件地址', `https://js.jt.beijing.gov.cn/jt/tiffile/${file}.pdf`)
64
+
65
+ const trackMap = {
66
+ '1': '110000000000511111993403800000', // 帮助指引
67
+ '2': '110000000000511111993403900000', // 隐私政策
68
+ '3': '110000000000511111993404000000' // 用户服务协议
69
+ }
70
+
71
+ // 上报事件
72
+ SDKTrack('function_btn_click', {
73
+ item_type: '8', // 业务分类
74
+ item_code: trackMap[track], // 事项ID
75
+ item_access: '', // 业务入口
76
+ })
77
+
78
+ utils.openDoc({
79
+ url: `https://js.jt.beijing.gov.cn/jt/tiffile/${file}.pdf`,
80
+ fileType: 'pdf',
81
+ name,
82
+ successFn: () => {
83
+ console.log('文档打开成功回调')
84
+ }
85
+ })
86
+ },
87
+
88
+ // 退出登录
89
+ loginOut() {
90
+ wx.showModal({
91
+ title: '温馨提示',
92
+ content: '是否确定退出登录?',
93
+ confirmColor: '#ce0022',
94
+ cancelColor: '#27282E',
95
+ success: res => {
96
+ if (res.confirm) {
97
+ this.toLoginOut()
98
+ }
99
+ }
100
+ })
101
+ },
102
+
103
+ // 确认退出登录
104
+ toLoginOut() {
105
+ wx.showLoading({
106
+ mask: true,
107
+ title: '加载中…'
108
+ })
109
+
110
+ // 上报事件
111
+ SDKTrack('function_btn_click', {
112
+ item_type: '8', // 业务分类
113
+ item_code: '110000000000511111993405000000', // 事项ID
114
+ item_access: '', // 业务入口
115
+ })
116
+
117
+ jingtongVerifyRequest.logOut().then(() => {
118
+ wx.showToast({
119
+ title: `${logout.logOutSuccess['zh_CN']}`,
120
+ icon: 'none',
121
+ duration: 1000,
122
+ mask: true
123
+ })
124
+ wx.removeStorageSync('tif.sid')
125
+ wx.removeStorageSync('tif.uid')
126
+
127
+ wx.removeStorageSync('tif.phone')
128
+ wx.removeStorageSync('tif.realPhone')
129
+ wx.removeStorageSync('tif.caPhone')
130
+ wx.removeStorageSync('tif.has_phone')
131
+ wx.removeStorageSync('tif.tel_confirm_time')
132
+ wx.removeStorageSync('tif.CAUniqueId')
133
+ wx.removeStorageSync('tif.lastLoginTime')
134
+
135
+
136
+ // 退出登录,执行业务侧回调清除本地缓存
137
+ wx.$_ServiceConfiguration && wx.$_ServiceConfiguration.methods && wx.$_ServiceConfiguration.methods._loginOutCallBack && wx.$_ServiceConfiguration.methods._loginOutCallBack(wx.$_ServiceConfiguration)
138
+
139
+ let formDataSuccess = wx.getStorageSync('tif.formDataSuccess') || ''
140
+ // 非人脸登录,清除身份信息
141
+ if (formDataSuccess && formDataSuccess.cid_type !== '111') {
142
+ wx.removeStorageSync('tif.formDataSuccess')
143
+ }
144
+ setTimeout(() => {
145
+ flow.resolve({
146
+ hasLoginOut: true
147
+ })
148
+ }, 800)
149
+ }).catch(err => {
150
+ console.log(err, '退出登录失败err')
151
+ wx.hideLoading();
152
+ wx.showToast({
153
+ title: JSON.parse(err).errmsg || '退出失败,请稍后再试',
154
+ icon: 'none',
155
+ duration: 1500
156
+ })
157
+ })
158
+ },
159
+
160
+ // 跳转登录管理页面
161
+ goToLoginManage() {
162
+ // 上报事件
163
+ SDKTrack('function_btn_click', {
164
+ item_type: '8', // 业务分类
165
+ item_code: '110000000000511111993403700000', // 事项ID
166
+ item_access: '', // 业务入口
167
+ })
168
+
169
+ flow.navigateTo({
170
+ url: '../../pages/login-manage/login-manage'
171
+ })
172
+ },
173
+
174
+ // 跳转个人信息页面
175
+ goToUserInfo() {
176
+ flow.navigateTo({
177
+ url: '../../pages/user-info/user-info'
178
+ })
179
+ },
180
+
181
+ // 显示换绑手机号码弹窗
182
+ showModal() {
183
+ if (!this.data.authExpired) {
184
+ // 上报事件
185
+ SDKTrack('function_btn_click', {
186
+ item_type: '9', // 业务分类
187
+ item_code: '110000000000511211993408000000', // 事项ID
188
+ item_access: '19', // 业务入口
189
+ })
190
+
191
+ this.setData({
192
+ showModal: true
193
+ })
194
+ } else {
195
+ wx.showToast({
196
+ title: '请先登录,再进行换绑手机号码操作',
197
+ icon: 'none',
198
+ duration: 3000
199
+ })
200
+ }
201
+ },
202
+
203
+ // 弹框确认
204
+ confirmModal() {
205
+ this.setData({
206
+ showModal: false
207
+ })
208
+ },
209
+
210
+ // 获取手机号码
211
+ getPhoneNumberFun(e) {
212
+ const params = Object.assign(e.detail, {
213
+ source: '2'
214
+ })
215
+ jingtongVerifyRequest.loginPhone(params).then(session => {
216
+ wx.showToast({
217
+ title: '换绑成功',
218
+ icon: 'none',
219
+ duration: 3000,
220
+ mask: true
221
+ })
222
+
223
+ // 登录成功回调 => 业务侧操作事项
224
+ wx.$_ServiceConfiguration && wx.$_ServiceConfiguration.methods && wx.$_ServiceConfiguration.methods._loginSuccessCallBack && wx.$_ServiceConfiguration.methods._loginSuccessCallBack(session)
225
+
226
+ let phone = session.phone
227
+ let pho = /(\d{3})\d*(\d{4})/
228
+
229
+ this.setData({
230
+ phone: wx.getStorageSync('tif.realPhone') || '',
231
+ star_phone: phone ? phone.replace(pho, '$1****$2') : ''
232
+ })
233
+ }).catch(err => {
234
+ console.log(err, '换绑手机号码')
235
+ wx.showToast({
236
+ title: err.errmsg || '换绑失败,请稍后再试',
237
+ icon: 'none'
238
+ })
239
+ })
240
+ },
241
+
242
+ // 数据保护设置
243
+ toDataProtection() {
244
+ // 执行业务侧回调
245
+ wx.$_ServiceConfiguration && wx.$_ServiceConfiguration.methods && wx.$_ServiceConfiguration.methods._dataProtectionCallBack && wx.$_ServiceConfiguration.methods._dataProtectionCallBack(wx.$_ServiceConfiguration)
246
+ },
247
+
248
+ // 跳转注销页面
249
+ goToLogOff() {
250
+ wx.showLoading({
251
+ mask: true,
252
+ title: '加载中…'
253
+ })
254
+
255
+ let { name, cid, cid_type } = this.data.sessionInfo
256
+
257
+ if (!name || !cid || !cid_type) {
258
+ wx.showToast({
259
+ title: '请先登录,再进行账号注销操作',
260
+ icon: 'none',
261
+ duration: 3000
262
+ })
263
+ } else {
264
+ // 上报事件
265
+ SDKTrack('function_btn_click', {
266
+ item_type: '8', // 业务分类
267
+ item_code: '110000000000511111993404800000', // 事项ID
268
+ item_access: '', // 业务入口
269
+ })
270
+
271
+ if (cid_type === '111') {
272
+ // 进行微信人脸识别
273
+ this.toWxFace(name, cid)
274
+ } else {
275
+ flow.navigateTo({
276
+ url: `../../pages/log-off/log-off?sessionInfo=${JSON.stringify(this.data.sessionInfo)}`
277
+ })
278
+ }
279
+ wx.hideLoading()
280
+ }
281
+ },
282
+
283
+ // 进行微信人脸识别
284
+ toWxFace(name, idCardNumber) {
285
+ let sessionInfo = this.data.sessionInfo
286
+ wx.startFacialRecognitionVerify({
287
+ name,
288
+ idCardNumber,
289
+ checkAliveType: '2',
290
+ success(res) {
291
+ console.log('刷脸认证结果: ', res)
292
+ if (res.errCode !== 0) {
293
+ wx.showToast({
294
+ title: '人脸识别失败,请稍后再试',
295
+ icon: 'none'
296
+ })
297
+ return
298
+ } else {
299
+ flow.navigateTo({
300
+ url: `../../pages/log-off/log-off?sessionInfo=${JSON.stringify(sessionInfo)}&verify_result=${res.verifyResult}`
301
+ })
302
+ }
303
+ },
304
+ fail: err => {
305
+ console.log('人脸识别err', err)
306
+ let { errmsg, errMsg, errCode } = err
307
+ if (errCode && errCode === 90100) {
308
+ wx.showToast({
309
+ title: '您已取消人脸识别',
310
+ icon: 'none',
311
+ duration: 3000
312
+ })
313
+ } else if (errCode && errCode === 10004) {
314
+ wx.showToast({
315
+ title: '人脸与身份信息不匹配',
316
+ icon: 'none',
317
+ duration: 3000
318
+ })
319
+ } else {
320
+ wx.showToast({
321
+ title: errmsg || errMsg || '人脸识别失败,请稍后再试',
322
+ icon: 'none',
323
+ duration: 3000
324
+ })
325
+ }
326
+ }
327
+ })
328
+ }
329
329
  })
@@ -1,6 +1,6 @@
1
- {
2
- "usingComponents": {
3
- "my-modal": "../../components/my-modal/my-modal"
4
- },
5
- "navigationBarTitleText": "设置"
1
+ {
2
+ "usingComponents": {
3
+ "my-modal": "../../components/my-modal/my-modal"
4
+ },
5
+ "navigationBarTitleText": "设置"
6
6
  }