@tuya-miniapp/smart-ui 1.3.1-beta-2 → 1.3.1-beta-4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/action-sheet/demo/index.d.ts +1 -0
- package/dist/action-sheet/demo/index.js +101 -0
- package/dist/action-sheet/index.js +1 -1
- package/dist/area/demo/index.d.ts +1 -0
- package/dist/area/demo/index.js +41 -0
- package/dist/area/index.js +4 -5
- package/dist/battery/demo/index.d.ts +1 -0
- package/dist/battery/demo/index.js +2 -0
- package/dist/battery/index.js +1 -3
- package/dist/bottom-sheet/demo/index.d.ts +1 -0
- package/dist/bottom-sheet/demo/index.js +24 -0
- package/dist/bottom-sheet/index.css +1 -1
- package/dist/bottom-sheet/index.js +3 -2
- package/dist/bottom-sheet/index.wxml +3 -1
- package/dist/bottom-sheet/index.wxss +1 -1
- package/dist/button/demo/index.d.ts +1 -0
- package/dist/button/demo/index.js +9 -0
- package/dist/button/index.js +1 -1
- package/dist/calendar/calendar.wxml +13 -8
- package/dist/calendar/components/header/index.css +1 -1
- package/dist/calendar/components/header/index.js +7 -3
- package/dist/calendar/components/header/index.wxml +3 -3
- package/dist/calendar/components/header/index.wxss +1 -1
- package/dist/calendar/components/month/index.css +1 -1
- package/dist/calendar/components/month/index.js +3 -5
- package/dist/calendar/components/month/index.wxs +1 -4
- package/dist/calendar/components/month/index.wxss +1 -1
- package/dist/calendar/components/month-list/index.css +1 -1
- package/dist/calendar/components/month-list/index.js +26 -41
- package/dist/calendar/components/month-list/index.wxml +8 -2
- package/dist/calendar/components/month-list/index.wxss +1 -1
- package/dist/calendar/components/year-list/index.css +1 -1
- package/dist/calendar/components/year-list/index.js +17 -4
- package/dist/calendar/components/year-list/index.wxml +8 -2
- package/dist/calendar/components/year-list/index.wxss +1 -1
- package/dist/calendar/demo/index.d.ts +1 -0
- package/dist/calendar/demo/index.js +103 -0
- package/dist/calendar/index.js +32 -39
- package/dist/calendar/index.wxs +5 -8
- package/dist/calendar/utils.d.ts +4 -0
- package/dist/calendar/utils.js +30 -4
- package/dist/cascader/demo/index.d.ts +1 -0
- package/dist/cascader/demo/index.js +191 -0
- package/dist/cascader/index.js +3 -3
- package/dist/cell/demo/index.d.ts +1 -0
- package/dist/cell/demo/index.js +14 -0
- package/dist/cell/index.js +1 -7
- package/dist/checkbox/demo/index.d.ts +1 -0
- package/dist/checkbox/demo/index.js +34 -0
- package/dist/checkbox-group/index.js +1 -1
- package/dist/circle/demo/index.d.ts +1 -0
- package/dist/circle/demo/index.js +19 -0
- package/dist/col/demo/index.d.ts +1 -0
- package/dist/col/demo/index.js +4 -0
- package/dist/collapse/demo/index.d.ts +1 -0
- package/dist/collapse/demo/index.js +36 -0
- package/dist/collapse/index.js +1 -1
- package/dist/collapse-item/animate.js +1 -1
- package/dist/common/component.js +1 -1
- package/dist/common/utils.js +3 -3
- package/dist/config-provider/demo/index.d.ts +1 -0
- package/dist/config-provider/demo/index.js +22 -0
- package/dist/count-down/demo/index.d.ts +1 -0
- package/dist/count-down/demo/index.js +33 -0
- package/dist/custom-keyboard/demo/index.d.ts +1 -0
- package/dist/custom-keyboard/demo/index.js +17 -0
- package/dist/custom-keyboard/index.js +1 -3
- package/dist/datetime-picker/demo/index.d.ts +1 -0
- package/dist/datetime-picker/demo/index.js +63 -0
- package/dist/datetime-picker/index.js +4 -5
- package/dist/dialog/demo/index.d.ts +1 -0
- package/dist/dialog/demo/index.js +134 -0
- package/dist/dialog/dialog.js +3 -5
- package/dist/dialog/index.js +1 -1
- package/dist/divider/demo/index.d.ts +1 -0
- package/dist/divider/demo/index.js +4 -0
- package/dist/dropdown-item/index.js +3 -3
- package/dist/dropdown-item/index.wxml +1 -7
- package/dist/dropdown-menu/demo/index.d.ts +1 -0
- package/dist/dropdown-menu/demo/index.js +47 -0
- package/dist/dropdown-menu/index.js +8 -10
- package/dist/empty/demo/index.d.ts +1 -0
- package/dist/empty/demo/index.js +13 -0
- package/dist/empty/index.css +1 -1
- package/dist/empty/index.wxs +1 -1
- package/dist/empty/index.wxss +1 -1
- package/dist/field/demo/index.d.ts +1 -0
- package/dist/field/demo/index.js +21 -0
- package/dist/goods-action/demo/index.d.ts +1 -0
- package/dist/goods-action/demo/index.js +12 -0
- package/dist/goods-action/index.js +1 -1
- package/dist/grid/demo/index.d.ts +1 -0
- package/dist/grid/demo/index.js +9 -0
- package/dist/grid/index.js +1 -1
- package/dist/grid-item/index.js +1 -1
- package/dist/icon/demo/index.d.ts +1 -0
- package/dist/icon/demo/index.js +26 -0
- package/dist/image/demo/index.d.ts +1 -0
- package/dist/image/demo/index.js +15 -0
- package/dist/index-anchor/index.js +1 -1
- package/dist/index-bar/demo/index.d.ts +1 -0
- package/dist/index-bar/demo/index.js +21 -0
- package/dist/index-bar/index.js +9 -16
- package/dist/loading/demo/index.d.ts +1 -0
- package/dist/loading/demo/index.js +4 -0
- package/dist/loading/index.js +25 -1
- package/dist/loading/index.wxml +2 -2
- package/dist/loading/index.wxs +6 -21
- package/dist/mixins/basic.js +2 -2
- package/dist/mixins/link.js +1 -2
- package/dist/mixins/page-scroll.js +1 -1
- package/dist/mixins/touch.js +1 -2
- package/dist/mixins/transition.js +1 -1
- package/dist/nav-bar/demo/index.d.ts +1 -0
- package/dist/nav-bar/demo/index.js +26 -0
- package/dist/nav-bar/index.css +1 -1
- package/dist/nav-bar/index.js +1 -1
- package/dist/nav-bar/index.wxml +1 -1
- package/dist/nav-bar/index.wxss +1 -1
- package/dist/normal-slider/demo/index.d.ts +1 -0
- package/dist/normal-slider/demo/index.js +19 -0
- package/dist/notice-bar/demo/index.d.ts +1 -0
- package/dist/notice-bar/demo/index.js +11 -0
- package/dist/notice-bar/index.css +1 -1
- package/dist/notice-bar/index.js +3 -6
- package/dist/notice-bar/index.wxml +1 -5
- package/dist/notice-bar/index.wxss +1 -1
- package/dist/notify/demo/index.d.ts +1 -0
- package/dist/notify/demo/index.js +45 -0
- package/dist/overlay/demo/index.d.ts +1 -0
- package/dist/overlay/demo/index.js +22 -0
- package/dist/picker/demo/index.d.ts +1 -0
- package/dist/picker/demo/index.js +76 -0
- package/dist/picker/index.css +1 -1
- package/dist/picker/index.js +2 -2
- package/dist/picker/index.wxml +1 -0
- package/dist/picker/index.wxss +1 -1
- package/dist/picker-column/index.js +3 -8
- package/dist/popup/demo/index.d.ts +1 -0
- package/dist/popup/demo/index.js +79 -0
- package/dist/progress/demo/index.d.ts +1 -0
- package/dist/progress/demo/index.js +4 -0
- package/dist/progress/index.js +1 -4
- package/dist/radio/demo/index.d.ts +1 -0
- package/dist/radio/demo/index.js +31 -0
- package/dist/radio-group/index.js +1 -1
- package/dist/rate/demo/index.d.ts +1 -0
- package/dist/rate/demo/index.js +25 -0
- package/dist/rate/index.js +2 -2
- package/dist/row/index.js +1 -1
- package/dist/search/demo/index.d.ts +1 -0
- package/dist/search/demo/index.js +43 -0
- package/dist/search/index.css +1 -1
- package/dist/search/index.js +1 -5
- package/dist/search/index.wxml +1 -1
- package/dist/search/index.wxss +1 -1
- package/dist/sidebar/demo/index.d.ts +1 -0
- package/dist/sidebar/demo/index.js +9 -0
- package/dist/skeleton/demo/index.d.ts +1 -0
- package/dist/skeleton/demo/index.js +11 -0
- package/dist/slider/demo/index.d.ts +1 -0
- package/dist/slider/demo/index.js +19 -0
- package/dist/slider/index.js +5 -7
- package/dist/stepper/demo/index.d.ts +1 -0
- package/dist/stepper/demo/index.js +19 -0
- package/dist/steps/demo/index.d.ts +1 -0
- package/dist/steps/demo/index.js +42 -0
- package/dist/sticky/demo/index.d.ts +1 -0
- package/dist/sticky/demo/index.js +26 -0
- package/dist/sticky/index.js +2 -2
- package/dist/swipe-cell/demo/index.d.ts +1 -0
- package/dist/swipe-cell/demo/index.js +45 -0
- package/dist/swipe-cell/index.js +3 -5
- package/dist/switch/demo/index.d.ts +1 -0
- package/dist/switch/demo/index.js +29 -0
- package/dist/switch/index.css +1 -1
- package/dist/switch/index.wxss +1 -1
- package/dist/tab/demo/index.d.ts +1 -0
- package/dist/tab/demo/index.js +55 -0
- package/dist/tabbar/demo/index.d.ts +1 -0
- package/dist/tabbar/demo/index.js +34 -0
- package/dist/tabbar/index.js +1 -1
- package/dist/tabs/index.css +1 -1
- package/dist/tabs/index.js +7 -25
- package/dist/tabs/index.wxss +1 -1
- package/dist/tag/demo/index.d.ts +1 -0
- package/dist/tag/demo/index.js +16 -0
- package/dist/tag/index.css +1 -1
- package/dist/tag/index.wxss +1 -1
- package/dist/toast/demo/index.d.ts +1 -0
- package/dist/toast/demo/index.js +67 -0
- package/dist/toast/toast.js +5 -5
- package/dist/transition/demo/index.d.ts +1 -0
- package/dist/transition/demo/index.js +67 -0
- package/dist/tree-select/demo/index.d.ts +1 -0
- package/dist/tree-select/demo/index.js +113 -0
- package/dist/wxs/style.wxs +0 -7
- package/lib/action-sheet/demo/index.d.ts +1 -0
- package/lib/action-sheet/demo/index.js +115 -0
- package/lib/area/demo/index.d.ts +1 -0
- package/lib/area/demo/index.js +47 -0
- package/lib/area/index.js +1 -2
- package/lib/battery/demo/index.d.ts +1 -0
- package/lib/battery/demo/index.js +4 -0
- package/lib/battery/index.js +1 -3
- package/lib/bottom-sheet/demo/index.d.ts +1 -0
- package/lib/bottom-sheet/demo/index.js +27 -0
- package/lib/bottom-sheet/index.css +1 -1
- package/lib/bottom-sheet/index.js +3 -2
- package/lib/bottom-sheet/index.wxml +3 -1
- package/lib/bottom-sheet/index.wxss +1 -1
- package/lib/button/demo/index.d.ts +1 -0
- package/lib/button/demo/index.js +14 -0
- package/lib/calendar/calendar.wxml +13 -8
- package/lib/calendar/components/header/index.css +1 -1
- package/lib/calendar/components/header/index.js +6 -2
- package/lib/calendar/components/header/index.wxml +3 -3
- package/lib/calendar/components/header/index.wxss +1 -1
- package/lib/calendar/components/month/index.css +1 -1
- package/lib/calendar/components/month/index.js +2 -6
- package/lib/calendar/components/month/index.wxs +1 -4
- package/lib/calendar/components/month/index.wxss +1 -1
- package/lib/calendar/components/month-list/index.css +1 -1
- package/lib/calendar/components/month-list/index.js +25 -40
- package/lib/calendar/components/month-list/index.wxml +8 -2
- package/lib/calendar/components/month-list/index.wxss +1 -1
- package/lib/calendar/components/year-list/index.css +1 -1
- package/lib/calendar/components/year-list/index.js +15 -2
- package/lib/calendar/components/year-list/index.wxml +8 -2
- package/lib/calendar/components/year-list/index.wxss +1 -1
- package/lib/calendar/demo/index.d.ts +1 -0
- package/lib/calendar/demo/index.js +105 -0
- package/lib/calendar/index.js +29 -38
- package/lib/calendar/index.wxs +5 -8
- package/lib/calendar/utils.d.ts +4 -0
- package/lib/calendar/utils.js +31 -4
- package/lib/cascader/demo/index.d.ts +1 -0
- package/lib/cascader/demo/index.js +197 -0
- package/lib/cell/demo/index.d.ts +1 -0
- package/lib/cell/demo/index.js +39 -0
- package/lib/cell/index.js +1 -7
- package/lib/checkbox/demo/index.d.ts +1 -0
- package/lib/checkbox/demo/index.js +38 -0
- package/lib/circle/demo/index.d.ts +1 -0
- package/lib/circle/demo/index.js +21 -0
- package/lib/col/demo/index.d.ts +1 -0
- package/lib/col/demo/index.js +6 -0
- package/lib/collapse/demo/index.d.ts +1 -0
- package/lib/collapse/demo/index.js +42 -0
- package/lib/config-provider/demo/index.d.ts +1 -0
- package/lib/config-provider/demo/index.js +24 -0
- package/lib/count-down/demo/index.d.ts +1 -0
- package/lib/count-down/demo/index.js +38 -0
- package/lib/custom-keyboard/demo/index.d.ts +1 -0
- package/lib/custom-keyboard/demo/index.js +19 -0
- package/lib/custom-keyboard/index.js +1 -3
- package/lib/datetime-picker/demo/index.d.ts +1 -0
- package/lib/datetime-picker/demo/index.js +68 -0
- package/lib/datetime-picker/index.js +4 -3
- package/lib/dialog/demo/index.d.ts +1 -0
- package/lib/dialog/demo/index.js +144 -0
- package/lib/dialog/dialog.js +1 -3
- package/lib/divider/demo/index.d.ts +1 -0
- package/lib/divider/demo/index.js +6 -0
- package/lib/dropdown-item/index.wxml +1 -7
- package/lib/dropdown-menu/demo/index.d.ts +1 -0
- package/lib/dropdown-menu/demo/index.js +52 -0
- package/lib/dropdown-menu/index.js +2 -4
- package/lib/empty/demo/index.d.ts +1 -0
- package/lib/empty/demo/index.js +15 -0
- package/lib/empty/index.css +1 -1
- package/lib/empty/index.wxs +1 -1
- package/lib/empty/index.wxss +1 -1
- package/lib/field/demo/index.d.ts +1 -0
- package/lib/field/demo/index.js +23 -0
- package/lib/goods-action/demo/index.d.ts +1 -0
- package/lib/goods-action/demo/index.js +17 -0
- package/lib/grid/demo/index.d.ts +1 -0
- package/lib/grid/demo/index.js +11 -0
- package/lib/icon/demo/index.d.ts +1 -0
- package/lib/icon/demo/index.js +54 -0
- package/lib/image/demo/index.d.ts +1 -0
- package/lib/image/demo/index.js +17 -0
- package/lib/index-bar/demo/index.d.ts +1 -0
- package/lib/index-bar/demo/index.js +23 -0
- package/lib/index-bar/index.js +3 -10
- package/lib/loading/demo/index.d.ts +1 -0
- package/lib/loading/demo/index.js +6 -0
- package/lib/loading/index.js +27 -1
- package/lib/loading/index.wxml +2 -2
- package/lib/loading/index.wxs +6 -21
- package/lib/mixins/link.js +1 -2
- package/lib/mixins/touch.js +1 -2
- package/lib/nav-bar/demo/index.d.ts +1 -0
- package/lib/nav-bar/demo/index.js +31 -0
- package/lib/nav-bar/index.css +1 -1
- package/lib/nav-bar/index.wxml +1 -1
- package/lib/nav-bar/index.wxss +1 -1
- package/lib/normal-slider/demo/index.d.ts +1 -0
- package/lib/normal-slider/demo/index.js +21 -0
- package/lib/notice-bar/demo/index.d.ts +1 -0
- package/lib/notice-bar/demo/index.js +16 -0
- package/lib/notice-bar/index.css +1 -1
- package/lib/notice-bar/index.js +2 -5
- package/lib/notice-bar/index.wxml +1 -5
- package/lib/notice-bar/index.wxss +1 -1
- package/lib/notify/demo/index.d.ts +1 -0
- package/lib/notify/demo/index.js +50 -0
- package/lib/overlay/demo/index.d.ts +1 -0
- package/lib/overlay/demo/index.js +24 -0
- package/lib/picker/demo/index.d.ts +1 -0
- package/lib/picker/demo/index.js +82 -0
- package/lib/picker/index.css +1 -1
- package/lib/picker/index.js +1 -3
- package/lib/picker/index.wxml +1 -0
- package/lib/picker/index.wxss +1 -1
- package/lib/picker-column/index.js +2 -7
- package/lib/popup/demo/index.d.ts +1 -0
- package/lib/popup/demo/index.js +85 -0
- package/lib/progress/demo/index.d.ts +1 -0
- package/lib/progress/demo/index.js +6 -0
- package/lib/progress/index.js +1 -4
- package/lib/radio/demo/index.d.ts +1 -0
- package/lib/radio/demo/index.js +34 -0
- package/lib/rate/demo/index.d.ts +1 -0
- package/lib/rate/demo/index.js +30 -0
- package/lib/search/demo/index.d.ts +1 -0
- package/lib/search/demo/index.js +48 -0
- package/lib/search/index.css +1 -1
- package/lib/search/index.js +1 -5
- package/lib/search/index.wxml +1 -1
- package/lib/search/index.wxss +1 -1
- package/lib/sidebar/demo/index.d.ts +1 -0
- package/lib/sidebar/demo/index.js +14 -0
- package/lib/skeleton/demo/index.d.ts +1 -0
- package/lib/skeleton/demo/index.js +14 -0
- package/lib/slider/demo/index.d.ts +1 -0
- package/lib/slider/demo/index.js +21 -0
- package/lib/slider/index.js +1 -3
- package/lib/stepper/demo/index.d.ts +1 -0
- package/lib/stepper/demo/index.js +25 -0
- package/lib/steps/demo/index.d.ts +1 -0
- package/lib/steps/demo/index.js +47 -0
- package/lib/sticky/demo/index.d.ts +1 -0
- package/lib/sticky/demo/index.js +30 -0
- package/lib/sticky/index.js +3 -1
- package/lib/swipe-cell/demo/index.d.ts +1 -0
- package/lib/swipe-cell/demo/index.js +50 -0
- package/lib/swipe-cell/index.js +1 -3
- package/lib/switch/demo/index.d.ts +1 -0
- package/lib/switch/demo/index.js +37 -0
- package/lib/switch/index.css +1 -1
- package/lib/switch/index.wxss +1 -1
- package/lib/tab/demo/index.d.ts +1 -0
- package/lib/tab/demo/index.js +57 -0
- package/lib/tabbar/demo/index.d.ts +1 -0
- package/lib/tabbar/demo/index.js +41 -0
- package/lib/tabs/index.css +1 -1
- package/lib/tabs/index.js +6 -24
- package/lib/tabs/index.wxss +1 -1
- package/lib/tag/demo/index.d.ts +1 -0
- package/lib/tag/demo/index.js +19 -0
- package/lib/tag/index.css +1 -1
- package/lib/tag/index.wxss +1 -1
- package/lib/toast/demo/index.d.ts +1 -0
- package/lib/toast/demo/index.js +74 -0
- package/lib/toast/toast.js +3 -3
- package/lib/transition/demo/index.d.ts +1 -0
- package/lib/transition/demo/index.js +71 -0
- package/lib/tree-select/demo/index.d.ts +1 -0
- package/lib/tree-select/demo/index.js +130 -0
- package/lib/wxs/style.wxs +0 -7
- package/package.json +15 -3
@@ -1 +1 @@
|
|
1
|
-
@import '../../../common/index.css';.contain{margin:24rpx 0}.item{border-radius:
|
1
|
+
@import '../../../common/index.css';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
|
@@ -16,6 +16,10 @@ var component_1 = require("../../../common/component");
|
|
16
16
|
}
|
17
17
|
},
|
18
18
|
},
|
19
|
+
readonly: {
|
20
|
+
type: Boolean,
|
21
|
+
value: false,
|
22
|
+
},
|
19
23
|
minDate: {
|
20
24
|
type: null,
|
21
25
|
value: new Date(new Date().getFullYear() - 30, 0, 1).getTime(),
|
@@ -24,6 +28,10 @@ var component_1 = require("../../../common/component");
|
|
24
28
|
type: null,
|
25
29
|
value: new Date(new Date().getFullYear() + 30, 11, 31).getTime(),
|
26
30
|
},
|
31
|
+
color: {
|
32
|
+
type: String,
|
33
|
+
value: '#3678e3',
|
34
|
+
},
|
27
35
|
currentYear: {
|
28
36
|
type: null,
|
29
37
|
value: new Date().getFullYear(),
|
@@ -76,12 +84,15 @@ var component_1 = require("../../../common/component");
|
|
76
84
|
var yearlist = years.map(function (date) {
|
77
85
|
var yearVal = new Date(date).getFullYear();
|
78
86
|
var curTime = new Date(date).getTime();
|
79
|
-
var
|
87
|
+
var isDisabled = false;
|
88
|
+
if (minDate && maxDate) {
|
89
|
+
isDisabled = curTime <= minStart || curTime >= maxStart;
|
90
|
+
}
|
80
91
|
return {
|
81
92
|
value: date,
|
82
93
|
year: yearVal,
|
83
94
|
text: yearFormatter.replace('YYYY', yearVal),
|
84
|
-
type:
|
95
|
+
type: isDisabled ? 'disabled' : '',
|
85
96
|
};
|
86
97
|
});
|
87
98
|
this.setData({
|
@@ -89,6 +100,8 @@ var component_1 = require("../../../common/component");
|
|
89
100
|
});
|
90
101
|
},
|
91
102
|
onClick: function (event) {
|
103
|
+
if (this.data.readonly)
|
104
|
+
return;
|
92
105
|
var index = event.currentTarget.dataset.index;
|
93
106
|
var item = this.data.years[index];
|
94
107
|
if (item.type !== 'disabled') {
|
@@ -1,7 +1,13 @@
|
|
1
1
|
<view class="contain">
|
2
2
|
<smart-row>
|
3
|
-
<smart-col wx:for="{{years}}" span="6">
|
4
|
-
<view
|
3
|
+
<smart-col wx:for="{{years}}" span="6" custom-class="col_item">
|
4
|
+
<view wx:if="{{item.type === 'disabled'}}" class="item item_disabled" data-index="{{index}}">
|
5
|
+
{{item.text}}
|
6
|
+
</view>
|
7
|
+
<view wx:elif="{{currentYear === item.year}}" class="item item_active" data-index="{{index}}" bindtap="onClick" style="background: {{ color }};">
|
8
|
+
{{item.text}}
|
9
|
+
</view>
|
10
|
+
<view wx:else class="item" data-index="{{index}}" bindtap="onClick">
|
5
11
|
{{item.text}}
|
6
12
|
</view>
|
7
13
|
</smart-col>
|
@@ -1 +1 @@
|
|
1
|
-
@import '../../../common/index.wxss';.contain{margin:24rpx 0}.item{border-radius:
|
1
|
+
@import '../../../common/index.wxss';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,105 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
var component_1 = require("../../common/component");
|
4
|
+
(0, component_1.SmartComponent)({
|
5
|
+
data: {
|
6
|
+
// day
|
7
|
+
curDayDate: new Date(2024, 0, 15).getTime(),
|
8
|
+
minDayDate: new Date(2024, 0, 4).getTime(),
|
9
|
+
maxDayDate: new Date(2024, 1, 20).getTime(),
|
10
|
+
// weekday
|
11
|
+
curWeekDayDate: [
|
12
|
+
new Date(2024, 0, 15).getTime(),
|
13
|
+
new Date(2024, 0, 21).getTime(),
|
14
|
+
],
|
15
|
+
minWeekDayDate: new Date(2024, 0, 4).getTime(),
|
16
|
+
maxWeekDayDate: new Date(2024, 1, 20).getTime(),
|
17
|
+
// range
|
18
|
+
curRangeDayDate: [
|
19
|
+
new Date(2024, 0, 10).getTime(),
|
20
|
+
new Date(2024, 0, 20).getTime(),
|
21
|
+
],
|
22
|
+
minRangeDayDate: new Date(2024, 0, 4).getTime(),
|
23
|
+
maxRangeDayDate: new Date(2024, 1, 20).getTime(),
|
24
|
+
// month
|
25
|
+
curMonthDate: new Date(2024, 6, 1).getTime(),
|
26
|
+
minMonthDate: new Date(2024, 2, 1).getTime(),
|
27
|
+
maxMonthDate: new Date(2025, 9, 31).getTime(),
|
28
|
+
// year
|
29
|
+
curYearDate: new Date(2017, 6, 1).getTime(),
|
30
|
+
minYearDate: new Date(2012, 0, 1).getTime(),
|
31
|
+
maxYearDate: new Date(2029, 10, 31).getTime(),
|
32
|
+
// locale
|
33
|
+
confirmText: I18n.t('confirm'),
|
34
|
+
confirmDisabledText: I18n.t('confirm'),
|
35
|
+
firstDayOfWeek: 0,
|
36
|
+
locale: {
|
37
|
+
shortWeekDays: [
|
38
|
+
I18n.t('week0'),
|
39
|
+
I18n.t('week1'),
|
40
|
+
I18n.t('week2'),
|
41
|
+
I18n.t('week3'),
|
42
|
+
I18n.t('week4'),
|
43
|
+
I18n.t('week5'),
|
44
|
+
I18n.t('week6'),
|
45
|
+
],
|
46
|
+
subFormatter: 'YYYY' + I18n.t('year') + 'MM' + I18n.t('month'),
|
47
|
+
},
|
48
|
+
locale2: {
|
49
|
+
subFormatter: 'YYYY' + I18n.t('year'),
|
50
|
+
monthsFormatter: [
|
51
|
+
I18n.t('cal_Jan'),
|
52
|
+
I18n.t('cal_Feb'),
|
53
|
+
I18n.t('cal_Mar'),
|
54
|
+
I18n.t('cal_Apr'),
|
55
|
+
I18n.t('cal_May'),
|
56
|
+
I18n.t('cal_Jun'),
|
57
|
+
I18n.t('cal_Jul'),
|
58
|
+
I18n.t('cal_Aug'),
|
59
|
+
I18n.t('cal_Sept'),
|
60
|
+
I18n.t('cal_Oct'),
|
61
|
+
I18n.t('cal_Nov'),
|
62
|
+
I18n.t('cal_Dec')
|
63
|
+
]
|
64
|
+
},
|
65
|
+
showDayPicker: false,
|
66
|
+
},
|
67
|
+
methods: {
|
68
|
+
setCurDay: function (event) {
|
69
|
+
var date = event.detail;
|
70
|
+
this.setData({
|
71
|
+
curDayDate: new Date(date).getTime(),
|
72
|
+
showDayPicker: false,
|
73
|
+
});
|
74
|
+
},
|
75
|
+
setWeekCurDay: function (event) {
|
76
|
+
var date = event.detail;
|
77
|
+
this.setData({
|
78
|
+
curWeekDayDate: [date[0], date[1]],
|
79
|
+
});
|
80
|
+
},
|
81
|
+
setRangeCurDay: function (event) {
|
82
|
+
var date = event.detail;
|
83
|
+
this.setData({
|
84
|
+
curRangeDayDate: [date[0], date[1]],
|
85
|
+
});
|
86
|
+
},
|
87
|
+
setCurMonth: function (event) {
|
88
|
+
var date = event.detail;
|
89
|
+
this.setData({
|
90
|
+
curMonthDate: date,
|
91
|
+
});
|
92
|
+
},
|
93
|
+
setCurYear: function (event) {
|
94
|
+
var date = event.detail;
|
95
|
+
this.setData({
|
96
|
+
curYearDate: date,
|
97
|
+
});
|
98
|
+
},
|
99
|
+
onShowDayPicker: function () {
|
100
|
+
this.setData({
|
101
|
+
showDayPicker: !this.data.showDayPicker,
|
102
|
+
});
|
103
|
+
},
|
104
|
+
},
|
105
|
+
});
|
package/lib/calendar/index.js
CHANGED
@@ -15,19 +15,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
var component_1 = require("../common/component");
|
16
16
|
var utils_1 = require("./utils");
|
17
17
|
var toast_1 = __importDefault(require("../toast/toast"));
|
18
|
-
var
|
19
|
-
var
|
20
|
-
var now = (0, utils_1.getToday)();
|
21
|
-
return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()).getTime();
|
22
|
-
})();
|
23
|
-
var getTime = function (date) {
|
24
|
-
return date instanceof Date ? date.getTime() : date;
|
25
|
-
};
|
18
|
+
var dateEdge = (0, utils_1.getInitEdgeDate)('year');
|
19
|
+
var getTime = function (date) { return (date instanceof Date ? date.getTime() : date); };
|
26
20
|
(0, component_1.SmartComponent)({
|
27
21
|
props: {
|
28
22
|
title: {
|
29
23
|
type: String,
|
30
|
-
value: '
|
24
|
+
value: 'Select Date',
|
31
25
|
},
|
32
26
|
color: String,
|
33
27
|
show: {
|
@@ -63,18 +57,13 @@ var getTime = function (date) {
|
|
63
57
|
rangeEnd: 'End',
|
64
58
|
},
|
65
59
|
},
|
66
|
-
formatter: null,
|
67
60
|
confirmText: {
|
68
61
|
type: String,
|
69
|
-
value: '
|
62
|
+
value: 'Confirm',
|
70
63
|
},
|
71
64
|
confirmDisabledText: {
|
72
65
|
type: String,
|
73
|
-
value: '
|
74
|
-
},
|
75
|
-
mode: {
|
76
|
-
type: String,
|
77
|
-
value: 'day',
|
66
|
+
value: 'Confirm',
|
78
67
|
},
|
79
68
|
rangePrompt: String,
|
80
69
|
showRangePrompt: {
|
@@ -97,11 +86,11 @@ var getTime = function (date) {
|
|
97
86
|
},
|
98
87
|
minDate: {
|
99
88
|
type: Number,
|
100
|
-
value:
|
89
|
+
value: dateEdge.min,
|
101
90
|
},
|
102
91
|
maxDate: {
|
103
92
|
type: Number,
|
104
|
-
value:
|
93
|
+
value: dateEdge.max,
|
105
94
|
},
|
106
95
|
position: {
|
107
96
|
type: String,
|
@@ -117,7 +106,7 @@ var getTime = function (date) {
|
|
117
106
|
},
|
118
107
|
poppable: {
|
119
108
|
type: Boolean,
|
120
|
-
value:
|
109
|
+
value: false,
|
121
110
|
},
|
122
111
|
showMark: {
|
123
112
|
type: Boolean,
|
@@ -129,7 +118,7 @@ var getTime = function (date) {
|
|
129
118
|
},
|
130
119
|
showConfirm: {
|
131
120
|
type: Boolean,
|
132
|
-
value:
|
121
|
+
value: false,
|
133
122
|
},
|
134
123
|
showSubtitle: {
|
135
124
|
type: Boolean,
|
@@ -189,15 +178,19 @@ var getTime = function (date) {
|
|
189
178
|
methods: {
|
190
179
|
onPrev: function () {
|
191
180
|
var visibleIndex = this.data.visibleIndex - 1;
|
192
|
-
if (this.data.
|
181
|
+
if (this.data.type === 'year') {
|
193
182
|
this.setData({
|
194
183
|
visibleIndex: visibleIndex,
|
195
184
|
});
|
196
185
|
return;
|
197
186
|
}
|
198
|
-
if (this.data.
|
187
|
+
if (this.data.type === 'month') {
|
188
|
+
var nextDate = new Date(this.data.currentDate);
|
189
|
+
nextDate.setFullYear(nextDate.getFullYear() - 1);
|
190
|
+
this.select(nextDate, true);
|
199
191
|
this.setData({
|
200
192
|
visibleIndex: visibleIndex,
|
193
|
+
currentDate: nextDate,
|
201
194
|
});
|
202
195
|
return;
|
203
196
|
}
|
@@ -209,15 +202,19 @@ var getTime = function (date) {
|
|
209
202
|
},
|
210
203
|
onNext: function () {
|
211
204
|
var visibleIndex = this.data.visibleIndex + 1;
|
212
|
-
if (this.data.
|
205
|
+
if (this.data.type === 'year') {
|
213
206
|
this.setData({
|
214
207
|
visibleIndex: visibleIndex,
|
215
208
|
});
|
216
209
|
return;
|
217
210
|
}
|
218
|
-
if (this.data.
|
211
|
+
if (this.data.type === 'month') {
|
212
|
+
var nextDate = new Date(this.data.currentDate);
|
213
|
+
nextDate.setFullYear(nextDate.getFullYear() + 1);
|
214
|
+
this.select(nextDate, true);
|
219
215
|
this.setData({
|
220
216
|
visibleIndex: visibleIndex,
|
217
|
+
currentDate: nextDate,
|
221
218
|
});
|
222
219
|
return;
|
223
220
|
}
|
@@ -231,16 +228,14 @@ var getTime = function (date) {
|
|
231
228
|
this.setData({ currentDate: this.getInitialDate(this.data.defaultDate) });
|
232
229
|
this.scrollIntoView();
|
233
230
|
},
|
234
|
-
initYearIdx: function (currentDate) {
|
235
|
-
},
|
236
231
|
initData: function () {
|
237
232
|
var currentDate = this.getInitialDate(this.data.defaultDate);
|
238
233
|
var months = (0, utils_1.getMonths)(this.data.minDate, this.data.maxDate);
|
239
234
|
var visibleIndex = this.data.defaultDate
|
240
235
|
? (0, utils_1.getCurrentIndex)(currentDate, months)
|
241
236
|
: months.length - 1;
|
242
|
-
var isYear = this.data.
|
243
|
-
var isMonth = this.data.
|
237
|
+
var isYear = this.data.type === 'year';
|
238
|
+
var isMonth = this.data.type === 'month';
|
244
239
|
var data = {
|
245
240
|
currentDate: currentDate,
|
246
241
|
months: months,
|
@@ -260,8 +255,9 @@ var getTime = function (date) {
|
|
260
255
|
limitDateRange: function (date, minDate, maxDate) {
|
261
256
|
if (minDate === void 0) { minDate = null; }
|
262
257
|
if (maxDate === void 0) { maxDate = null; }
|
263
|
-
|
264
|
-
|
258
|
+
var _a = (0, utils_1.getInitEdgeDate)(this.data.type), min = _a.min, max = _a.max;
|
259
|
+
minDate = minDate || this.data.minDate || min;
|
260
|
+
maxDate = maxDate || this.data.maxDate || max;
|
265
261
|
if ((0, utils_1.compareDay)(date, minDate) === -1) {
|
266
262
|
return minDate;
|
267
263
|
}
|
@@ -300,8 +296,7 @@ var getTime = function (date) {
|
|
300
296
|
return this.limitDateRange(defaultDate);
|
301
297
|
},
|
302
298
|
scrollIntoView: function () {
|
303
|
-
if (!this.isMounted)
|
304
|
-
return;
|
299
|
+
// if (!this.isMounted) return;
|
305
300
|
},
|
306
301
|
onOpen: function () {
|
307
302
|
this.$emit('open');
|
@@ -401,10 +396,7 @@ var getTime = function (date) {
|
|
401
396
|
if (!valid) {
|
402
397
|
// auto selected to max range if showConfirm
|
403
398
|
if (this.data.showConfirm) {
|
404
|
-
this.emit([
|
405
|
-
date[0],
|
406
|
-
(0, utils_1.getDayByOffset)(date[0], this.data.maxRange - 1),
|
407
|
-
]);
|
399
|
+
this.emit([date[0], (0, utils_1.getDayByOffset)(date[0], this.data.maxRange - 1)]);
|
408
400
|
}
|
409
401
|
else {
|
410
402
|
this.emit(date);
|
@@ -439,8 +431,7 @@ var getTime = function (date) {
|
|
439
431
|
},
|
440
432
|
onConfirm: function () {
|
441
433
|
var _this = this;
|
442
|
-
if (this.data.type === 'range' &&
|
443
|
-
!this.checkRange(this.data.currentDate)) {
|
434
|
+
if (this.data.type === 'range' && !this.checkRange(this.data.currentDate)) {
|
444
435
|
return;
|
445
436
|
}
|
446
437
|
wx.nextTick(function () {
|
package/lib/calendar/index.wxs
CHANGED
@@ -38,23 +38,20 @@ function getVisible(visibleIndex, curIndex) {
|
|
38
38
|
function formatMonthTitle(date, formatter = 'YYYY-MM') {
|
39
39
|
date = getDate(date);
|
40
40
|
const year = date.getFullYear();
|
41
|
-
const month =
|
42
|
-
date.getMonth() + 1 < 10
|
43
|
-
? `0${date.getMonth() + 1}`
|
44
|
-
: date.getMonth() + 1 + '';
|
41
|
+
const month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1 + "";
|
45
42
|
return formatter.replace('YYYY', year + '').replace('MM', month);
|
46
43
|
}
|
47
44
|
|
48
45
|
function formatYearTitle(date, offset, formatter = 'YYYY') {
|
49
46
|
date = getDate(date);
|
50
|
-
const year = date.getFullYear()
|
47
|
+
const year = date.getFullYear();
|
51
48
|
return formatter.replace('YYYY', year + '');
|
52
49
|
}
|
53
50
|
|
54
51
|
module.exports = {
|
55
52
|
getMonths: getMonths,
|
56
|
-
getVisible,
|
53
|
+
getVisible: getVisible,
|
57
54
|
getButtonDisabled: getButtonDisabled,
|
58
|
-
formatMonthTitle,
|
59
|
-
formatYearTitle,
|
55
|
+
formatMonthTitle: formatMonthTitle,
|
56
|
+
formatYearTitle: formatYearTitle,
|
60
57
|
};
|
package/lib/calendar/utils.d.ts
CHANGED
package/lib/calendar/utils.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getWeekStartAndEnd = exports.getCurrentIndex = exports.getYears = exports.getMonths = exports.getMonthEndDay = exports.copyDates = exports.calcDateNum = exports.getToday = exports.getNextDay = exports.getPrevDay = exports.getDayByOffset = exports.compareDay = exports.compareMonth = exports.formatMonthTitle = exports.ROW_HEIGHT = void 0;
|
3
|
+
exports.getInitEdgeDate = exports.getWeekStartAndEnd = exports.getCurrentIndex = exports.getYears = exports.getMonths = exports.getMonthEndDay = exports.copyDates = exports.calcDateNum = exports.getToday = exports.getNextDay = exports.getPrevDay = exports.getDayByOffset = exports.compareDay = exports.compareMonth = exports.formatMonthTitle = exports.ROW_HEIGHT = void 0;
|
4
4
|
exports.ROW_HEIGHT = 34;
|
5
5
|
function formatMonthTitle(date, formatter) {
|
6
6
|
if (formatter === void 0) { formatter = 'YYYY-MM'; }
|
@@ -8,9 +8,7 @@ function formatMonthTitle(date, formatter) {
|
|
8
8
|
date = new Date(date);
|
9
9
|
}
|
10
10
|
var year = date.getFullYear();
|
11
|
-
var month = date.getMonth() + 1 < 10
|
12
|
-
? "0".concat(date.getMonth() + 1)
|
13
|
-
: date.getMonth() + 1 + '';
|
11
|
+
var month = date.getMonth() + 1 < 10 ? "0".concat(date.getMonth() + 1) : date.getMonth() + 1 + '';
|
14
12
|
return formatter.replace('YYYY', year + '').replace('MM', month);
|
15
13
|
}
|
16
14
|
exports.formatMonthTitle = formatMonthTitle;
|
@@ -147,3 +145,32 @@ function getWeekStartAndEnd(date) {
|
|
147
145
|
};
|
148
146
|
}
|
149
147
|
exports.getWeekStartAndEnd = getWeekStartAndEnd;
|
148
|
+
var getInitEdgeDate = function (type) {
|
149
|
+
var currentYear = new Date().getFullYear();
|
150
|
+
if (type === 'month') {
|
151
|
+
var minMonthDate = new Date(currentYear - 1, 1, 1).getTime();
|
152
|
+
var maxMonthDate = new Date(currentYear + 1, 12, 31).getTime();
|
153
|
+
return {
|
154
|
+
min: minMonthDate,
|
155
|
+
max: maxMonthDate,
|
156
|
+
};
|
157
|
+
}
|
158
|
+
if (type === 'year') {
|
159
|
+
var minMonthDate = new Date(currentYear - 10, 1, 1).getTime();
|
160
|
+
var maxMonthDate = new Date(currentYear + 10, 12, 31).getTime();
|
161
|
+
return {
|
162
|
+
min: minMonthDate,
|
163
|
+
max: maxMonthDate,
|
164
|
+
};
|
165
|
+
}
|
166
|
+
var initialMinDate = getToday().getTime();
|
167
|
+
var initialMaxDate = (function () {
|
168
|
+
var now = getToday();
|
169
|
+
return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()).getTime();
|
170
|
+
})();
|
171
|
+
return {
|
172
|
+
min: initialMinDate,
|
173
|
+
max: initialMaxDate,
|
174
|
+
};
|
175
|
+
};
|
176
|
+
exports.getInitEdgeDate = getInitEdgeDate;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,197 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
var component_1 = require("../../common/component");
|
4
|
+
var zhCNOptions = [
|
5
|
+
{
|
6
|
+
text: I18n.t('zhejiangProvince'),
|
7
|
+
value: '330000',
|
8
|
+
options: [
|
9
|
+
{
|
10
|
+
text: I18n.t('hangzhou'),
|
11
|
+
value: '330100',
|
12
|
+
options: [
|
13
|
+
{
|
14
|
+
text: I18n.t('upperCityDistrict'),
|
15
|
+
value: '330102',
|
16
|
+
},
|
17
|
+
{
|
18
|
+
text: I18n.t('downtownDistrict'),
|
19
|
+
value: '330103',
|
20
|
+
},
|
21
|
+
{
|
22
|
+
text: I18n.t('jiangganDistrict'),
|
23
|
+
value: '330104',
|
24
|
+
},
|
25
|
+
],
|
26
|
+
},
|
27
|
+
{
|
28
|
+
text: I18n.t('ningboCity'),
|
29
|
+
value: '330200',
|
30
|
+
options: [
|
31
|
+
{
|
32
|
+
text: I18n.t('haishuDistrict'),
|
33
|
+
value: '330203',
|
34
|
+
},
|
35
|
+
{
|
36
|
+
text: I18n.t('jiangbeiDistrict'),
|
37
|
+
value: '330205',
|
38
|
+
},
|
39
|
+
{
|
40
|
+
text: I18n.t('beilunDistrict'),
|
41
|
+
value: '330206',
|
42
|
+
},
|
43
|
+
],
|
44
|
+
},
|
45
|
+
{
|
46
|
+
text: I18n.t('wenzhou'),
|
47
|
+
value: '330300',
|
48
|
+
options: [
|
49
|
+
{
|
50
|
+
text: I18n.t('luchengDistrict'),
|
51
|
+
value: '330302',
|
52
|
+
},
|
53
|
+
{
|
54
|
+
text: I18n.t('longwanDistrict'),
|
55
|
+
value: '330303',
|
56
|
+
},
|
57
|
+
{
|
58
|
+
text: I18n.t('ouhaiDistrict'),
|
59
|
+
value: '330304',
|
60
|
+
},
|
61
|
+
],
|
62
|
+
},
|
63
|
+
],
|
64
|
+
},
|
65
|
+
{
|
66
|
+
text: I18n.t('jiangsuProvince'),
|
67
|
+
value: '320000',
|
68
|
+
options: [
|
69
|
+
{
|
70
|
+
text: I18n.t('nanjing'),
|
71
|
+
value: '320100',
|
72
|
+
options: [
|
73
|
+
{
|
74
|
+
text: I18n.t('xuanwuDistrict'),
|
75
|
+
value: '320102',
|
76
|
+
},
|
77
|
+
{
|
78
|
+
text: I18n.t('qinhuaiDistrict'),
|
79
|
+
value: '320104',
|
80
|
+
},
|
81
|
+
{
|
82
|
+
text: I18n.t('jianyeDistrict'),
|
83
|
+
value: '320105',
|
84
|
+
},
|
85
|
+
],
|
86
|
+
},
|
87
|
+
{
|
88
|
+
text: I18n.t('wuxi'),
|
89
|
+
value: '320200',
|
90
|
+
options: [
|
91
|
+
{
|
92
|
+
text: I18n.t('xishanDistrict'),
|
93
|
+
value: '320205',
|
94
|
+
},
|
95
|
+
{
|
96
|
+
text: I18n.t('huishanDistrict'),
|
97
|
+
value: '320206',
|
98
|
+
},
|
99
|
+
{
|
100
|
+
text: I18n.t('binhuDistrict'),
|
101
|
+
value: '320211',
|
102
|
+
},
|
103
|
+
],
|
104
|
+
},
|
105
|
+
{
|
106
|
+
text: I18n.t('xuzhou'),
|
107
|
+
value: '320300',
|
108
|
+
options: [
|
109
|
+
{
|
110
|
+
text: I18n.t('gulouDistrict'),
|
111
|
+
value: '320302',
|
112
|
+
},
|
113
|
+
{
|
114
|
+
text: I18n.t('yunlongDistrict'),
|
115
|
+
value: '320303',
|
116
|
+
},
|
117
|
+
{
|
118
|
+
text: I18n.t('jiawangDistrict'),
|
119
|
+
value: '320305',
|
120
|
+
},
|
121
|
+
],
|
122
|
+
},
|
123
|
+
],
|
124
|
+
},
|
125
|
+
];
|
126
|
+
var asyncOptions1 = [
|
127
|
+
{
|
128
|
+
text: I18n.t('zhejiangProvince'),
|
129
|
+
value: '330000',
|
130
|
+
options: [],
|
131
|
+
},
|
132
|
+
];
|
133
|
+
var asyncOptions2 = [
|
134
|
+
{ text: I18n.t('hangzhou'), value: '330100' },
|
135
|
+
{ text: I18n.t('ningboCity'), value: '330200' },
|
136
|
+
];
|
137
|
+
(0, component_1.SmartComponent)({
|
138
|
+
data: {
|
139
|
+
area: I18n.t('region'),
|
140
|
+
options: zhCNOptions,
|
141
|
+
selectArea: I18n.t('pleaseSelectARegion'),
|
142
|
+
baseState: {
|
143
|
+
show: false,
|
144
|
+
value: '',
|
145
|
+
result: '',
|
146
|
+
},
|
147
|
+
asyncState: {
|
148
|
+
show: false,
|
149
|
+
value: undefined,
|
150
|
+
result: '',
|
151
|
+
options: asyncOptions1,
|
152
|
+
},
|
153
|
+
customFieldState: {
|
154
|
+
show: false,
|
155
|
+
value: '',
|
156
|
+
result: '',
|
157
|
+
},
|
158
|
+
},
|
159
|
+
methods: {
|
160
|
+
onClick: function (e) {
|
161
|
+
var _a;
|
162
|
+
var stateKey = e.currentTarget.dataset.stateKey;
|
163
|
+
this.setData((_a = {},
|
164
|
+
_a["".concat(stateKey, ".show")] = true,
|
165
|
+
_a));
|
166
|
+
},
|
167
|
+
onClose: function (e) {
|
168
|
+
var _a;
|
169
|
+
var stateKey = e.currentTarget.dataset.stateKey;
|
170
|
+
this.setData((_a = {},
|
171
|
+
_a["".concat(stateKey, ".show")] = false,
|
172
|
+
_a));
|
173
|
+
},
|
174
|
+
onFinish: function (e) {
|
175
|
+
var _a;
|
176
|
+
var stateKey = e.currentTarget.dataset.stateKey;
|
177
|
+
var _b = e.detail, selectedOptions = _b.selectedOptions, value = _b.value;
|
178
|
+
var result = selectedOptions.map(function (option) { return option.text; }).join('/');
|
179
|
+
this.setData((_a = {},
|
180
|
+
_a["".concat(stateKey, ".value")] = value,
|
181
|
+
_a["".concat(stateKey, ".result")] = result,
|
182
|
+
_a));
|
183
|
+
this.onClose(e);
|
184
|
+
},
|
185
|
+
loadDynamicOptions: function (e) {
|
186
|
+
var _this = this;
|
187
|
+
var value = e.detail.value;
|
188
|
+
if (value === '330000') {
|
189
|
+
setTimeout(function () {
|
190
|
+
_this.setData({
|
191
|
+
'asyncState.options[0].options': asyncOptions2,
|
192
|
+
});
|
193
|
+
}, 500);
|
194
|
+
}
|
195
|
+
},
|
196
|
+
},
|
197
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|