weapps-plugin-jingtong-verify 1.6.0 → 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 (224) hide show
  1. package/README.md +1 -1
  2. package/app.json +33 -41
  3. package/package.json +21 -21
  4. package/sdk.js +309 -320
  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 -182
  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 -241
  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 -214
  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 -47
  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 -11
  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 -403
  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 +1558 -1812
  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 -522
  146. package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxss +133 -185
  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 -110
  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 -331
  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 -670
  182. package/weapps-plugin-jingtong-verify/utils/rules.js +301 -405
  183. package/weapps-plugin-jingtong-verify/utils/tifadmin_config.js +61 -61
  184. package/weapps-plugin-jingtong-verify/utils/validate.js +772 -910
  185. package/weapps-plugin-jingtong-verify/components/custom-steps/custom-steps.js +0 -41
  186. package/weapps-plugin-jingtong-verify/components/custom-steps/custom-steps.json +0 -4
  187. package/weapps-plugin-jingtong-verify/components/custom-steps/custom-steps.wxml +0 -20
  188. package/weapps-plugin-jingtong-verify/components/custom-steps/custom-steps.wxss +0 -112
  189. package/weapps-plugin-jingtong-verify/components/to-other-modal/to-other-modal.js +0 -73
  190. package/weapps-plugin-jingtong-verify/components/to-other-modal/to-other-modal.json +0 -4
  191. package/weapps-plugin-jingtong-verify/components/to-other-modal/to-other-modal.wxml +0 -19
  192. package/weapps-plugin-jingtong-verify/components/to-other-modal/to-other-modal.wxss +0 -72
  193. package/weapps-plugin-jingtong-verify/images/bank-card-verify.png +0 -0
  194. package/weapps-plugin-jingtong-verify/images/chek_right.png +0 -0
  195. package/weapps-plugin-jingtong-verify/images/chevron-down.png +0 -0
  196. package/weapps-plugin-jingtong-verify/images/chevron-up.png +0 -0
  197. package/weapps-plugin-jingtong-verify/pages/bank-card-login/bank-card-login.js +0 -506
  198. package/weapps-plugin-jingtong-verify/pages/bank-card-login/bank-card-login.json +0 -8
  199. package/weapps-plugin-jingtong-verify/pages/bank-card-login/bank-card-login.wxml +0 -79
  200. package/weapps-plugin-jingtong-verify/pages/bank-card-login/bank-card-login.wxss +0 -212
  201. package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-face-setting/bank-card-login-forgot-face-setting.js +0 -1392
  202. package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-face-setting/bank-card-login-forgot-face-setting.json +0 -10
  203. package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-face-setting/bank-card-login-forgot-face-setting.wxml +0 -247
  204. package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-face-setting/bank-card-login-forgot-face-setting.wxss +0 -397
  205. package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-sms-setting/bank-card-login-forgot-sms-setting.js +0 -66
  206. package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-sms-setting/bank-card-login-forgot-sms-setting.wxml +0 -2
  207. package/weapps-plugin-jingtong-verify/pages/bank-card-login-pwd-setting/bank-card-login-pwd-setting.js +0 -463
  208. package/weapps-plugin-jingtong-verify/pages/bank-card-login-pwd-setting/bank-card-login-pwd-setting.json +0 -8
  209. package/weapps-plugin-jingtong-verify/pages/bank-card-login-pwd-setting/bank-card-login-pwd-setting.wxml +0 -69
  210. package/weapps-plugin-jingtong-verify/pages/bank-card-login-pwd-setting/bank-card-login-pwd-setting.wxss +0 -232
  211. package/weapps-plugin-jingtong-verify/pages/bank-card-verify/bank-card-verify.js +0 -984
  212. package/weapps-plugin-jingtong-verify/pages/bank-card-verify/bank-card-verify.json +0 -12
  213. package/weapps-plugin-jingtong-verify/pages/bank-card-verify/bank-card-verify.wxml +0 -157
  214. package/weapps-plugin-jingtong-verify/pages/bank-card-verify/bank-card-verify.wxss +0 -258
  215. package/weapps-plugin-jingtong-verify/pages/login-help/login-help.js +0 -147
  216. package/weapps-plugin-jingtong-verify/pages/login-help/login-help.json +0 -4
  217. package/weapps-plugin-jingtong-verify/pages/login-help/login-help.wxml +0 -48
  218. package/weapps-plugin-jingtong-verify/pages/login-help/login-help.wxss +0 -166
  219. package/weapps-plugin-jingtong-verify/pages/login-manage-setting/login-manage-setting.js +0 -189
  220. package/weapps-plugin-jingtong-verify/pages/login-manage-setting/login-manage-setting.json +0 -4
  221. package/weapps-plugin-jingtong-verify/pages/login-manage-setting/login-manage-setting.wxml +0 -19
  222. package/weapps-plugin-jingtong-verify/pages/login-manage-setting/login-manage-setting.wxss +0 -69
  223. package/weapps-plugin-jingtong-verify/utils/constantVal.js +0 -75
  224. package/weapps-plugin-jingtong-verify/utils/md5.js +0 -184
package/sdk.js CHANGED
@@ -1,321 +1,310 @@
1
- const jingtongVerifyRequest = require('./weapps-plugin-jingtong-verify/utils/request')
2
- const { nation } = require("./weapps-plugin-jingtong-verify/utils/country")
3
- // const jingtongVerifyRequest = require('./utils/request')
4
- // const { nation } = require("./utils/country")
5
- const {
6
- flow,
7
- config
8
- } = require('@wecity/weda-plugin-utils')
9
-
10
- // 统一插件配置
11
- exports.init = (options) => {
12
- console.log('设置配置', options)
13
- jingtongVerifyRequest.init(options)
14
- }
15
-
16
- // 对业务侧入参进行拦截和兼容
17
- const parseOptions = (options) => {
18
- const optionsType = Object.prototype.toString.call(options)
19
- console.log('===处理前options===', options)
20
- if ((options && optionsType !== '[object Object]') || (optionsType === '[object Null]')) {
21
- console.error('业务侧入参不合法!!入参的数据类型必须为对象')
22
- options = {}
23
- }
24
- options = Object.assign({}, options)
25
- console.log('== 处理后options ==', options)
26
- return options
27
- }
28
-
29
- // 身份验证
30
- exports.goToFace = () => {
31
- console.log('跳转到子包 === 身份验证服务')
32
- return flow.createFlow('/weapps-plugin-jingtong-verify/pages/face-verify/face-verify', {
33
- needUnite: 'false' // 需串联起来
34
- })
35
- }
36
- // 获取会话
37
- exports.getSession = (options) => {
38
- // 对参数做兼容性处理
39
- let optionsParse = parseOptions(options)
40
-
41
- jingtongVerifyRequest.getSession({
42
- success: res => {
43
- optionsParse && optionsParse.success && optionsParse.success(res)
44
- },
45
- fail: fail => {
46
- console.log('getSession-fail', fail)
47
- optionsParse && optionsParse.fail && optionsParse.fail(fail)
48
- }
49
- })
50
- }
51
-
52
- // 个人信息
53
- exports.goToUserInfo = () => {
54
- console.log('跳转到子包 === 个人信息服务')
55
- return flow.createFlow('/weapps-plugin-jingtong-verify/pages/user-info/user-info')
56
- }
57
-
58
- // 设置
59
- exports.goToSetting = () => {
60
- console.log('跳转到子包 === 设置服务')
61
- return flow.createFlow('/weapps-plugin-jingtong-verify/pages/setting/setting')
62
- }
63
-
64
- // 身份验证
65
- const toVerify = () => {
66
- return flow.createFlow('/weapps-plugin-jingtong-verify/pages/face-verify/face-verify', {
67
- needUnite: 'true' // 需串联起来
68
- })
69
- }
70
-
71
- // 确认手机号码
72
- const toConfirmPhone = () => {
73
- return flow.createFlow('/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone')
74
- }
75
-
76
- // 绑定手机号码
77
- const toBindPhone = (source) => {
78
- return flow.createFlow('/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone', {
79
- source
80
- })
81
- }
82
- // 去设置登录密码
83
- exports.goToBankCardLoginPwdSetting = (options) => {
84
- console.log('跳转到子包 === 设置登录密码')
85
- // 对参数做兼容性处理
86
- let optionsParse = parseOptions(options)
87
- jingtongVerifyRequest.getSession({
88
- success: res => {
89
- console.log(res)
90
- return flow.createFlow('/weapps-plugin-jingtong-verify/pages/bank-card-login-pwd-setting/bank-card-login-pwd-setting',{
91
- "name": res.name,
92
- "idCardNumber": res.cid,
93
- "strCid": res.star_cid,
94
- "cid_type": res.cid_type,
95
- "verify_expire_time": res.verify_expire_time
96
- })
97
- },
98
- fail: fail => {
99
- console.log('getSession-fail', fail)
100
- optionsParse && optionsParse.fail && optionsParse.fail(fail)
101
- }
102
- })
103
-
104
- }
105
- // 比较两个时间 time1,time2均为日期类型
106
- // 判断当前日期与time1日期是否相差小于6月
107
- const completeDate = (time1, m) => {
108
- var diffyear = new Date().getFullYear() - time1.getFullYear();
109
- var diffmonth = diffyear * 12 + new Date().getMonth() - time1.getMonth();
110
- if (diffmonth < 0) {
111
- return false;
112
- }
113
-
114
- var diffDay = new Date().getDate() - time1.getDate();
115
- if (diffmonth < m || (diffmonth == m && diffDay <= 0)) {
116
- if (diffmonth == m && diffDay == 0) {
117
- var timeA = time1.getHours() * 3600 + 60 * time1.getMinutes() + time1.getSeconds();
118
- var timeB = new Date().getHours() * 3600 + 60 * new Date().getMinutes() + new Date().getSeconds();
119
- if (timeB - timeA > 0) {
120
- return false;
121
- }
122
- }
123
- return true;
124
- }
125
- return false;
126
- }
127
-
128
- // 串通业务总接口
129
- exports.getPersonToken = (options) => {
130
- // 对参数做兼容性处理
131
- let optionsParse = parseOptions(options)
132
-
133
- jingtongVerifyRequest.getSession({
134
- success: res => {
135
- if (!res.face_time && !res.realname_time) {
136
- // 未身份验证/身份验证已过期
137
- toVerify().then(res => {
138
- optionsParse && optionsParse.success && optionsParse.success(res)
139
- })
140
- } else {
141
- // 身份验证未过期 => 判断有无手机号码
142
- if (res.has_phone) {
143
- const { tel_confirm_time } = res
144
- if (res.phone !== res.caPhone && tel_confirm_time && (!completeDate(new Date(Number(tel_confirm_time + '000')), 6))) {
145
- // 【phone与caPhone不同】且【tel_confirm_time大于6个月】
146
- toConfirmPhone().then(res => {
147
- optionsParse && optionsParse.success && optionsParse.success(res)
148
- })
149
- } else {
150
- // 手机号码未过期
151
- jingtongVerifyRequest.personToken({
152
- from: 'sdk'
153
- }).then(data => {
154
- optionsParse && optionsParse.success && optionsParse.success({
155
- token: data
156
- })
157
- }).catch(err => {
158
- console.log(JSON.parse(err))
159
- if (err && err === '4035') {
160
- // 无手机号码 => 绑定手机号码
161
- toBindPhone('5').then(res => {
162
- optionsParse && optionsParse.success && optionsParse.success(res)
163
- })
164
- }
165
- })
166
- }
167
- } else {
168
- // 无手机号码 => 绑定手机号码
169
- toBindPhone('6').then(res => {
170
- optionsParse && optionsParse.success && optionsParse.success(res)
171
- })
172
- }
173
- }
174
- },
175
- fail: err => {
176
- console.log('getSession-fail', err)
177
- optionsParse && optionsParse.fail && optionsParse.fail(err)
178
- }
179
- })
180
- }
181
-
182
- // 外国护照认证
183
- const toPassportVerify = () => {
184
- return flow.createFlow('/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify', {
185
- needUnite: 'true' // 需串联起来
186
- })
187
- }
188
-
189
- // 串通业务总接口 -- 外国护照入口
190
- exports.getPersonTokenPassport = (options) => {
191
- // 对参数做兼容性处理
192
- let optionsParse = parseOptions(options)
193
-
194
- jingtongVerifyRequest.getSession({
195
- success: res => {
196
- if (!res.face_time && !res.realname_time) {
197
- // 未身份验证/身份验证已过期
198
- toPassportVerify().then(res => {
199
- optionsParse && optionsParse.success && optionsParse.success(res)
200
- })
201
- } else {
202
- // 身份验证未过期 => 判断有无手机号码
203
- if (res.has_phone) {
204
- const { tel_confirm_time } = res
205
- if (res.phone !== res.caPhone && tel_confirm_time && (!completeDate(new Date(Number(tel_confirm_time + '000')), 6))) {
206
- // 【phone与caPhone不同】且【tel_confirm_time大于6个月】
207
- toConfirmPhone().then(res => {
208
- optionsParse && optionsParse.success && optionsParse.success(res)
209
- })
210
- } else {
211
- // 手机号码未过期
212
- jingtongVerifyRequest.personToken({
213
- from: 'sdk'
214
- }).then(data => {
215
- optionsParse && optionsParse.success && optionsParse.success({
216
- token: data
217
- })
218
- }).catch(err => {
219
- console.log(JSON.parse(err))
220
- if (err && err === '4035') {
221
- // 无手机号码 => 绑定手机号码
222
- toBindPhone('5').then(res => {
223
- optionsParse && optionsParse.success && optionsParse.success(res)
224
- })
225
- }
226
- })
227
- }
228
- } else {
229
- // 无手机号码 => 绑定手机号码
230
- toBindPhone('6').then(res => {
231
- optionsParse && optionsParse.success && optionsParse.success(res)
232
- })
233
- }
234
- }
235
- },
236
- fail: err => {
237
- console.log('getSession-fail', err)
238
- optionsParse && optionsParse.fail && optionsParse.fail(err)
239
- }
240
- })
241
- }
242
-
243
- // 退出登录(非页面)
244
- exports.toLogOut = (options) => {
245
- // 对参数做兼容性处理
246
- let optionsParse = parseOptions(options)
247
-
248
- // 将弹窗标识设置为不需要弹窗
249
- jingtongVerifyRequest.setUserReadStatus(false).then(() => {
250
- console.log('设置弹窗标识成功')
251
-
252
- jingtongVerifyRequest.logOut().then(() => {
253
- optionsParse && optionsParse.success && optionsParse.success()
254
- }).catch(err => {
255
- console.log('退出登录err', err)
256
- optionsParse && optionsParse.fail && optionsParse.fail(err)
257
- })
258
- }).catch(err => {
259
- console.log('设置弹窗标识失败', err)
260
- })
261
- }
262
-
263
- // 获取弹窗标识
264
- exports.getUserReadStatus = (options) => {
265
- // 对参数做兼容性处理
266
- let optionsParse = parseOptions(options)
267
-
268
- jingtongVerifyRequest.getUserReadStatus().then(res => {
269
- optionsParse && optionsParse.success && optionsParse.success(res)
270
- }).catch(err => {
271
- optionsParse && optionsParse.fail && optionsParse.fail(err)
272
- })
273
- }
274
-
275
- // 设置弹窗标识(入参默认为不需要弹窗)
276
- exports.setUserReadStatus = (options) => {
277
- // 对参数做兼容性处理
278
- let optionsParse = parseOptions(options)
279
-
280
- const status = optionsParse && optionsParse.needRead || false
281
- console.log('业务侧入参的弹窗标识', status)
282
- jingtongVerifyRequest.setUserReadStatus(status).then(() => {
283
- console.log('设置弹窗标识成功')
284
- }).catch(err => {
285
- console.log('设置弹窗标识失败', err)
286
- })
287
- }
288
-
289
- // 拉起人脸识别,返回结果
290
- exports.toFaceVerifyAll = (options) => {
291
- // 对参数做兼容性处理
292
- let optionsParse = parseOptions(options)
293
-
294
- jingtongVerifyRequest.fetchFaceVerify({
295
- params: optionsParse.params,
296
- success: res => {
297
- console.log('=====人脸识别成功=====', res)
298
- optionsParse && optionsParse.success && optionsParse.success(res)
299
- },
300
- fail: err => {
301
- console.log('=====人脸识别失败=====', err)
302
- optionsParse && optionsParse.fail && optionsParse.fail(err)
303
- }
304
- })
305
- }
306
-
307
- // 获取国籍列表
308
- exports.getNationList = () => {
309
- return nation || []
310
- }
311
-
312
- // 语言国际化
313
- exports.setLocalLanguage = (options) => {
314
- // 对参数做兼容性处理
315
- let optionsParse = parseOptions(options)
316
-
317
- Object.assign(optionsParse, {
318
- language: optionsParse.language || 'zh_CN'
319
- })
320
- wx.setStorageSync('tif.currentLanguage', optionsParse.language)
1
+ const jingtongVerifyRequest = require('./weapps-plugin-jingtong-verify/utils/request')
2
+ const { nation } = require("./weapps-plugin-jingtong-verify/utils/country")
3
+ const {
4
+ flow,
5
+ config
6
+ } = require('@wecity/weda-plugin-utils')
7
+
8
+ // 统一插件配置
9
+ exports.init = (options) => {
10
+ console.log('设置配置', options)
11
+ jingtongVerifyRequest.init(options)
12
+ }
13
+
14
+ // 对业务侧入参进行拦截和兼容
15
+ const parseOptions = (options) => {
16
+ const optionsType = Object.prototype.toString.call(options)
17
+ console.log('===处理前options===', options)
18
+ if ((options && optionsType !== '[object Object]') || (optionsType === '[object Null]')) {
19
+ console.error('业务侧入参不合法!!入参的数据类型必须为对象')
20
+ options = {}
21
+ }
22
+ options = Object.assign({}, options)
23
+ console.log('== 处理后options ==', options)
24
+ return options
25
+ }
26
+
27
+ // 获取会话
28
+ exports.getSession = (options) => {
29
+ // 对参数做兼容性处理
30
+ let optionsParse = parseOptions(options)
31
+
32
+ jingtongVerifyRequest.getSession({
33
+ success: res => {
34
+ optionsParse && optionsParse.success && optionsParse.success(res)
35
+ },
36
+ fail: fail => {
37
+ console.log('getSession-fail', fail)
38
+ optionsParse && optionsParse.fail && optionsParse.fail(fail)
39
+ }
40
+ })
41
+ }
42
+
43
+ // 个人信息
44
+ exports.goToUserInfo = () => {
45
+ console.log('跳转到子包 === 个人信息服务')
46
+ return flow.createFlow('/weapps-plugin-jingtong-verify/pages/user-info/user-info')
47
+ }
48
+
49
+ // 设置
50
+ exports.goToSetting = () => {
51
+ console.log('跳转到子包 === 设置服务')
52
+ return flow.createFlow('/weapps-plugin-jingtong-verify/pages/setting/setting')
53
+ }
54
+
55
+ // 身份验证
56
+ const toVerify = () => {
57
+ return flow.createFlow('/weapps-plugin-jingtong-verify/pages/face-verify/face-verify', {
58
+ needUnite: 'true' // 需串联起来
59
+ })
60
+ }
61
+
62
+ // 确认手机号码
63
+ const toConfirmPhone = () => {
64
+ return flow.createFlow('/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone')
65
+ }
66
+
67
+ // 绑定手机号码
68
+ const toBindPhone = (source) => {
69
+ return flow.createFlow('/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone', {
70
+ source
71
+ })
72
+ }
73
+
74
+ // 比较两个时间 time1,time2均为日期类型
75
+ // 判断当前日期与time1日期是否相差小于6月
76
+ const completeDate = (time1, m) => {
77
+ var diffyear = new Date().getFullYear() - time1.getFullYear();
78
+ var diffmonth = diffyear * 12 + new Date().getMonth() - time1.getMonth();
79
+ if (diffmonth < 0) {
80
+ return false;
81
+ }
82
+
83
+ var diffDay = new Date().getDate() - time1.getDate();
84
+ if (diffmonth < m || (diffmonth == m && diffDay <= 0)) {
85
+ if (diffmonth == m && diffDay == 0) {
86
+ var timeA = time1.getHours() * 3600 + 60 * time1.getMinutes() + time1.getSeconds();
87
+ var timeB = new Date().getHours() * 3600 + 60 * new Date().getMinutes() + new Date().getSeconds();
88
+ if (timeB - timeA > 0) {
89
+ return false;
90
+ }
91
+ }
92
+ return true;
93
+ }
94
+ return false;
95
+ }
96
+
97
+ // 串通业务总接口
98
+ exports.getPersonToken = (options) => {
99
+ // 对参数做兼容性处理
100
+ let optionsParse = parseOptions(options)
101
+
102
+ jingtongVerifyRequest.getSession({
103
+ success: res => {
104
+ if (!res.face_time && !res.realname_time) {
105
+ // 未身份验证/身份验证已过期
106
+ toVerify().then(res => {
107
+ optionsParse && optionsParse.success && optionsParse.success(res)
108
+ })
109
+ } else {
110
+ // 身份验证未过期 => 判断有无手机号码
111
+ if (res.has_phone) {
112
+ const { tel_confirm_time } = res
113
+ if (res.phone !== res.caPhone && tel_confirm_time && (!completeDate(new Date(Number(tel_confirm_time + '000')), 6))) {
114
+ // 【phone与caPhone不同】且【tel_confirm_time大于6个月】
115
+ // toConfirmPhone().then(res => {
116
+ // optionsParse && optionsParse.success && optionsParse.success(res)
117
+ // })
118
+ // 新增逻辑:如果caPhone存在,则跳转原来的逻辑,即换绑手机号,否则跳转绑定手机号
119
+ if (res.caPhone == null || res.caPhone === '') {
120
+ toBindPhone('14').then(res => {
121
+ optionsParse && optionsParse.success && optionsParse.success(res)
122
+ })
123
+ } else {
124
+ toConfirmPhone().then(res => {
125
+ optionsParse && optionsParse.success && optionsParse.success(res)
126
+ })
127
+ }
128
+ } else {
129
+ // 手机号码未过期
130
+ jingtongVerifyRequest.personToken({
131
+ from: 'sdk'
132
+ }).then(data => {
133
+ optionsParse && optionsParse.success && optionsParse.success({
134
+ token: data
135
+ })
136
+ }).catch(err => {
137
+ console.log(JSON.parse(err))
138
+ if (err && err === '4035') {
139
+ // 无手机号码 => 绑定手机号码
140
+ toBindPhone('5').then(res => {
141
+ optionsParse && optionsParse.success && optionsParse.success(res)
142
+ })
143
+ }
144
+ })
145
+ }
146
+ } else {
147
+ // 无手机号码 => 绑定手机号码
148
+ toBindPhone('6').then(res => {
149
+ optionsParse && optionsParse.success && optionsParse.success(res)
150
+ })
151
+ }
152
+ }
153
+ },
154
+ fail: err => {
155
+ console.log('getSession-fail', err)
156
+ optionsParse && optionsParse.fail && optionsParse.fail(err)
157
+ }
158
+ })
159
+ }
160
+
161
+ // 外国护照认证
162
+ const toPassportVerify = () => {
163
+ return flow.createFlow('/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify', {
164
+ needUnite: 'true' // 需串联起来
165
+ })
166
+ }
167
+
168
+ // 串通业务总接口 -- 外国护照入口
169
+ exports.getPersonTokenPassport = (options) => {
170
+ // 对参数做兼容性处理
171
+ let optionsParse = parseOptions(options)
172
+
173
+ jingtongVerifyRequest.getSession({
174
+ success: res => {
175
+ if (!res.face_time && !res.realname_time) {
176
+ // 未身份验证/身份验证已过期
177
+ toPassportVerify().then(res => {
178
+ optionsParse && optionsParse.success && optionsParse.success(res)
179
+ })
180
+ } else {
181
+ // 身份验证未过期 => 判断有无手机号码
182
+ if (res.has_phone) {
183
+ const { tel_confirm_time } = res
184
+ if (res.phone !== res.caPhone && tel_confirm_time && (!completeDate(new Date(Number(tel_confirm_time + '000')), 6))) {
185
+ // 【phone与caPhone不同】且【tel_confirm_time大于6个月】
186
+ // toConfirmPhone().then(res => {
187
+ // optionsParse && optionsParse.success && optionsParse.success(res)
188
+ // })
189
+ // 新增逻辑:如果caPhone存在,则跳转原来的逻辑,即换绑手机号,否则跳转绑定手机号
190
+ if (res.caPhone == null || res.caPhone === '') {
191
+ toBindPhone('14').then(res => {
192
+ optionsParse && optionsParse.success && optionsParse.success(res)
193
+ })
194
+ } else {
195
+ toConfirmPhone().then(res => {
196
+ optionsParse && optionsParse.success && optionsParse.success(res)
197
+ })
198
+ }
199
+ } else {
200
+ // 手机号码未过期
201
+ jingtongVerifyRequest.personToken({
202
+ from: 'sdk'
203
+ }).then(data => {
204
+ optionsParse && optionsParse.success && optionsParse.success({
205
+ token: data
206
+ })
207
+ }).catch(err => {
208
+ console.log(JSON.parse(err))
209
+ if (err && err === '4035') {
210
+ // 无手机号码 => 绑定手机号码
211
+ toBindPhone('5').then(res => {
212
+ optionsParse && optionsParse.success && optionsParse.success(res)
213
+ })
214
+ }
215
+ })
216
+ }
217
+ } else {
218
+ // 无手机号码 => 绑定手机号码
219
+ toBindPhone('6').then(res => {
220
+ optionsParse && optionsParse.success && optionsParse.success(res)
221
+ })
222
+ }
223
+ }
224
+ },
225
+ fail: err => {
226
+ console.log('getSession-fail', err)
227
+ optionsParse && optionsParse.fail && optionsParse.fail(err)
228
+ }
229
+ })
230
+ }
231
+
232
+ // 退出登录(非页面)
233
+ exports.toLogOut = (options) => {
234
+ // 对参数做兼容性处理
235
+ let optionsParse = parseOptions(options)
236
+
237
+ // 将弹窗标识设置为不需要弹窗
238
+ jingtongVerifyRequest.setUserReadStatus(false).then(() => {
239
+ console.log('设置弹窗标识成功')
240
+
241
+ jingtongVerifyRequest.logOut().then(() => {
242
+ optionsParse && optionsParse.success && optionsParse.success()
243
+ }).catch(err => {
244
+ console.log('退出登录err', err)
245
+ optionsParse && optionsParse.fail && optionsParse.fail(err)
246
+ })
247
+ }).catch(err => {
248
+ console.log('设置弹窗标识失败', err)
249
+ })
250
+ }
251
+
252
+ // 获取弹窗标识
253
+ exports.getUserReadStatus = (options) => {
254
+ // 对参数做兼容性处理
255
+ let optionsParse = parseOptions(options)
256
+
257
+ jingtongVerifyRequest.getUserReadStatus().then(res => {
258
+ optionsParse && optionsParse.success && optionsParse.success(res)
259
+ }).catch(err => {
260
+ optionsParse && optionsParse.fail && optionsParse.fail(err)
261
+ })
262
+ }
263
+
264
+ // 设置弹窗标识(入参默认为不需要弹窗)
265
+ exports.setUserReadStatus = (options) => {
266
+ // 对参数做兼容性处理
267
+ let optionsParse = parseOptions(options)
268
+
269
+ const status = optionsParse && optionsParse.needRead || false
270
+ console.log('业务侧入参的弹窗标识', status)
271
+ jingtongVerifyRequest.setUserReadStatus(status).then(() => {
272
+ console.log('设置弹窗标识成功')
273
+ }).catch(err => {
274
+ console.log('设置弹窗标识失败', err)
275
+ })
276
+ }
277
+
278
+ // 拉起人脸识别,返回结果
279
+ exports.toFaceVerifyAll = (options) => {
280
+ // 对参数做兼容性处理
281
+ let optionsParse = parseOptions(options)
282
+
283
+ jingtongVerifyRequest.fetchFaceVerify({
284
+ params: optionsParse.params,
285
+ success: res => {
286
+ console.log('=====人脸识别成功=====', res)
287
+ optionsParse && optionsParse.success && optionsParse.success(res)
288
+ },
289
+ fail: err => {
290
+ console.log('=====人脸识别失败=====', err)
291
+ optionsParse && optionsParse.fail && optionsParse.fail(err)
292
+ }
293
+ })
294
+ }
295
+
296
+ // 获取国籍列表
297
+ exports.getNationList = () => {
298
+ return nation || []
299
+ }
300
+
301
+ // 语言国际化
302
+ exports.setLocalLanguage = (options) => {
303
+ // 对参数做兼容性处理
304
+ let optionsParse = parseOptions(options)
305
+
306
+ Object.assign(optionsParse, {
307
+ language: optionsParse.language || 'zh_CN'
308
+ })
309
+ wx.setStorageSync('tif.currentLanguage', optionsParse.language)
321
310
  }