提交工作台和首页的更改
This commit is contained in:
98
pages/meterBalanceRecord/index.js
Normal file
98
pages/meterBalanceRecord/index.js
Normal 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() {
|
||||
|
||||
}
|
||||
})
|
8
pages/meterBalanceRecord/index.json
Normal file
8
pages/meterBalanceRecord/index.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigator": "/components/navigator/index",
|
||||
"timePicker": "/components/timePicker/index",
|
||||
"van-icon": "@vant/weapp/icon/index"
|
||||
},
|
||||
"navigationStyle": "custom"
|
||||
}
|
22
pages/meterBalanceRecord/index.wxml
Normal file
22
pages/meterBalanceRecord/index.wxml
Normal 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"
|
||||
/>
|
26
pages/meterBalanceRecord/index.wxss
Normal file
26
pages/meterBalanceRecord/index.wxss
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user