202404 足球入场逻辑
This commit is contained in:
3
app.json
3
app.json
@@ -27,7 +27,8 @@
|
||||
"pages/loginIndex/index",
|
||||
"pages/withdrawal/index",
|
||||
"pages/healthDocs/index",
|
||||
"pages/disclaimers/index"
|
||||
"pages/disclaimers/index",
|
||||
"pages/myEnterBook/index"
|
||||
],
|
||||
"window": {
|
||||
"backgroundTextStyle": "dark",
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
// pages/disclaimers/index.js
|
||||
// pages/notice/index.js
|
||||
const app = getApp();
|
||||
let id = ''
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
us: {
|
||||
|
||||
},
|
||||
announcement: {},
|
||||
isGoHome: false,
|
||||
},
|
||||
|
||||
@@ -16,10 +15,16 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function(options) {
|
||||
app.$api.aboutUs({}).then(res => {
|
||||
id = options.id;
|
||||
app.$api.announcementDetail({
|
||||
id: id
|
||||
}).then(res => {
|
||||
res.announcement.description = res.announcement.description.replace(/section/g, "div");
|
||||
this.setData({
|
||||
us: res.uss
|
||||
announcement: res.announcement
|
||||
})
|
||||
}, err => {
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"navigationBarTitleText": "公告",
|
||||
"usingComponents": {
|
||||
"header": "/component/header/header"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
<!--pages/disclaimers/index.wxml-->
|
||||
<header isGoHome="{{isGoHome}}"></header>
|
||||
<view class='container' wx:if="{{us.description}}">
|
||||
<image class='logo' src='{{us.image}}' mode='aspectFit'></image>
|
||||
<rich-text class='info' nodes="{{us.description}}"></rich-text>
|
||||
<!--pages/notice/index.wxml-->
|
||||
<header title="公告" isGoHome="{{isGoHome}}"></header>
|
||||
<view class='container'>
|
||||
<view class='body'>
|
||||
<view class='title'>{{announcement.title}}</view>
|
||||
<view class='date'>{{announcement.time}}</view>
|
||||
<view class='rich-box'>
|
||||
<rich-text nodes="{{announcement.description}}"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -1,23 +1,38 @@
|
||||
/* pages/disclaimers/index.wxss */
|
||||
/* pages/notice/index.wxss */
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
padding: 180rpx 50rpx 50rpx;
|
||||
min-height: calc(100vh - 240rpx);
|
||||
}
|
||||
.logo {
|
||||
width: 400rpx;
|
||||
height: 100rpx;
|
||||
/* min-height: calc(1100 - 200rpx); */
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.info {
|
||||
margin-top: 60rpx;
|
||||
font-size: 24rpx;
|
||||
color: #FFF;
|
||||
line-height: 36rpx;
|
||||
.body {
|
||||
padding-bottom: 40rpx;
|
||||
padding-left: 30rpx;
|
||||
padding-right: 30rpx;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.wscnph {
|
||||
.title {
|
||||
padding-top: 40rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.date {
|
||||
height: 20rpx;
|
||||
margin-top: 36rpx;
|
||||
font-size: 20rpx;
|
||||
color: #cfcfcf;
|
||||
line-height: 20rpx;
|
||||
}
|
||||
|
||||
.rich-box {
|
||||
margin-top: 40rpx;
|
||||
|
||||
font-size: 26rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.rich-box .wscnph {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -120,6 +120,19 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
enterJoin(){
|
||||
if (!this.data.memberLessonTicket.id){
|
||||
wx.showToast({
|
||||
title: '未找到课程预定信息!',
|
||||
icon: 'none',
|
||||
})
|
||||
return;
|
||||
}
|
||||
wx.navigateTo({
|
||||
url: '/pages/myEnterBook/index?ticketId=' + this.data.memberLessonTicket.id,
|
||||
})
|
||||
},
|
||||
|
||||
// 我要签到
|
||||
signIn() {
|
||||
let that = this;
|
||||
|
||||
@@ -42,11 +42,11 @@
|
||||
<text>费用</text>
|
||||
<view class='cell-right-white' bindtap='callPhone' wx:if="{{!memberLessonTicket.memberCard.cardType}}">已支付: ¥{{memberLessonTicket.order.price}}</view>
|
||||
</view>
|
||||
<view class='cell unline'>
|
||||
<view wx:if="{{memberLessonTicket.venueLesson.venueType != 3}}" class='cell unline'>
|
||||
<image src='../../images/21@3x.png' mode='aspectFit'></image>
|
||||
<text>助理教练信息</text>
|
||||
</view>
|
||||
<view class='qrCode-box'>
|
||||
<view wx:if="{{memberLessonTicket.venueLesson.venueType != 3}}" class='qrCode-box'>
|
||||
<image src='{{memberLessonTicket.venueLesson.coach.wechatCode}}' bindtap='clickImage'></image>
|
||||
<text>扫一扫加好友</text>
|
||||
</view>
|
||||
@@ -55,8 +55,10 @@
|
||||
<view class='footer-box' wx:if="{{memberLessonTicket.status == 0}}">
|
||||
<!-- {{isSignIn ? "" : "isActive"}} -->
|
||||
<view class='footer-btn ' bindtap='cancelBooking'>取消预约</view>
|
||||
<!-- 如果是足球,则展示入场按钮 -->
|
||||
<!-- {{isSignIn ? "isActive" : ""}} -->
|
||||
<view class='footer-btn isActive' bindtap='signIn'>我要签到</view>
|
||||
<view wx:if="{{memberLessonTicket.venueLesson.venueType == 3}}" class='footer-btn isActive' bindtap='enterJoin'>我要进场</view>
|
||||
<view wx:else class='footer-btn isActive' bindtap='signIn'>我要签到</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
108
pages/myEnterBook/index.js
Normal file
108
pages/myEnterBook/index.js
Normal file
@@ -0,0 +1,108 @@
|
||||
// pages/myBookings/index.js
|
||||
const app = getApp();
|
||||
let ticketId = 0;
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
memberLessonTicket: {},
|
||||
isGoHome: false
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function(options) {
|
||||
if (options.ticketId) {
|
||||
ticketId = options.ticketId
|
||||
}
|
||||
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: '智慧云馆'
|
||||
}
|
||||
},
|
||||
|
||||
openDoor(){
|
||||
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
getData() {
|
||||
app.$api.memberLessonTicketsEnter({
|
||||
ticketId: ticketId
|
||||
}).then(res => {
|
||||
if (!res.memberLessonTicket) {
|
||||
wx.navigateBack({
|
||||
delta: 1,
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
memberLessonTicket: res.memberLessonTicket,
|
||||
})
|
||||
}, err => {
|
||||
|
||||
})
|
||||
},
|
||||
// 打开导航,
|
||||
opnGPS() {
|
||||
wx.openLocation({
|
||||
latitude: Number(this.data.memberLessonTicket.venueLesson.latitude),
|
||||
longitude: Number(this.data.memberLessonTicket.venueLesson.longitude),
|
||||
name: this.data.memberLessonTicket.venueLesson.name,
|
||||
address: this.data.memberLessonTicket.venueLesson.address,
|
||||
})
|
||||
}
|
||||
})
|
||||
7
pages/myEnterBook/index.json
Normal file
7
pages/myEnterBook/index.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "我的预约",
|
||||
"usingComponents": {
|
||||
"confirm-dialog": "/component/confirmDialog/confirmDialog",
|
||||
"header": "/component/header/header"
|
||||
}
|
||||
}
|
||||
45
pages/myEnterBook/index.wxml
Normal file
45
pages/myEnterBook/index.wxml
Normal file
@@ -0,0 +1,45 @@
|
||||
<!--pages/myBookings/index.wxml-->
|
||||
<header title="订场信息" isGoHome="{{isGoHome}}"></header>
|
||||
<view class='container' wx:if="{{memberLessonTicket}}">
|
||||
<view class='cell-box'>
|
||||
<view class='cell'>
|
||||
<view class='title'>
|
||||
<text>{{memberLessonTicket.venueName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class='cell'>
|
||||
<view class='title'>
|
||||
<text>{{memberLessonTicket.lessonname}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class='cell'>
|
||||
<image src='../../images/42@3x.png' mode='aspectFit'></image>
|
||||
<text>{{memberLessonTicket.date}} {{memberLessonTicket.startTime}} ~ {{memberLessonTicket.endTime}}</text>
|
||||
</view>
|
||||
<view class='cell' bindtap='opnGPS'>
|
||||
<image src='../../images/41@3x.png' mode='aspectFit'></image>
|
||||
<text>{{memberLessonTicket.address}}</text>
|
||||
<view class='cell-right'>
|
||||
<image src='../../images/34@3x.png' class='gps-img'></image>
|
||||
<text>导航</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="side-line">---预定人员列表---</view>
|
||||
<view class="cell-box">
|
||||
<view wx:for="{{memberLessonTicket.memberTicketInviteList}}" wx:key='{{index}}'>
|
||||
<view class='cell'>
|
||||
<image src='../../images/39@3x.png' mode='aspectFit'></image>
|
||||
<text>{{item.memberId}}</text>
|
||||
<view class="cell-right">
|
||||
<text>{{item.mobile}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class='footer-box'>
|
||||
<view class='footer-btn isActive' bindtap='openDoor'>开门</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
124
pages/myEnterBook/index.wxss
Normal file
124
pages/myEnterBook/index.wxss
Normal file
@@ -0,0 +1,124 @@
|
||||
/* 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;
|
||||
}
|
||||
.side-line {
|
||||
flex: 1;
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
line-height: 100rpx;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
//testURL
|
||||
// const BASE_URL = 'http://127.0.0.1:8093';
|
||||
// const BASE_URL = 'http://192.168.31.173:8093';
|
||||
//prodURL
|
||||
const BASE_URL = 'https://api.hongyutiyu.top';
|
||||
// const platformId = 1;
|
||||
@@ -363,6 +364,14 @@ export default {
|
||||
memberLessonTicketsDetail(params) {
|
||||
return fetchPost('/member/lesson/tickets/detail', params, true);
|
||||
},
|
||||
// 足球预约邀请详情页
|
||||
memberLessonTicketsEnter(params) {
|
||||
return fetchPost('/member/lesson/tickets/invite', params, true);
|
||||
},
|
||||
// 足球场开门
|
||||
memberTicketOpenDoor(params) {
|
||||
return fetchPost('/member/lesson/tickets/open/door', params, true);
|
||||
},
|
||||
// 入场订单
|
||||
memberEnterList(params) {
|
||||
return fetchPost('/member/order/enter/list', params, true);
|
||||
|
||||
Reference in New Issue
Block a user