From 8a2cf467c1ef2622885ac2a920b6beb6e124a47b Mon Sep 17 00:00:00 2001
From: HRK <119110706+18148764734@users.noreply.github.com>
Date: Wed, 24 Apr 2024 16:22:27 +0800
Subject: [PATCH] =?UTF-8?q?feat=E2=9C=A8:=20uni-datetime-picker=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E7=82=B9=E5=87=BB=E6=97=A5=E6=9C=9F=E4=BA=8B=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/vue/datetime-picker/datetime-picker.vue | 11 +-
uni_modules/uni-datetime-picker/changelog.md | 2 +
.../uni-datetime-picker/calendar.vue | 8 +-
.../uni-datetime-picker.vue | 2106 +++++++++--------
uni_modules/uni-datetime-picker/package.json | 2 +-
5 files changed, 1070 insertions(+), 1059 deletions(-)
diff --git a/pages/vue/datetime-picker/datetime-picker.vue b/pages/vue/datetime-picker/datetime-picker.vue
index 94e0ea4d..b885e23a 100644
--- a/pages/vue/datetime-picker/datetime-picker.vue
+++ b/pages/vue/datetime-picker/datetime-picker.vue
@@ -21,7 +21,7 @@
-
+
@@ -77,9 +77,9 @@
console.log('日期时间范围选:', this.datetimeRange);
}
},
- methods: {
- show(){
- console.log('----show事件:');
+ methods: {
+ show(){
+ console.log('----show事件:');
},
change(e) {
console.log('----change事件:', e);
@@ -106,6 +106,9 @@
`${addZero ? this.addZero(hour) : hour}:${addZero ? this.addZero(minute) : minute}` :
`${addZero ? this.addZero(hour) : hour}:${addZero ? this.addZero(minute) : minute}:${addZero ? this.addZero(second) : second}`
},
+ calendarClick(e){
+ console.log("点击的日期:",JSON.stringify(e))
+ },
addZero(num) {
if (num < 10) {
num = `0${num}`
diff --git a/uni_modules/uni-datetime-picker/changelog.md b/uni_modules/uni-datetime-picker/changelog.md
index 0e764775..8798e937 100644
--- a/uni_modules/uni-datetime-picker/changelog.md
+++ b/uni_modules/uni-datetime-picker/changelog.md
@@ -1,3 +1,5 @@
+## 2.2.34(2024-04-24)
+- 新增 日期点击事件,在点击日期时会触发该事件。
## 2.2.33(2024-04-15)
- 修复 抖音小程序事件传递失效bug
## 2.2.32(2024-02-20)
diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue
index 31f7340e..e6fe5944 100644
--- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue
+++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue
@@ -541,8 +541,8 @@
/**
* 变化触发
*/
- change() {
- if (!this.insert) return
+ change(isSingleChange) {
+ if (!this.insert && !isSingleChange) return
this.setEmit('change')
},
/**
@@ -611,7 +611,7 @@
this.tempRange.before = this.cale.multipleStatus.before
this.tempRange.after = this.cale.multipleStatus.after
}
- this.change()
+ this.change(true)
},
changeMonth(type) {
let newDate
@@ -944,4 +944,4 @@
}
/* #endif */
-
+
diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue
index 5a4025b0..11fc45a9 100644
--- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue
+++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue
@@ -1,1051 +1,1057 @@
-
-
-
-
-
-
-
- {{ displayValue || singlePlaceholderText }}
-
-
-
-
- {{ displayRangeValue.startDate || startPlaceholderText }}
-
- {{rangeSeparator}}
-
- {{ displayRangeValue.endDate || endPlaceholderText }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-datetime-picker/package.json b/uni_modules/uni-datetime-picker/package.json
index c8709499..4d1b05c5 100644
--- a/uni_modules/uni-datetime-picker/package.json
+++ b/uni_modules/uni-datetime-picker/package.json
@@ -1,7 +1,7 @@
{
"id": "uni-datetime-picker",
"displayName": "uni-datetime-picker 日期选择器",
- "version": "2.2.33",
+ "version": "2.2.34",
"description": "uni-datetime-picker 日期时间选择器,支持日历,支持范围选择",
"keywords": [
"uni-datetime-picker",