init project
This commit is contained in:
105
pages/myBills/index.js
Normal file
105
pages/myBills/index.js
Normal file
@@ -0,0 +1,105 @@
|
||||
// pages/myBills/index.js
|
||||
const app = getApp();
|
||||
let page = 1;
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
list: [],
|
||||
isShowNewplot: false,
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
this.getData();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
page = 1;
|
||||
this.getData()
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
page++
|
||||
this.getData();
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
return {
|
||||
title: '智慧云馆'
|
||||
}
|
||||
},
|
||||
|
||||
getData() {
|
||||
wx.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true,
|
||||
})
|
||||
app.$api.memberMoneyLogBill({
|
||||
page: page,
|
||||
pageSize: 10
|
||||
}).then(res => {
|
||||
let list = [];
|
||||
if (page != 1) {
|
||||
list = this.data.list;
|
||||
}
|
||||
if (res.page.data.length == 0) {
|
||||
page--
|
||||
}
|
||||
for (let i = 0; i < res.page.data.length; i++) {
|
||||
list.push(res.page.data[i]);
|
||||
}
|
||||
this.setData({
|
||||
list: list,
|
||||
isShowNewplot: true
|
||||
})
|
||||
wx.stopPullDownRefresh()
|
||||
}, err => {
|
||||
wx.stopPullDownRefresh()
|
||||
this.setData({
|
||||
isShowNewplot: true
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
7
pages/myBills/index.json
Normal file
7
pages/myBills/index.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "我的账单",
|
||||
"enablePullDownRefresh": true,
|
||||
"usingComponents": {
|
||||
"header": "/component/header/header"
|
||||
}
|
||||
}
|
||||
28
pages/myBills/index.wxml
Normal file
28
pages/myBills/index.wxml
Normal file
@@ -0,0 +1,28 @@
|
||||
<!--pages/myBills/index.wxml-->
|
||||
<header title="我的账单"></header>
|
||||
<view class='container'>
|
||||
<view class='list'>
|
||||
<view class='cell' wx:for="{{list}}" wx:key="{{index}}">
|
||||
<view class='left'>
|
||||
<!-- <view class='title'>{{item.venueLesson.name}}</view> -->
|
||||
<view class='title' wx:if="{{item.type == 1}}">{{item.venue.name}}进场</view>
|
||||
<view class='title' wx:if="{{item.type == 2}}">购买{{item.venue.name}}{{item.cardType}}</view>
|
||||
<view class='title' wx:if="{{item.type == 3}}">预约{{item.venueLesson.name}}</view>
|
||||
<view class='title' wx:if="{{item.type == 4}}">充值</view>
|
||||
<view class='title' wx:if="{{item.type == 5}}">{{item.venueLesson.name}}退款</view>
|
||||
<view class='title' wx:if="{{item.type == 6}}">提现</view>
|
||||
<view class='title' wx:if="{{item.type == 7}}">提现失败</view>
|
||||
<view class='title' wx:if="{{item.type == 8}}">提现审核通过</view>
|
||||
<view class='title' wx:if="{{item.type == 9}}">单次扣款</view>
|
||||
<view class='date'>{{item.createdTime}}</view>
|
||||
</view>
|
||||
<view class='right' wx:if="{{item.payType == 3}}">使用{{item.cardType}}</view>
|
||||
<view class='right {{item.money > 0 ? "isActive" : ""}}' wx:else>{{item.money > 0 ? "+" : ""}}{{item.money}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class='newplot' wx:if="{{isShowNewplot && list.length == 0}}">
|
||||
<image src='../../images/noContent.png'></image>
|
||||
<text>暂无记录 ~</text>
|
||||
</view>
|
||||
61
pages/myBills/index.wxss
Normal file
61
pages/myBills/index.wxss
Normal file
@@ -0,0 +1,61 @@
|
||||
/* pages/myBills/index.wxss */
|
||||
.container {
|
||||
min-height: calc(100vh - 190rpx);
|
||||
padding: 160rpx 0 30rpx 0;
|
||||
}
|
||||
|
||||
.list {
|
||||
background: #1a191e;
|
||||
}
|
||||
|
||||
.list .cell {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 120rpx;
|
||||
padding: 0 30rpx;
|
||||
border-bottom: 2rpx solid #212025;
|
||||
}
|
||||
|
||||
.list .cell .left .title {
|
||||
font-size: 24rpx;
|
||||
line-height: 24rpx;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.list .cell .left .date {
|
||||
margin-top: 24rpx;
|
||||
font-size: 20rpx;
|
||||
line-height: 20rpx;
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
|
||||
.list .cell .right {
|
||||
font-size: 26rpx;
|
||||
color: #FFF;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.list .cell .right.isActive {
|
||||
color: #caae2a;
|
||||
}
|
||||
|
||||
.newplot {
|
||||
position: fixed;
|
||||
top: 140rpx;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #FFF;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.newplot>image {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
margin-top: -200rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user