202404 入场需要查看免责声明
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
// pages/basketballGym/index.js
|
// pages/basketballGym/index.js
|
||||||
// import QRCode from './qrcode';
|
// import QRCode from './qrcode';
|
||||||
import drawQrcode from './weapp.qrcode.js';
|
import drawQrcode from './weapp.qrcode.js';
|
||||||
|
import {getTimeoutStorage} from "../../utils/util";
|
||||||
const app = getApp();
|
const app = getApp();
|
||||||
import {
|
import {
|
||||||
getCurrentPageUrl
|
getCurrentPageUrl
|
||||||
@@ -291,6 +292,9 @@ Page({
|
|||||||
|
|
||||||
// 我要进场
|
// 我要进场
|
||||||
enter() {
|
enter() {
|
||||||
|
let isRead = getTimeoutStorage('isReaded');
|
||||||
|
console.log('isRead======' + isRead)
|
||||||
|
if (isRead == 'ojbk') {
|
||||||
app.$api.venueJoin({
|
app.$api.venueJoin({
|
||||||
venueId: id
|
venueId: id
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
@@ -305,7 +309,11 @@ Page({
|
|||||||
}, err => {
|
}, err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
})
|
})
|
||||||
|
}else {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/disclaimers/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 我要出场
|
// 我要出场
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
// pages/notice/index.js
|
// pages/notice/index.js
|
||||||
const app = getApp();
|
const app = getApp();
|
||||||
let id = ''
|
|
||||||
|
import {setTimeOutStorage} from "../../utils/util";
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
announcement: {},
|
disclaimers: {},
|
||||||
isGoHome: false,
|
isGoHome: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -15,13 +16,11 @@ Page({
|
|||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad: function(options) {
|
onLoad: function(options) {
|
||||||
id = options.id;
|
app.$api.disclaimersDetail({
|
||||||
app.$api.announcementDetail({
|
|
||||||
id: id
|
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
res.announcement.description = res.announcement.description.replace(/section/g, "div");
|
res.disclaimers.description = res.disclaimers.description.replace(/section/g, "div");
|
||||||
this.setData({
|
this.setData({
|
||||||
announcement: res.announcement
|
disclaimers: res.disclaimers
|
||||||
})
|
})
|
||||||
}, err => {
|
}, err => {
|
||||||
|
|
||||||
@@ -80,5 +79,13 @@ Page({
|
|||||||
return {
|
return {
|
||||||
title: '智慧云馆'
|
title: '智慧云馆'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
backToOpen () {
|
||||||
|
wx.navigateBack({
|
||||||
|
success (res){
|
||||||
|
setTimeOutStorage('isReaded','ojbk',1200000)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
<!--pages/notice/index.wxml-->
|
<!--pages/notice/index.wxml-->
|
||||||
<header title="公告" isGoHome="{{isGoHome}}"></header>
|
<header title="免责声明" isGoHome="{{isGoHome}}"></header>
|
||||||
<view class='container'>
|
<view class='container'>
|
||||||
<view class='body'>
|
<view class='body'>
|
||||||
<view class='title'>{{announcement.title}}</view>
|
<!-- <view class='title'>免责声明</view>-->
|
||||||
<view class='date'>{{announcement.time}}</view>
|
|
||||||
<view class='rich-box'>
|
<view class='rich-box'>
|
||||||
<rich-text nodes="{{announcement.description}}"></rich-text>
|
<rich-text nodes="{{disclaimers.description}}"></rich-text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class='footer-box'>
|
||||||
|
<view class='footer-btn' bindtap='backToOpen'>同意</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -2,14 +2,13 @@
|
|||||||
|
|
||||||
.container {
|
.container {
|
||||||
/* min-height: calc(1100 - 200rpx); */
|
/* min-height: calc(1100 - 200rpx); */
|
||||||
background: #fff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.body {
|
.body {
|
||||||
padding-bottom: 40rpx;
|
padding-bottom: 40rpx;
|
||||||
padding-left: 30rpx;
|
padding-left: 30rpx;
|
||||||
padding-right: 30rpx;
|
padding-right: 30rpx;
|
||||||
background: #fff;
|
color: aliceblue;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
@@ -18,14 +17,6 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.date {
|
|
||||||
height: 20rpx;
|
|
||||||
margin-top: 36rpx;
|
|
||||||
font-size: 20rpx;
|
|
||||||
color: #cfcfcf;
|
|
||||||
line-height: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rich-box {
|
.rich-box {
|
||||||
margin-top: 40rpx;
|
margin-top: 40rpx;
|
||||||
|
|
||||||
@@ -36,3 +27,12 @@
|
|||||||
.rich-box .wscnph {
|
.rich-box .wscnph {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.footer-btn {
|
||||||
|
flex: 1;
|
||||||
|
background: #ffda2e;
|
||||||
|
color: #1a191e;
|
||||||
|
font-size: 32rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 100rpx;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// pages/myBookings/index.js
|
// pages/myBookings/index.js
|
||||||
const app = getApp();
|
const app = getApp();
|
||||||
|
import {getTimeoutStorage} from "../../utils/util";
|
||||||
let ticketId = 0;
|
let ticketId = 0;
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
@@ -76,10 +77,18 @@ Page({
|
|||||||
},
|
},
|
||||||
|
|
||||||
openDoor(){
|
openDoor(){
|
||||||
|
let isRead = getTimeoutStorage('isReaded');
|
||||||
|
console.log('isRead======' + isRead)
|
||||||
|
if (isRead == 'ojbk') {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title:'开门成功',
|
title:'足球场开门成功',
|
||||||
icon : "success"
|
icon : "success"
|
||||||
})
|
})
|
||||||
|
}else {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/disclaimers/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取数据
|
// 获取数据
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//testURL
|
//testURL
|
||||||
// const BASE_URL = 'http://127.0.0.1:8093';
|
// 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
|
//prodURL
|
||||||
const BASE_URL = 'https://api.hongyutiyu.top';
|
const BASE_URL = 'https://api.hongyutiyu.top';
|
||||||
// const platformId = 1;
|
// const platformId = 1;
|
||||||
@@ -334,6 +334,10 @@ export default {
|
|||||||
aboutUs(params) {
|
aboutUs(params) {
|
||||||
return fetchGet('/about/uss', params, false);
|
return fetchGet('/about/uss', params, false);
|
||||||
},
|
},
|
||||||
|
// 免责声明
|
||||||
|
disclaimersDetail(params) {
|
||||||
|
return fetchGet('/notice/disclaimers', params, false);
|
||||||
|
},
|
||||||
// 上传图像
|
// 上传图像
|
||||||
uploadAvatar(params) {
|
uploadAvatar(params) {
|
||||||
return fetchPost('/upload/avatar', params, true, true);
|
return fetchPost('/upload/avatar', params, true, true);
|
||||||
|
|||||||
@@ -26,7 +26,36 @@ const getCurrentPageUrl = () => {
|
|||||||
return url;
|
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 = {
|
module.exports = {
|
||||||
formatTime: formatTime,
|
formatTime: formatTime,
|
||||||
getCurrentPageUrl: getCurrentPageUrl
|
getCurrentPageUrl: getCurrentPageUrl,
|
||||||
|
setTimeOutStorage: setTimeOutStorage,
|
||||||
|
getTimeoutStorage: getTimeoutStorage
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user