1
- <template >
2
- <view class =" uni-calendar-item__weeks-box" :class =" {
3
- 'uni-calendar-item--disable':weeks.disable,
4
- 'uni-calendar-item--before-checked-x':weeks.beforeMultiple,
5
- 'uni-calendar-item--multiple': weeks.multiple,
6
- 'uni-calendar-item--after-checked-x':weeks.afterMultiple,
7
- }" @click =" choiceDate(weeks)" @mouseenter =" handleMousemove(weeks)" >
8
- <view class =" uni-calendar-item__weeks-box-item" :class =" {
9
- 'uni-calendar-item--isDay-text': weeks.isDay,
10
- 'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
11
- 'uni-calendar-item--checked-range-text': checkHover,
12
- 'uni-calendar-item--before-checked':weeks.beforeMultiple,
13
- 'uni-calendar-item--multiple': weeks.multiple,
14
- 'uni-calendar-item--after-checked':weeks.afterMultiple,
15
- 'uni-calendar-item--disable':weeks.disable,
16
- }" >
17
- <text v-if =" selected&&weeks.extraInfo" class =" uni-calendar-item__weeks-box-circle" ></text >
18
- <text class =" uni-calendar-item__weeks-box-text" >{{weeks.date}}</text >
19
- <!-- <text v-if="!lunar&&!weeks.extraInfo && weeks.isDay" class="uni-calendar-item__weeks-lunar-text">今天</text>
20
- <text v-if="lunar&&!weeks.extraInfo" class="uni-calendar-item__weeks-lunar-text" >{{weeks.isDay?'今天': (weeks.lunar.IDayCn === '初一'?weeks.lunar.IMonthCn:weeks.lunar.IDayCn)}}</text> -->
21
- <!-- <text v-if="weeks.extraInfo&&weeks.extraInfo.info" class="uni-calendar-item__weeks-lunar-text">{{weeks.extraInfo.info}}</text> -->
22
- </view >
23
- </view >
24
- </template >
25
-
26
- <script >
27
- export default {
28
- props: {
29
- weeks: {
30
- type: Object ,
31
- default () {
32
- return {}
33
- }
34
- },
35
- calendar: {
36
- type: Object ,
37
- default : () => {
38
- return {}
39
- }
40
- },
41
- selected: {
42
- type: Array ,
43
- default : () => {
44
- return []
45
- }
46
- },
47
- lunar: {
48
- type: Boolean ,
49
- default: false
50
- },
51
- checkHover: {
52
- type: Boolean ,
53
- default: false
54
- }
55
- },
56
- methods: {
57
- choiceDate (weeks ) {
58
- this .$emit (' change' , weeks)
59
- },
60
- handleMousemove (weeks ) {
61
- this .$emit (' handleMouse' , weeks)
62
- }
63
- }
64
- }
65
- </script >
66
-
67
- <style scoped>
68
- .uni-calendar-item__weeks-box {
69
- flex : 1 ;
70
- /* #ifndef APP-NVUE */
71
- display : flex ;
72
- /* #endif */
73
- flex-direction : column ;
74
- justify-content : center ;
75
- align-items : center ;
76
- margin : 3px 0 ;
77
- }
78
-
79
- .uni-calendar-item__weeks-box-text {
80
- font-size : 14px ;
81
- }
82
-
83
- .uni-calendar-item__weeks-lunar-text {
84
- font-size : 12px ;
85
- color : #333 ;
86
- }
87
-
88
- .uni-calendar-item__weeks-box-item {
89
- position : relative ;
90
- /* #ifndef APP-NVUE */
91
- display : flex ;
92
- /* #endif */
93
- flex-direction : column ;
94
- justify-content : center ;
95
- align-items : center ;
96
- width : 43px ;
97
- height : 43px ;
98
- /* #ifdef H5 */
99
- cursor : pointer ;
100
- /* #endif */
101
- }
102
-
103
- .uni-calendar-item__weeks-box-circle {
104
- position : absolute ;
105
- top : 5px ;
106
- right : 5px ;
107
- width : 8px ;
108
- height : 8px ;
109
- border-radius : 8px ;
110
- background-color : #dd524d ;
111
- }
112
-
113
- .uni-calendar-item__weeks-box .uni-calendar-item--disable {
114
- color : #c0c0c0 ;
115
- cursor : default ;
116
- }
117
-
118
- .uni-calendar-item--isDay-text {
119
- color : #007aff !important ;
120
- }
121
-
122
- .uni-calendar-item--isDay {
123
- background-color : #007aff ;
124
- opacity : 0.8 ;
125
- color : #fff ;
126
- }
127
-
128
- .uni-calendar-item--extra {
129
- color : #dd524d ;
130
- opacity : 0.8 ;
131
- }
132
-
133
- .uni-calendar-item--checked {
134
- background-color : #007aff ;
135
- box-sizing : border-box ;
136
- border : 6px solid #f2f6fc ;
137
- color : #fff ;
138
- opacity : 0.8 ;
139
- }
140
-
141
- .uni-calendar-item--multiple .uni-calendar-item--checked-range-text {
142
- color : #333 ;
143
- }
144
-
145
- .uni-calendar-item--multiple {
146
- background-color : #f2f6fc ;
147
- opacity : 0.8 ;
148
- }
149
-
150
- .uni-calendar-item--multiple .uni-calendar-item--before-checked {
151
- background-color : #409eff ;
152
- color : #fff !important ;
153
- box-sizing : border-box ;
154
- border : 6px solid #f2f6fc ;
155
- }
156
-
157
- .uni-calendar-item--multiple .uni-calendar-item--after-checked {
158
- background-color : #409eff ;
159
- color : #fff !important ;
160
- box-sizing : border-box ;
161
- border : 6px solid #f2f6fc ;
162
- }
163
-
164
- .uni-calendar-item--before-checked-x {
165
- background-color : #f2f6fc ;
166
- }
167
-
168
- .uni-calendar-item--after-checked-x {
169
- background-color : #f2f6fc ;
170
- }
1
+ <template >
2
+ <view class =" uni-calendar-item__weeks-box" :class =" {
3
+ 'uni-calendar-item--disable':weeks.disable,
4
+ 'uni-calendar-item--before-checked-x':weeks.beforeMultiple,
5
+ 'uni-calendar-item--multiple': weeks.multiple,
6
+ 'uni-calendar-item--after-checked-x':weeks.afterMultiple,
7
+ }" @click =" choiceDate(weeks)" @mouseenter =" handleMousemove(weeks)" >
8
+ <view class =" uni-calendar-item__weeks-box-item" :class =" {
9
+ 'uni-calendar-item--isDay-text': weeks.isDay,
10
+ 'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && !weeks.isDay,
11
+ 'uni-calendar-item--checked-range-text': checkHover,
12
+ 'uni-calendar-item--before-checked':weeks.beforeMultiple,
13
+ 'uni-calendar-item--multiple': weeks.multiple,
14
+ 'uni-calendar-item--after-checked':weeks.afterMultiple,
15
+ 'uni-calendar-item--disable':weeks.disable,
16
+ }" >
17
+ <text v-if =" selected&&weeks.extraInfo" class =" uni-calendar-item__weeks-box-circle" ></text >
18
+ <text class =" uni-calendar-item__weeks-box-text" >{{weeks.date}}</text >
19
+ <!-- <text v-if="!lunar&&!weeks.extraInfo && weeks.isDay" class="uni-calendar-item__weeks-lunar-text">今天</text>
20
+ <text v-if="lunar&&!weeks.extraInfo" class="uni-calendar-item__weeks-lunar-text" >{{weeks.isDay?'今天': (weeks.lunar.IDayCn === '初一'?weeks.lunar.IMonthCn:weeks.lunar.IDayCn)}}</text> -->
21
+ <!-- <text v-if="weeks.extraInfo&&weeks.extraInfo.info" class="uni-calendar-item__weeks-lunar-text">{{weeks.extraInfo.info}}</text> -->
22
+ </view >
23
+ </view >
24
+ </template >
25
+
26
+ <script >
27
+ export default {
28
+ props: {
29
+ weeks: {
30
+ type: Object ,
31
+ default () {
32
+ return {}
33
+ }
34
+ },
35
+ calendar: {
36
+ type: Object ,
37
+ default : () => {
38
+ return {}
39
+ }
40
+ },
41
+ selected: {
42
+ type: Array ,
43
+ default : () => {
44
+ return []
45
+ }
46
+ },
47
+ lunar: {
48
+ type: Boolean ,
49
+ default: false
50
+ },
51
+ checkHover: {
52
+ type: Boolean ,
53
+ default: false
54
+ }
55
+ },
56
+ methods: {
57
+ choiceDate (weeks ) {
58
+ this .$emit (' change' , weeks)
59
+ },
60
+ handleMousemove (weeks ) {
61
+ this .$emit (' handleMouse' , weeks)
62
+ }
63
+ }
64
+ }
65
+ </script >
66
+
67
+ <style scoped>
68
+ .uni-calendar-item__weeks-box {
69
+ flex : 1 ;
70
+ /* #ifndef APP-NVUE */
71
+ display : flex ;
72
+ /* #endif */
73
+ flex-direction : column ;
74
+ justify-content : center ;
75
+ align-items : center ;
76
+ margin : 3px 0 ;
77
+ }
78
+
79
+ .uni-calendar-item__weeks-box-text {
80
+ font-size : 14px ;
81
+ }
82
+
83
+ .uni-calendar-item__weeks-lunar-text {
84
+ font-size : 12px ;
85
+ color : #333 ;
86
+ }
87
+
88
+ .uni-calendar-item__weeks-box-item {
89
+ position : relative ;
90
+ /* #ifndef APP-NVUE */
91
+ display : flex ;
92
+ /* #endif */
93
+ flex-direction : column ;
94
+ justify-content : center ;
95
+ align-items : center ;
96
+ width : 43px ;
97
+ height : 43px ;
98
+ /* #ifdef H5 */
99
+ cursor : pointer ;
100
+ /* #endif */
101
+ }
102
+
103
+ .uni-calendar-item__weeks-box-circle {
104
+ position : absolute ;
105
+ top : 5px ;
106
+ right : 5px ;
107
+ width : 8px ;
108
+ height : 8px ;
109
+ border-radius : 8px ;
110
+ background-color : #dd524d ;
111
+ }
112
+
113
+ .uni-calendar-item__weeks-box .uni-calendar-item--disable {
114
+ color : #c0c0c0 ;
115
+ cursor : default ;
116
+ }
117
+
118
+ .uni-calendar-item--isDay-text {
119
+ color : #007aff !important ;
120
+ }
121
+
122
+ .uni-calendar-item--isDay {
123
+ background-color : #007aff ;
124
+ opacity : 0.8 ;
125
+ color : #fff ;
126
+ }
127
+
128
+ .uni-calendar-item--extra {
129
+ color : #dd524d ;
130
+ opacity : 0.8 ;
131
+ }
132
+
133
+ .uni-calendar-item--checked {
134
+ background-color : #007aff ;
135
+ box-sizing : border-box ;
136
+ border : 6px solid #f2f6fc ;
137
+ color : #fff ;
138
+ opacity : 0.8 ;
139
+ }
140
+
141
+ .uni-calendar-item--multiple .uni-calendar-item--checked-range-text {
142
+ color : #333 ;
143
+ }
144
+
145
+ .uni-calendar-item--multiple {
146
+ background-color : #f2f6fc ;
147
+ opacity : 0.8 ;
148
+ }
149
+
150
+ .uni-calendar-item--multiple .uni-calendar-item--before-checked {
151
+ background-color : #409eff ;
152
+ color : #fff !important ;
153
+ box-sizing : border-box ;
154
+ border : 6px solid #f2f6fc ;
155
+ }
156
+
157
+ .uni-calendar-item--multiple .uni-calendar-item--after-checked {
158
+ background-color : #409eff ;
159
+ color : #fff !important ;
160
+ box-sizing : border-box ;
161
+ border : 6px solid #f2f6fc ;
162
+ }
163
+
164
+ .uni-calendar-item--before-checked-x {
165
+ background-color : #f2f6fc ;
166
+ }
167
+
168
+ .uni-calendar-item--after-checked-x {
169
+ background-color : #f2f6fc ;
170
+ }
171
171
</style >
0 commit comments