uview-plus 3.3.67 → 3.3.68
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/changelog.md +7 -0
- package/components/u-calendar/calendar.js +3 -1
- package/components/u-calendar/header.vue +1 -1
- package/components/u-calendar/month.vue +24 -3
- package/components/u-calendar/props.js +9 -1
- package/components/u-calendar/u-calendar.vue +2 -0
- package/components/u-number-box/u-number-box.vue +2 -0
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
:class="[item1.selected && 'u-calendar-month__days__day__select--selected']">
|
|
13
13
|
<view class="u-calendar-month__days__day__select" :style="[daySelectStyle(index, index1, item1)]">
|
|
14
14
|
<text class="u-calendar-month__days__day__select__info"
|
|
15
|
-
:class="[item1.disabled
|
|
15
|
+
:class="[(item1.disabled || isForbid(item1) ) ? 'u-calendar-month__days__day__select__info--disabled' : '']"
|
|
16
16
|
:style="[textStyle(item1)]">{{ item1.day }}</text>
|
|
17
17
|
<text v-if="getBottomInfo(index, index1, item1)"
|
|
18
18
|
class="u-calendar-month__days__day__select__buttom-info"
|
|
19
|
-
:class="[item1.disabled
|
|
19
|
+
:class="[(item1.disabled || isForbid(item1) ) ? 'u-calendar-month__days__day__select__buttom-info--disabled' : '']"
|
|
20
20
|
:style="[textStyle(item1)]">{{ getBottomInfo(index, index1, item1) }}</text>
|
|
21
21
|
<text v-if="item1.dot" class="u-calendar-month__days__day__select__dot"></text>
|
|
22
22
|
</view>
|
|
@@ -126,6 +126,14 @@
|
|
|
126
126
|
allowSameDay: {
|
|
127
127
|
type: Boolean,
|
|
128
128
|
default: false
|
|
129
|
+
},
|
|
130
|
+
forbidDays: {
|
|
131
|
+
type: Array,
|
|
132
|
+
default: () => []
|
|
133
|
+
},
|
|
134
|
+
forbidDaysToast: {
|
|
135
|
+
type: String,
|
|
136
|
+
default: ''
|
|
129
137
|
}
|
|
130
138
|
},
|
|
131
139
|
data() {
|
|
@@ -167,7 +175,7 @@
|
|
|
167
175
|
style.marginLeft = addUnit(week * dayWidth, 'px')
|
|
168
176
|
}
|
|
169
177
|
if (this.mode === 'range') {
|
|
170
|
-
// 之所以需要这么写,是因为DCloud公司的iOS
|
|
178
|
+
// 之所以需要这么写,是因为DCloud公司的iOS客户端导致的bug
|
|
171
179
|
style.paddingLeft = 0
|
|
172
180
|
style.paddingRight = 0
|
|
173
181
|
style.paddingBottom = 0
|
|
@@ -297,6 +305,13 @@
|
|
|
297
305
|
})
|
|
298
306
|
})
|
|
299
307
|
},
|
|
308
|
+
isForbid(item) {
|
|
309
|
+
let date = dayjs(item.date).format("YYYY-MM-DD")
|
|
310
|
+
if (this.mode !== 'range' && this.forbidDays.includes(date)) {
|
|
311
|
+
return true
|
|
312
|
+
}
|
|
313
|
+
return false
|
|
314
|
+
},
|
|
300
315
|
// 判断两个日期是否相等
|
|
301
316
|
dateSame(date1, date2) {
|
|
302
317
|
return dayjs(date1).isSame(dayjs(date2))
|
|
@@ -362,6 +377,12 @@
|
|
|
362
377
|
this.item = item
|
|
363
378
|
const date = dayjs(item.date).format("YYYY-MM-DD")
|
|
364
379
|
if (item.disabled) return
|
|
380
|
+
if (this.isForbid(item)) {
|
|
381
|
+
uni.showToast({
|
|
382
|
+
title: this.forbidDaysToast
|
|
383
|
+
})
|
|
384
|
+
return
|
|
385
|
+
}
|
|
365
386
|
// 对上一次选择的日期数组进行深度克隆
|
|
366
387
|
let selected = deepClone(this.selected)
|
|
367
388
|
if (this.mode === 'single') {
|
|
@@ -147,6 +147,14 @@ export const props = defineMixin({
|
|
|
147
147
|
weekText: {
|
|
148
148
|
type: Array,
|
|
149
149
|
default: defProps.calendar.weekText
|
|
150
|
-
}
|
|
150
|
+
},
|
|
151
|
+
forbidDays: {
|
|
152
|
+
type: Array,
|
|
153
|
+
default: defProps.calendar.forbidDays
|
|
154
|
+
},
|
|
155
|
+
forbidDaysToast:{
|
|
156
|
+
type: String,
|
|
157
|
+
default: defProps.calendar.forbidDaysToast
|
|
158
|
+
},
|
|
151
159
|
}
|
|
152
160
|
})
|
|
@@ -313,6 +313,8 @@
|
|
|
313
313
|
// 为空返回
|
|
314
314
|
if (value === '') return
|
|
315
315
|
let formatted = this.filter(value)
|
|
316
|
+
// https://github.com/ijry/uview-plus/issues/613
|
|
317
|
+
this.emitChange(value);
|
|
316
318
|
// 最大允许的小数长度
|
|
317
319
|
if (this.decimalLength !== null && formatted.indexOf('.') !== -1) {
|
|
318
320
|
const pair = formatted.split('.');
|
package/package.json
CHANGED