202404 入场需要查看免责声明

This commit is contained in:
2024-05-26 20:25:06 +08:00
parent 8b1c94b806
commit 298a18e933
7 changed files with 100 additions and 41 deletions

View File

@@ -1,6 +1,7 @@
// pages/basketballGym/index.js
// import QRCode from './qrcode';
import drawQrcode from './weapp.qrcode.js';
import {getTimeoutStorage} from "../../utils/util";
const app = getApp();
import {
getCurrentPageUrl
@@ -291,21 +292,28 @@ Page({
// 我要进场
enter() {
app.$api.venueJoin({
venueId: id
}).then(res => {
this.setData({
flg: res.join.flg,
msg: res.join.msg,
payMoney: res.join.money
let isRead = getTimeoutStorage('isReaded');
console.log('isRead======' + isRead)
if (isRead == 'ojbk') {
app.$api.venueJoin({
venueId: id
}).then(res => {
this.setData({
flg: res.join.flg,
msg: res.join.msg,
payMoney: res.join.money
})
if (res.join.flg == 0) {
this.showBarcode('000')
}
}, err => {
console.log(err);
})
if (res.join.flg == 0) {
this.showBarcode('000')
}
}, err => {
console.log(err);
})
}else {
wx.navigateTo({
url: '/pages/disclaimers/index'
})
}
},
// 我要出场

View File

@@ -1,13 +1,14 @@
// pages/notice/index.js
const app = getApp();
let id = ''
import {setTimeOutStorage} from "../../utils/util";
Page({
/**
* 页面的初始数据
*/
data: {
announcement: {},
disclaimers: {},
isGoHome: false,
},
@@ -15,13 +16,11 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
id = options.id;
app.$api.announcementDetail({
id: id
app.$api.disclaimersDetail({
}).then(res => {
res.announcement.description = res.announcement.description.replace(/section/g, "div");
res.disclaimers.description = res.disclaimers.description.replace(/section/g, "div");
this.setData({
announcement: res.announcement
disclaimers: res.disclaimers
})
}, err => {
@@ -80,5 +79,13 @@ Page({
return {
title: '智慧云馆'
}
},
backToOpen () {
wx.navigateBack({
success (res){
setTimeOutStorage('isReaded','ojbk',1200000)
}
})
}
})

View File

@@ -1,11 +1,13 @@
<!--pages/notice/index.wxml-->
<header title="公告" isGoHome="{{isGoHome}}"></header>
<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='title'>免责声明</view>-->
<view class='rich-box'>
<rich-text nodes="{{announcement.description}}"></rich-text>
<rich-text nodes="{{disclaimers.description}}"></rich-text>
</view>
</view>
<view class='footer-box'>
<view class='footer-btn' bindtap='backToOpen'>同意</view>
</view>
</view>

View File

@@ -2,14 +2,13 @@
.container {
/* min-height: calc(1100 - 200rpx); */
background: #fff;
}
.body {
padding-bottom: 40rpx;
padding-left: 30rpx;
padding-right: 30rpx;
background: #fff;
color: aliceblue;
}
.title {
@@ -18,14 +17,6 @@
font-weight: bold;
}
.date {
height: 20rpx;
margin-top: 36rpx;
font-size: 20rpx;
color: #cfcfcf;
line-height: 20rpx;
}
.rich-box {
margin-top: 40rpx;
@@ -36,3 +27,12 @@
.rich-box .wscnph {
width: 100%;
}
.footer-btn {
flex: 1;
background: #ffda2e;
color: #1a191e;
font-size: 32rpx;
text-align: center;
line-height: 100rpx;
}

View File

@@ -1,5 +1,6 @@
// pages/myBookings/index.js
const app = getApp();
import {getTimeoutStorage} from "../../utils/util";
let ticketId = 0;
Page({
@@ -76,10 +77,18 @@ Page({
},
openDoor(){
wx.showToast({
title:'开门成功',
icon : "success"
})
let isRead = getTimeoutStorage('isReaded');
console.log('isRead======' + isRead)
if (isRead == 'ojbk') {
wx.showToast({
title:'足球场开门成功',
icon : "success"
})
}else {
wx.navigateTo({
url: '/pages/disclaimers/index'
})
}
},
// 获取数据

View File

@@ -1,6 +1,6 @@
//testURL
// const BASE_URL = 'http://127.0.0.1:8093';
// const BASE_URL = 'http://192.168.31.173:8093';
// const BASE_URL = 'http://192.168.1.3:8093';
//prodURL
const BASE_URL = 'https://api.hongyutiyu.top';
// const platformId = 1;
@@ -334,6 +334,10 @@ export default {
aboutUs(params) {
return fetchGet('/about/uss', params, false);
},
// 免责声明
disclaimersDetail(params) {
return fetchGet('/notice/disclaimers', params, false);
},
// 上传图像
uploadAvatar(params) {
return fetchPost('/upload/avatar', params, true, true);

View File

@@ -26,7 +26,36 @@ const getCurrentPageUrl = () => {
return url;
}
const setTimeOutStorage = (key,value,timeout) => {
let timestamp = Date.parse(new Date());
wx.setStorageSync(key,
{
'value': value,
'timeout': timestamp + timeout
})
}
const getTimeoutStorage = (key) => {
// 当前时间
let timestamp = Date.parse(new Date());
// 缓存中的过期时间
let data = wx.getStorageSync(key);
let data_expiration = data.timeout;
let value = data.value;
// 如果缓存中没有data_expiration说明也没有token还未登录
if (data_expiration) {
// 如果超时了,清除缓存,重新登录
if (timestamp > data_expiration) {
wx.removeStorageSync(key);
return null;
}
}
return value;
}
module.exports = {
formatTime: formatTime,
getCurrentPageUrl: getCurrentPageUrl
getCurrentPageUrl: getCurrentPageUrl,
setTimeOutStorage: setTimeOutStorage,
getTimeoutStorage: getTimeoutStorage
}