wedux-ui 0.1.0
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/LICENSE +21 -0
- package/README.md +184 -0
- package/miniprogram_dist/behaviors/formField.js +35 -0
- package/miniprogram_dist/components/avatar/avatar.js +70 -0
- package/miniprogram_dist/components/avatar/avatar.json +4 -0
- package/miniprogram_dist/components/avatar/avatar.scss +68 -0
- package/miniprogram_dist/components/avatar/avatar.wxml +15 -0
- package/miniprogram_dist/components/avatar-group/avatar-group.js +45 -0
- package/miniprogram_dist/components/avatar-group/avatar-group.json +7 -0
- package/miniprogram_dist/components/avatar-group/avatar-group.scss +4 -0
- package/miniprogram_dist/components/avatar-group/avatar-group.wxml +3 -0
- package/miniprogram_dist/components/back-top/back-top.js +68 -0
- package/miniprogram_dist/components/back-top/back-top.json +4 -0
- package/miniprogram_dist/components/back-top/back-top.scss +43 -0
- package/miniprogram_dist/components/back-top/back-top.wxml +10 -0
- package/miniprogram_dist/components/badge/badge.js +100 -0
- package/miniprogram_dist/components/badge/badge.json +4 -0
- package/miniprogram_dist/components/badge/badge.scss +98 -0
- package/miniprogram_dist/components/badge/badge.wxml +11 -0
- package/miniprogram_dist/components/button/button.js +152 -0
- package/miniprogram_dist/components/button/button.json +4 -0
- package/miniprogram_dist/components/button/button.scss +499 -0
- package/miniprogram_dist/components/button/button.wxml +21 -0
- package/miniprogram_dist/components/button-group/button-group.js +51 -0
- package/miniprogram_dist/components/button-group/button-group.json +4 -0
- package/miniprogram_dist/components/button-group/button-group.scss +8 -0
- package/miniprogram_dist/components/button-group/button-group.wxml +3 -0
- package/miniprogram_dist/components/calendar/calendar.js +308 -0
- package/miniprogram_dist/components/calendar/calendar.json +4 -0
- package/miniprogram_dist/components/calendar/calendar.scss +141 -0
- package/miniprogram_dist/components/calendar/calendar.wxml +47 -0
- package/miniprogram_dist/components/card/card.js +44 -0
- package/miniprogram_dist/components/card/card.json +4 -0
- package/miniprogram_dist/components/card/card.scss +143 -0
- package/miniprogram_dist/components/card/card.wxml +31 -0
- package/miniprogram_dist/components/checkbox/checkbox.js +43 -0
- package/miniprogram_dist/components/checkbox/checkbox.json +4 -0
- package/miniprogram_dist/components/checkbox/checkbox.scss +77 -0
- package/miniprogram_dist/components/checkbox/checkbox.wxml +13 -0
- package/miniprogram_dist/components/checkbox-button/checkbox-button.js +43 -0
- package/miniprogram_dist/components/checkbox-button/checkbox-button.json +4 -0
- package/miniprogram_dist/components/checkbox-button/checkbox-button.scss +39 -0
- package/miniprogram_dist/components/checkbox-button/checkbox-button.wxml +8 -0
- package/miniprogram_dist/components/checkbox-group/checkbox-group.js +84 -0
- package/miniprogram_dist/components/checkbox-group/checkbox-group.json +4 -0
- package/miniprogram_dist/components/checkbox-group/checkbox-group.scss +9 -0
- package/miniprogram_dist/components/checkbox-group/checkbox-group.wxml +3 -0
- package/miniprogram_dist/components/color-picker/color-picker.js +348 -0
- package/miniprogram_dist/components/color-picker/color-picker.json +7 -0
- package/miniprogram_dist/components/color-picker/color-picker.scss +383 -0
- package/miniprogram_dist/components/color-picker/color-picker.wxml +232 -0
- package/miniprogram_dist/components/date-picker/date-picker.js +1289 -0
- package/miniprogram_dist/components/date-picker/date-picker.json +7 -0
- package/miniprogram_dist/components/date-picker/date-picker.scss +468 -0
- package/miniprogram_dist/components/date-picker/date-picker.wxml +214 -0
- package/miniprogram_dist/components/divider/divider.js +34 -0
- package/miniprogram_dist/components/divider/divider.json +4 -0
- package/miniprogram_dist/components/divider/divider.scss +75 -0
- package/miniprogram_dist/components/divider/divider.wxml +8 -0
- package/miniprogram_dist/components/drawer/drawer.js +104 -0
- package/miniprogram_dist/components/drawer/drawer.json +4 -0
- package/miniprogram_dist/components/drawer/drawer.scss +171 -0
- package/miniprogram_dist/components/drawer/drawer.wxml +22 -0
- package/miniprogram_dist/components/ellipsis/ellipsis.js +38 -0
- package/miniprogram_dist/components/ellipsis/ellipsis.json +4 -0
- package/miniprogram_dist/components/ellipsis/ellipsis.scss +22 -0
- package/miniprogram_dist/components/ellipsis/ellipsis.wxml +7 -0
- package/miniprogram_dist/components/flex/flex.js +81 -0
- package/miniprogram_dist/components/flex/flex.json +4 -0
- package/miniprogram_dist/components/flex/flex.scss +4 -0
- package/miniprogram_dist/components/flex/flex.wxml +3 -0
- package/miniprogram_dist/components/float-button/float-button.js +78 -0
- package/miniprogram_dist/components/float-button/float-button.json +4 -0
- package/miniprogram_dist/components/float-button/float-button.scss +54 -0
- package/miniprogram_dist/components/float-button/float-button.wxml +9 -0
- package/miniprogram_dist/components/form/form.js +142 -0
- package/miniprogram_dist/components/form/form.json +4 -0
- package/miniprogram_dist/components/form/form.scss +11 -0
- package/miniprogram_dist/components/form/form.wxml +3 -0
- package/miniprogram_dist/components/form/validator.js +220 -0
- package/miniprogram_dist/components/form-item/form-item.js +240 -0
- package/miniprogram_dist/components/form-item/form-item.json +4 -0
- package/miniprogram_dist/components/form-item/form-item.scss +59 -0
- package/miniprogram_dist/components/form-item/form-item.wxml +33 -0
- package/miniprogram_dist/components/gradient-text/gradient-text.js +54 -0
- package/miniprogram_dist/components/gradient-text/gradient-text.json +4 -0
- package/miniprogram_dist/components/gradient-text/gradient-text.scss +7 -0
- package/miniprogram_dist/components/gradient-text/gradient-text.wxml +1 -0
- package/miniprogram_dist/components/h/h.js +60 -0
- package/miniprogram_dist/components/h/h.json +4 -0
- package/miniprogram_dist/components/h/h.scss +53 -0
- package/miniprogram_dist/components/h/h.wxml +1 -0
- package/miniprogram_dist/components/highlight/highlight.js +77 -0
- package/miniprogram_dist/components/highlight/highlight.json +4 -0
- package/miniprogram_dist/components/highlight/highlight.scss +8 -0
- package/miniprogram_dist/components/highlight/highlight.wxml +12 -0
- package/miniprogram_dist/components/infinite-scroll/infinite-scroll.js +31 -0
- package/miniprogram_dist/components/infinite-scroll/infinite-scroll.json +4 -0
- package/miniprogram_dist/components/infinite-scroll/infinite-scroll.scss +31 -0
- package/miniprogram_dist/components/infinite-scroll/infinite-scroll.wxml +12 -0
- package/miniprogram_dist/components/input/input.js +59 -0
- package/miniprogram_dist/components/input/input.json +4 -0
- package/miniprogram_dist/components/input/input.scss +96 -0
- package/miniprogram_dist/components/input/input.wxml +34 -0
- package/miniprogram_dist/components/input-otp/input-otp.js +106 -0
- package/miniprogram_dist/components/input-otp/input-otp.json +4 -0
- package/miniprogram_dist/components/input-otp/input-otp.scss +122 -0
- package/miniprogram_dist/components/input-otp/input-otp.wxml +38 -0
- package/miniprogram_dist/components/layout/layout.js +50 -0
- package/miniprogram_dist/components/layout/layout.json +4 -0
- package/miniprogram_dist/components/layout/layout.scss +10 -0
- package/miniprogram_dist/components/layout/layout.wxml +3 -0
- package/miniprogram_dist/components/layout-content/layout-content.js +47 -0
- package/miniprogram_dist/components/layout-content/layout-content.json +4 -0
- package/miniprogram_dist/components/layout-content/layout-content.scss +5 -0
- package/miniprogram_dist/components/layout-content/layout-content.wxml +13 -0
- package/miniprogram_dist/components/layout-footer/layout-footer.js +59 -0
- package/miniprogram_dist/components/layout-footer/layout-footer.json +4 -0
- package/miniprogram_dist/components/layout-footer/layout-footer.scss +23 -0
- package/miniprogram_dist/components/layout-footer/layout-footer.wxml +16 -0
- package/miniprogram_dist/components/layout-header/layout-header.js +59 -0
- package/miniprogram_dist/components/layout-header/layout-header.json +4 -0
- package/miniprogram_dist/components/layout-header/layout-header.scss +23 -0
- package/miniprogram_dist/components/layout-header/layout-header.wxml +16 -0
- package/miniprogram_dist/components/layout-sider/layout-sider.js +48 -0
- package/miniprogram_dist/components/layout-sider/layout-sider.json +4 -0
- package/miniprogram_dist/components/layout-sider/layout-sider.scss +13 -0
- package/miniprogram_dist/components/layout-sider/layout-sider.wxml +5 -0
- package/miniprogram_dist/components/list/list.js +55 -0
- package/miniprogram_dist/components/list/list.json +4 -0
- package/miniprogram_dist/components/list/list.scss +51 -0
- package/miniprogram_dist/components/list/list.wxml +9 -0
- package/miniprogram_dist/components/list-item/list-item.js +24 -0
- package/miniprogram_dist/components/list-item/list-item.json +4 -0
- package/miniprogram_dist/components/list-item/list-item.scss +51 -0
- package/miniprogram_dist/components/list-item/list-item.wxml +14 -0
- package/miniprogram_dist/components/navigation-bar/navigation-bar.js +77 -0
- package/miniprogram_dist/components/navigation-bar/navigation-bar.json +4 -0
- package/miniprogram_dist/components/navigation-bar/navigation-bar.scss +63 -0
- package/miniprogram_dist/components/navigation-bar/navigation-bar.wxml +35 -0
- package/miniprogram_dist/components/number-animation/number-animation.js +124 -0
- package/miniprogram_dist/components/number-animation/number-animation.json +4 -0
- package/miniprogram_dist/components/number-animation/number-animation.scss +3 -0
- package/miniprogram_dist/components/number-animation/number-animation.wxml +1 -0
- package/miniprogram_dist/components/popover/popover.js +183 -0
- package/miniprogram_dist/components/popover/popover.json +4 -0
- package/miniprogram_dist/components/popover/popover.scss +69 -0
- package/miniprogram_dist/components/popover/popover.wxml +19 -0
- package/miniprogram_dist/components/qr-code/qr-code.js +216 -0
- package/miniprogram_dist/components/qr-code/qr-code.json +4 -0
- package/miniprogram_dist/components/qr-code/qr-code.scss +8 -0
- package/miniprogram_dist/components/qr-code/qr-code.wxml +16 -0
- package/miniprogram_dist/components/radio/radio.js +38 -0
- package/miniprogram_dist/components/radio/radio.json +4 -0
- package/miniprogram_dist/components/radio/radio.scss +50 -0
- package/miniprogram_dist/components/radio/radio.wxml +12 -0
- package/miniprogram_dist/components/radio-button/radio-button.js +39 -0
- package/miniprogram_dist/components/radio-button/radio-button.json +4 -0
- package/miniprogram_dist/components/radio-button/radio-button.scss +39 -0
- package/miniprogram_dist/components/radio-button/radio-button.wxml +8 -0
- package/miniprogram_dist/components/radio-group/radio-group.js +72 -0
- package/miniprogram_dist/components/radio-group/radio-group.json +4 -0
- package/miniprogram_dist/components/radio-group/radio-group.scss +9 -0
- package/miniprogram_dist/components/radio-group/radio-group.wxml +3 -0
- package/miniprogram_dist/components/rate/rate.js +90 -0
- package/miniprogram_dist/components/rate/rate.json +4 -0
- package/miniprogram_dist/components/rate/rate.scss +59 -0
- package/miniprogram_dist/components/rate/rate.wxml +16 -0
- package/miniprogram_dist/components/select/select.js +201 -0
- package/miniprogram_dist/components/select/select.json +7 -0
- package/miniprogram_dist/components/select/select.scss +235 -0
- package/miniprogram_dist/components/select/select.wxml +79 -0
- package/miniprogram_dist/components/stepper/stepper.js +113 -0
- package/miniprogram_dist/components/stepper/stepper.json +4 -0
- package/miniprogram_dist/components/stepper/stepper.scss +73 -0
- package/miniprogram_dist/components/stepper/stepper.wxml +23 -0
- package/miniprogram_dist/components/switch/switch.js +42 -0
- package/miniprogram_dist/components/switch/switch.json +4 -0
- package/miniprogram_dist/components/switch/switch.scss +77 -0
- package/miniprogram_dist/components/switch/switch.wxml +10 -0
- package/miniprogram_dist/components/tab-bar/tab-bar.js +53 -0
- package/miniprogram_dist/components/tab-bar/tab-bar.json +4 -0
- package/miniprogram_dist/components/tab-bar/tab-bar.scss +53 -0
- package/miniprogram_dist/components/tab-bar/tab-bar.wxml +12 -0
- package/miniprogram_dist/components/tag/tag.js +87 -0
- package/miniprogram_dist/components/tag/tag.json +4 -0
- package/miniprogram_dist/components/tag/tag.scss +138 -0
- package/miniprogram_dist/components/tag/tag.wxml +12 -0
- package/miniprogram_dist/components/textarea/textarea.js +46 -0
- package/miniprogram_dist/components/textarea/textarea.json +4 -0
- package/miniprogram_dist/components/textarea/textarea.scss +51 -0
- package/miniprogram_dist/components/textarea/textarea.wxml +20 -0
- package/miniprogram_dist/components/theme-provider/presets.js +101 -0
- package/miniprogram_dist/components/theme-provider/theme-provider.js +34 -0
- package/miniprogram_dist/components/theme-provider/theme-provider.json +4 -0
- package/miniprogram_dist/components/theme-provider/theme-provider.scss +3 -0
- package/miniprogram_dist/components/theme-provider/theme-provider.wxml +3 -0
- package/miniprogram_dist/components/time-picker/time-picker.js +136 -0
- package/miniprogram_dist/components/time-picker/time-picker.json +7 -0
- package/miniprogram_dist/components/time-picker/time-picker.scss +135 -0
- package/miniprogram_dist/components/time-picker/time-picker.wxml +47 -0
- package/miniprogram_dist/components/tooltip/tooltip.js +179 -0
- package/miniprogram_dist/components/tooltip/tooltip.json +4 -0
- package/miniprogram_dist/components/tooltip/tooltip.scss +66 -0
- package/miniprogram_dist/components/tooltip/tooltip.wxml +17 -0
- package/miniprogram_dist/components/tree/tree.js +647 -0
- package/miniprogram_dist/components/tree/tree.json +4 -0
- package/miniprogram_dist/components/tree/tree.scss +178 -0
- package/miniprogram_dist/components/tree/tree.wxml +59 -0
- package/miniprogram_dist/components/tree-select/tree-select.js +260 -0
- package/miniprogram_dist/components/tree-select/tree-select.json +8 -0
- package/miniprogram_dist/components/tree-select/tree-select.scss +250 -0
- package/miniprogram_dist/components/tree-select/tree-select.wxml +118 -0
- package/miniprogram_dist/components/upload/upload.js +387 -0
- package/miniprogram_dist/components/upload/upload.json +4 -0
- package/miniprogram_dist/components/upload/upload.scss +258 -0
- package/miniprogram_dist/components/upload/upload.wxml +142 -0
- package/miniprogram_dist/components/watermark/watermark.js +260 -0
- package/miniprogram_dist/components/watermark/watermark.json +4 -0
- package/miniprogram_dist/components/watermark/watermark.scss +35 -0
- package/miniprogram_dist/components/watermark/watermark.wxml +13 -0
- package/miniprogram_dist/libs/qrcodegen.js +714 -0
- package/miniprogram_dist/libs/seemly.min.js +547 -0
- package/miniprogram_dist/libs/tempo_1_0_0.js +1264 -0
- package/miniprogram_dist/libs/validator_13_56_26.min.js +5282 -0
- package/miniprogram_dist/styles/demo.scss +96 -0
- package/miniprogram_dist/styles/iconfont.scss +91 -0
- package/miniprogram_dist/styles/theme.scss +126 -0
- package/miniprogram_dist/styles/tokens.scss +292 -0
- package/miniprogram_dist/utils/relations.js +21 -0
- package/package.json +25 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
@import '../../styles/iconfont.scss';
|
|
2
|
+
|
|
3
|
+
/* Trigger */
|
|
4
|
+
.w-date-picker__trigger {
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
height: var(--size-input-height);
|
|
8
|
+
padding: 0 var(--spacing-md);
|
|
9
|
+
background: var(--color-input-bg);
|
|
10
|
+
border: 2rpx solid var(--color-input-border);
|
|
11
|
+
border-radius: var(--radius-md);
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
transition: border-color 0.2s;
|
|
14
|
+
gap: var(--spacing-xs);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.w-date-picker--size-medium .w-date-picker__trigger,
|
|
18
|
+
.w-date-picker--size-medium.w-date-picker__trigger {
|
|
19
|
+
height: var(--size-input-height-md);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.w-date-picker--size-small .w-date-picker__trigger,
|
|
23
|
+
.w-date-picker--size-small.w-date-picker__trigger {
|
|
24
|
+
height: var(--size-input-height-sm);
|
|
25
|
+
padding: 0 var(--spacing-sm);
|
|
26
|
+
font-size: var(--font-size-sm);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.w-date-picker--disabled {
|
|
30
|
+
background: var(--color-input-bg-disabled);
|
|
31
|
+
opacity: 0.6;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.w-date-picker--error {
|
|
35
|
+
border-color: var(--color-input-border-error);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.w-date-picker--warning {
|
|
39
|
+
border-color: var(--color-input-border-warning);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.w-date-picker__icon {
|
|
43
|
+
flex-shrink: 0;
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.w-date-picker__calendar-icon {
|
|
49
|
+
font-size: 32rpx;
|
|
50
|
+
color: var(--color-text-secondary);
|
|
51
|
+
line-height: 1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.w-date-picker__text {
|
|
55
|
+
flex: 1;
|
|
56
|
+
min-width: 0;
|
|
57
|
+
color: var(--color-text-primary);
|
|
58
|
+
font-size: inherit;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
text-overflow: ellipsis;
|
|
61
|
+
white-space: nowrap;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.w-date-picker__placeholder {
|
|
65
|
+
flex: 1;
|
|
66
|
+
min-width: 0;
|
|
67
|
+
color: var(--color-text-placeholder);
|
|
68
|
+
font-size: inherit;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.w-date-picker__clear {
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
width: 36rpx;
|
|
76
|
+
height: 36rpx;
|
|
77
|
+
flex-shrink: 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.w-date-picker__clear-icon {
|
|
81
|
+
width: 28rpx;
|
|
82
|
+
height: 28rpx;
|
|
83
|
+
border-radius: 50%;
|
|
84
|
+
background: var(--color-text-placeholder);
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
font-size: 16rpx;
|
|
89
|
+
color: var(--color-bg-elevated);
|
|
90
|
+
line-height: 1;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Panel */
|
|
94
|
+
.w-date-picker__panel {
|
|
95
|
+
background: var(--color-bg-elevated);
|
|
96
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.w-date-picker__header {
|
|
100
|
+
display: flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
justify-content: space-between;
|
|
103
|
+
padding: var(--spacing-md) var(--spacing-lg);
|
|
104
|
+
border-bottom: 1rpx solid var(--color-separator);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.w-date-picker__btn {
|
|
108
|
+
font-size: var(--font-size-md);
|
|
109
|
+
color: var(--color-text-secondary);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.w-date-picker__btn--primary {
|
|
113
|
+
color: var(--color-brand);
|
|
114
|
+
font-weight: 500;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.w-date-picker__title {
|
|
118
|
+
font-size: var(--font-size-lg);
|
|
119
|
+
font-weight: 500;
|
|
120
|
+
color: var(--color-text-primary);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* Range Bar */
|
|
124
|
+
.w-date-picker__range-bar {
|
|
125
|
+
display: flex;
|
|
126
|
+
align-items: center;
|
|
127
|
+
padding: var(--spacing-sm) var(--spacing-lg);
|
|
128
|
+
gap: var(--spacing-sm);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.w-date-picker__range-bar-item {
|
|
132
|
+
flex: 1;
|
|
133
|
+
text-align: center;
|
|
134
|
+
padding: var(--spacing-xs) 0;
|
|
135
|
+
font-size: var(--font-size-md);
|
|
136
|
+
color: var(--color-text-placeholder);
|
|
137
|
+
border-bottom: 4rpx solid transparent;
|
|
138
|
+
transition:
|
|
139
|
+
color 0.2s,
|
|
140
|
+
border-color 0.2s;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.w-date-picker__range-bar-item--active {
|
|
144
|
+
color: var(--color-brand);
|
|
145
|
+
border-bottom-color: var(--color-brand);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.w-date-picker__range-bar-separator {
|
|
149
|
+
color: var(--color-text-placeholder);
|
|
150
|
+
font-size: var(--font-size-md);
|
|
151
|
+
flex-shrink: 0;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* Shortcuts */
|
|
155
|
+
.w-date-picker__shortcuts {
|
|
156
|
+
display: flex;
|
|
157
|
+
padding: var(--spacing-xs) var(--spacing-lg);
|
|
158
|
+
gap: var(--spacing-sm);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.w-date-picker__shortcut {
|
|
162
|
+
font-size: var(--font-size-sm);
|
|
163
|
+
color: var(--color-brand);
|
|
164
|
+
padding: 4rpx var(--spacing-sm);
|
|
165
|
+
border-radius: var(--radius-sm);
|
|
166
|
+
background: var(--color-date-range-bg);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* Navigation */
|
|
170
|
+
.w-date-picker__nav {
|
|
171
|
+
display: flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
justify-content: space-between;
|
|
174
|
+
padding: var(--spacing-sm) var(--spacing-lg);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.w-date-picker__nav-btn {
|
|
178
|
+
width: 64rpx;
|
|
179
|
+
height: 64rpx;
|
|
180
|
+
display: flex;
|
|
181
|
+
align-items: center;
|
|
182
|
+
justify-content: center;
|
|
183
|
+
font-size: 32rpx;
|
|
184
|
+
color: var(--color-text-secondary);
|
|
185
|
+
border-radius: var(--radius-sm);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.w-date-picker__nav-title {
|
|
189
|
+
font-size: var(--font-size-lg);
|
|
190
|
+
font-weight: 500;
|
|
191
|
+
color: var(--color-text-primary);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/* Calendar */
|
|
195
|
+
.w-date-picker__calendar {
|
|
196
|
+
padding: 0 var(--spacing-sm);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.w-date-picker__weekdays {
|
|
200
|
+
display: flex;
|
|
201
|
+
flex-wrap: wrap;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.w-date-picker__weekday {
|
|
205
|
+
width: 14.2857%;
|
|
206
|
+
height: 64rpx;
|
|
207
|
+
display: flex;
|
|
208
|
+
align-items: center;
|
|
209
|
+
justify-content: center;
|
|
210
|
+
font-size: var(--font-size-sm);
|
|
211
|
+
color: var(--color-text-secondary);
|
|
212
|
+
box-sizing: border-box;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.w-date-picker__days {
|
|
216
|
+
display: flex;
|
|
217
|
+
flex-wrap: wrap;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.w-date-picker__day {
|
|
221
|
+
width: 14.2857%;
|
|
222
|
+
height: 80rpx;
|
|
223
|
+
display: flex;
|
|
224
|
+
align-items: center;
|
|
225
|
+
justify-content: center;
|
|
226
|
+
font-size: var(--font-size-md);
|
|
227
|
+
color: var(--color-text-primary);
|
|
228
|
+
box-sizing: border-box;
|
|
229
|
+
position: relative;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.w-date-picker__day--other {
|
|
233
|
+
color: var(--color-text-placeholder);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.w-date-picker__day-inner {
|
|
237
|
+
width: 64rpx;
|
|
238
|
+
height: 64rpx;
|
|
239
|
+
display: flex;
|
|
240
|
+
align-items: center;
|
|
241
|
+
justify-content: center;
|
|
242
|
+
border-radius: 50%;
|
|
243
|
+
box-sizing: border-box;
|
|
244
|
+
position: relative;
|
|
245
|
+
z-index: 1;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.w-date-picker__day--selected .w-date-picker__day-inner {
|
|
249
|
+
background: var(--color-brand);
|
|
250
|
+
color: #ffffff;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.w-date-picker__day--today:not(.w-date-picker__day--selected):not(
|
|
254
|
+
.w-date-picker__day--range-start
|
|
255
|
+
):not(.w-date-picker__day--range-end)
|
|
256
|
+
.w-date-picker__day-inner {
|
|
257
|
+
border: 2rpx solid var(--color-brand);
|
|
258
|
+
color: var(--color-brand);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/* Day range states */
|
|
262
|
+
.w-date-picker__day--in-range {
|
|
263
|
+
background: var(--color-date-range-bg);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.w-date-picker__day--range-start {
|
|
267
|
+
&::before {
|
|
268
|
+
content: '';
|
|
269
|
+
position: absolute;
|
|
270
|
+
top: 50%;
|
|
271
|
+
right: 0;
|
|
272
|
+
transform: translateY(-50%);
|
|
273
|
+
width: 50%;
|
|
274
|
+
height: 64rpx;
|
|
275
|
+
background: var(--color-date-range-bg);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.w-date-picker__day-inner {
|
|
279
|
+
background: var(--color-brand);
|
|
280
|
+
color: #ffffff;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.w-date-picker__day--range-end {
|
|
285
|
+
&::before {
|
|
286
|
+
content: '';
|
|
287
|
+
position: absolute;
|
|
288
|
+
top: 50%;
|
|
289
|
+
left: 0;
|
|
290
|
+
transform: translateY(-50%);
|
|
291
|
+
width: 50%;
|
|
292
|
+
height: 64rpx;
|
|
293
|
+
background: var(--color-date-range-bg);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.w-date-picker__day-inner {
|
|
297
|
+
background: var(--color-brand);
|
|
298
|
+
color: #ffffff;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.w-date-picker__day--range-start.w-date-picker__day--range-end {
|
|
303
|
+
&::before {
|
|
304
|
+
display: none;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/* Month grid */
|
|
309
|
+
.w-date-picker__months {
|
|
310
|
+
display: flex;
|
|
311
|
+
flex-wrap: wrap;
|
|
312
|
+
padding: var(--spacing-md);
|
|
313
|
+
gap: var(--spacing-sm);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.w-date-picker__month-cell {
|
|
317
|
+
width: calc((100% - var(--spacing-sm) * 3) / 4);
|
|
318
|
+
height: 88rpx;
|
|
319
|
+
display: flex;
|
|
320
|
+
align-items: center;
|
|
321
|
+
justify-content: center;
|
|
322
|
+
font-size: var(--font-size-md);
|
|
323
|
+
color: var(--color-text-primary);
|
|
324
|
+
border-radius: var(--radius-md);
|
|
325
|
+
background: var(--color-bg-base);
|
|
326
|
+
box-sizing: border-box;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.w-date-picker__month-cell--selected {
|
|
330
|
+
background: var(--color-brand);
|
|
331
|
+
color: #ffffff;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.w-date-picker__month-cell--current:not(.w-date-picker__month-cell--selected):not(
|
|
335
|
+
.w-date-picker__month-cell--range-start
|
|
336
|
+
):not(.w-date-picker__month-cell--range-end) {
|
|
337
|
+
border: 2rpx solid var(--color-brand);
|
|
338
|
+
color: var(--color-brand);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.w-date-picker__month-cell--range-start,
|
|
342
|
+
.w-date-picker__month-cell--range-end {
|
|
343
|
+
background: var(--color-brand);
|
|
344
|
+
color: #ffffff;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.w-date-picker__month-cell--in-range {
|
|
348
|
+
background: var(--color-date-range-bg);
|
|
349
|
+
color: var(--color-text-primary);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/* Year grid */
|
|
353
|
+
.w-date-picker__years {
|
|
354
|
+
display: flex;
|
|
355
|
+
flex-wrap: wrap;
|
|
356
|
+
padding: var(--spacing-md);
|
|
357
|
+
gap: var(--spacing-sm);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.w-date-picker__year-cell {
|
|
361
|
+
width: calc((100% - var(--spacing-sm) * 3) / 4);
|
|
362
|
+
height: 88rpx;
|
|
363
|
+
display: flex;
|
|
364
|
+
align-items: center;
|
|
365
|
+
justify-content: center;
|
|
366
|
+
font-size: var(--font-size-md);
|
|
367
|
+
color: var(--color-text-primary);
|
|
368
|
+
border-radius: var(--radius-md);
|
|
369
|
+
background: var(--color-bg-base);
|
|
370
|
+
box-sizing: border-box;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.w-date-picker__year-cell--selected {
|
|
374
|
+
background: var(--color-brand);
|
|
375
|
+
color: #ffffff;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.w-date-picker__year-cell--current:not(.w-date-picker__year-cell--selected):not(
|
|
379
|
+
.w-date-picker__year-cell--range-start
|
|
380
|
+
):not(.w-date-picker__year-cell--range-end) {
|
|
381
|
+
border: 2rpx solid var(--color-brand);
|
|
382
|
+
color: var(--color-brand);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.w-date-picker__year-cell--range-start,
|
|
386
|
+
.w-date-picker__year-cell--range-end {
|
|
387
|
+
background: var(--color-brand);
|
|
388
|
+
color: #ffffff;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.w-date-picker__year-cell--in-range {
|
|
392
|
+
background: var(--color-date-range-bg);
|
|
393
|
+
color: var(--color-text-primary);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/* Quarter grid */
|
|
397
|
+
.w-date-picker__quarters {
|
|
398
|
+
display: flex;
|
|
399
|
+
flex-wrap: wrap;
|
|
400
|
+
padding: var(--spacing-md);
|
|
401
|
+
gap: var(--spacing-sm);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.w-date-picker__quarter-cell {
|
|
405
|
+
width: calc((100% - var(--spacing-sm)) / 2);
|
|
406
|
+
height: 120rpx;
|
|
407
|
+
display: flex;
|
|
408
|
+
align-items: center;
|
|
409
|
+
justify-content: center;
|
|
410
|
+
font-size: var(--font-size-md);
|
|
411
|
+
color: var(--color-text-primary);
|
|
412
|
+
border-radius: var(--radius-md);
|
|
413
|
+
background: var(--color-bg-base);
|
|
414
|
+
box-sizing: border-box;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.w-date-picker__quarter-cell--selected {
|
|
418
|
+
background: var(--color-brand);
|
|
419
|
+
color: #ffffff;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.w-date-picker__quarter-cell--current:not(.w-date-picker__quarter-cell--selected):not(
|
|
423
|
+
.w-date-picker__quarter-cell--range-start
|
|
424
|
+
):not(.w-date-picker__quarter-cell--range-end) {
|
|
425
|
+
border: 2rpx solid var(--color-brand);
|
|
426
|
+
color: var(--color-brand);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.w-date-picker__quarter-cell--range-start,
|
|
430
|
+
.w-date-picker__quarter-cell--range-end {
|
|
431
|
+
background: var(--color-brand);
|
|
432
|
+
color: #ffffff;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.w-date-picker__quarter-cell--in-range {
|
|
436
|
+
background: var(--color-date-range-bg);
|
|
437
|
+
color: var(--color-text-primary);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/* Datetime time section */
|
|
441
|
+
.w-date-picker__time {
|
|
442
|
+
border-top: 1rpx solid var(--color-separator);
|
|
443
|
+
padding: 0 var(--spacing-md);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.w-date-picker__time-label {
|
|
447
|
+
font-size: var(--font-size-sm);
|
|
448
|
+
color: var(--color-text-secondary);
|
|
449
|
+
padding: var(--spacing-sm) 0 0;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.w-date-picker__time-picker {
|
|
453
|
+
width: 100%;
|
|
454
|
+
height: 264rpx;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.w-date-picker__time-indicator {
|
|
458
|
+
height: 72rpx;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.w-date-picker__time-item {
|
|
462
|
+
display: flex;
|
|
463
|
+
align-items: center;
|
|
464
|
+
justify-content: center;
|
|
465
|
+
height: 72rpx;
|
|
466
|
+
font-size: var(--font-size-lg);
|
|
467
|
+
color: var(--color-text-primary);
|
|
468
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
<view class="w-date-picker">
|
|
2
|
+
<view
|
|
3
|
+
class="w-date-picker__trigger w-date-picker--size-{{size || _formItemSize || 'medium'}} {{(disabled || _formItemDisabled) ? 'w-date-picker--disabled' : ''}} {{readonly ? 'w-date-picker--readonly' : ''}} {{status === 'error' ? 'w-date-picker--error' : ''}} {{status === 'warning' ? 'w-date-picker--warning' : ''}}"
|
|
4
|
+
bindtap="handleTap"
|
|
5
|
+
>
|
|
6
|
+
<text wx:if="{{_displayText}}" class="w-date-picker__text">{{_displayText}}</text>
|
|
7
|
+
<text wx:else class="w-date-picker__placeholder">{{placeholder}}</text>
|
|
8
|
+
<view
|
|
9
|
+
wx:if="{{clearable && _displayText && !disabled && !_formItemDisabled && !readonly}}"
|
|
10
|
+
class="w-date-picker__clear"
|
|
11
|
+
catchtap="handleClear"
|
|
12
|
+
>
|
|
13
|
+
<text class="w-date-picker__clear-icon iconfont icon-close"></text>
|
|
14
|
+
</view>
|
|
15
|
+
<view wx:else class="w-date-picker__icon">
|
|
16
|
+
<text class="w-date-picker__calendar-icon iconfont icon-calendar"></text>
|
|
17
|
+
</view>
|
|
18
|
+
</view>
|
|
19
|
+
|
|
20
|
+
<w-drawer show="{{_visible}}" placement="bottom" round bind:update:show="handleCancel">
|
|
21
|
+
<view class="w-date-picker__panel">
|
|
22
|
+
<!-- Header -->
|
|
23
|
+
<view class="w-date-picker__header">
|
|
24
|
+
<view class="w-date-picker__btn" bindtap="handleCancel">取消</view>
|
|
25
|
+
<view class="w-date-picker__title">
|
|
26
|
+
{{type === 'datetime' ? '选择日期时间' : type === 'month' ? '选择月份' : type === 'year' ?
|
|
27
|
+
'选择年份' : type === 'daterange' ? '选择日期范围' : type === 'datetimerange' ?
|
|
28
|
+
'选择日期时间范围' : type === 'monthrange' ? '选择月份范围' : type === 'yearrange' ?
|
|
29
|
+
'选择年份范围' : type === 'quarter' ? '选择季度' : type === 'quarterrange' ?
|
|
30
|
+
'选择季度范围' : type === 'week' ? '选择周' : '选择日期'}}
|
|
31
|
+
</view>
|
|
32
|
+
<view class="w-date-picker__btn w-date-picker__btn--primary" bindtap="handleConfirm">
|
|
33
|
+
确认
|
|
34
|
+
</view>
|
|
35
|
+
</view>
|
|
36
|
+
|
|
37
|
+
<!-- Range Bar (range types only) -->
|
|
38
|
+
<view wx:if="{{_isRange}}" class="w-date-picker__range-bar">
|
|
39
|
+
<view
|
|
40
|
+
class="w-date-picker__range-bar-item {{_activeEndpoint === 'start' ? 'w-date-picker__range-bar-item--active' : ''}}"
|
|
41
|
+
bindtap="handleEndpointTap"
|
|
42
|
+
data-endpoint="start"
|
|
43
|
+
>
|
|
44
|
+
<text>{{_rangeStartText || '开始'}}</text>
|
|
45
|
+
</view>
|
|
46
|
+
<text class="w-date-picker__range-bar-separator">~</text>
|
|
47
|
+
<view
|
|
48
|
+
class="w-date-picker__range-bar-item {{_activeEndpoint === 'end' ? 'w-date-picker__range-bar-item--active' : ''}}"
|
|
49
|
+
bindtap="handleEndpointTap"
|
|
50
|
+
data-endpoint="end"
|
|
51
|
+
>
|
|
52
|
+
<text>{{_rangeEndText || '结束'}}</text>
|
|
53
|
+
</view>
|
|
54
|
+
</view>
|
|
55
|
+
|
|
56
|
+
<!-- Shortcut bar -->
|
|
57
|
+
<view wx:if="{{type === 'date' || type === 'datetime'}}" class="w-date-picker__shortcuts">
|
|
58
|
+
<view class="w-date-picker__shortcut" bindtap="handleShortcut" data-action="today">
|
|
59
|
+
今天
|
|
60
|
+
</view>
|
|
61
|
+
<view
|
|
62
|
+
wx:if="{{type === 'datetime'}}"
|
|
63
|
+
class="w-date-picker__shortcut"
|
|
64
|
+
bindtap="handleShortcut"
|
|
65
|
+
data-action="now"
|
|
66
|
+
>
|
|
67
|
+
此刻
|
|
68
|
+
</view>
|
|
69
|
+
</view>
|
|
70
|
+
<view
|
|
71
|
+
wx:elif="{{type === 'daterange' || type === 'datetimerange'}}"
|
|
72
|
+
class="w-date-picker__shortcuts"
|
|
73
|
+
>
|
|
74
|
+
<view class="w-date-picker__shortcut" bindtap="handleShortcut" data-action="today">
|
|
75
|
+
今天
|
|
76
|
+
</view>
|
|
77
|
+
<view
|
|
78
|
+
wx:if="{{type === 'datetimerange'}}"
|
|
79
|
+
class="w-date-picker__shortcut"
|
|
80
|
+
bindtap="handleShortcut"
|
|
81
|
+
data-action="now"
|
|
82
|
+
>
|
|
83
|
+
此刻
|
|
84
|
+
</view>
|
|
85
|
+
</view>
|
|
86
|
+
<view wx:elif="{{type === 'week'}}" class="w-date-picker__shortcuts">
|
|
87
|
+
<view class="w-date-picker__shortcut" bindtap="handleShortcut" data-action="thisWeek">
|
|
88
|
+
本周
|
|
89
|
+
</view>
|
|
90
|
+
</view>
|
|
91
|
+
<view wx:elif="{{type === 'monthrange'}}" class="w-date-picker__shortcuts">
|
|
92
|
+
<view class="w-date-picker__shortcut" bindtap="handleShortcut" data-action="thisMonth">
|
|
93
|
+
本月
|
|
94
|
+
</view>
|
|
95
|
+
</view>
|
|
96
|
+
<view wx:elif="{{type === 'yearrange'}}" class="w-date-picker__shortcuts">
|
|
97
|
+
<view class="w-date-picker__shortcut" bindtap="handleShortcut" data-action="thisYear">
|
|
98
|
+
今年
|
|
99
|
+
</view>
|
|
100
|
+
</view>
|
|
101
|
+
<view
|
|
102
|
+
wx:elif="{{type === 'quarter' || type === 'quarterrange'}}"
|
|
103
|
+
class="w-date-picker__shortcuts"
|
|
104
|
+
>
|
|
105
|
+
<view class="w-date-picker__shortcut" bindtap="handleShortcut" data-action="thisQuarter">
|
|
106
|
+
本季度
|
|
107
|
+
</view>
|
|
108
|
+
</view>
|
|
109
|
+
|
|
110
|
+
<!-- Navigation -->
|
|
111
|
+
<view class="w-date-picker__nav">
|
|
112
|
+
<view class="w-date-picker__nav-btn" bindtap="handlePrev">
|
|
113
|
+
<text class="iconfont icon-left"></text>
|
|
114
|
+
</view>
|
|
115
|
+
<view class="w-date-picker__nav-title" bindtap="handleTitleTap">{{_panelTitle}}</view>
|
|
116
|
+
<view class="w-date-picker__nav-btn" bindtap="handleNext">
|
|
117
|
+
<text class="iconfont icon-right"></text>
|
|
118
|
+
</view>
|
|
119
|
+
</view>
|
|
120
|
+
|
|
121
|
+
<!-- Date panel (date / datetime / daterange / datetimerange / week) -->
|
|
122
|
+
<view wx:if="{{_panelMode === 'date'}}" class="w-date-picker__calendar">
|
|
123
|
+
<view class="w-date-picker__weekdays">
|
|
124
|
+
<view wx:for="{{_weekDays}}" wx:key="*this" class="w-date-picker__weekday">{{item}}</view>
|
|
125
|
+
</view>
|
|
126
|
+
<view class="w-date-picker__days">
|
|
127
|
+
<view
|
|
128
|
+
wx:for="{{_days}}"
|
|
129
|
+
wx:key="index"
|
|
130
|
+
class="w-date-picker__day {{item.isCurrentMonth ? '' : 'w-date-picker__day--other'}} {{item.isSelected ? 'w-date-picker__day--selected' : ''}} {{item.isToday ? 'w-date-picker__day--today' : ''}} {{item.isRangeStart ? 'w-date-picker__day--range-start' : ''}} {{item.isRangeEnd ? 'w-date-picker__day--range-end' : ''}} {{item.isInRange ? 'w-date-picker__day--in-range' : ''}}"
|
|
131
|
+
bindtap="handleDayTap"
|
|
132
|
+
data-year="{{item.year}}"
|
|
133
|
+
data-month="{{item.month}}"
|
|
134
|
+
data-day="{{item.day}}"
|
|
135
|
+
>
|
|
136
|
+
<view class="w-date-picker__day-inner">{{item.day}}</view>
|
|
137
|
+
</view>
|
|
138
|
+
</view>
|
|
139
|
+
</view>
|
|
140
|
+
|
|
141
|
+
<!-- Month panel -->
|
|
142
|
+
<view wx:if="{{_panelMode === 'month'}}" class="w-date-picker__months">
|
|
143
|
+
<view
|
|
144
|
+
wx:for="{{_monthList}}"
|
|
145
|
+
wx:key="month"
|
|
146
|
+
class="w-date-picker__month-cell {{item.isSelected ? 'w-date-picker__month-cell--selected' : ''}} {{item.isCurrent ? 'w-date-picker__month-cell--current' : ''}} {{item.isRangeStart ? 'w-date-picker__month-cell--range-start' : ''}} {{item.isRangeEnd ? 'w-date-picker__month-cell--range-end' : ''}} {{item.isInRange ? 'w-date-picker__month-cell--in-range' : ''}}"
|
|
147
|
+
bindtap="handleMonthTap"
|
|
148
|
+
data-month="{{item.month}}"
|
|
149
|
+
>
|
|
150
|
+
{{item.label}}
|
|
151
|
+
</view>
|
|
152
|
+
</view>
|
|
153
|
+
|
|
154
|
+
<!-- Year panel -->
|
|
155
|
+
<view wx:if="{{_panelMode === 'year'}}" class="w-date-picker__years">
|
|
156
|
+
<view
|
|
157
|
+
wx:for="{{_yearObjList}}"
|
|
158
|
+
wx:key="year"
|
|
159
|
+
class="w-date-picker__year-cell {{item.isSelected ? 'w-date-picker__year-cell--selected' : ''}} {{item.isCurrent ? 'w-date-picker__year-cell--current' : ''}} {{item.isRangeStart ? 'w-date-picker__year-cell--range-start' : ''}} {{item.isRangeEnd ? 'w-date-picker__year-cell--range-end' : ''}} {{item.isInRange ? 'w-date-picker__year-cell--in-range' : ''}}"
|
|
160
|
+
bindtap="handleYearTap"
|
|
161
|
+
data-year="{{item.year}}"
|
|
162
|
+
>
|
|
163
|
+
{{item.year}}
|
|
164
|
+
</view>
|
|
165
|
+
</view>
|
|
166
|
+
|
|
167
|
+
<!-- Quarter panel -->
|
|
168
|
+
<view wx:if="{{_panelMode === 'quarter'}}" class="w-date-picker__quarters">
|
|
169
|
+
<view
|
|
170
|
+
wx:for="{{_quarterList}}"
|
|
171
|
+
wx:key="quarter"
|
|
172
|
+
class="w-date-picker__quarter-cell {{item.isSelected ? 'w-date-picker__quarter-cell--selected' : ''}} {{item.isCurrent ? 'w-date-picker__quarter-cell--current' : ''}} {{item.isRangeStart ? 'w-date-picker__quarter-cell--range-start' : ''}} {{item.isRangeEnd ? 'w-date-picker__quarter-cell--range-end' : ''}} {{item.isInRange ? 'w-date-picker__quarter-cell--in-range' : ''}}"
|
|
173
|
+
bindtap="handleQuarterTap"
|
|
174
|
+
data-quarter="{{item.quarter}}"
|
|
175
|
+
>
|
|
176
|
+
{{item.label}}
|
|
177
|
+
</view>
|
|
178
|
+
</view>
|
|
179
|
+
|
|
180
|
+
<!-- Time picker for datetime / datetimerange -->
|
|
181
|
+
<view
|
|
182
|
+
wx:if="{{(type === 'datetime' || type === 'datetimerange') && _panelMode === 'date'}}"
|
|
183
|
+
class="w-date-picker__time"
|
|
184
|
+
>
|
|
185
|
+
<view class="w-date-picker__time-label">
|
|
186
|
+
{{type === 'datetimerange' ? (_activeEndpoint === 'start' ? '开始时间' : '结束时间') :
|
|
187
|
+
'时间'}}
|
|
188
|
+
</view>
|
|
189
|
+
<picker-view
|
|
190
|
+
class="w-date-picker__time-picker"
|
|
191
|
+
value="{{type === 'datetimerange' ? (_activeEndpoint === 'start' ? _startTimePickerValue : _endTimePickerValue) : _timePickerValue}}"
|
|
192
|
+
indicator-class="w-date-picker__time-indicator"
|
|
193
|
+
bindchange="handleTimeChange"
|
|
194
|
+
>
|
|
195
|
+
<picker-view-column>
|
|
196
|
+
<view wx:for="{{_timeHours}}" wx:key="*this" class="w-date-picker__time-item">
|
|
197
|
+
{{item}}
|
|
198
|
+
</view>
|
|
199
|
+
</picker-view-column>
|
|
200
|
+
<picker-view-column>
|
|
201
|
+
<view wx:for="{{_timeMinutes}}" wx:key="*this" class="w-date-picker__time-item">
|
|
202
|
+
{{item}}
|
|
203
|
+
</view>
|
|
204
|
+
</picker-view-column>
|
|
205
|
+
<picker-view-column>
|
|
206
|
+
<view wx:for="{{_timeSeconds}}" wx:key="*this" class="w-date-picker__time-item">
|
|
207
|
+
{{item}}
|
|
208
|
+
</view>
|
|
209
|
+
</picker-view-column>
|
|
210
|
+
</picker-view>
|
|
211
|
+
</view>
|
|
212
|
+
</view>
|
|
213
|
+
</w-drawer>
|
|
214
|
+
</view>
|