@xtdev/xt-miniprogram-ui 1.2.48 → 1.2.50
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.
|
@@ -93,7 +93,6 @@ Component({
|
|
|
93
93
|
endDateStr: '', // 结束日期字符
|
|
94
94
|
defaultDate: '', // 默认日期(组件接收的|当前时间)
|
|
95
95
|
checkedType: 'start', // 当前选择的日期类型
|
|
96
|
-
clickedEnd: false, // 点击结束时间
|
|
97
96
|
filtType: 'dateRange', // 选择器模式
|
|
98
97
|
typeEnums: {
|
|
99
98
|
date: '按日筛选',
|
|
@@ -346,10 +345,8 @@ Component({
|
|
|
346
345
|
// 切换日期类型
|
|
347
346
|
switchDateType(e) {
|
|
348
347
|
const checkedType = e.currentTarget.dataset.type;
|
|
349
|
-
const { data: { clickedEnd } } = this;
|
|
350
348
|
this.setData({
|
|
351
349
|
checkedType,
|
|
352
|
-
clickedEnd: checkedType === 'end' ? true : clickedEnd
|
|
353
350
|
});
|
|
354
351
|
this.showCheckedPicker();
|
|
355
352
|
},
|
|
@@ -405,7 +402,6 @@ Component({
|
|
|
405
402
|
endDateArr: [],
|
|
406
403
|
endDateStr: '',
|
|
407
404
|
endDateValue: '',
|
|
408
|
-
clickedEnd: false
|
|
409
405
|
})
|
|
410
406
|
}
|
|
411
407
|
},
|
|
@@ -17,10 +17,12 @@
|
|
|
17
17
|
<view class="date-sel">
|
|
18
18
|
<view wx:if="{{filtType === 'date'}}" class="sel-sigle actived">{{dateStr}}</view>
|
|
19
19
|
<view wx:else class="sel-range">
|
|
20
|
-
<view catchtap="switchDateType" data-type="start" class="sel-start
|
|
20
|
+
<view catchtap="switchDateType" data-type="start" class="sel-start {{checkedType == 'start' ? 'actived' : ''}}">
|
|
21
|
+
{{startDateStr}}
|
|
22
|
+
</view>
|
|
21
23
|
<view>至</view>
|
|
22
|
-
<view catchtap="switchDateType" data-type="end" class="sel-end {{
|
|
23
|
-
{{
|
|
24
|
+
<view catchtap="switchDateType" data-type="end" class="sel-end {{checkedType == 'end' ? 'actived' : ''}}">
|
|
25
|
+
{{ endDateStr || '结束时间'}}
|
|
24
26
|
</view>
|
|
25
27
|
</view>
|
|
26
28
|
</view>
|
|
@@ -107,7 +107,6 @@ Component({
|
|
|
107
107
|
endDateStr: "", // 结束日期字符
|
|
108
108
|
defaultDate: "", // 默认日期(组件接收的|当前时间)
|
|
109
109
|
checkedType: "start", // 当前选择的日期类型
|
|
110
|
-
clickedEnd: false, // 点击结束时间
|
|
111
110
|
filtType: "dateRange", // 选择器模式
|
|
112
111
|
btnDisabled: false, // 按钮禁用
|
|
113
112
|
newDaysArr: [], // 新的天数数组列表,储存拖动之后的天数数组值,用于拖动结束后更新
|
|
@@ -264,6 +263,7 @@ Component({
|
|
|
264
263
|
dateArr,
|
|
265
264
|
defaultDate,
|
|
266
265
|
minDate,
|
|
266
|
+
filtType
|
|
267
267
|
},
|
|
268
268
|
} = this;
|
|
269
269
|
currentDate = currentDate || getDefaultDate();
|
|
@@ -281,7 +281,7 @@ Component({
|
|
|
281
281
|
: 1;
|
|
282
282
|
if (curDateArr && curDateArr.length) {
|
|
283
283
|
// 如果有设置当前日期,则数组下标选中当前日期
|
|
284
|
-
dateStr = `${curYear}年${curMonth}月${curDay}日`;
|
|
284
|
+
dateStr = filtType === "yearMonth" ? `${curYear}年${curMonth}月` : `${curYear}年${curMonth}月${curDay}日`;
|
|
285
285
|
dateArr = [
|
|
286
286
|
curYear - defaultYear,
|
|
287
287
|
curMonth - defaultMonth,
|
|
@@ -290,7 +290,9 @@ Component({
|
|
|
290
290
|
dateValue = `${curYear}-${curMonth}-${curDay}`;
|
|
291
291
|
} else {
|
|
292
292
|
// 如果有设置当前日期,则数组下标默认选中当前
|
|
293
|
-
dateStr = `${now.getFullYear()}年${
|
|
293
|
+
dateStr = filtType === "yearMonth" ? `${now.getFullYear()}年${
|
|
294
|
+
now.getMonth() + 1
|
|
295
|
+
}月` : `${now.getFullYear()}年${
|
|
294
296
|
now.getMonth() + 1
|
|
295
297
|
}月${now.getDate()}日`;
|
|
296
298
|
dateArr = [now.getFullYear() - 1990, now.getMonth(), now.getDate() - 1];
|
|
@@ -548,12 +550,8 @@ Component({
|
|
|
548
550
|
// 切换日期类型
|
|
549
551
|
switchDateType(e) {
|
|
550
552
|
const checkedType = e.currentTarget.dataset.type;
|
|
551
|
-
const {
|
|
552
|
-
data: { clickedEnd },
|
|
553
|
-
} = this;
|
|
554
553
|
this.setData({
|
|
555
554
|
checkedType,
|
|
556
|
-
clickedEnd: checkedType === "end" ? true : clickedEnd,
|
|
557
555
|
});
|
|
558
556
|
this.showCheckedPicker();
|
|
559
557
|
},
|
|
@@ -614,8 +612,7 @@ Component({
|
|
|
614
612
|
startDateStr: resetDateStr,
|
|
615
613
|
endDateArr: [],
|
|
616
614
|
endDateStr: '',
|
|
617
|
-
endDateValue: ''
|
|
618
|
-
clickedEnd: false
|
|
615
|
+
endDateValue: ''
|
|
619
616
|
})
|
|
620
617
|
}
|
|
621
618
|
},
|
|
@@ -17,10 +17,12 @@
|
|
|
17
17
|
<view class="date-sel">
|
|
18
18
|
<view wx:if="{{filtType === 'date' || filtType === 'yearMonth'}}" class="sel-sigle actived">{{dateStr}}</view>
|
|
19
19
|
<view wx:else class="sel-range">
|
|
20
|
-
<view catchtap="switchDateType" data-type="start" class="sel-start actived
|
|
20
|
+
<view catchtap="switchDateType" data-type="start" class="sel-start {{checkedType == 'start' ? 'actived' : ''}}">
|
|
21
|
+
{{startDateStr}}
|
|
22
|
+
</view>
|
|
21
23
|
<view>至</view>
|
|
22
|
-
<view catchtap="switchDateType" data-type="end" class="sel-end
|
|
23
|
-
{{
|
|
24
|
+
<view catchtap="switchDateType" data-type="end" class="sel-end {{checkedType == 'end' ? 'actived' : ''}}">
|
|
25
|
+
{{ endDateStr || '结束时间'}}
|
|
24
26
|
</view>
|
|
25
27
|
</view>
|
|
26
28
|
</view>
|