@xtdev/xt-miniprogram-ui 1.2.43 → 1.2.45
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.
|
@@ -593,11 +593,34 @@ Component({
|
|
|
593
593
|
});
|
|
594
594
|
},
|
|
595
595
|
// 重置时间
|
|
596
|
-
|
|
597
|
-
this
|
|
596
|
+
onReset() {
|
|
597
|
+
const { data: { defaultDate, filtType, minDate } } = this;
|
|
598
|
+
let resetDateValue, resetDateStr, resetDateArr;
|
|
599
|
+
let { data: { dateStr } } = this;
|
|
600
|
+
let curDateArr = this.transformToArr(defaultDate);
|
|
601
|
+
let minDateArr = this.transformToArr(minDate);
|
|
602
|
+
resetDateStr = `${curDateArr[0]}年${curDateArr[1]}月${curDateArr[2]}日`;
|
|
603
|
+
resetDateArr = [curDateArr[0] - (minDateArr && minDateArr[0] ? minDateArr[0] : 1990), curDateArr[1] - 1, curDateArr[2] - 1];
|
|
604
|
+
resetDateValue = `${curDateArr[0]}-${curDateArr[1]}-${curDateArr[2]}`;
|
|
605
|
+
this.setData({
|
|
606
|
+
dateArr: resetDateArr,
|
|
607
|
+
dateStr: resetDateStr,
|
|
608
|
+
dateValue: resetDateValue
|
|
609
|
+
});
|
|
610
|
+
if (filtType === 'dateRange') {
|
|
611
|
+
this.setData({
|
|
612
|
+
startDateValue: resetDateValue,
|
|
613
|
+
startDateArr: resetDateArr,
|
|
614
|
+
startDateStr: resetDateStr,
|
|
615
|
+
endDateArr: [],
|
|
616
|
+
endDateStr: '',
|
|
617
|
+
endDateValue: '',
|
|
618
|
+
clickedEnd: false
|
|
619
|
+
})
|
|
620
|
+
}
|
|
598
621
|
},
|
|
599
622
|
// 关闭选择器
|
|
600
|
-
|
|
623
|
+
onClose() {
|
|
601
624
|
this.onReset();
|
|
602
625
|
this.setData({ show: false });
|
|
603
626
|
},
|