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.
- package/app.json +41 -33
- package/package.json +20 -20
- package/sdk.js +289 -289
- package/weapps-plugin-jingtong-verify/components/card-modal/card-modal.js +31 -31
- package/weapps-plugin-jingtong-verify/components/card-modal/card-modal.json +3 -3
- package/weapps-plugin-jingtong-verify/components/card-modal/card-modal.wxml +9 -9
- package/weapps-plugin-jingtong-verify/components/card-modal/card-modal.wxss +65 -65
- package/weapps-plugin-jingtong-verify/components/custom-steps/custom-steps.js +41 -0
- package/weapps-plugin-jingtong-verify/components/custom-steps/custom-steps.json +4 -0
- package/weapps-plugin-jingtong-verify/components/custom-steps/custom-steps.wxml +20 -0
- package/weapps-plugin-jingtong-verify/components/custom-steps/custom-steps.wxss +112 -0
- package/weapps-plugin-jingtong-verify/components/face-error-modal/face-error-modal.js +37 -37
- package/weapps-plugin-jingtong-verify/components/face-error-modal/face-error-modal.json +3 -3
- package/weapps-plugin-jingtong-verify/components/face-error-modal/face-error-modal.wxml +30 -30
- package/weapps-plugin-jingtong-verify/components/face-error-modal/face-error-modal.wxss +79 -79
- package/weapps-plugin-jingtong-verify/components/face-modal/face-modal.js +32 -32
- package/weapps-plugin-jingtong-verify/components/face-modal/face-modal.json +3 -3
- package/weapps-plugin-jingtong-verify/components/face-modal/face-modal.wxml +16 -16
- package/weapps-plugin-jingtong-verify/components/face-modal/face-modal.wxss +57 -57
- package/weapps-plugin-jingtong-verify/components/gsd-lib/anim/anim.min.js +1 -1
- package/weapps-plugin-jingtong-verify/components/gsd-lib/crypto/crypto.js +37 -37
- package/weapps-plugin-jingtong-verify/components/gsd-lib/crypto/index.js +44 -44
- package/weapps-plugin-jingtong-verify/components/gsd-lib/dayjs/index.js +351 -351
- package/weapps-plugin-jingtong-verify/components/gsd-lib/event/index.js +117 -117
- package/weapps-plugin-jingtong-verify/components/gsd-lib/index.js +63 -63
- package/weapps-plugin-jingtong-verify/components/gsd-lib/map/index.js +10 -10
- package/weapps-plugin-jingtong-verify/components/gsd-lib/map/qmap.js +6 -6
- package/weapps-plugin-jingtong-verify/components/gsd-lib/storage/index.js +114 -114
- package/weapps-plugin-jingtong-verify/components/gsd-lib/utils/index.js +218 -218
- package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/formCheck.js +72 -72
- package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/formController.js +47 -47
- package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/icon.js +11 -11
- package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/list.js +16 -16
- package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/navigator.js +33 -33
- package/weapps-plugin-jingtong-verify/components/gsd-ui/behaviors/primarySecondButton.js +18 -18
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-agree/index.js +12 -12
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-agree/index.json +5 -5
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-agree/index.wxml +15 -15
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.js +47 -47
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.json +3 -3
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-badge/index.wxml +13 -13
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-button-group/index.js +44 -44
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-button-group/index.json +5 -5
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-button-group/index.wxml +28 -28
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.js +30 -30
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.json +6 -6
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.wxml +42 -42
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-cell/index.wxss +1 -1
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-date-picker-en/index.js +418 -418
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-date-picker-en/index.json +5 -5
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-date-picker-en/index.wxml +29 -29
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-dropdown/index.js +11 -11
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-dropdown/index.json +3 -3
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-dropdown/index.wxml +4 -4
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form/index.js +182 -179
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form/index.json +6 -6
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form/index.wxml +16 -16
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-cell/index.js +92 -92
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-cell/index.json +6 -6
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-cell/index.wxml +12 -12
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-cell/index.wxss +2 -2
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-item/index.js +49 -49
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-item/index.json +3 -3
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-form-item/index.wxml +14 -14
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-icon/index.js +33 -33
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-icon/index.json +3 -3
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-icon/index.wxml +2 -2
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-index-list/index.js +108 -108
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-index-list/index.json +6 -6
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-index-list/index.wxml +53 -53
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-input/index.js +241 -236
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-input/index.json +8 -8
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-input/index.wxml +49 -49
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-picker/index.js +328 -328
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-picker/index.json +6 -6
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-picker/index.wxml +26 -26
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-popover/index.js +159 -159
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-popover/index.json +3 -3
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-popover/index.wxml +10 -10
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-search/index.js +112 -112
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-search/index.json +5 -5
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-search/index.wxml +21 -21
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.js +21 -21
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.json +7 -7
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-switch/index.wxml +16 -16
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-tips/index.js +50 -50
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-tips/index.json +5 -5
- package/weapps-plugin-jingtong-verify/components/gsd-ui/g-tips/index.wxml +27 -27
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/add.svg +13 -13
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/arrow.svg +14 -14
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/delete.svg +16 -16
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/preview.svg +21 -21
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/image/user.svg +13 -13
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-agree.wxss +147 -147
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-badge.wxss +41 -41
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-button-group.wxss +244 -244
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-cell.wxss +220 -220
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-dropdown.wxss +115 -115
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-form-cell.wxss +101 -101
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-form-item.wxss +174 -174
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-form.wxss +101 -101
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-icon.wxss +268 -268
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-index-list.wxss +206 -206
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-input.wxss +214 -206
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-picker.wxss +139 -139
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-popover.wxss +129 -129
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-search.wxss +171 -171
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-switch.wxss +176 -176
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/components/g-tips.wxss +173 -173
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/icon/iconfont.wxss +160 -160
- package/weapps-plugin-jingtong-verify/components/gsd-ui/static/style/main.wxss +283 -283
- package/weapps-plugin-jingtong-verify/components/gsd-ui/utils/helper.js +55 -55
- package/weapps-plugin-jingtong-verify/components/gsd-ui/utils/validType.js +117 -117
- package/weapps-plugin-jingtong-verify/components/gsd-ui/utils/validator.js +106 -106
- package/weapps-plugin-jingtong-verify/components/lock-face-modal/lock-face-modal.js +32 -32
- package/weapps-plugin-jingtong-verify/components/lock-face-modal/lock-face-modal.json +3 -3
- package/weapps-plugin-jingtong-verify/components/lock-face-modal/lock-face-modal.wxml +8 -8
- package/weapps-plugin-jingtong-verify/components/lock-face-modal/lock-face-modal.wxss +57 -57
- package/weapps-plugin-jingtong-verify/components/modal/modal.js +32 -32
- package/weapps-plugin-jingtong-verify/components/modal/modal.json +3 -3
- package/weapps-plugin-jingtong-verify/components/modal/modal.wxml +28 -28
- package/weapps-plugin-jingtong-verify/components/modal/modal.wxss +84 -84
- package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.js +82 -82
- package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.json +3 -3
- package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.wxml +18 -18
- package/weapps-plugin-jingtong-verify/components/my-modal/my-modal.wxss +72 -72
- package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.js +47 -39
- package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.json +3 -3
- package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.wxml +11 -9
- package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.wxss +51 -51
- package/weapps-plugin-jingtong-verify/components/to-other-modal/to-other-modal.js +73 -0
- package/weapps-plugin-jingtong-verify/components/to-other-modal/to-other-modal.json +4 -0
- package/weapps-plugin-jingtong-verify/components/to-other-modal/to-other-modal.wxml +19 -0
- package/weapps-plugin-jingtong-verify/components/to-other-modal/to-other-modal.wxss +72 -0
- package/weapps-plugin-jingtong-verify/i18n/index.js +7 -7
- package/weapps-plugin-jingtong-verify/i18n/logout.js +10 -10
- package/weapps-plugin-jingtong-verify/i18n/rules.js +374 -262
- package/weapps-plugin-jingtong-verify/images/bank-card-verify.png +0 -0
- package/weapps-plugin-jingtong-verify/images/chek_right.png +0 -0
- package/weapps-plugin-jingtong-verify/images/chevron-down.png +0 -0
- package/weapps-plugin-jingtong-verify/images/chevron-up.png +0 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-login/bank-card-login.js +488 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-login/bank-card-login.json +7 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-login/bank-card-login.wxml +73 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-login/bank-card-login.wxss +205 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-face-setting/bank-card-login-forgot-face-setting.js +1218 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-face-setting/bank-card-login-forgot-face-setting.json +10 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-face-setting/bank-card-login-forgot-face-setting.wxml +254 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-face-setting/bank-card-login-forgot-face-setting.wxss +389 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-sms-setting/bank-card-login-forgot-sms-setting.js +66 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-login-forgot-sms-setting/bank-card-login-forgot-sms-setting.wxml +2 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-login-pwd-setting/bank-card-login-pwd-setting.js +461 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-login-pwd-setting/bank-card-login-pwd-setting.json +8 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-login-pwd-setting/bank-card-login-pwd-setting.wxml +67 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-login-pwd-setting/bank-card-login-pwd-setting.wxss +231 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-verify/bank-card-verify.js +477 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-verify/bank-card-verify.json +12 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-verify/bank-card-verify.wxml +120 -0
- package/weapps-plugin-jingtong-verify/pages/bank-card-verify/bank-card-verify.wxss +217 -0
- package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.js +86 -86
- package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.json +6 -6
- package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.wxml +20 -20
- package/weapps-plugin-jingtong-verify/pages/bind-phone/bind-phone.wxss +51 -51
- package/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone.js +167 -167
- package/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone.json +3 -3
- package/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone.wxml +30 -30
- package/weapps-plugin-jingtong-verify/pages/confirm-phone/confirm-phone.wxss +91 -91
- package/weapps-plugin-jingtong-verify/pages/face-error-reason/face-error-reason.js +79 -79
- package/weapps-plugin-jingtong-verify/pages/face-error-reason/face-error-reason.json +5 -5
- package/weapps-plugin-jingtong-verify/pages/face-error-reason/face-error-reason.wxml +19 -19
- package/weapps-plugin-jingtong-verify/pages/face-error-reason/face-error-reason.wxss +44 -44
- package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.js +1687 -1548
- package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.json +17 -17
- package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxml +516 -504
- package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxss +185 -133
- package/weapps-plugin-jingtong-verify/pages/log-off/log-off.js +127 -127
- package/weapps-plugin-jingtong-verify/pages/log-off/log-off.json +5 -5
- package/weapps-plugin-jingtong-verify/pages/log-off/log-off.wxml +36 -36
- package/weapps-plugin-jingtong-verify/pages/log-off/log-off.wxss +60 -60
- package/weapps-plugin-jingtong-verify/pages/login-help/login-help.js +147 -0
- package/weapps-plugin-jingtong-verify/pages/login-help/login-help.json +4 -0
- package/weapps-plugin-jingtong-verify/pages/login-help/login-help.wxml +48 -0
- package/weapps-plugin-jingtong-verify/pages/login-help/login-help.wxss +166 -0
- package/weapps-plugin-jingtong-verify/pages/login-manage/login-manage.js +106 -106
- package/weapps-plugin-jingtong-verify/pages/login-manage/login-manage.json +3 -3
- package/weapps-plugin-jingtong-verify/pages/login-manage/login-manage.wxml +29 -29
- package/weapps-plugin-jingtong-verify/pages/login-manage/login-manage.wxss +68 -68
- package/weapps-plugin-jingtong-verify/pages/login-manage-setting/login-manage-setting.js +156 -0
- package/weapps-plugin-jingtong-verify/pages/login-manage-setting/login-manage-setting.json +4 -0
- package/weapps-plugin-jingtong-verify/pages/login-manage-setting/login-manage-setting.wxml +19 -0
- package/weapps-plugin-jingtong-verify/pages/login-manage-setting/login-manage-setting.wxss +69 -0
- package/weapps-plugin-jingtong-verify/pages/logoff-success/logoff-success.js +24 -24
- package/weapps-plugin-jingtong-verify/pages/logoff-success/logoff-success.json +3 -3
- package/weapps-plugin-jingtong-verify/pages/logoff-success/logoff-success.wxml +12 -12
- package/weapps-plugin-jingtong-verify/pages/logoff-success/logoff-success.wxss +33 -33
- package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.js +110 -110
- package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.json +6 -6
- package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.wxml +9 -9
- package/weapps-plugin-jingtong-verify/pages/nation-list/nation-list.wxss +1 -1
- package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.js +854 -854
- package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.json +11 -11
- package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.wxml +162 -162
- package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.wxss +64 -64
- package/weapps-plugin-jingtong-verify/pages/setting/setting.js +331 -328
- package/weapps-plugin-jingtong-verify/pages/setting/setting.json +5 -5
- package/weapps-plugin-jingtong-verify/pages/setting/setting.wxml +91 -91
- package/weapps-plugin-jingtong-verify/pages/setting/setting.wxss +69 -69
- package/weapps-plugin-jingtong-verify/pages/user-info/user-info.js +306 -306
- package/weapps-plugin-jingtong-verify/pages/user-info/user-info.json +7 -7
- package/weapps-plugin-jingtong-verify/pages/user-info/user-info.wxml +142 -142
- package/weapps-plugin-jingtong-verify/pages/user-info/user-info.wxss +110 -110
- package/weapps-plugin-jingtong-verify/style/page.wxss +13 -13
- package/weapps-plugin-jingtong-verify/utils/QDTrackerNew/QDTracker.js +15 -15
- package/weapps-plugin-jingtong-verify/utils/QDTrackerNew/QDTrackerMain.js +59 -59
- package/weapps-plugin-jingtong-verify/utils/constantVal.js +75 -0
- package/weapps-plugin-jingtong-verify/utils/country.js +209 -209
- package/weapps-plugin-jingtong-verify/utils/index.js +306 -306
- package/weapps-plugin-jingtong-verify/utils/jsencrypt.min.js +1 -1
- package/weapps-plugin-jingtong-verify/utils/request.js +604 -1
- package/weapps-plugin-jingtong-verify/utils/rules.js +387 -301
- package/weapps-plugin-jingtong-verify/utils/tifadmin_config.js +61 -61
- package/weapps-plugin-jingtong-verify/utils/validate.js +894 -772
|
@@ -1,328 +1,328 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// pages/g-picker/index.js
|
|
4
|
-
const formControllerBehavior = require("../behaviors/formController");
|
|
5
|
-
const pickerMode = 'selector';
|
|
6
|
-
Component({
|
|
7
|
-
externalClasses: ['dropdown-class'],
|
|
8
|
-
behaviors: [formControllerBehavior],
|
|
9
|
-
relations: {
|
|
10
|
-
'../g-form-item/index': {
|
|
11
|
-
type: 'child'
|
|
12
|
-
},
|
|
13
|
-
'../g-form/index': {
|
|
14
|
-
type: 'ancestor'
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
properties: {
|
|
18
|
-
label: String,
|
|
19
|
-
actionText: {
|
|
20
|
-
type: String,
|
|
21
|
-
value: '选择'
|
|
22
|
-
},
|
|
23
|
-
_required: {
|
|
24
|
-
type: Boolean,
|
|
25
|
-
value: true
|
|
26
|
-
},
|
|
27
|
-
range: {
|
|
28
|
-
type: Array,
|
|
29
|
-
value: [],
|
|
30
|
-
__type__(type) { return type; }
|
|
31
|
-
},
|
|
32
|
-
rangeKey: {
|
|
33
|
-
type: String,
|
|
34
|
-
value: 'name',
|
|
35
|
-
observer(_rangeKey) {
|
|
36
|
-
this.setData({ _rangeKey });
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
value: {
|
|
40
|
-
type: [String, Array],
|
|
41
|
-
observer(newValue) {
|
|
42
|
-
this.initStatus(newValue);
|
|
43
|
-
this.initValue();
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
type: {
|
|
47
|
-
type: String,
|
|
48
|
-
value: 'formItem'
|
|
49
|
-
},
|
|
50
|
-
mode: {
|
|
51
|
-
type: String,
|
|
52
|
-
value: pickerMode
|
|
53
|
-
},
|
|
54
|
-
disabled: {
|
|
55
|
-
type: Boolean
|
|
56
|
-
},
|
|
57
|
-
start: {
|
|
58
|
-
type: String
|
|
59
|
-
},
|
|
60
|
-
end: {
|
|
61
|
-
type: String
|
|
62
|
-
},
|
|
63
|
-
fields: {
|
|
64
|
-
type: String,
|
|
65
|
-
value: 'day'
|
|
66
|
-
},
|
|
67
|
-
customItem: {
|
|
68
|
-
type: String
|
|
69
|
-
},
|
|
70
|
-
splitKey: {
|
|
71
|
-
type: String,
|
|
72
|
-
value: ',',
|
|
73
|
-
observer(_splitKey) {
|
|
74
|
-
this.setData({ _splitKey });
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
placeholder: {
|
|
78
|
-
type: String,
|
|
79
|
-
value: '请选择',
|
|
80
|
-
observer(newVal) {
|
|
81
|
-
if (!this.properties.value) {
|
|
82
|
-
this.setData({
|
|
83
|
-
_displayName: newVal
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
data: {
|
|
90
|
-
_readonly: false,
|
|
91
|
-
_rangeKey: 'name',
|
|
92
|
-
_splitKey: ',',
|
|
93
|
-
_displayName: '请选择',
|
|
94
|
-
_valueIndex: undefined,
|
|
95
|
-
_status: '',
|
|
96
|
-
_statusMessage: '',
|
|
97
|
-
_isEmpty: true
|
|
98
|
-
},
|
|
99
|
-
ready() {
|
|
100
|
-
const { mode, splitKey } = this.properties;
|
|
101
|
-
// 初始化各属性
|
|
102
|
-
// 处理 rangeKey 的 bug
|
|
103
|
-
if (mode === 'region') {
|
|
104
|
-
this.setData({
|
|
105
|
-
_rangeKey: '',
|
|
106
|
-
_splitKey: splitKey === ',' ? '' : splitKey
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
if (mode === 'multiSelector') {
|
|
110
|
-
this.setData({
|
|
111
|
-
_valueIndex: []
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
this.initValue();
|
|
115
|
-
},
|
|
116
|
-
methods: {
|
|
117
|
-
// 获取 value 是否为空
|
|
118
|
-
isValueEmpty(value) {
|
|
119
|
-
const { mode } = this.properties;
|
|
120
|
-
if (mode === 'selector' || mode === 'date' || mode === 'time' || mode === 'none') {
|
|
121
|
-
return typeof value === 'undefined' || value === '';
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
return (Array.isArray(value) && value.length === 0);
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
// 初始化状态,包括 placeholder, _status
|
|
128
|
-
initStatus(value) {
|
|
129
|
-
const { placeholder } = this.properties;
|
|
130
|
-
if (this.isValueEmpty(value)) {
|
|
131
|
-
this.setData({
|
|
132
|
-
_status: '',
|
|
133
|
-
_statusMessage: '',
|
|
134
|
-
_isEmpty: true,
|
|
135
|
-
_displayName: placeholder,
|
|
136
|
-
_valueIndex: value || ''
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
this.setData({
|
|
141
|
-
_isEmpty: false,
|
|
142
|
-
_status: '',
|
|
143
|
-
_statusMessage: ''
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
initValue() {
|
|
148
|
-
// 根据 value 初始化选项
|
|
149
|
-
const { value, mode, splitKey } = this.properties;
|
|
150
|
-
if ((!Array.isArray(value) && !!value) || (Array.isArray(value) && value.length > 0)) {
|
|
151
|
-
// 如果是 none 模式,则不进行 value 处理,是什么就展示什么
|
|
152
|
-
if (mode === 'none') {
|
|
153
|
-
this.setData({
|
|
154
|
-
_isEmpty: false,
|
|
155
|
-
_readonly: true,
|
|
156
|
-
_displayName: Array.isArray(value) ? value.join('') : value
|
|
157
|
-
});
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
if (mode === 'selector' || mode === 'multiSelector') {
|
|
161
|
-
if (Array.isArray(value)) {
|
|
162
|
-
if (value.length > 0) {
|
|
163
|
-
this.setValue(value);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
this.setValue(value);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
let _displayName = '';
|
|
172
|
-
if (mode === 'region') {
|
|
173
|
-
if (Array.isArray(value))
|
|
174
|
-
_displayName = value.join(splitKey);
|
|
175
|
-
}
|
|
176
|
-
else {
|
|
177
|
-
_displayName = value;
|
|
178
|
-
}
|
|
179
|
-
this.setData({
|
|
180
|
-
_isEmpty: false,
|
|
181
|
-
_valueIndex: value,
|
|
182
|
-
_displayName
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
// 通过 value 来设置 index 和 displayName,单选和复选用
|
|
188
|
-
setValue(value) {
|
|
189
|
-
const { range, splitKey } = this.properties;
|
|
190
|
-
const { _rangeKey } = this.data;
|
|
191
|
-
let _displayName, _valueIndex;
|
|
192
|
-
if (Array.isArray(value)) {
|
|
193
|
-
// 多选
|
|
194
|
-
const displayNameArr = [];
|
|
195
|
-
_valueIndex = value.map((v, rangeIdx) => {
|
|
196
|
-
let findIdx;
|
|
197
|
-
const rangeCol = range[rangeIdx];
|
|
198
|
-
// 获取索引
|
|
199
|
-
rangeCol.some((rangeItem, rangeIdx) => {
|
|
200
|
-
if (rangeItem.value === v) {
|
|
201
|
-
findIdx = rangeIdx;
|
|
202
|
-
displayNameArr.push(rangeItem.displayName || rangeItem[_rangeKey]);
|
|
203
|
-
return false;
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
return findIdx;
|
|
207
|
-
});
|
|
208
|
-
_displayName = displayNameArr.join(splitKey);
|
|
209
|
-
}
|
|
210
|
-
else {
|
|
211
|
-
// 单选
|
|
212
|
-
range.some((rangeItem, rangeIdx) => {
|
|
213
|
-
if (rangeItem.value === value) {
|
|
214
|
-
_valueIndex = rangeIdx;
|
|
215
|
-
_displayName = rangeItem.displayName || rangeItem[_rangeKey] || rangeItem.value;
|
|
216
|
-
return false;
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
if (_valueIndex === void 0) {
|
|
221
|
-
console.warn('无法检索到选项,请检查传入的 value 值和 range 值是否对应');
|
|
222
|
-
return false;
|
|
223
|
-
}
|
|
224
|
-
this.setData({
|
|
225
|
-
_isEmpty: false,
|
|
226
|
-
_valueIndex,
|
|
227
|
-
_displayName
|
|
228
|
-
});
|
|
229
|
-
},
|
|
230
|
-
handleChange(e) {
|
|
231
|
-
this.initStatus();
|
|
232
|
-
const mode = this.properties.mode;
|
|
233
|
-
if (mode === 'selector' || mode === 'multiSelector') {
|
|
234
|
-
this.triggerRangeChange(e);
|
|
235
|
-
}
|
|
236
|
-
else if (mode === 'time' || mode === 'date') {
|
|
237
|
-
this.triggerDateTimeChange(e);
|
|
238
|
-
}
|
|
239
|
-
else if (mode === 'region') {
|
|
240
|
-
this.triggerRegionChange(e);
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
// 单选和复选的逻辑
|
|
244
|
-
triggerRangeChange(e) {
|
|
245
|
-
const _valueIndex = e.detail.value;
|
|
246
|
-
const { range, splitKey } = this.properties;
|
|
247
|
-
const { _rangeKey } = this.data;
|
|
248
|
-
// 数组
|
|
249
|
-
let _displayName, value, name;
|
|
250
|
-
if (range.length < 1) {
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
if (Array.isArray(_valueIndex)) {
|
|
254
|
-
name = _valueIndex.map((vidx, index) => {
|
|
255
|
-
const rangeItem = range[index];
|
|
256
|
-
vidx = vidx || 0;
|
|
257
|
-
return rangeItem[vidx] && (rangeItem.displayName || rangeItem[vidx][_rangeKey]);
|
|
258
|
-
});
|
|
259
|
-
value = _valueIndex.map((vidx, index) => {
|
|
260
|
-
const rangeItem = range[index];
|
|
261
|
-
vidx = vidx || 0;
|
|
262
|
-
return rangeItem[vidx] && rangeItem[vidx].value;
|
|
263
|
-
});
|
|
264
|
-
_displayName = name.filter(str => !!str).join(splitKey);
|
|
265
|
-
}
|
|
266
|
-
else {
|
|
267
|
-
_displayName = range[_valueIndex]._displayName || range[_valueIndex][_rangeKey];
|
|
268
|
-
value = range[_valueIndex].value;
|
|
269
|
-
}
|
|
270
|
-
this.setData({
|
|
271
|
-
_isEmpty: false,
|
|
272
|
-
_valueIndex: e.detail.value,
|
|
273
|
-
_displayName
|
|
274
|
-
});
|
|
275
|
-
this.triggerEvent('change', {
|
|
276
|
-
value,
|
|
277
|
-
index: _valueIndex
|
|
278
|
-
});
|
|
279
|
-
},
|
|
280
|
-
// 时间选择器
|
|
281
|
-
triggerDateTimeChange(e) {
|
|
282
|
-
this.setData({
|
|
283
|
-
_isEmpty: false,
|
|
284
|
-
_valueIndex: e.detail.value,
|
|
285
|
-
_displayName: e.detail.value
|
|
286
|
-
});
|
|
287
|
-
this.triggerEvent('change', e.detail);
|
|
288
|
-
},
|
|
289
|
-
// 地区选择器
|
|
290
|
-
triggerRegionChange(e) {
|
|
291
|
-
const valueSet = new Set(e.detail.value);
|
|
292
|
-
// 处理掉重复的,无用的前缀等字符
|
|
293
|
-
const _displayName = Array.from(valueSet)
|
|
294
|
-
.filter((name) => {
|
|
295
|
-
return -1 === ['县', '省直辖县级行政区划'].indexOf(name);
|
|
296
|
-
})
|
|
297
|
-
.join(this.properties.splitKey);
|
|
298
|
-
this.setData({
|
|
299
|
-
_isEmpty: false,
|
|
300
|
-
_valueIndex: e.detail.value,
|
|
301
|
-
_displayName
|
|
302
|
-
});
|
|
303
|
-
this.triggerEvent('change', e.detail);
|
|
304
|
-
},
|
|
305
|
-
// 列变化
|
|
306
|
-
triggerColumnchange(e) {
|
|
307
|
-
const { range } = this.properties;
|
|
308
|
-
const { _valueIndex } = this.data;
|
|
309
|
-
// 根据列变化,得到修改后的值
|
|
310
|
-
const { column, value: index } = e.detail;
|
|
311
|
-
const value = range[column][index].value;
|
|
312
|
-
_valueIndex[column] = index;
|
|
313
|
-
for (let i = column + 1; i < range.length; i++) {
|
|
314
|
-
_valueIndex[i] = 0;
|
|
315
|
-
}
|
|
316
|
-
this.setData({ _valueIndex });
|
|
317
|
-
this.triggerEvent('columnchange', {
|
|
318
|
-
column, index, value
|
|
319
|
-
});
|
|
320
|
-
},
|
|
321
|
-
triggerCancel(e) {
|
|
322
|
-
this.triggerEvent('cancel', e.detail);
|
|
323
|
-
},
|
|
324
|
-
handleActionTap(e) {
|
|
325
|
-
this.triggerEvent('actionTap', e.detail);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// pages/g-picker/index.js
|
|
4
|
+
const formControllerBehavior = require("../behaviors/formController");
|
|
5
|
+
const pickerMode = 'selector';
|
|
6
|
+
Component({
|
|
7
|
+
externalClasses: ['dropdown-class'],
|
|
8
|
+
behaviors: [formControllerBehavior],
|
|
9
|
+
relations: {
|
|
10
|
+
'../g-form-item/index': {
|
|
11
|
+
type: 'child'
|
|
12
|
+
},
|
|
13
|
+
'../g-form/index': {
|
|
14
|
+
type: 'ancestor'
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
properties: {
|
|
18
|
+
label: String,
|
|
19
|
+
actionText: {
|
|
20
|
+
type: String,
|
|
21
|
+
value: '选择'
|
|
22
|
+
},
|
|
23
|
+
_required: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
value: true
|
|
26
|
+
},
|
|
27
|
+
range: {
|
|
28
|
+
type: Array,
|
|
29
|
+
value: [],
|
|
30
|
+
__type__(type) { return type; }
|
|
31
|
+
},
|
|
32
|
+
rangeKey: {
|
|
33
|
+
type: String,
|
|
34
|
+
value: 'name',
|
|
35
|
+
observer(_rangeKey) {
|
|
36
|
+
this.setData({ _rangeKey });
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
value: {
|
|
40
|
+
type: [String, Array],
|
|
41
|
+
observer(newValue) {
|
|
42
|
+
this.initStatus(newValue);
|
|
43
|
+
this.initValue();
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
type: {
|
|
47
|
+
type: String,
|
|
48
|
+
value: 'formItem'
|
|
49
|
+
},
|
|
50
|
+
mode: {
|
|
51
|
+
type: String,
|
|
52
|
+
value: pickerMode
|
|
53
|
+
},
|
|
54
|
+
disabled: {
|
|
55
|
+
type: Boolean
|
|
56
|
+
},
|
|
57
|
+
start: {
|
|
58
|
+
type: String
|
|
59
|
+
},
|
|
60
|
+
end: {
|
|
61
|
+
type: String
|
|
62
|
+
},
|
|
63
|
+
fields: {
|
|
64
|
+
type: String,
|
|
65
|
+
value: 'day'
|
|
66
|
+
},
|
|
67
|
+
customItem: {
|
|
68
|
+
type: String
|
|
69
|
+
},
|
|
70
|
+
splitKey: {
|
|
71
|
+
type: String,
|
|
72
|
+
value: ',',
|
|
73
|
+
observer(_splitKey) {
|
|
74
|
+
this.setData({ _splitKey });
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
placeholder: {
|
|
78
|
+
type: String,
|
|
79
|
+
value: '请选择',
|
|
80
|
+
observer(newVal) {
|
|
81
|
+
if (!this.properties.value) {
|
|
82
|
+
this.setData({
|
|
83
|
+
_displayName: newVal
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
data: {
|
|
90
|
+
_readonly: false,
|
|
91
|
+
_rangeKey: 'name',
|
|
92
|
+
_splitKey: ',',
|
|
93
|
+
_displayName: '请选择',
|
|
94
|
+
_valueIndex: undefined,
|
|
95
|
+
_status: '',
|
|
96
|
+
_statusMessage: '',
|
|
97
|
+
_isEmpty: true
|
|
98
|
+
},
|
|
99
|
+
ready() {
|
|
100
|
+
const { mode, splitKey } = this.properties;
|
|
101
|
+
// 初始化各属性
|
|
102
|
+
// 处理 rangeKey 的 bug
|
|
103
|
+
if (mode === 'region') {
|
|
104
|
+
this.setData({
|
|
105
|
+
_rangeKey: '',
|
|
106
|
+
_splitKey: splitKey === ',' ? '' : splitKey
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
if (mode === 'multiSelector') {
|
|
110
|
+
this.setData({
|
|
111
|
+
_valueIndex: []
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
this.initValue();
|
|
115
|
+
},
|
|
116
|
+
methods: {
|
|
117
|
+
// 获取 value 是否为空
|
|
118
|
+
isValueEmpty(value) {
|
|
119
|
+
const { mode } = this.properties;
|
|
120
|
+
if (mode === 'selector' || mode === 'date' || mode === 'time' || mode === 'none') {
|
|
121
|
+
return typeof value === 'undefined' || value === '';
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
return (Array.isArray(value) && value.length === 0);
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
// 初始化状态,包括 placeholder, _status
|
|
128
|
+
initStatus(value) {
|
|
129
|
+
const { placeholder } = this.properties;
|
|
130
|
+
if (this.isValueEmpty(value)) {
|
|
131
|
+
this.setData({
|
|
132
|
+
_status: '',
|
|
133
|
+
_statusMessage: '',
|
|
134
|
+
_isEmpty: true,
|
|
135
|
+
_displayName: placeholder,
|
|
136
|
+
_valueIndex: value || ''
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
this.setData({
|
|
141
|
+
_isEmpty: false,
|
|
142
|
+
_status: '',
|
|
143
|
+
_statusMessage: ''
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
initValue() {
|
|
148
|
+
// 根据 value 初始化选项
|
|
149
|
+
const { value, mode, splitKey } = this.properties;
|
|
150
|
+
if ((!Array.isArray(value) && !!value) || (Array.isArray(value) && value.length > 0)) {
|
|
151
|
+
// 如果是 none 模式,则不进行 value 处理,是什么就展示什么
|
|
152
|
+
if (mode === 'none') {
|
|
153
|
+
this.setData({
|
|
154
|
+
_isEmpty: false,
|
|
155
|
+
_readonly: true,
|
|
156
|
+
_displayName: Array.isArray(value) ? value.join('') : value
|
|
157
|
+
});
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (mode === 'selector' || mode === 'multiSelector') {
|
|
161
|
+
if (Array.isArray(value)) {
|
|
162
|
+
if (value.length > 0) {
|
|
163
|
+
this.setValue(value);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
this.setValue(value);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
let _displayName = '';
|
|
172
|
+
if (mode === 'region') {
|
|
173
|
+
if (Array.isArray(value))
|
|
174
|
+
_displayName = value.join(splitKey);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
_displayName = value;
|
|
178
|
+
}
|
|
179
|
+
this.setData({
|
|
180
|
+
_isEmpty: false,
|
|
181
|
+
_valueIndex: value,
|
|
182
|
+
_displayName
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
// 通过 value 来设置 index 和 displayName,单选和复选用
|
|
188
|
+
setValue(value) {
|
|
189
|
+
const { range, splitKey } = this.properties;
|
|
190
|
+
const { _rangeKey } = this.data;
|
|
191
|
+
let _displayName, _valueIndex;
|
|
192
|
+
if (Array.isArray(value)) {
|
|
193
|
+
// 多选
|
|
194
|
+
const displayNameArr = [];
|
|
195
|
+
_valueIndex = value.map((v, rangeIdx) => {
|
|
196
|
+
let findIdx;
|
|
197
|
+
const rangeCol = range[rangeIdx];
|
|
198
|
+
// 获取索引
|
|
199
|
+
rangeCol.some((rangeItem, rangeIdx) => {
|
|
200
|
+
if (rangeItem.value === v) {
|
|
201
|
+
findIdx = rangeIdx;
|
|
202
|
+
displayNameArr.push(rangeItem.displayName || rangeItem[_rangeKey]);
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
return findIdx;
|
|
207
|
+
});
|
|
208
|
+
_displayName = displayNameArr.join(splitKey);
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
// 单选
|
|
212
|
+
range.some((rangeItem, rangeIdx) => {
|
|
213
|
+
if (rangeItem.value === value) {
|
|
214
|
+
_valueIndex = rangeIdx;
|
|
215
|
+
_displayName = rangeItem.displayName || rangeItem[_rangeKey] || rangeItem.value;
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
if (_valueIndex === void 0) {
|
|
221
|
+
console.warn('无法检索到选项,请检查传入的 value 值和 range 值是否对应');
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
this.setData({
|
|
225
|
+
_isEmpty: false,
|
|
226
|
+
_valueIndex,
|
|
227
|
+
_displayName
|
|
228
|
+
});
|
|
229
|
+
},
|
|
230
|
+
handleChange(e) {
|
|
231
|
+
this.initStatus();
|
|
232
|
+
const mode = this.properties.mode;
|
|
233
|
+
if (mode === 'selector' || mode === 'multiSelector') {
|
|
234
|
+
this.triggerRangeChange(e);
|
|
235
|
+
}
|
|
236
|
+
else if (mode === 'time' || mode === 'date') {
|
|
237
|
+
this.triggerDateTimeChange(e);
|
|
238
|
+
}
|
|
239
|
+
else if (mode === 'region') {
|
|
240
|
+
this.triggerRegionChange(e);
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
// 单选和复选的逻辑
|
|
244
|
+
triggerRangeChange(e) {
|
|
245
|
+
const _valueIndex = e.detail.value;
|
|
246
|
+
const { range, splitKey } = this.properties;
|
|
247
|
+
const { _rangeKey } = this.data;
|
|
248
|
+
// 数组
|
|
249
|
+
let _displayName, value, name;
|
|
250
|
+
if (range.length < 1) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
if (Array.isArray(_valueIndex)) {
|
|
254
|
+
name = _valueIndex.map((vidx, index) => {
|
|
255
|
+
const rangeItem = range[index];
|
|
256
|
+
vidx = vidx || 0;
|
|
257
|
+
return rangeItem[vidx] && (rangeItem.displayName || rangeItem[vidx][_rangeKey]);
|
|
258
|
+
});
|
|
259
|
+
value = _valueIndex.map((vidx, index) => {
|
|
260
|
+
const rangeItem = range[index];
|
|
261
|
+
vidx = vidx || 0;
|
|
262
|
+
return rangeItem[vidx] && rangeItem[vidx].value;
|
|
263
|
+
});
|
|
264
|
+
_displayName = name.filter(str => !!str).join(splitKey);
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
_displayName = range[_valueIndex]._displayName || range[_valueIndex][_rangeKey];
|
|
268
|
+
value = range[_valueIndex].value;
|
|
269
|
+
}
|
|
270
|
+
this.setData({
|
|
271
|
+
_isEmpty: false,
|
|
272
|
+
_valueIndex: e.detail.value,
|
|
273
|
+
_displayName
|
|
274
|
+
});
|
|
275
|
+
this.triggerEvent('change', {
|
|
276
|
+
value,
|
|
277
|
+
index: _valueIndex
|
|
278
|
+
});
|
|
279
|
+
},
|
|
280
|
+
// 时间选择器
|
|
281
|
+
triggerDateTimeChange(e) {
|
|
282
|
+
this.setData({
|
|
283
|
+
_isEmpty: false,
|
|
284
|
+
_valueIndex: e.detail.value,
|
|
285
|
+
_displayName: e.detail.value
|
|
286
|
+
});
|
|
287
|
+
this.triggerEvent('change', e.detail);
|
|
288
|
+
},
|
|
289
|
+
// 地区选择器
|
|
290
|
+
triggerRegionChange(e) {
|
|
291
|
+
const valueSet = new Set(e.detail.value);
|
|
292
|
+
// 处理掉重复的,无用的前缀等字符
|
|
293
|
+
const _displayName = Array.from(valueSet)
|
|
294
|
+
.filter((name) => {
|
|
295
|
+
return -1 === ['县', '省直辖县级行政区划'].indexOf(name);
|
|
296
|
+
})
|
|
297
|
+
.join(this.properties.splitKey);
|
|
298
|
+
this.setData({
|
|
299
|
+
_isEmpty: false,
|
|
300
|
+
_valueIndex: e.detail.value,
|
|
301
|
+
_displayName
|
|
302
|
+
});
|
|
303
|
+
this.triggerEvent('change', e.detail);
|
|
304
|
+
},
|
|
305
|
+
// 列变化
|
|
306
|
+
triggerColumnchange(e) {
|
|
307
|
+
const { range } = this.properties;
|
|
308
|
+
const { _valueIndex } = this.data;
|
|
309
|
+
// 根据列变化,得到修改后的值
|
|
310
|
+
const { column, value: index } = e.detail;
|
|
311
|
+
const value = range[column][index].value;
|
|
312
|
+
_valueIndex[column] = index;
|
|
313
|
+
for (let i = column + 1; i < range.length; i++) {
|
|
314
|
+
_valueIndex[i] = 0;
|
|
315
|
+
}
|
|
316
|
+
this.setData({ _valueIndex });
|
|
317
|
+
this.triggerEvent('columnchange', {
|
|
318
|
+
column, index, value
|
|
319
|
+
});
|
|
320
|
+
},
|
|
321
|
+
triggerCancel(e) {
|
|
322
|
+
this.triggerEvent('cancel', e.detail);
|
|
323
|
+
},
|
|
324
|
+
handleActionTap(e) {
|
|
325
|
+
this.triggerEvent('actionTap', e.detail);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"component": true,
|
|
3
|
-
"usingComponents": {
|
|
4
|
-
"g-form-item": "../g-form-item/index",
|
|
5
|
-
"g-dropdown": "../g-dropdown/index"
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"component": true,
|
|
3
|
+
"usingComponents": {
|
|
4
|
+
"g-form-item": "../g-form-item/index",
|
|
5
|
+
"g-dropdown": "../g-dropdown/index"
|
|
6
|
+
}
|
|
7
7
|
}
|