新增查看入场订单信息入口
This commit is contained in:
116
pages/myEnterList/index.js
Normal file
116
pages/myEnterList/index.js
Normal file
@@ -0,0 +1,116 @@
|
||||
// pages/myBookingsList/index.js
|
||||
const app = getApp();
|
||||
let page = 1;
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
list: [],
|
||||
isShowNewplot: false,
|
||||
gohome: true
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function() {
|
||||
page = 1;
|
||||
this.getData();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
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.memberEnterList({
|
||||
page: page,
|
||||
pageSize: 10
|
||||
}).then(res => {
|
||||
let list = [];
|
||||
if (page == 1) {
|
||||
this.setData({
|
||||
list: []
|
||||
})
|
||||
} else {
|
||||
list = this.data.list;
|
||||
}
|
||||
for (let i = 0; i < res.page.data.length; i++) {
|
||||
let currentDate = new Date().getTime();
|
||||
res.page.data[i].isEnd = currentDate < res.page.data[i].startTime;
|
||||
list.push(res.page.data[i]);
|
||||
}
|
||||
this.setData({
|
||||
list: list,
|
||||
isShowNewplot: true
|
||||
})
|
||||
wx.stopPullDownRefresh()
|
||||
}, err => {
|
||||
wx.stopPullDownRefresh()
|
||||
})
|
||||
},
|
||||
|
||||
// 点击CEll
|
||||
clickCell(e) {
|
||||
let id = e.currentTarget.dataset.id;
|
||||
wx.navigateTo({
|
||||
url: `/pages/myEnters/index?id=${id}`,
|
||||
})
|
||||
}
|
||||
})
|
||||
7
pages/myEnterList/index.json
Normal file
7
pages/myEnterList/index.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "篮球订单",
|
||||
"enablePullDownRefresh": true,
|
||||
"usingComponents": {
|
||||
"header": "/component/header/header"
|
||||
}
|
||||
}
|
||||
40
pages/myEnterList/index.wxml
Normal file
40
pages/myEnterList/index.wxml
Normal file
@@ -0,0 +1,40 @@
|
||||
<!--pages/myBookingsList/index.wxml-->
|
||||
<header title="篮球订单"></header>
|
||||
|
||||
<view class='container'>
|
||||
<view class='header'>
|
||||
<!-- <view class='btn-box' data-state='0' bindtap='changeTab'>-->
|
||||
<!-- <view class='item-btn {{state == 0 ? "isActive" : ""}}'>已预约</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class='btn-box' data-state='1' bindtap='changeTab'>-->
|
||||
<!-- <view class='item-btn {{state == 1 ? "isActive" : ""}}'>已完成</view>-->
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
<view class='cell' wx:for="{{list}}" wx:key="{{index}}" bindtap='clickCell' data-id='{{item.id}}'>
|
||||
<view class='top'>
|
||||
<text>预约单号: {{item.orderSn}}</text>
|
||||
<text class='isActive' wx:if="{{item.status == 0}}">进行中</text>
|
||||
<text wx:if="{{item.status == 1}}">已完成</text>
|
||||
</view>
|
||||
<view class='bottom'>
|
||||
<image src='{{item.lessonImage}}' mode='aspectFill'></image>
|
||||
<view class='goods-box'>
|
||||
<view class='title-box'>
|
||||
<view class='title-left'>
|
||||
<text>{{item.lessonName}}</text>
|
||||
</view>
|
||||
<view class='title-right' wx:if="{{item.payType == 1}}">¥{{item.price}}</view>
|
||||
</view>
|
||||
<view class='message'>
|
||||
{{item.startTime}} ~ {{item.endTime == null ? '现在': item.endTime }}
|
||||
</view>
|
||||
<view class='message'>{{item.address}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class='newplot' wx:if="{{list.length == 0 && isShowNewplot}}">
|
||||
<image src='../../images/noContent.png'></image>
|
||||
<text>暂无预约 ~</text>
|
||||
</view>
|
||||
134
pages/myEnterList/index.wxss
Normal file
134
pages/myEnterList/index.wxss
Normal file
@@ -0,0 +1,134 @@
|
||||
/* pages/myBookingsList/index.wxss */
|
||||
|
||||
.container {
|
||||
min-height: calc(100vh - 260rpx);
|
||||
padding: 250rpx 30rpx 30rpx 30rpx;
|
||||
}
|
||||
|
||||
.header {
|
||||
position: fixed;
|
||||
top: 120rpx;
|
||||
left: 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
background: #1a191e;
|
||||
}
|
||||
|
||||
.header .btn-box {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.header .btn-box .item-btn {
|
||||
width: 90rpx;
|
||||
height: 84rpx;
|
||||
margin: 0 auto;
|
||||
font-size: 28rpx;
|
||||
line-height: 90rpx;
|
||||
border-bottom: 6rpx solid #1a191e;
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
|
||||
.header .btn-box .item-btn.isActive {
|
||||
color: #ffda2e;
|
||||
border-bottom: 6rpx solid #ffda2e;
|
||||
}
|
||||
|
||||
.cell {
|
||||
margin-bottom: 30rpx;
|
||||
border-radius: 20rpx;
|
||||
background: #1a191e;
|
||||
}
|
||||
|
||||
.cell .top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 80rpx;
|
||||
padding: 0 26rpx;
|
||||
border: 2rpx solid #212025;
|
||||
}
|
||||
|
||||
.cell .top>text:first-child {
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.cell .top>text:last-child {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.cell .top>text:last-child.isActive {
|
||||
color: #ffda2e;
|
||||
}
|
||||
|
||||
.cell .bottom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 24rpx;
|
||||
}
|
||||
|
||||
.cell .bottom>image {
|
||||
width: 130rpx;
|
||||
height: 110rpx;
|
||||
}
|
||||
|
||||
.cell .bottom .goods-box {
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.cell .bottom .goods-box .title-box {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.cell .bottom .goods-box .title-box .title-left {
|
||||
flex: 1;
|
||||
height: 26rpx;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
line-height: 26rpx;
|
||||
}
|
||||
|
||||
.cell .bottom .goods-box .title-box .title-left>text:first-child {
|
||||
font-size: 26rpx;
|
||||
color: #ffda2e;
|
||||
}
|
||||
|
||||
.cell .bottom .goods-box .title-box .title-right {
|
||||
font-size: 24rpx;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.cell .bottom .goods-box .message {
|
||||
font-size: 22rpx;
|
||||
color: #FFF;
|
||||
line-height: 22rpx;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.newplot {
|
||||
position: fixed;
|
||||
top: 260rpx;
|
||||
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