weapps-plugin-jingtong-verify 1.6.1 → 1.6.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/app.json +33 -33
- package/package.json +20 -20
- package/sdk.js +313 -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/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 +179 -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 +236 -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 +206 -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 +39 -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 +9 -9
- package/weapps-plugin-jingtong-verify/components/tip-modal/tip-modal.wxss +51 -51
- 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 +262 -262
- 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 +1557 -1547
- package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.json +17 -17
- package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxml +504 -504
- package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxss +133 -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-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/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 +120 -120
- 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 +865 -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 +328 -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/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 +1 -1
- package/weapps-plugin-jingtong-verify/utils/rules.js +301 -301
- package/weapps-plugin-jingtong-verify/utils/tifadmin_config.js +61 -61
- package/weapps-plugin-jingtong-verify/utils/validate.js +772 -772
|
@@ -1,92 +1,92 @@
|
|
|
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
|
-
// 缓存数据
|
|
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
|
-
slot: Boolean,
|
|
19
|
-
label: String,
|
|
20
|
-
value: {
|
|
21
|
-
type: String,
|
|
22
|
-
value: '',
|
|
23
|
-
observer(newValue, oldValue) {
|
|
24
|
-
this.resetStatus();
|
|
25
|
-
if (newValue && newValue !== oldValue) {
|
|
26
|
-
this.validateValue.bind(this);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
placeholder: {
|
|
31
|
-
type: String,
|
|
32
|
-
value: '请输入'
|
|
33
|
-
},
|
|
34
|
-
disabled: Boolean,
|
|
35
|
-
icon: String,
|
|
36
|
-
actionText: String
|
|
37
|
-
},
|
|
38
|
-
data: {
|
|
39
|
-
_status: '',
|
|
40
|
-
_value: '',
|
|
41
|
-
_statusMessage: ''
|
|
42
|
-
},
|
|
43
|
-
methods: {
|
|
44
|
-
getFormNode() {
|
|
45
|
-
const form = this.getRelationNodes('../g-form/index');
|
|
46
|
-
return form && form[0];
|
|
47
|
-
},
|
|
48
|
-
// 重置状态
|
|
49
|
-
resetStatus() {
|
|
50
|
-
this.setData({
|
|
51
|
-
_status: '',
|
|
52
|
-
_statusMessage: ''
|
|
53
|
-
});
|
|
54
|
-
},
|
|
55
|
-
// 内部校验 input
|
|
56
|
-
validateValue() {
|
|
57
|
-
if (!this.id) {
|
|
58
|
-
throw new Error('请提供需要校验的组件 ID');
|
|
59
|
-
}
|
|
60
|
-
const formData = { [this.id]: this.properties.value };
|
|
61
|
-
const { rules = {}, validateType = {} } = this.getFormNode().properties;
|
|
62
|
-
// 根据校验规则,有错误显示状态,无错误重置状态
|
|
63
|
-
validator(formData, rules, validateType).then((errorArr) => {
|
|
64
|
-
console.log('form-field validate: ', formData, rules, errorArr);
|
|
65
|
-
if (errorArr.length > 0) {
|
|
66
|
-
this.setData({
|
|
67
|
-
_status: 'warn',
|
|
68
|
-
_statusMessage: errorArr[0].message
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
this.resetStatus();
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
},
|
|
76
|
-
// clear
|
|
77
|
-
handleTapClear(e) {
|
|
78
|
-
const { disabled } = this.properties;
|
|
79
|
-
if (disabled)
|
|
80
|
-
return false;
|
|
81
|
-
},
|
|
82
|
-
// tap info
|
|
83
|
-
handleTapIcon() {
|
|
84
|
-
const { icon } = this.properties;
|
|
85
|
-
this.triggerEvent('iconTap', { type: icon });
|
|
86
|
-
},
|
|
87
|
-
// action tap
|
|
88
|
-
handleActionTap(e) {
|
|
89
|
-
this.triggerEvent('actionTap', e.detail);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
});
|
|
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
|
+
// 缓存数据
|
|
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
|
+
slot: Boolean,
|
|
19
|
+
label: String,
|
|
20
|
+
value: {
|
|
21
|
+
type: String,
|
|
22
|
+
value: '',
|
|
23
|
+
observer(newValue, oldValue) {
|
|
24
|
+
this.resetStatus();
|
|
25
|
+
if (newValue && newValue !== oldValue) {
|
|
26
|
+
this.validateValue.bind(this);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
placeholder: {
|
|
31
|
+
type: String,
|
|
32
|
+
value: '请输入'
|
|
33
|
+
},
|
|
34
|
+
disabled: Boolean,
|
|
35
|
+
icon: String,
|
|
36
|
+
actionText: String
|
|
37
|
+
},
|
|
38
|
+
data: {
|
|
39
|
+
_status: '',
|
|
40
|
+
_value: '',
|
|
41
|
+
_statusMessage: ''
|
|
42
|
+
},
|
|
43
|
+
methods: {
|
|
44
|
+
getFormNode() {
|
|
45
|
+
const form = this.getRelationNodes('../g-form/index');
|
|
46
|
+
return form && form[0];
|
|
47
|
+
},
|
|
48
|
+
// 重置状态
|
|
49
|
+
resetStatus() {
|
|
50
|
+
this.setData({
|
|
51
|
+
_status: '',
|
|
52
|
+
_statusMessage: ''
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
// 内部校验 input
|
|
56
|
+
validateValue() {
|
|
57
|
+
if (!this.id) {
|
|
58
|
+
throw new Error('请提供需要校验的组件 ID');
|
|
59
|
+
}
|
|
60
|
+
const formData = { [this.id]: this.properties.value };
|
|
61
|
+
const { rules = {}, validateType = {} } = this.getFormNode().properties;
|
|
62
|
+
// 根据校验规则,有错误显示状态,无错误重置状态
|
|
63
|
+
validator(formData, rules, validateType).then((errorArr) => {
|
|
64
|
+
console.log('form-field validate: ', formData, rules, errorArr);
|
|
65
|
+
if (errorArr.length > 0) {
|
|
66
|
+
this.setData({
|
|
67
|
+
_status: 'warn',
|
|
68
|
+
_statusMessage: errorArr[0].message
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this.resetStatus();
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
// clear
|
|
77
|
+
handleTapClear(e) {
|
|
78
|
+
const { disabled } = this.properties;
|
|
79
|
+
if (disabled)
|
|
80
|
+
return false;
|
|
81
|
+
},
|
|
82
|
+
// tap info
|
|
83
|
+
handleTapIcon() {
|
|
84
|
+
const { icon } = this.properties;
|
|
85
|
+
this.triggerEvent('iconTap', { type: icon });
|
|
86
|
+
},
|
|
87
|
+
// action tap
|
|
88
|
+
handleActionTap(e) {
|
|
89
|
+
this.triggerEvent('actionTap', e.detail);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"component": true,
|
|
3
|
-
"usingComponents": {
|
|
4
|
-
"g-form-item": "../g-form-item/index",
|
|
5
|
-
"g-icon": "../g-icon/index"
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"component": true,
|
|
3
|
+
"usingComponents": {
|
|
4
|
+
"g-form-item": "../g-form-item/index",
|
|
5
|
+
"g-icon": "../g-icon/index"
|
|
6
|
+
}
|
|
7
7
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<!--pages/g-input/index.wxml-->
|
|
2
|
-
<g-form-item label="{{label}}" disabled="{{disabled}}" status="{{_status}}" statusMessage="{{_statusMessage}}">
|
|
3
|
-
<view wx:if="{{slot}}">
|
|
4
|
-
<slot />
|
|
5
|
-
</view>
|
|
6
|
-
<view wx:else>
|
|
7
|
-
<view class="picker">
|
|
8
|
-
<view class="picker__value {{!value ? 'picker__value--placeholder': ''}} {{disabled ? 'picker__value--disabled' : ''}}">{{value || placeholder}}</view>
|
|
9
|
-
<view class="picker__action" wx:if="{{actionText}}" bind:tap="handleActionTap">{{actionText}}</view>
|
|
10
|
-
</view>
|
|
11
|
-
</view>
|
|
12
|
-
</g-form-item>
|
|
1
|
+
<!--pages/g-input/index.wxml-->
|
|
2
|
+
<g-form-item label="{{label}}" disabled="{{disabled}}" status="{{_status}}" statusMessage="{{_statusMessage}}">
|
|
3
|
+
<view wx:if="{{slot}}">
|
|
4
|
+
<slot />
|
|
5
|
+
</view>
|
|
6
|
+
<view wx:else>
|
|
7
|
+
<view class="picker">
|
|
8
|
+
<view class="picker__value {{!value ? 'picker__value--placeholder': ''}} {{disabled ? 'picker__value--disabled' : ''}}">{{value || placeholder}}</view>
|
|
9
|
+
<view class="picker__action" wx:if="{{actionText}}" bind:tap="handleActionTap">{{actionText}}</view>
|
|
10
|
+
</view>
|
|
11
|
+
</view>
|
|
12
|
+
</g-form-item>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@import '../static/style/components/g-picker';
|
|
2
|
-
@import '../static/style/components/g-form-cell';
|
|
1
|
+
@import '../static/style/components/g-picker';
|
|
2
|
+
@import '../static/style/components/g-form-cell';
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
// pages/g-form-item/index.js
|
|
2
|
-
const platform = wx.getSystemInfoSync().brand.toLowerCase();
|
|
3
|
-
Component({
|
|
4
|
-
__timer__: undefined,
|
|
5
|
-
externalClasses: ['component-class', 'static-item-class'],
|
|
6
|
-
properties: {
|
|
7
|
-
showQuestion: Boolean,
|
|
8
|
-
label: String,
|
|
9
|
-
disabled: Boolean,
|
|
10
|
-
required: Boolean,
|
|
11
|
-
status: {
|
|
12
|
-
type: String,
|
|
13
|
-
observer(_status) {
|
|
14
|
-
// 处理 iPhone 平台的问题
|
|
15
|
-
if (platform === 'iphone') {
|
|
16
|
-
// 先清除原有的定时器,再开新的定时器
|
|
17
|
-
if (this.__timer__)
|
|
18
|
-
clearTimeout(this.__timer__);
|
|
19
|
-
this.__timer__ = setTimeout(() => {
|
|
20
|
-
this.setData({ _status });
|
|
21
|
-
this.__timer__ = undefined;
|
|
22
|
-
}, 500);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
this.setData({ _status });
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
statusMessage: {
|
|
30
|
-
type: String,
|
|
31
|
-
value: '输入有误,请检查后重试',
|
|
32
|
-
observer(_statusMessage = '输入有误,请检查后重试') {
|
|
33
|
-
this.setData({ _statusMessage });
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
data: {
|
|
38
|
-
_status: '',
|
|
39
|
-
_statusMessage: ''
|
|
40
|
-
},
|
|
41
|
-
/**
|
|
42
|
-
* 组件的方法列表
|
|
43
|
-
*/
|
|
44
|
-
methods: {
|
|
45
|
-
showTip() {
|
|
46
|
-
this.triggerEvent('showQuestionTip')
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
});
|
|
1
|
+
// pages/g-form-item/index.js
|
|
2
|
+
const platform = wx.getSystemInfoSync().brand.toLowerCase();
|
|
3
|
+
Component({
|
|
4
|
+
__timer__: undefined,
|
|
5
|
+
externalClasses: ['component-class', 'static-item-class'],
|
|
6
|
+
properties: {
|
|
7
|
+
showQuestion: Boolean,
|
|
8
|
+
label: String,
|
|
9
|
+
disabled: Boolean,
|
|
10
|
+
required: Boolean,
|
|
11
|
+
status: {
|
|
12
|
+
type: String,
|
|
13
|
+
observer(_status) {
|
|
14
|
+
// 处理 iPhone 平台的问题
|
|
15
|
+
if (platform === 'iphone') {
|
|
16
|
+
// 先清除原有的定时器,再开新的定时器
|
|
17
|
+
if (this.__timer__)
|
|
18
|
+
clearTimeout(this.__timer__);
|
|
19
|
+
this.__timer__ = setTimeout(() => {
|
|
20
|
+
this.setData({ _status });
|
|
21
|
+
this.__timer__ = undefined;
|
|
22
|
+
}, 500);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
this.setData({ _status });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
statusMessage: {
|
|
30
|
+
type: String,
|
|
31
|
+
value: '输入有误,请检查后重试',
|
|
32
|
+
observer(_statusMessage = '输入有误,请检查后重试') {
|
|
33
|
+
this.setData({ _statusMessage });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
data: {
|
|
38
|
+
_status: '',
|
|
39
|
+
_statusMessage: ''
|
|
40
|
+
},
|
|
41
|
+
/**
|
|
42
|
+
* 组件的方法列表
|
|
43
|
+
*/
|
|
44
|
+
methods: {
|
|
45
|
+
showTip() {
|
|
46
|
+
this.triggerEvent('showQuestionTip')
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"component": true,
|
|
3
|
-
"usingComponents": {}
|
|
1
|
+
{
|
|
2
|
+
"component": true,
|
|
3
|
+
"usingComponents": {}
|
|
4
4
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
<!--pages/g-form-item/index.wxml-->
|
|
2
|
-
<view class="form-item {{_status ? 'form-item--' + status : ''}} component-class static-item-class no-border-class">
|
|
3
|
-
<view class="form-item__wrap {{disabled ? 'form-item__wrap--disabled' : ''}}">
|
|
4
|
-
<view class="flex-row-start form-item__label" wx:if="{{label}}" aria-label="{{label}}">
|
|
5
|
-
<text>{{label}}</text>
|
|
6
|
-
<text class="star" wx:if="{{ required }}">*</text>
|
|
7
|
-
<image src="../../../images/question.png" mode="widthFix" catch:tap="showTip" class="question-icon" wx:if="{{ showQuestion }}" />
|
|
8
|
-
</view>
|
|
9
|
-
<slot />
|
|
10
|
-
</view>
|
|
11
|
-
</view>
|
|
12
|
-
<view wx:if="{{_status}}" class="form-item__status-message {{_status ? 'form-item__status-message--' + status : ''}}">
|
|
13
|
-
{{_statusMessage}}
|
|
14
|
-
</view>
|
|
1
|
+
<!--pages/g-form-item/index.wxml-->
|
|
2
|
+
<view class="form-item {{_status ? 'form-item--' + status : ''}} component-class static-item-class no-border-class">
|
|
3
|
+
<view class="form-item__wrap {{disabled ? 'form-item__wrap--disabled' : ''}}">
|
|
4
|
+
<view class="flex-row-start form-item__label" wx:if="{{label}}" aria-label="{{label}}">
|
|
5
|
+
<text>{{label}}</text>
|
|
6
|
+
<text class="star" wx:if="{{ required }}">*</text>
|
|
7
|
+
<image src="../../../images/question.png" mode="widthFix" catch:tap="showTip" class="question-icon" wx:if="{{ showQuestion }}" />
|
|
8
|
+
</view>
|
|
9
|
+
<slot />
|
|
10
|
+
</view>
|
|
11
|
+
</view>
|
|
12
|
+
<view wx:if="{{_status}}" class="form-item__status-message {{_status ? 'form-item__status-message--' + status : ''}}">
|
|
13
|
+
{{_statusMessage}}
|
|
14
|
+
</view>
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
// pages/g-icon/index.js
|
|
2
|
-
let iconType;
|
|
3
|
-
Component({
|
|
4
|
-
properties: {
|
|
5
|
-
type: {
|
|
6
|
-
type: String,
|
|
7
|
-
value: iconType
|
|
8
|
-
},
|
|
9
|
-
spin: {
|
|
10
|
-
type: Boolean,
|
|
11
|
-
value: false
|
|
12
|
-
},
|
|
13
|
-
color: {
|
|
14
|
-
type: String,
|
|
15
|
-
value: '',
|
|
16
|
-
observer(value) {
|
|
17
|
-
let color = value;
|
|
18
|
-
if (value === 'primary') {
|
|
19
|
-
color = '#C02C38';
|
|
20
|
-
}
|
|
21
|
-
this.setData({ _color: color });
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
size: {
|
|
25
|
-
type: Number,
|
|
26
|
-
value: 36
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
data: {
|
|
30
|
-
_color: ''
|
|
31
|
-
},
|
|
32
|
-
methods: {}
|
|
33
|
-
});
|
|
1
|
+
// pages/g-icon/index.js
|
|
2
|
+
let iconType;
|
|
3
|
+
Component({
|
|
4
|
+
properties: {
|
|
5
|
+
type: {
|
|
6
|
+
type: String,
|
|
7
|
+
value: iconType
|
|
8
|
+
},
|
|
9
|
+
spin: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
value: false
|
|
12
|
+
},
|
|
13
|
+
color: {
|
|
14
|
+
type: String,
|
|
15
|
+
value: '',
|
|
16
|
+
observer(value) {
|
|
17
|
+
let color = value;
|
|
18
|
+
if (value === 'primary') {
|
|
19
|
+
color = '#C02C38';
|
|
20
|
+
}
|
|
21
|
+
this.setData({ _color: color });
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
size: {
|
|
25
|
+
type: Number,
|
|
26
|
+
value: 36
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
data: {
|
|
30
|
+
_color: ''
|
|
31
|
+
},
|
|
32
|
+
methods: {}
|
|
33
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"component": true,
|
|
3
|
-
"usingComponents": {}
|
|
1
|
+
{
|
|
2
|
+
"component": true,
|
|
3
|
+
"usingComponents": {}
|
|
4
4
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<!--pages/g-icon/index.wxml-->
|
|
2
|
-
<view class="g-icon g-icon-{{type}}" style="font-size: {{size}}rpx; {{_color ? 'color: ' + _color : ''}}" />
|
|
1
|
+
<!--pages/g-icon/index.wxml-->
|
|
2
|
+
<view class="g-icon g-icon-{{type}}" style="font-size: {{size}}rpx; {{_color ? 'color: ' + _color : ''}}" />
|