完成简易版的充值和充值记录查询页面,简单的我的页面
This commit is contained in:
93
pages/rechargeRecord/index.js
Normal file
93
pages/rechargeRecord/index.js
Normal file
@@ -0,0 +1,93 @@
|
||||
import { getYears } from "../../utils/index";
|
||||
|
||||
// pages/rechargeRecord/index.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
year: new Date().getFullYear(),
|
||||
month: new Date().getMonth() + 1,
|
||||
years: getYears(),
|
||||
list: [
|
||||
{ code: '165146513', money: 100, time: "2024-02-20 18:56:15" },
|
||||
{ code: '466541651', money: 200, time: "2024-02-28 18:56:15" },
|
||||
{ code: '165146513', money: 100, time: "2024-02-20 18:56:15" },
|
||||
{ code: '466541651', money: 200, time: "2024-02-28 18:56:15" },
|
||||
{ code: '165146513', money: 100, time: "2024-02-20 18:56:15" },
|
||||
{ code: '466541651', money: 200, time: "2024-02-28 18:56:15" },
|
||||
{ code: '165146513', money: 100, time: "2024-02-20 18:56:15" },
|
||||
{ code: '466541651', money: 200, time: "2024-02-28 18:56:15" },
|
||||
{ code: '165146513', money: 100, time: "2024-02-20 18:56:15" },
|
||||
{ code: '466541651', money: 200, time: "2024-02-28 18:56:15" },
|
||||
{ code: '165146513', money: 100, time: "2024-02-20 18:56:15" },
|
||||
{ code: '466541651', money: 200, time: "2024-02-28 18:56:15" },
|
||||
{ code: '165146513', money: 100, time: "2024-02-20 18:56:15" },
|
||||
{ code: '466541651', money: 200, time: "2024-02-28 18:56:15" },
|
||||
{ code: '165146513', money: 100, time: "2024-02-20 18:56:15" },
|
||||
{ code: '466541651', money: 200, time: "2024-02-28 18:56:15" }
|
||||
]
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
onChangeYear(e) {
|
||||
const { years } = this.data;
|
||||
this.setData({
|
||||
year: years[Number(e.detail.value)]
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
6
pages/rechargeRecord/index.json
Normal file
6
pages/rechargeRecord/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigator": "/components/navigator/index",
|
||||
"scrollPageWrapper": "/components/scrollPageWrapper/index"
|
||||
}
|
||||
}
|
25
pages/rechargeRecord/index.wxml
Normal file
25
pages/rechargeRecord/index.wxml
Normal file
@@ -0,0 +1,25 @@
|
||||
<!--pages/rechargeRecord/index.wxml-->
|
||||
<scrollPageWrapper>
|
||||
<navigator title="充值记录" />
|
||||
<scroll-view type="list" scroll-y style="display: flex; flex-direction: column; flex: 1; width: 100%; overflow: auto;">
|
||||
<view class="wrapper" list-item>
|
||||
<view>
|
||||
<picker bindchange="onChangeYear" value="{{index}}" range="{{years}}">
|
||||
<view class="yearPicker">
|
||||
{{ year }}年
|
||||
<image src="/assets/images/down.png" mode="" class="down" />
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="recordsWrapper">
|
||||
<view class="recordsItem border" wx:for="{{list}}">
|
||||
<view class="codeTime">
|
||||
<view class="code"> 表号:{{ item.code }} </view>
|
||||
<view class="time"> {{ item.time }} </view>
|
||||
</view>
|
||||
<view class="money"> {{ item.money }} </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</scrollPageWrapper>
|
48
pages/rechargeRecord/index.wxss
Normal file
48
pages/rechargeRecord/index.wxss
Normal file
@@ -0,0 +1,48 @@
|
||||
/* pages/rechargeRecord/index.wxss */
|
||||
.yearPicker {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.down {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.recordsWrapper {
|
||||
background-color: white;
|
||||
margin-top: 24rpx;
|
||||
border-radius: 6rpx;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
}
|
||||
.recordsItem {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 16rpx 20rpx;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
border-top: 0;
|
||||
}
|
||||
.recordsItem:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
.code {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
.time {
|
||||
margin-top: 16rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.money {
|
||||
font-size: 42rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
}
|
Reference in New Issue
Block a user