weapps-plugin-jingtong-verify 1.4.6 → 1.4.7

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 (222) hide show
  1. package/app.json +41 -33
  2. package/package.json +20 -20
  3. package/sdk.js +289 -289
  4. package/weapps-plugin-jingtong-verify/components/card-modal/card-modal.js +31 -31
  5. package/weapps-plugin-jingtong-verify/components/card-modal/card-modal.json +3 -3
  6. package/weapps-plugin-jingtong-verify/components/card-modal/card-modal.wxml +9 -9
  7. package/weapps-plugin-jingtong-verify/components/card-modal/card-modal.wxss +65 -65
  8. package/weapps-plugin-jingtong-verify/components/custom-steps/custom-steps.js +41 -0
  9. package/weapps-plugin-jingtong-verify/components/custom-steps/custom-steps.json +4 -0
  10. package/weapps-plugin-jingtong-verify/components/custom-steps/custom-steps.wxml +20 -0
  11. package/weapps-plugin-jingtong-verify/components/custom-steps/custom-steps.wxss +112 -0
  12. package/weapps-plugin-jingtong-verify/components/face-error-modal/face-error-modal.js +37 -37
  13. package/weapps-plugin-jingtong-verify/components/face-error-modal/face-error-modal.json +3 -3
  14. package/weapps-plugin-jingtong-verify/components/face-error-modal/face-error-modal.wxml +30 -30
  15. package/weapps-plugin-jingtong-verify/components/face-error-modal/face-error-modal.wxss +79 -79
  16. package/weapps-plugin-jingtong-verify/components/face-modal/face-modal.js +32 -32
  17. package/weapps-plugin-jingtong-verify/components/face-modal/face-modal.json +3 -3
  18. package/weapps-plugin-jingtong-verify/components/face-modal/face-modal.wxml +16 -16
  19. package/weapps-plugin-jingtong-verify/components/face-modal/face-modal.wxss +57 -57
  20. package/weapps-plugin-jingtong-verify/components/gsd-lib/anim/anim.min.js +1 -1
  21. package/weapps-plugin-jingtong-verify/components/gsd-lib/crypto/crypto.js +37 -37
  22. package/weapps-plugin-jingtong-verify/components/gsd-lib/crypto/index.js +44 -44
  23. package/weapps-plugin-jingtong-verify/components/gsd-lib/dayjs/index.js +351 -351
  24. package/weapps-plugin-jingtong-verify/components/gsd-lib/event/index.js +117 -117
  25. package/weapps-plugin-jingtong-verify/components/gsd-lib/index.js +63 -63
  26. package/weapps-plugin-jingtong-verify/components/gsd-lib/map/index.js +10 -10
  27. package/weapps-plugin-jingtong-verify/components/gsd-lib/map/qmap.js +6 -6
  28. package/weapps-plugin-jingtong-verify/components/gsd-lib/storage/index.js +114 -114
  29. package/weapps-plugin-jingtong-verify/components/gsd-lib/utils/index.js +218 -218
  30. package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/formCheck.js +72 -72
  31. package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/formController.js +47 -47
  32. package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/icon.js +11 -11
  33. package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/list.js +16 -16
  34. package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/navigator.js +33 -33
  35. package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/primarySecondButton.js +18 -18
  36. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-agree/index.js +12 -12
  37. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-agree/index.json +5 -5
  38. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-agree/index.wxml +15 -15
  39. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.js +47 -47
  40. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.json +3 -3
  41. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.wxml +13 -13
  42. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-button-group/index.js +44 -44
  43. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-button-group/index.json +5 -5
  44. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-button-group/index.wxml +28 -28
  45. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.js +30 -30
  46. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.json +6 -6
  47. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.wxml +42 -42
  48. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.wxss +1 -1
  49. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-date-picker-en/index.js +418 -418
  50. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-date-picker-en/index.json +5 -5
  51. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-date-picker-en/index.wxml +29 -29
  52. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-dropdown/index.js +11 -11
  53. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-dropdown/index.json +3 -3
  54. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-dropdown/index.wxml +4 -4
  55. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form/index.js +182 -179
  56. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form/index.json +6 -6
  57. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form/index.wxml +16 -16
  58. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-cell/index.js +92 -92
  59. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-cell/index.json +6 -6
  60. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-cell/index.wxml +12 -12
  61. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-cell/index.wxss +2 -2
  62. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-item/index.js +49 -49
  63. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-item/index.json +3 -3
  64. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-item/index.wxml +14 -14
  65. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-icon/index.js +33 -33
  66. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-icon/index.json +3 -3
  67. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-icon/index.wxml +2 -2
  68. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-index-list/index.js +108 -108
  69. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-index-list/index.json +6 -6
  70. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-index-list/index.wxml +53 -53
  71. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-input/index.js +241 -236
  72. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-input/index.json +8 -8
  73. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-input/index.wxml +49 -49
  74. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-picker/index.js +328 -328
  75. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-picker/index.json +6 -6
  76. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-picker/index.wxml +26 -26
  77. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-popover/index.js +159 -159
  78. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-popover/index.json +3 -3
  79. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-popover/index.wxml +10 -10
  80. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-search/index.js +112 -112
  81. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-search/index.json +5 -5
  82. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-search/index.wxml +21 -21
  83. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.js +21 -21
  84. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.json +7 -7
  85. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.wxml +16 -16
  86. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-tips/index.js +50 -50
  87. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-tips/index.json +5 -5
  88. package/weapps-plugin-jingtong-verify/components/gsd-ui/g-tips/index.wxml +27 -27
  89. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/add.svg +13 -13
  90. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/arrow.svg +14 -14
  91. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/delete.svg +16 -16
  92. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/preview.svg +21 -21
  93. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/user.svg +13 -13
  94. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-agree.wxss +147 -147
  95. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-badge.wxss +41 -41
  96. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-button-group.wxss +244 -244
  97. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-cell.wxss +220 -220
  98. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-dropdown.wxss +115 -115
  99. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-form-cell.wxss +101 -101
  100. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-form-item.wxss +174 -174
  101. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-form.wxss +101 -101
  102. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-icon.wxss +268 -268
  103. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-index-list.wxss +206 -206
  104. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-input.wxss +214 -206
  105. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-picker.wxss +139 -139
  106. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-popover.wxss +129 -129
  107. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-search.wxss +171 -171
  108. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-switch.wxss +176 -176
  109. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-tips.wxss +173 -173
  110. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/icon/iconfont.wxss +160 -160
  111. package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/main.wxss +283 -283
  112. package/weapps-plugin-jingtong-verify/components/gsd-ui/utils/helper.js +55 -55
  113. package/weapps-plugin-jingtong-verify/components/gsd-ui/utils/validType.js +117 -117
  114. package/weapps-plugin-jingtong-verify/components/gsd-ui/utils/validator.js +106 -106
  115. package/weapps-plugin-jingtong-verify/components/lock-face-modal/lock-face-modal.js +32 -32
  116. package/weapps-plugin-jingtong-verify/components/lock-face-modal/lock-face-modal.json +3 -3
  117. package/weapps-plugin-jingtong-verify/components/lock-face-modal/lock-face-modal.wxml +8 -8
  118. package/weapps-plugin-jingtong-verify/components/lock-face-modal/lock-face-modal.wxss +57 -57
  119. package/weapps-plugin-jingtong-verify/components/modal/modal.js +32 -32
  120. package/weapps-plugin-jingtong-verify/components/modal/modal.json +3 -3
  121. package/weapps-plugin-jingtong-verify/components/modal/modal.wxml +28 -28
  122. package/weapps-plugin-jingtong-verify/components/modal/modal.wxss +84 -84
  123. package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.js +82 -82
  124. package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.json +3 -3
  125. package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.wxml +18 -18
  126. package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.wxss +72 -72
  127. package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.js +47 -39
  128. package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.json +3 -3
  129. package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.wxml +11 -9
  130. package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.wxss +51 -51
  131. package/weapps-plugin-jingtong-verify/components/to-other-modal/to-other-modal.js +73 -0
  132. package/weapps-plugin-jingtong-verify/components/to-other-modal/to-other-modal.json +4 -0
  133. package/weapps-plugin-jingtong-verify/components/to-other-modal/to-other-modal.wxml +19 -0
  134. package/weapps-plugin-jingtong-verify/components/to-other-modal/to-other-modal.wxss +72 -0
  135. package/weapps-plugin-jingtong-verify/i18n/index.js +7 -7
  136. package/weapps-plugin-jingtong-verify/i18n/logout.js +10 -10
  137. package/weapps-plugin-jingtong-verify/i18n/rules.js +374 -262
  138. package/weapps-plugin-jingtong-verify/images/bank-card-verify.png +0 -0
  139. package/weapps-plugin-jingtong-verify/images/chek_right.png +0 -0
  140. package/weapps-plugin-jingtong-verify/images/chevron-down.png +0 -0
  141. package/weapps-plugin-jingtong-verify/images/chevron-up.png +0 -0
  142. package/weapps-plugin-jingtong-verify/pages/bank-card-login/bank-card-login.js +488 -0
  143. package/weapps-plugin-jingtong-verify/pages/bank-card-login/bank-card-login.json +7 -0
  144. package/weapps-plugin-jingtong-verify/pages/bank-card-login/bank-card-login.wxml +73 -0
  145. package/weapps-plugin-jingtong-verify/pages/bank-card-login/bank-card-login.wxss +205 -0
  146. package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-face-setting/bank-card-login-forgot-face-setting.js +1218 -0
  147. package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-face-setting/bank-card-login-forgot-face-setting.json +10 -0
  148. package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-face-setting/bank-card-login-forgot-face-setting.wxml +254 -0
  149. package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-face-setting/bank-card-login-forgot-face-setting.wxss +389 -0
  150. package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-sms-setting/bank-card-login-forgot-sms-setting.js +66 -0
  151. package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-sms-setting/bank-card-login-forgot-sms-setting.wxml +2 -0
  152. package/weapps-plugin-jingtong-verify/pages/bank-card-login-pwd-setting/bank-card-login-pwd-setting.js +461 -0
  153. package/weapps-plugin-jingtong-verify/pages/bank-card-login-pwd-setting/bank-card-login-pwd-setting.json +8 -0
  154. package/weapps-plugin-jingtong-verify/pages/bank-card-login-pwd-setting/bank-card-login-pwd-setting.wxml +67 -0
  155. package/weapps-plugin-jingtong-verify/pages/bank-card-login-pwd-setting/bank-card-login-pwd-setting.wxss +231 -0
  156. package/weapps-plugin-jingtong-verify/pages/bank-card-verify/bank-card-verify.js +477 -0
  157. package/weapps-plugin-jingtong-verify/pages/bank-card-verify/bank-card-verify.json +12 -0
  158. package/weapps-plugin-jingtong-verify/pages/bank-card-verify/bank-card-verify.wxml +120 -0
  159. package/weapps-plugin-jingtong-verify/pages/bank-card-verify/bank-card-verify.wxss +217 -0
  160. package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.js +86 -86
  161. package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.json +6 -6
  162. package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.wxml +20 -20
  163. package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.wxss +51 -51
  164. package/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone.js +167 -167
  165. package/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone.json +3 -3
  166. package/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone.wxml +30 -30
  167. package/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone.wxss +91 -91
  168. package/weapps-plugin-jingtong-verify/pages/face-error-reason/face-error-reason.js +79 -79
  169. package/weapps-plugin-jingtong-verify/pages/face-error-reason/face-error-reason.json +5 -5
  170. package/weapps-plugin-jingtong-verify/pages/face-error-reason/face-error-reason.wxml +19 -19
  171. package/weapps-plugin-jingtong-verify/pages/face-error-reason/face-error-reason.wxss +44 -44
  172. package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.js +1687 -1548
  173. package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.json +17 -17
  174. package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxml +516 -504
  175. package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxss +185 -133
  176. package/weapps-plugin-jingtong-verify/pages/log-off/log-off.js +127 -127
  177. package/weapps-plugin-jingtong-verify/pages/log-off/log-off.json +5 -5
  178. package/weapps-plugin-jingtong-verify/pages/log-off/log-off.wxml +36 -36
  179. package/weapps-plugin-jingtong-verify/pages/log-off/log-off.wxss +60 -60
  180. package/weapps-plugin-jingtong-verify/pages/login-help/login-help.js +147 -0
  181. package/weapps-plugin-jingtong-verify/pages/login-help/login-help.json +4 -0
  182. package/weapps-plugin-jingtong-verify/pages/login-help/login-help.wxml +48 -0
  183. package/weapps-plugin-jingtong-verify/pages/login-help/login-help.wxss +166 -0
  184. package/weapps-plugin-jingtong-verify/pages/login-manage/login-manage.js +106 -106
  185. package/weapps-plugin-jingtong-verify/pages/login-manage/login-manage.json +3 -3
  186. package/weapps-plugin-jingtong-verify/pages/login-manage/login-manage.wxml +29 -29
  187. package/weapps-plugin-jingtong-verify/pages/login-manage/login-manage.wxss +68 -68
  188. package/weapps-plugin-jingtong-verify/pages/login-manage-setting/login-manage-setting.js +156 -0
  189. package/weapps-plugin-jingtong-verify/pages/login-manage-setting/login-manage-setting.json +4 -0
  190. package/weapps-plugin-jingtong-verify/pages/login-manage-setting/login-manage-setting.wxml +19 -0
  191. package/weapps-plugin-jingtong-verify/pages/login-manage-setting/login-manage-setting.wxss +69 -0
  192. package/weapps-plugin-jingtong-verify/pages/logoff-success/logoff-success.js +24 -24
  193. package/weapps-plugin-jingtong-verify/pages/logoff-success/logoff-success.json +3 -3
  194. package/weapps-plugin-jingtong-verify/pages/logoff-success/logoff-success.wxml +12 -12
  195. package/weapps-plugin-jingtong-verify/pages/logoff-success/logoff-success.wxss +33 -33
  196. package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.js +110 -110
  197. package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.json +6 -6
  198. package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.wxml +9 -9
  199. package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.wxss +1 -1
  200. package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.js +854 -854
  201. package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.json +11 -11
  202. package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.wxml +162 -162
  203. package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.wxss +64 -64
  204. package/weapps-plugin-jingtong-verify/pages/setting/setting.js +331 -328
  205. package/weapps-plugin-jingtong-verify/pages/setting/setting.json +5 -5
  206. package/weapps-plugin-jingtong-verify/pages/setting/setting.wxml +91 -91
  207. package/weapps-plugin-jingtong-verify/pages/setting/setting.wxss +69 -69
  208. package/weapps-plugin-jingtong-verify/pages/user-info/user-info.js +306 -306
  209. package/weapps-plugin-jingtong-verify/pages/user-info/user-info.json +7 -7
  210. package/weapps-plugin-jingtong-verify/pages/user-info/user-info.wxml +142 -142
  211. package/weapps-plugin-jingtong-verify/pages/user-info/user-info.wxss +110 -110
  212. package/weapps-plugin-jingtong-verify/style/page.wxss +13 -13
  213. package/weapps-plugin-jingtong-verify/utils/QDTrackerNew/QDTracker.js +15 -15
  214. package/weapps-plugin-jingtong-verify/utils/QDTrackerNew/QDTrackerMain.js +59 -59
  215. package/weapps-plugin-jingtong-verify/utils/constantVal.js +75 -0
  216. package/weapps-plugin-jingtong-verify/utils/country.js +209 -209
  217. package/weapps-plugin-jingtong-verify/utils/index.js +306 -306
  218. package/weapps-plugin-jingtong-verify/utils/jsencrypt.min.js +1 -1
  219. package/weapps-plugin-jingtong-verify/utils/request.js +604 -1
  220. package/weapps-plugin-jingtong-verify/utils/rules.js +387 -301
  221. package/weapps-plugin-jingtong-verify/utils/tifadmin_config.js +61 -61
  222. package/weapps-plugin-jingtong-verify/utils/validate.js +894 -772
@@ -1,236 +1,241 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // pages/g-input/index.js
4
- const formControllerBehavior = require("../behaviors/formController");
5
- const validator = require("../utils/validator");
6
- Component({
7
- relations: {
8
- '../g-form-item/index': {
9
- type: 'child'
10
- },
11
- '../g-form/index': {
12
- type: 'ancestor'
13
- }
14
- },
15
- // 缓存数据
16
- __value__: '',
17
- options: {
18
- multipleSlots: true
19
- },
20
- behaviors: [formControllerBehavior],
21
- properties: {
22
- iconDesc: {
23
- type: String,
24
- value: ''
25
- },
26
- label: String,
27
- showQuestion: {
28
- type: Boolean,
29
- value: false
30
- },
31
- _required: {
32
- type: Boolean,
33
- value: true
34
- },
35
- value: {
36
- type: String,
37
- value: '',
38
- observer(newVal) {
39
- // 只有外部特殊设置的 value 才会触发 rerender
40
- // console.log(newVal, this.__value__);
41
- if (newVal !== this.__value__) {
42
- this.__value__ = newVal;
43
- this.setData({
44
- _value: newVal
45
- });
46
- if (this.data._status)
47
- this.resetStatus();
48
- }
49
- }
50
- },
51
- placeholder: {
52
- type: String,
53
- value: '请输入'
54
- },
55
- validateTrigger: {
56
- type: String,
57
- value: 'blur'
58
- },
59
- type: {
60
- type: String,
61
- value: 'text'
62
- },
63
- password: Boolean,
64
- clearable: Boolean,
65
- showEye: Boolean,
66
- isOpen: Boolean,
67
- disabled: Boolean,
68
- prepend: Boolean,
69
- append: Boolean,
70
- maxlength: {
71
- type: Number,
72
- value: 140
73
- },
74
- cursorSpacing: {
75
- type: Number,
76
- value: 0
77
- },
78
- focus: {
79
- type: Boolean,
80
- value: false,
81
- observer(newVal) {
82
- this.setData({
83
- _focus: newVal
84
- });
85
- }
86
- },
87
- confirmType: {
88
- type: String,
89
- value: 'done'
90
- },
91
- confirmHold: Boolean,
92
- cursor: Number,
93
- selectionStart: {
94
- type: Number,
95
- value: -1
96
- },
97
- selectionEnd: {
98
- type: Number,
99
- value: -1
100
- },
101
- adjustPosition: {
102
- type: Boolean,
103
- value: true
104
- },
105
- icon: {
106
- type: String,
107
- value: ''
108
- }
109
- },
110
- data: {
111
- _status: '',
112
- _value: '',
113
- _statusMessage: '',
114
- _focus: false
115
- },
116
- ready() {
117
- this.initSlots();
118
- },
119
- methods: {
120
- initSlots() {
121
- const query = this.createSelectorQuery();
122
- query.selectAll('.slot').boundingClientRect().exec(console.log);
123
- },
124
- // 重置状态
125
- resetStatus() {
126
- this.setData({
127
- _status: '',
128
- _statusMessage: ''
129
- });
130
- },
131
- // 内部校验 input
132
- validateInput() {
133
- if (!this.id) {
134
- throw new Error('请提供需要校验的组件 ID');
135
- }
136
- const formData = { [this.id]: this.__value__ };
137
- const formNode = this.getFormNode();
138
- if (!formNode)
139
- return;
140
- const { rules = {}, validateType = {} } = formNode.properties;
141
- // 根据校验规则,有错误显示状态,无错误重置状态
142
- validator(formData, rules, validateType).then((errorArr) => {
143
- // console.log('form-field validateInput: ', formData, rules, errorArr);
144
- if (errorArr.length > 0) {
145
- this.setData({
146
- _status: 'warn',
147
- _statusMessage: errorArr[0].message
148
- });
149
- }
150
- else {
151
- this.resetStatus();
152
- }
153
- });
154
- },
155
- // 处理点击
156
- handleTap(e) {
157
- this.setData({
158
- _focus: true
159
- });
160
- },
161
- // 重新处理输入框
162
- handleInput(e) {
163
- if (this.data._status)
164
- this.resetStatus();
165
- // 将数据存到内存中,防止无节制的 setData
166
- this.__value__ = e.detail.value;
167
- this.triggerEvent('input', e.detail);
168
- this.triggerEvent('change', e.detail);
169
- },
170
- // focus
171
- handleFocus(e) {
172
- this.setData({ _focus: true });
173
- this.triggerEvent('focus', e.detail);
174
- },
175
- // blur
176
- handleBlur(e) {
177
- console.log('blur', e)
178
- const { validateTrigger } = this.properties;
179
- const { eye, open } = e.currentTarget.dataset
180
- if (validateTrigger === 'blur' && ((eye && open) || !eye)) {
181
- // 触发内部校验
182
- setTimeout(() => {
183
- this.validateInput();
184
- }, 300)
185
- }
186
- this.setData({ _focus: false });
187
- this.triggerEvent('blur', e.detail);
188
- // 避免输入法最后一个字没点击确认
189
- if (this.__value__ !== e.detail.value) {
190
- this.__value__ = e.detail.value;
191
-
192
- this.triggerEvent('input', e.detail);
193
- this.triggerEvent('change', e.detail);
194
- }
195
- },
196
- // confirm
197
- handleConfirm(e) {
198
- this.triggerEvent('confirm', e.detail);
199
- },
200
- // clear
201
- handleTapClear(e) {
202
- const { disabled } = this.properties;
203
- const { _focus } = this.data;
204
- if (disabled)
205
- return false;
206
- this.triggerEvent('input', { value: '' });
207
- this.triggerEvent('change', { value: '' });
208
- if (!_focus) {
209
- // 触发内部校验
210
- this.validateInput();
211
- }
212
- },
213
- // 明文
214
- handleTapEye(e) {
215
- const { disabled } = this.properties;
216
- const { _focus } = this.data;
217
- if (disabled)
218
- return false;
219
- // this.triggerEvent('input', { value: '' });
220
- // this.triggerEvent('change', { value: '' });
221
- // if (!_focus) {
222
- // // 触发内部校验
223
- // this.validateInput();
224
- // }
225
- this.triggerEvent('openEye', { isOpen: e.currentTarget.dataset.open });
226
- },
227
- // tap info
228
- handleTapIcon() {
229
- const { icon } = this.properties;
230
- this.triggerEvent('iconTap', { type: icon });
231
- },
232
- showQuestionTip() {
233
- this.triggerEvent('showQuestionTip')
234
- }
235
- }
236
- });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // pages/g-input/index.js
4
+ const formControllerBehavior = require("../behaviors/formController");
5
+ const validator = require("../utils/validator");
6
+ Component({
7
+ relations: {
8
+ '../g-form-item/index': {
9
+ type: 'child'
10
+ },
11
+ '../g-form/index': {
12
+ type: 'ancestor'
13
+ }
14
+ },
15
+ // 缓存数据
16
+ __value__: '',
17
+ options: {
18
+ multipleSlots: true
19
+ },
20
+ behaviors: [formControllerBehavior],
21
+ properties: {
22
+ iconDesc: {
23
+ type: String,
24
+ value: ''
25
+ },
26
+ label: String,
27
+ showQuestion: {
28
+ type: Boolean,
29
+ value: false
30
+ },
31
+ _required: {
32
+ type: Boolean,
33
+ value: true
34
+ },
35
+ value: {
36
+ type: String,
37
+ value: '',
38
+ observer(newVal) {
39
+ // 只有外部特殊设置的 value 才会触发 rerender
40
+ // console.log(newVal, this.__value__);
41
+ if (newVal !== this.__value__) {
42
+ this.__value__ = newVal;
43
+ this.setData({
44
+ _value: newVal
45
+ });
46
+ if (this.data._status)
47
+ this.resetStatus();
48
+ }
49
+ }
50
+ },
51
+ placeholder: {
52
+ type: String,
53
+ value: '请输入'
54
+ },
55
+ // 🔥 在这里添加新属性
56
+ placeholderClass: { // 新增属性名
57
+ type: String,
58
+ value: 'input__placeholder' // 默认值
59
+ },
60
+ validateTrigger: {
61
+ type: String,
62
+ value: 'blur'
63
+ },
64
+ type: {
65
+ type: String,
66
+ value: 'text'
67
+ },
68
+ password: Boolean,
69
+ clearable: Boolean,
70
+ showEye: Boolean,
71
+ isOpen: Boolean,
72
+ disabled: Boolean,
73
+ prepend: Boolean,
74
+ append: Boolean,
75
+ maxlength: {
76
+ type: Number,
77
+ value: 140
78
+ },
79
+ cursorSpacing: {
80
+ type: Number,
81
+ value: 0
82
+ },
83
+ focus: {
84
+ type: Boolean,
85
+ value: false,
86
+ observer(newVal) {
87
+ this.setData({
88
+ _focus: newVal
89
+ });
90
+ }
91
+ },
92
+ confirmType: {
93
+ type: String,
94
+ value: 'done'
95
+ },
96
+ confirmHold: Boolean,
97
+ cursor: Number,
98
+ selectionStart: {
99
+ type: Number,
100
+ value: -1
101
+ },
102
+ selectionEnd: {
103
+ type: Number,
104
+ value: -1
105
+ },
106
+ adjustPosition: {
107
+ type: Boolean,
108
+ value: true
109
+ },
110
+ icon: {
111
+ type: String,
112
+ value: ''
113
+ }
114
+ },
115
+ data: {
116
+ _status: '',
117
+ _value: '',
118
+ _statusMessage: '',
119
+ _focus: false
120
+ },
121
+ ready() {
122
+ this.initSlots();
123
+ },
124
+ methods: {
125
+ initSlots() {
126
+ const query = this.createSelectorQuery();
127
+ query.selectAll('.slot').boundingClientRect().exec(console.log);
128
+ },
129
+ // 重置状态
130
+ resetStatus() {
131
+ this.setData({
132
+ _status: '',
133
+ _statusMessage: ''
134
+ });
135
+ },
136
+ // 内部校验 input
137
+ validateInput() {
138
+ if (!this.id) {
139
+ throw new Error('请提供需要校验的组件 ID');
140
+ }
141
+ const formData = { [this.id]: this.__value__ };
142
+ const formNode = this.getFormNode();
143
+ if (!formNode)
144
+ return;
145
+ const { rules = {}, validateType = {} } = formNode.properties;
146
+ // 根据校验规则,有错误显示状态,无错误重置状态
147
+ validator(formData, rules, validateType).then((errorArr) => {
148
+ // console.log('form-field validateInput: ', formData, rules, errorArr);
149
+ if (errorArr.length > 0) {
150
+ this.setData({
151
+ _status: 'warn',
152
+ _statusMessage: errorArr[0].message
153
+ });
154
+ }
155
+ else {
156
+ this.resetStatus();
157
+ }
158
+ });
159
+ },
160
+ // 处理点击
161
+ handleTap(e) {
162
+ this.setData({
163
+ _focus: true
164
+ });
165
+ },
166
+ // 重新处理输入框
167
+ handleInput(e) {
168
+ if (this.data._status)
169
+ this.resetStatus();
170
+ // 将数据存到内存中,防止无节制的 setData
171
+ this.__value__ = e.detail.value;
172
+ this.triggerEvent('input', e.detail);
173
+ this.triggerEvent('change', e.detail);
174
+ },
175
+ // focus
176
+ handleFocus(e) {
177
+ this.setData({ _focus: true });
178
+ this.triggerEvent('focus', e.detail);
179
+ },
180
+ // blur
181
+ handleBlur(e) {
182
+ console.log('blur', e)
183
+ const { validateTrigger } = this.properties;
184
+ const { eye, open } = e.currentTarget.dataset
185
+ if (validateTrigger === 'blur' && ((eye && open) || !eye)) {
186
+ // 触发内部校验
187
+ setTimeout(() => {
188
+ this.validateInput();
189
+ }, 300)
190
+ }
191
+ this.setData({ _focus: false });
192
+ this.triggerEvent('blur', e.detail);
193
+ // 避免输入法最后一个字没点击确认
194
+ if (this.__value__ !== e.detail.value) {
195
+ this.__value__ = e.detail.value;
196
+
197
+ this.triggerEvent('input', e.detail);
198
+ this.triggerEvent('change', e.detail);
199
+ }
200
+ },
201
+ // confirm
202
+ handleConfirm(e) {
203
+ this.triggerEvent('confirm', e.detail);
204
+ },
205
+ // clear
206
+ handleTapClear(e) {
207
+ const { disabled } = this.properties;
208
+ const { _focus } = this.data;
209
+ if (disabled)
210
+ return false;
211
+ this.triggerEvent('input', { value: '' });
212
+ this.triggerEvent('change', { value: '' });
213
+ if (!_focus) {
214
+ // 触发内部校验
215
+ this.validateInput();
216
+ }
217
+ },
218
+ // 明文
219
+ handleTapEye(e) {
220
+ const { disabled } = this.properties;
221
+ const { _focus } = this.data;
222
+ if (disabled)
223
+ return false;
224
+ // this.triggerEvent('input', { value: '' });
225
+ // this.triggerEvent('change', { value: '' });
226
+ // if (!_focus) {
227
+ // // 触发内部校验
228
+ // this.validateInput();
229
+ // }
230
+ this.triggerEvent('openEye', { isOpen: e.currentTarget.dataset.open });
231
+ },
232
+ // tap info
233
+ handleTapIcon() {
234
+ const { icon } = this.properties;
235
+ this.triggerEvent('iconTap', { type: icon });
236
+ },
237
+ showQuestionTip() {
238
+ this.triggerEvent('showQuestionTip')
239
+ }
240
+ }
241
+ });
@@ -1,8 +1,8 @@
1
- {
2
- "component": true,
3
- "usingComponents": {
4
- "g-form-item": "../g-form-item/index",
5
- "g-icon": "../g-icon/index",
6
- "g-popover": "../g-popover/index"
7
- }
8
- }
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "g-form-item": "../g-form-item/index",
5
+ "g-icon": "../g-icon/index",
6
+ "g-popover": "../g-popover/index"
7
+ }
8
+ }
@@ -1,49 +1,49 @@
1
- <!--pages/g-input/index.wxml-->
2
- <g-form-item label="{{label}}" disabled="{{disabled}}" status="{{_status}}" statusMessage="{{_statusMessage}}" static-item-class="{{icon === 'info'?'static-item':''}}" showQuestion="{{showQuestion}}" required="{{ _required }}" bind:showQuestionTip="showQuestionTip">
3
- <view class="{{icon === 'info'?'input__containerIcon':'input__container'}}">
4
- <view class="input__prepend" wx:if="{{prepend}}">
5
- <slot name="prepend" class="slot"/>
6
- </view>
7
-
8
-
9
- <view class="{{icon === 'info'?'input__wrapperIcon':'input__wrapper'}}">
10
- <input name="{{id}}" value="{{_value}}"
11
- class="input__element {{icon === 'info'?'input__elementIcon':''}}"
12
- type="{{type}}" password="{{password}}"
13
- placeholder="{{placeholder}}"
14
- placeholder-class="input__placeholder"
15
- disabled="{{disabled}}" maxlength="{{maxlength}}"
16
- cursor-spacing="{{cursorSpacing}}"
17
- focus="{{_focus}}" confirm-type="{{confirmType}}"
18
- confirm-hold="{{confirmHold}}" cursor="{{cursor}}"
19
- selection-start="{{selectionStart}}"
20
- selection-end="{{selectionEnd}}"
21
- adjust-position="{{adjustPosition}}"
22
- bindinput="handleInput" bindfocus="handleFocus"
23
- bindblur="handleBlur" bindconfirm="handleConfirm"
24
- data-open="{{isOpen}}"
25
- data-eye="{{showEye}}"
26
- />
27
-
28
- <view class="{{icon === 'info'?'input__iconInfo__container':'input__icon__container'}}" >
29
- <view class="input__icon input__icon--clear" hidden="{{!clearable || !value}}" catch:tap="handleTapClear">
30
- <g-icon type="close-circle" size="36"/>
31
- </view>
32
- <view class="input__icon input__icon--clear" hidden="{{!showEye}}" catch:tap="handleTapEye" data-value="{{value}}" data-open="{{isOpen}}">
33
- <g-icon type="eye" size="36" wx:if="{{isOpen}}" />
34
- <g-icon type="eye-close" size="36" wx:else />
35
- </view>
36
- <view class="input__icon input__icon--{{icon}}" wx:if="{{icon}}" catch:tap="handleTapIcon">
37
- <g-popover wx:if="{{icon === 'info'}}" content="{{iconDesc}}" placement="topRight">
38
- <g-icon type="info-o" size="36"/>
39
- </g-popover>
40
- </view>
41
- </view>
42
- </view>
43
-
44
-
45
- <view class="input__append" wx:if="{{append}}">
46
- <slot name="append" class="slot"/>
47
- </view>
48
- </view>
49
- </g-form-item>
1
+ <!--pages/g-input/index.wxml-->
2
+ <g-form-item label="{{label}}" disabled="{{disabled}}" status="{{_status}}" statusMessage="{{_statusMessage}}" static-item-class="{{icon === 'info'?'static-item':''}}" showQuestion="{{showQuestion}}" required="{{ _required }}" bind:showQuestionTip="showQuestionTip">
3
+ <view class="{{icon === 'info'?'input__containerIcon':'input__container'}}">
4
+ <view class="input__prepend" wx:if="{{prepend}}">
5
+ <slot name="prepend" class="slot"/>
6
+ </view>
7
+
8
+
9
+ <view class="{{icon === 'info'?'input__wrapperIcon':'input__wrapper'}}">
10
+ <input name="{{id}}" value="{{_value}}"
11
+ class="input__element {{icon === 'info'?'input__elementIcon':''}}"
12
+ type="{{type}}" password="{{password}}"
13
+ placeholder="{{placeholder}}"
14
+ placeholder-class="{{placeholderClass}}"
15
+ disabled="{{disabled}}" maxlength="{{maxlength}}"
16
+ cursor-spacing="{{cursorSpacing}}"
17
+ focus="{{_focus}}" confirm-type="{{confirmType}}"
18
+ confirm-hold="{{confirmHold}}" cursor="{{cursor}}"
19
+ selection-start="{{selectionStart}}"
20
+ selection-end="{{selectionEnd}}"
21
+ adjust-position="{{adjustPosition}}"
22
+ bindinput="handleInput" bindfocus="handleFocus"
23
+ bindblur="handleBlur" bindconfirm="handleConfirm"
24
+ data-open="{{isOpen}}"
25
+ data-eye="{{showEye}}"
26
+ />
27
+
28
+ <view class="{{icon === 'info'?'input__iconInfo__container':'input__icon__container'}}" >
29
+ <view class="input__icon input__icon--clear" hidden="{{!clearable || !value}}" catch:tap="handleTapClear">
30
+ <g-icon type="close-circle" size="36"/>
31
+ </view>
32
+ <view class="input__icon input__icon--clear" hidden="{{!showEye}}" catch:tap="handleTapEye" data-value="{{value}}" data-open="{{isOpen}}">
33
+ <g-icon type="eye" size="36" wx:if="{{isOpen}}" />
34
+ <g-icon type="eye-close" size="36" wx:else />
35
+ </view>
36
+ <view class="input__icon input__icon--{{icon}}" wx:if="{{icon}}" catch:tap="handleTapIcon">
37
+ <g-popover wx:if="{{icon === 'info'}}" content="{{iconDesc}}" placement="topRight">
38
+ <g-icon type="info-o" size="36"/>
39
+ </g-popover>
40
+ </view>
41
+ </view>
42
+ </view>
43
+
44
+
45
+ <view class="input__append" wx:if="{{append}}">
46
+ <slot name="append" class="slot"/>
47
+ </view>
48
+ </view>
49
+ </g-form-item>