新增查看入场订单信息入口

This commit is contained in:
2024-01-07 20:02:48 +08:00
parent ccd97a0446
commit c9d2e41b11
13 changed files with 629 additions and 7 deletions

138
pages/myEnters/index.js Normal file
View File

@@ -0,0 +1,138 @@
// pages/myBookings/index.js
const app = getApp();
let enterId = ""
Page({
/**
* 页面的初始数据
*/
data: {
isSignIn: false,
memberEnterDetail: {},
showDeleteDialog: false,
isGoHome: false,
endDate: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
enterId = options.id;
this.getData();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
let pages = getCurrentPages();
this.setData({
isGoHome: pages.length == 1
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
return {
title: '智慧云馆'
}
},
// 获取数据
getData() {
app.$api.memberEntersDetail({
enterId: enterId
}).then(res => {
let currentDate = new Date().getTime();
let startDate = currentDate;
if (res.memberEnterDetail) {
startDate = new Date(res.memberEnterDetail.date.replace(/-/g, "/") + ' ' + res.memberEnterDetail.startTime).getTime();
}
if (!res.memberEnterDetail) {
wx.navigateBack({
delta: 1,
})
}
this.setData({
memberEnterDetail: res.memberEnterDetail
})
}, err => {
})
},
// 取消弹框
cancelDeleteDialog() {
this.setData({
showDeleteDialog: false
})
},
// // 确认删除
// confirmDeleteDialog() {
// app.$api.memberEnterDetailsCancel({
// orderSn: this.data.memberEnterDetail.orderSn
// }).then(res => {
// wx.showToast({
// title: '取消成功',
// })
// this.setData({
// showDeleteDialog: false
// })
// this.getData();
// }, err => {
// this.setData({
// showDeleteDialog: false
// })
// });
// },
// 打开导航,
opnGPS() {
wx.openLocation({
latitude: Number(this.data.memberEnterDetail.latitude),
longitude: Number(this.data.memberEnterDetail.longitude),
name: this.data.memberEnterDetail.lessonName,
address: this.data.memberEnterDetail.address,
})
}
})

View File

@@ -0,0 +1,7 @@
{
"navigationBarTitleText": "篮球订单",
"usingComponents": {
"confirm-dialog": "/component/confirmDialog/confirmDialog",
"header": "/component/header/header"
}
}

43
pages/myEnters/index.wxml Normal file
View File

@@ -0,0 +1,43 @@
<!--pages/myBookings/index.wxml-->
<header title="篮球订单" isGoHome="{{isGoHome}}"></header>
<view class='container'>
<view class='cell-box'>
<view class='cell'>
<view class='title'>
<text>{{memberEnterDetail.lessonName}}</text>
</view>
<!-- <view class='state'>{{memberEnterDetail.status == 0 ? "已预约" : (memberEnterDetail.status == 1 ? "已完成" : "已取消")}}</view> -->
<view class='state' wx:if="{{memberEnterDetail.status == 0}}">使用中</view>
<view class='state' wx:if="{{memberEnterDetail.status == 1}}">待结算</view>
<view class='state' wx:if="{{memberEnterDetail.status == 2}}">已结算</view>
</view>
<view class='cell'>
<image src='../../images/42@3x.png' mode='aspectFit'></image>
<text>开始时间</text>
<view class='cell-right-white'>{{memberEnterDetail.startTime}}分钟</view>
</view>
<view class='cell'>
<image src='../../images/42@3x.png' mode='aspectFit'></image>
<text>出场时间</text>
<view class='cell-right-white'>{{memberEnterDetail.endTime}}</view>
</view>
<view class='cell'>
<image src='../../images/42@3x.png' mode='aspectFit'></image>
<text>运动时长</text>
<view class='cell-right-white'>{{memberEnterDetail.lessonCount}}</view>
</view>
<view class='cell'>
<image src='../../images/33@3x.png' mode='aspectFit'></image>
<text>费用</text>
<view class='cell-right-white'>已支付: ¥{{memberEnterDetail.price}}</view>
</view>
<view class='cell' bindtap='opnGPS'>
<image src='../../images/41@3x.png' mode='aspectFit'></image>
<text>{{memberEnterDetail.address}}</text>
<view class='cell-right'>
<image src='../../images/34@3x.png' class='gps-img'></image>
<text>导航</text>
</view>
</view>
</view>
</view>

117
pages/myEnters/index.wxss Normal file
View File

@@ -0,0 +1,117 @@
/* pages/myBookings/index.wxss */
.container {
min-height: calc(100vh - 290rpx);
padding: 160rpx 30rpx 130rpx 30rpx;
}
.cell-box {
background: #1a191e;
border-radius: 10rpx;
}
.cell-box .cell {
display: flex;
justify-content: space-between;
align-items: center;
height: 90rpx;
padding: 0 20rpx;
border-bottom: 2rpx solid #212025;
}
.cell-box .cell.unline {
border: none;
}
.cell-box .cell>image {
width: 34rpx;
height: 34rpx;
margin-right: 26rpx;
}
.cell-box .cell>text {
flex: 1;
font-size: 24rpx;
color: rgba(255, 255, 255, 0.6);
}
.cell-box .cell .title {
flex: 1;
display: flex;
align-items: center;
color: #fff;
font-size: 26rpx;
}
.cell-box .cell .cell-right {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: rgba(255, 255, 255, 0.6);
font-size: 20rpx;
}
.cell-box .cell .cell-right .gps-img {
width: 50rpx;
height: 50rpx;
border-radius: 50%;
}
.cell-box .cell .cell-right>text {
height: 20rpx;
margin-top: 6rpx;
line-height: 20rpx;
}
.cell-box .cell .state {
font-size: 22rpx;
color: #ffda2e;
}
.cell-box .cell .cell-right-white {
color: #fff;
font-size: 24rpx;
}
.cell-box .qrCode-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 300rpx;
}
.cell-box .qrCode-box>image {
width: 200rpx;
height: 200rpx;
}
.cell-box .qrCode-box>text {
margin-top: 20rpx;
font-size: 22rpx;
line-height: 22rpx;
color: rgba(255, 255, 255, 0.6);
}
.footer-box {
position: fixed;
bottom: 0;
left: 0;
display: flex;
width: 100%;
height: 100rpx;
}
.footer-btn {
flex: 1;
background: #767578;
color: #1a191e;
font-size: 32rpx;
text-align: center;
line-height: 100rpx;
}
.footer-btn.isActive {
background: #ffda2e;
}