提交工作台和首页的更改

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,98 @@
import dayjs from "../../utils/dayjs"
// pages/meterBalanceRecord/index.js
Page({
/**
* 页面的初始数据
*/
data: {
time: "",
timeStamp: undefined,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const { id } = options
console.log("id---", id)
this.setData({
id,
time: dayjs().format("YYYY-MM"),
timeStamp: Date.now()
})
},
clickTime() {
this.setData({
timeVisible: true
})
},
onTimeConfirm(e) {
console.log('e', e)
const { time } = e.detail;
this.setData({
time,
timeStamp: new Date(time).getTime(),
timeVisible: false,
})
},
onTimeCancel() {
this.setData({
timeVisible: false,
})
},
onTimeClose() {
this.setData({
timeVisible: false,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,8 @@
{
"usingComponents": {
"navigator": "/components/navigator/index",
"timePicker": "/components/timePicker/index",
"van-icon": "@vant/weapp/icon/index"
},
"navigationStyle": "custom"
}

View File

@@ -0,0 +1,22 @@
<!--pages/meterBalanceRecord/index.wxml-->
<navigator title="电费扣款记录" canBack="{{true}}" />
<view class="pageWrapper">
<view class="timeChooseWrapper">
<view> 选择时间 </view>
<view class="time" bind:tap="clickTime">
<view class="timeText"> {{time}} </view>
<van-icon name="arrow-down" />
</view>
</view>
</view>
<timePicker
type="month"
currentDate="{{timeStamp}}"
show="{{timeVisible}}"
bind:cancel="onTimeCancel"
bind:close="onTimeClose"
bind:confirm="onTimeConfirm"
/>

View File

@@ -0,0 +1,26 @@
/* pages/meterBalanceRecord/index.wxss */
.pageWrapper {
margin: 30rpx;
}
.time {
flex: 1;
margin-left: 30rpx;
margin-right: 30rpx;
display: flex;
padding: 10rpx 20rpx;
border-radius: 12rpx;
border: 1rpx solid #ccc;
background-color: #fff;
}
.timeChooseWrapper {
display: flex;
align-items: center;
font-size: 36rpx;
}
.timeText {
flex: 1;
}