提交工作台和首页的更改

This commit is contained in:
2025-07-16 17:33:15 +08:00
parent 7bd4da3c84
commit ac0a4b02c7
25 changed files with 368 additions and 29 deletions

View 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") })
}
}
})

View File

@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index"
}
}

View 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>

View File

@@ -0,0 +1 @@
/* components/datePicker/index.wxss */

View File

@@ -23,6 +23,7 @@ Component({
year: String,
month: Number,
day: Number,
currentDate: Number,
},
/**
* 组件的初始数据