提交工作台和首页的更改
This commit is contained in:
37
components/DateTimePicker/index.js
Normal file
37
components/DateTimePicker/index.js
Normal file
@@ -0,0 +1,37 @@
|
||||
// components/datePicker/index.js
|
||||
import dayjs from "../../utils/dayjs"
|
||||
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
show: Boolean,
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
currentDate: new Date().getTime(),
|
||||
maxDate: new Date().getTime(),
|
||||
minDate: new Date(2024, 1, 1).getTime(),
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {
|
||||
console.log("attached", this.data.show)
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
onCancel() {
|
||||
this.triggerEvent("cancel")
|
||||
},
|
||||
onConfirm(e) {
|
||||
this.triggerEvent("confirm", { time: dayjs(e.detail).format("YYYY-MM-DD HH:mm:ss") })
|
||||
}
|
||||
}
|
||||
})
|
7
components/DateTimePicker/index.json
Normal file
7
components/DateTimePicker/index.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-popup": "@vant/weapp/popup/index",
|
||||
"van-datetime-picker": "@vant/weapp/datetime-picker/index"
|
||||
}
|
||||
}
|
18
components/DateTimePicker/index.wxml
Normal file
18
components/DateTimePicker/index.wxml
Normal file
@@ -0,0 +1,18 @@
|
||||
<!--components/datePicker/index.wxml-->
|
||||
|
||||
<van-popup
|
||||
show="{{ show }}"
|
||||
position="bottom"
|
||||
bind:close="onClose"
|
||||
z-index="10000"
|
||||
>
|
||||
|
||||
<van-datetime-picker
|
||||
type="datetime"
|
||||
value="{{ currentDate }}"
|
||||
min-date="{{ minDate }}"
|
||||
max-date="{{ maxDate }}"
|
||||
bind:confirm="onConfirm"
|
||||
bind:cancel="onCancel"
|
||||
/>
|
||||
</van-popup>
|
1
components/DateTimePicker/index.wxss
Normal file
1
components/DateTimePicker/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
/* components/datePicker/index.wxss */
|
@@ -23,6 +23,7 @@ Component({
|
||||
year: String,
|
||||
month: Number,
|
||||
day: Number,
|
||||
currentDate: Number,
|
||||
},
|
||||
/**
|
||||
* 组件的初始数据
|
||||
|
Reference in New Issue
Block a user