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,26 +1,26 @@
|
|
|
1
|
-
<!--pages/g-picker/index.wxml-->
|
|
2
|
-
|
|
3
|
-
<picker mode="{{mode}}" range="{{range}}" range-key="{{_rangeKey}}"
|
|
4
|
-
start="{{start}}" end="{{end}}" fields="{{fields}}"
|
|
5
|
-
disabled="{{disabled || _readonly}}" value="{{_valueIndex}}"
|
|
6
|
-
custom-item="{{customItem}}"
|
|
7
|
-
bindchange="handleChange"
|
|
8
|
-
bindcancel="triggerCancel"
|
|
9
|
-
bindcolumnchange="triggerColumnchange"
|
|
10
|
-
>
|
|
11
|
-
<view wx:if="{{type === 'formItem'}}">
|
|
12
|
-
<g-form-item label="{{label}}" disabled="{{disabled}}" status="{{_status}}" statusMessage="{{_statusMessage}}" required="{{ _required }}">
|
|
13
|
-
<view class="picker">
|
|
14
|
-
<view class="picker__value {{_isEmpty ? 'picker__value--placeholder': ''}} {{disabled ? 'picker__value--disabled' : ''}}">{{_displayName}}</view>
|
|
15
|
-
<view class="picker__action" bind:tap="handleActionTap">{{actionText}}</view>
|
|
16
|
-
</view>
|
|
17
|
-
</g-form-item>
|
|
18
|
-
</view>
|
|
19
|
-
<view wx:elif="{{type === 'dropdown'}}">
|
|
20
|
-
<g-dropdown>
|
|
21
|
-
<view class="dropdown dropdown-class {{_isEmpty ? 'picker__value--placeholder': ''}} {{disabled ? 'picker__value--disabled' : ''}}">
|
|
22
|
-
{{_displayName}}
|
|
23
|
-
</view>
|
|
24
|
-
</g-dropdown>
|
|
25
|
-
</view>
|
|
26
|
-
</picker>
|
|
1
|
+
<!--pages/g-picker/index.wxml-->
|
|
2
|
+
|
|
3
|
+
<picker mode="{{mode}}" range="{{range}}" range-key="{{_rangeKey}}"
|
|
4
|
+
start="{{start}}" end="{{end}}" fields="{{fields}}"
|
|
5
|
+
disabled="{{disabled || _readonly}}" value="{{_valueIndex}}"
|
|
6
|
+
custom-item="{{customItem}}"
|
|
7
|
+
bindchange="handleChange"
|
|
8
|
+
bindcancel="triggerCancel"
|
|
9
|
+
bindcolumnchange="triggerColumnchange"
|
|
10
|
+
>
|
|
11
|
+
<view wx:if="{{type === 'formItem'}}">
|
|
12
|
+
<g-form-item label="{{label}}" disabled="{{disabled}}" status="{{_status}}" statusMessage="{{_statusMessage}}" required="{{ _required }}">
|
|
13
|
+
<view class="picker">
|
|
14
|
+
<view class="picker__value {{_isEmpty ? 'picker__value--placeholder': ''}} {{disabled ? 'picker__value--disabled' : ''}}">{{_displayName}}</view>
|
|
15
|
+
<view class="picker__action" bind:tap="handleActionTap">{{actionText}}</view>
|
|
16
|
+
</view>
|
|
17
|
+
</g-form-item>
|
|
18
|
+
</view>
|
|
19
|
+
<view wx:elif="{{type === 'dropdown'}}">
|
|
20
|
+
<g-dropdown>
|
|
21
|
+
<view class="dropdown dropdown-class {{_isEmpty ? 'picker__value--placeholder': ''}} {{disabled ? 'picker__value--disabled' : ''}}">
|
|
22
|
+
{{_displayName}}
|
|
23
|
+
</view>
|
|
24
|
+
</g-dropdown>
|
|
25
|
+
</view>
|
|
26
|
+
</picker>
|
|
@@ -1,159 +1,159 @@
|
|
|
1
|
-
// pages/g-popover/index.js
|
|
2
|
-
const winHeight = wx.getSystemInfoSync().windowHeight;
|
|
3
|
-
const winWidth = wx.getSystemInfoSync().windowWidth;
|
|
4
|
-
const getPlacements = (rects, placement = 'top') => {
|
|
5
|
-
const [pBox, pItem] = rects;
|
|
6
|
-
const offsetY = 10;
|
|
7
|
-
const offsetX = 2;
|
|
8
|
-
const centerX = (pItem.width - pBox.width) / 2;
|
|
9
|
-
const centerY = (pItem.height - pBox.height) / 2;
|
|
10
|
-
switch (placement) {
|
|
11
|
-
case 'top':
|
|
12
|
-
return {
|
|
13
|
-
top: -pBox.height - offsetY,
|
|
14
|
-
left: centerX,
|
|
15
|
-
right: 0
|
|
16
|
-
};
|
|
17
|
-
case 'topLeft':
|
|
18
|
-
return {
|
|
19
|
-
top: -pBox.height - offsetY,
|
|
20
|
-
left: offsetX,
|
|
21
|
-
right: 0
|
|
22
|
-
};
|
|
23
|
-
case 'topRight':
|
|
24
|
-
return {
|
|
25
|
-
top: -pBox.height - offsetY,
|
|
26
|
-
left: 0,
|
|
27
|
-
right: offsetX
|
|
28
|
-
};
|
|
29
|
-
case 'bottom':
|
|
30
|
-
return {
|
|
31
|
-
top: pItem.height + offsetY,
|
|
32
|
-
left: centerX,
|
|
33
|
-
right: 0
|
|
34
|
-
};
|
|
35
|
-
case 'bottomLeft':
|
|
36
|
-
return {
|
|
37
|
-
top: pItem.height + offsetY,
|
|
38
|
-
left: offsetX,
|
|
39
|
-
right: 0
|
|
40
|
-
};
|
|
41
|
-
case 'bottomRight':
|
|
42
|
-
return {
|
|
43
|
-
top: pItem.height + offsetY,
|
|
44
|
-
left: 0,
|
|
45
|
-
right: offsetX
|
|
46
|
-
};
|
|
47
|
-
case 'left':
|
|
48
|
-
return {
|
|
49
|
-
top: centerY,
|
|
50
|
-
left: -pBox.width - offsetY,
|
|
51
|
-
right: 0
|
|
52
|
-
};
|
|
53
|
-
case 'leftTop':
|
|
54
|
-
return {
|
|
55
|
-
top: offsetX,
|
|
56
|
-
left: -pBox.width - offsetY,
|
|
57
|
-
right: 0
|
|
58
|
-
};
|
|
59
|
-
case 'leftBottom':
|
|
60
|
-
return {
|
|
61
|
-
top: pItem.height - pBox.height,
|
|
62
|
-
left: -pBox.width - offsetY,
|
|
63
|
-
right: 0
|
|
64
|
-
};
|
|
65
|
-
case 'right':
|
|
66
|
-
return {
|
|
67
|
-
top: centerY,
|
|
68
|
-
left: pItem.width + offsetY,
|
|
69
|
-
right: 0
|
|
70
|
-
};
|
|
71
|
-
case 'rightTop':
|
|
72
|
-
return {
|
|
73
|
-
top: offsetX,
|
|
74
|
-
left: pItem.width + offsetY,
|
|
75
|
-
right: 0
|
|
76
|
-
};
|
|
77
|
-
case 'rightBottom':
|
|
78
|
-
return {
|
|
79
|
-
top: pItem.height - pBox.height,
|
|
80
|
-
left: pItem.width + offsetY,
|
|
81
|
-
right: 0
|
|
82
|
-
};
|
|
83
|
-
default:
|
|
84
|
-
return {
|
|
85
|
-
top: -pBox.height - offsetY,
|
|
86
|
-
left: centerX,
|
|
87
|
-
right: 0
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
Component({
|
|
92
|
-
options: {
|
|
93
|
-
multipleSlots: true
|
|
94
|
-
},
|
|
95
|
-
properties: {
|
|
96
|
-
content: {
|
|
97
|
-
type: String,
|
|
98
|
-
value: 'tips'
|
|
99
|
-
},
|
|
100
|
-
placement: {
|
|
101
|
-
type: String,
|
|
102
|
-
value: 'top',
|
|
103
|
-
},
|
|
104
|
-
visible: {
|
|
105
|
-
type: Boolean,
|
|
106
|
-
value: false,
|
|
107
|
-
},
|
|
108
|
-
position: {
|
|
109
|
-
type: String,
|
|
110
|
-
value: 'static'
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
data: {
|
|
114
|
-
_popVisible: false,
|
|
115
|
-
_popoStyle: ''
|
|
116
|
-
},
|
|
117
|
-
ready() {
|
|
118
|
-
if (this.data.visible) {
|
|
119
|
-
this.onShow();
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
methods: {
|
|
123
|
-
onShow() {
|
|
124
|
-
const query = wx.createSelectorQuery().in(this);
|
|
125
|
-
query.select('.popBox').boundingClientRect();
|
|
126
|
-
query.select('.popoverItem').boundingClientRect();
|
|
127
|
-
query.exec((rects) => {
|
|
128
|
-
if (rects.filter((n) => !n).length)
|
|
129
|
-
return;
|
|
130
|
-
const placements = getPlacements(rects, this.data.placement);
|
|
131
|
-
const _popoStyle = `
|
|
132
|
-
top: ${placements.top}px;
|
|
133
|
-
${placements.left ? `left: ${placements.left}px;` : ''}
|
|
134
|
-
${placements.right ? `right: ${placements.right}px;` : ''}
|
|
135
|
-
`;
|
|
136
|
-
this.setData({
|
|
137
|
-
_popoStyle,
|
|
138
|
-
_popVisible: true
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
},
|
|
142
|
-
onTap() {
|
|
143
|
-
if (!this.data.visible) { // 显示
|
|
144
|
-
this.setData({
|
|
145
|
-
visible: true,
|
|
146
|
-
_popVisible: false
|
|
147
|
-
}, () => {
|
|
148
|
-
this.onShow();
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
this.setData({
|
|
153
|
-
visible: false,
|
|
154
|
-
_popVisible: false
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
});
|
|
1
|
+
// pages/g-popover/index.js
|
|
2
|
+
const winHeight = wx.getSystemInfoSync().windowHeight;
|
|
3
|
+
const winWidth = wx.getSystemInfoSync().windowWidth;
|
|
4
|
+
const getPlacements = (rects, placement = 'top') => {
|
|
5
|
+
const [pBox, pItem] = rects;
|
|
6
|
+
const offsetY = 10;
|
|
7
|
+
const offsetX = 2;
|
|
8
|
+
const centerX = (pItem.width - pBox.width) / 2;
|
|
9
|
+
const centerY = (pItem.height - pBox.height) / 2;
|
|
10
|
+
switch (placement) {
|
|
11
|
+
case 'top':
|
|
12
|
+
return {
|
|
13
|
+
top: -pBox.height - offsetY,
|
|
14
|
+
left: centerX,
|
|
15
|
+
right: 0
|
|
16
|
+
};
|
|
17
|
+
case 'topLeft':
|
|
18
|
+
return {
|
|
19
|
+
top: -pBox.height - offsetY,
|
|
20
|
+
left: offsetX,
|
|
21
|
+
right: 0
|
|
22
|
+
};
|
|
23
|
+
case 'topRight':
|
|
24
|
+
return {
|
|
25
|
+
top: -pBox.height - offsetY,
|
|
26
|
+
left: 0,
|
|
27
|
+
right: offsetX
|
|
28
|
+
};
|
|
29
|
+
case 'bottom':
|
|
30
|
+
return {
|
|
31
|
+
top: pItem.height + offsetY,
|
|
32
|
+
left: centerX,
|
|
33
|
+
right: 0
|
|
34
|
+
};
|
|
35
|
+
case 'bottomLeft':
|
|
36
|
+
return {
|
|
37
|
+
top: pItem.height + offsetY,
|
|
38
|
+
left: offsetX,
|
|
39
|
+
right: 0
|
|
40
|
+
};
|
|
41
|
+
case 'bottomRight':
|
|
42
|
+
return {
|
|
43
|
+
top: pItem.height + offsetY,
|
|
44
|
+
left: 0,
|
|
45
|
+
right: offsetX
|
|
46
|
+
};
|
|
47
|
+
case 'left':
|
|
48
|
+
return {
|
|
49
|
+
top: centerY,
|
|
50
|
+
left: -pBox.width - offsetY,
|
|
51
|
+
right: 0
|
|
52
|
+
};
|
|
53
|
+
case 'leftTop':
|
|
54
|
+
return {
|
|
55
|
+
top: offsetX,
|
|
56
|
+
left: -pBox.width - offsetY,
|
|
57
|
+
right: 0
|
|
58
|
+
};
|
|
59
|
+
case 'leftBottom':
|
|
60
|
+
return {
|
|
61
|
+
top: pItem.height - pBox.height,
|
|
62
|
+
left: -pBox.width - offsetY,
|
|
63
|
+
right: 0
|
|
64
|
+
};
|
|
65
|
+
case 'right':
|
|
66
|
+
return {
|
|
67
|
+
top: centerY,
|
|
68
|
+
left: pItem.width + offsetY,
|
|
69
|
+
right: 0
|
|
70
|
+
};
|
|
71
|
+
case 'rightTop':
|
|
72
|
+
return {
|
|
73
|
+
top: offsetX,
|
|
74
|
+
left: pItem.width + offsetY,
|
|
75
|
+
right: 0
|
|
76
|
+
};
|
|
77
|
+
case 'rightBottom':
|
|
78
|
+
return {
|
|
79
|
+
top: pItem.height - pBox.height,
|
|
80
|
+
left: pItem.width + offsetY,
|
|
81
|
+
right: 0
|
|
82
|
+
};
|
|
83
|
+
default:
|
|
84
|
+
return {
|
|
85
|
+
top: -pBox.height - offsetY,
|
|
86
|
+
left: centerX,
|
|
87
|
+
right: 0
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
Component({
|
|
92
|
+
options: {
|
|
93
|
+
multipleSlots: true
|
|
94
|
+
},
|
|
95
|
+
properties: {
|
|
96
|
+
content: {
|
|
97
|
+
type: String,
|
|
98
|
+
value: 'tips'
|
|
99
|
+
},
|
|
100
|
+
placement: {
|
|
101
|
+
type: String,
|
|
102
|
+
value: 'top',
|
|
103
|
+
},
|
|
104
|
+
visible: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
value: false,
|
|
107
|
+
},
|
|
108
|
+
position: {
|
|
109
|
+
type: String,
|
|
110
|
+
value: 'static'
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
data: {
|
|
114
|
+
_popVisible: false,
|
|
115
|
+
_popoStyle: ''
|
|
116
|
+
},
|
|
117
|
+
ready() {
|
|
118
|
+
if (this.data.visible) {
|
|
119
|
+
this.onShow();
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
methods: {
|
|
123
|
+
onShow() {
|
|
124
|
+
const query = wx.createSelectorQuery().in(this);
|
|
125
|
+
query.select('.popBox').boundingClientRect();
|
|
126
|
+
query.select('.popoverItem').boundingClientRect();
|
|
127
|
+
query.exec((rects) => {
|
|
128
|
+
if (rects.filter((n) => !n).length)
|
|
129
|
+
return;
|
|
130
|
+
const placements = getPlacements(rects, this.data.placement);
|
|
131
|
+
const _popoStyle = `
|
|
132
|
+
top: ${placements.top}px;
|
|
133
|
+
${placements.left ? `left: ${placements.left}px;` : ''}
|
|
134
|
+
${placements.right ? `right: ${placements.right}px;` : ''}
|
|
135
|
+
`;
|
|
136
|
+
this.setData({
|
|
137
|
+
_popoStyle,
|
|
138
|
+
_popVisible: true
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
onTap() {
|
|
143
|
+
if (!this.data.visible) { // 显示
|
|
144
|
+
this.setData({
|
|
145
|
+
visible: true,
|
|
146
|
+
_popVisible: false
|
|
147
|
+
}, () => {
|
|
148
|
+
this.onShow();
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
this.setData({
|
|
153
|
+
visible: false,
|
|
154
|
+
_popVisible: false
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"component": true,
|
|
3
|
-
"usingComponents": {}
|
|
1
|
+
{
|
|
2
|
+
"component": true,
|
|
3
|
+
"usingComponents": {}
|
|
4
4
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<!-- 组件模板 -->
|
|
2
|
-
<view style="position: {{position}};">
|
|
3
|
-
<view class="container" bind:tap="onTap">
|
|
4
|
-
<view wx:if="{{visible && content}}" class="popBox {{placement}} {{_popVisible? 'show': 'hide'}}" style="{{_popoStyle}}">
|
|
5
|
-
<view class="contentStyle">{{content}}</view>
|
|
6
|
-
</view>
|
|
7
|
-
<view class="popoverItem">
|
|
8
|
-
<slot></slot>
|
|
9
|
-
</view>
|
|
10
|
-
</view>
|
|
1
|
+
<!-- 组件模板 -->
|
|
2
|
+
<view style="position: {{position}};">
|
|
3
|
+
<view class="container" bind:tap="onTap">
|
|
4
|
+
<view wx:if="{{visible && content}}" class="popBox {{placement}} {{_popVisible? 'show': 'hide'}}" style="{{_popoStyle}}">
|
|
5
|
+
<view class="contentStyle">{{content}}</view>
|
|
6
|
+
</view>
|
|
7
|
+
<view class="popoverItem">
|
|
8
|
+
<slot></slot>
|
|
9
|
+
</view>
|
|
10
|
+
</view>
|
|
11
11
|
</view>
|
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// pages/g-search/index.js
|
|
4
|
-
const Event = require("../../gsd-lib/event/index");
|
|
5
|
-
Component({
|
|
6
|
-
properties: {
|
|
7
|
-
value: String,
|
|
8
|
-
autofocus: Boolean,
|
|
9
|
-
placeholder: {
|
|
10
|
-
type: String,
|
|
11
|
-
value: '搜索'
|
|
12
|
-
},
|
|
13
|
-
fill: Boolean,
|
|
14
|
-
withText: Boolean,
|
|
15
|
-
needChoose: Boolean,
|
|
16
|
-
disabled: {
|
|
17
|
-
type: Boolean,
|
|
18
|
-
value: false
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
data: {
|
|
22
|
-
_isSearch: false,
|
|
23
|
-
_focus: false,
|
|
24
|
-
_value: ''
|
|
25
|
-
},
|
|
26
|
-
ready() {
|
|
27
|
-
this.init();
|
|
28
|
-
this.initListener();
|
|
29
|
-
},
|
|
30
|
-
detached() {
|
|
31
|
-
this.removeListener();
|
|
32
|
-
},
|
|
33
|
-
methods: {
|
|
34
|
-
initListener() {
|
|
35
|
-
Event.addEventListener('g-search__blur', () => {
|
|
36
|
-
this.setData({
|
|
37
|
-
_isSearch: false,
|
|
38
|
-
_focus: false
|
|
39
|
-
});
|
|
40
|
-
}, this);
|
|
41
|
-
Event.addEventListener('g-search__focus', () => {
|
|
42
|
-
this.setData({
|
|
43
|
-
_isSearch: true,
|
|
44
|
-
_focus: true
|
|
45
|
-
});
|
|
46
|
-
}, this);
|
|
47
|
-
},
|
|
48
|
-
removeListener() {
|
|
49
|
-
Event.removeSingleEventListener('g-search__blur', () => {
|
|
50
|
-
this.setData({
|
|
51
|
-
_isSearch: false,
|
|
52
|
-
_focus: false
|
|
53
|
-
});
|
|
54
|
-
}, this);
|
|
55
|
-
Event.removeSingleEventListener('g-search__focus', () => {
|
|
56
|
-
this.setData({
|
|
57
|
-
_isSearch: true,
|
|
58
|
-
_focus: true
|
|
59
|
-
});
|
|
60
|
-
}, this);
|
|
61
|
-
},
|
|
62
|
-
init() {
|
|
63
|
-
const { autofocus } = this.properties;
|
|
64
|
-
if (autofocus) {
|
|
65
|
-
this.setData({
|
|
66
|
-
_isSearch: autofocus,
|
|
67
|
-
_focus: autofocus
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
handleInput(e) {
|
|
72
|
-
this.setData({
|
|
73
|
-
_value: e.detail.value,
|
|
74
|
-
value: e.detail.value
|
|
75
|
-
});
|
|
76
|
-
this.triggerEvent('change', e.detail);
|
|
77
|
-
},
|
|
78
|
-
handleConfirm(e) {
|
|
79
|
-
this.setData({ _focus: false });
|
|
80
|
-
this.triggerEvent('confirm', e.detail);
|
|
81
|
-
},
|
|
82
|
-
handleInputFocus(e) {
|
|
83
|
-
this.setData({
|
|
84
|
-
_isSearch: true,
|
|
85
|
-
_focus: true
|
|
86
|
-
});
|
|
87
|
-
this.triggerEvent('focus', e.detail);
|
|
88
|
-
},
|
|
89
|
-
handleBlur(e) {
|
|
90
|
-
this.setData({
|
|
91
|
-
_focus: false,
|
|
92
|
-
});
|
|
93
|
-
this.triggerEvent('blur', e.detail);
|
|
94
|
-
},
|
|
95
|
-
handleClear(e) {
|
|
96
|
-
this.setData({
|
|
97
|
-
_focus: true,
|
|
98
|
-
_value: '',
|
|
99
|
-
value: ''
|
|
100
|
-
});
|
|
101
|
-
this.triggerEvent('change', { value: '' });
|
|
102
|
-
},
|
|
103
|
-
handleCancel(e) {
|
|
104
|
-
this.setData({
|
|
105
|
-
_isSearch: false,
|
|
106
|
-
_value: '',
|
|
107
|
-
value: ''
|
|
108
|
-
});
|
|
109
|
-
this.triggerEvent('cancel', e.detail);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// pages/g-search/index.js
|
|
4
|
+
const Event = require("../../gsd-lib/event/index");
|
|
5
|
+
Component({
|
|
6
|
+
properties: {
|
|
7
|
+
value: String,
|
|
8
|
+
autofocus: Boolean,
|
|
9
|
+
placeholder: {
|
|
10
|
+
type: String,
|
|
11
|
+
value: '搜索'
|
|
12
|
+
},
|
|
13
|
+
fill: Boolean,
|
|
14
|
+
withText: Boolean,
|
|
15
|
+
needChoose: Boolean,
|
|
16
|
+
disabled: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
value: false
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
data: {
|
|
22
|
+
_isSearch: false,
|
|
23
|
+
_focus: false,
|
|
24
|
+
_value: ''
|
|
25
|
+
},
|
|
26
|
+
ready() {
|
|
27
|
+
this.init();
|
|
28
|
+
this.initListener();
|
|
29
|
+
},
|
|
30
|
+
detached() {
|
|
31
|
+
this.removeListener();
|
|
32
|
+
},
|
|
33
|
+
methods: {
|
|
34
|
+
initListener() {
|
|
35
|
+
Event.addEventListener('g-search__blur', () => {
|
|
36
|
+
this.setData({
|
|
37
|
+
_isSearch: false,
|
|
38
|
+
_focus: false
|
|
39
|
+
});
|
|
40
|
+
}, this);
|
|
41
|
+
Event.addEventListener('g-search__focus', () => {
|
|
42
|
+
this.setData({
|
|
43
|
+
_isSearch: true,
|
|
44
|
+
_focus: true
|
|
45
|
+
});
|
|
46
|
+
}, this);
|
|
47
|
+
},
|
|
48
|
+
removeListener() {
|
|
49
|
+
Event.removeSingleEventListener('g-search__blur', () => {
|
|
50
|
+
this.setData({
|
|
51
|
+
_isSearch: false,
|
|
52
|
+
_focus: false
|
|
53
|
+
});
|
|
54
|
+
}, this);
|
|
55
|
+
Event.removeSingleEventListener('g-search__focus', () => {
|
|
56
|
+
this.setData({
|
|
57
|
+
_isSearch: true,
|
|
58
|
+
_focus: true
|
|
59
|
+
});
|
|
60
|
+
}, this);
|
|
61
|
+
},
|
|
62
|
+
init() {
|
|
63
|
+
const { autofocus } = this.properties;
|
|
64
|
+
if (autofocus) {
|
|
65
|
+
this.setData({
|
|
66
|
+
_isSearch: autofocus,
|
|
67
|
+
_focus: autofocus
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
handleInput(e) {
|
|
72
|
+
this.setData({
|
|
73
|
+
_value: e.detail.value,
|
|
74
|
+
value: e.detail.value
|
|
75
|
+
});
|
|
76
|
+
this.triggerEvent('change', e.detail);
|
|
77
|
+
},
|
|
78
|
+
handleConfirm(e) {
|
|
79
|
+
this.setData({ _focus: false });
|
|
80
|
+
this.triggerEvent('confirm', e.detail);
|
|
81
|
+
},
|
|
82
|
+
handleInputFocus(e) {
|
|
83
|
+
this.setData({
|
|
84
|
+
_isSearch: true,
|
|
85
|
+
_focus: true
|
|
86
|
+
});
|
|
87
|
+
this.triggerEvent('focus', e.detail);
|
|
88
|
+
},
|
|
89
|
+
handleBlur(e) {
|
|
90
|
+
this.setData({
|
|
91
|
+
_focus: false,
|
|
92
|
+
});
|
|
93
|
+
this.triggerEvent('blur', e.detail);
|
|
94
|
+
},
|
|
95
|
+
handleClear(e) {
|
|
96
|
+
this.setData({
|
|
97
|
+
_focus: true,
|
|
98
|
+
_value: '',
|
|
99
|
+
value: ''
|
|
100
|
+
});
|
|
101
|
+
this.triggerEvent('change', { value: '' });
|
|
102
|
+
},
|
|
103
|
+
handleCancel(e) {
|
|
104
|
+
this.setData({
|
|
105
|
+
_isSearch: false,
|
|
106
|
+
_value: '',
|
|
107
|
+
value: ''
|
|
108
|
+
});
|
|
109
|
+
this.triggerEvent('cancel', e.detail);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"component": true,
|
|
3
|
-
"usingComponents": {
|
|
4
|
-
"g-icon": "../g-icon/index"
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"component": true,
|
|
3
|
+
"usingComponents": {
|
|
4
|
+
"g-icon": "../g-icon/index"
|
|
5
|
+
}
|
|
6
6
|
}
|