|
|
|
|
@ -1,6 +1,21 @@
|
|
|
|
|
<template>
|
|
|
|
|
<view class="container">
|
|
|
|
|
<image class="cbg" :src="base.imgHost('common_bg.png')"></image>
|
|
|
|
|
<view class="qrcode" @click="showBigCode = true">
|
|
|
|
|
<view class="qrcode-text">
|
|
|
|
|
<text>最</text>
|
|
|
|
|
<text>近</text>
|
|
|
|
|
<text>预</text>
|
|
|
|
|
<text>约</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="qrcode-code">
|
|
|
|
|
<uqrcode v-if="myQrcode" ref="uqrcode" canvas-id="qrcode" :value="myQrcode.qrcode" :sizeUnit="'rpx'"
|
|
|
|
|
:size="100" :options="{
|
|
|
|
|
margin: 5,
|
|
|
|
|
foregroundImageSrc: '/static/index_icon1.png',
|
|
|
|
|
}"></uqrcode>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="book-top">
|
|
|
|
|
<text class="book-top-line"></text>
|
|
|
|
|
<image :src="base.imgHost('book-top.png')"></image>
|
|
|
|
|
@ -24,7 +39,10 @@
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="book-pic-item-introduce" v-if="item.introduce">{{item.introduce}}</view>
|
|
|
|
|
<view v-if="item.floor" class="book-pic-item-info">
|
|
|
|
|
<view v-if="item.content" class="book-pic-item-info">
|
|
|
|
|
<view v-html="item.content"></view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- <view v-if="item.floor" class="book-pic-item-info">
|
|
|
|
|
<image style="width:20rpx;height:26rpx;margin-right:30rpx"
|
|
|
|
|
:src="base.imgHost('book-address.png')"></image>
|
|
|
|
|
<view class="book-pic-item-info-between">
|
|
|
|
|
@ -46,12 +64,12 @@
|
|
|
|
|
<view v-if="item.total" class="book-pic-item-info">
|
|
|
|
|
<image style="width:29rpx;height:21rpx;margin-right:21rpx"
|
|
|
|
|
:src="base.imgHost('book-people.png')"></image>
|
|
|
|
|
<view class="book-pic-item-info-between">
|
|
|
|
|
<text>容纳</text>
|
|
|
|
|
<text>人数:</text>
|
|
|
|
|
<view class="book-pic-item-info-between">
|
|
|
|
|
<text>容纳</text>
|
|
|
|
|
<text>人数:</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view>{{item.total}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view> -->
|
|
|
|
|
</block>
|
|
|
|
|
<block v-else>
|
|
|
|
|
<swiper circular :indicator-dots="false" indicator-active-color="#b79373"
|
|
|
|
|
@ -67,7 +85,10 @@
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="item.introduce">{{item.introduce}}</view>
|
|
|
|
|
<view v-if="item.floor" class="book-pic-item-info">
|
|
|
|
|
<view v-if="item.content" class="book-pic-item-info">
|
|
|
|
|
<view v-html="item.content"></view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- <view v-if="item.floor" class="book-pic-item-info">
|
|
|
|
|
<image style="width:20rpx;height:26rpx;margin-right:30rpx"
|
|
|
|
|
:src="base.imgHost('book-address.png')"></image>
|
|
|
|
|
<view class="book-pic-item-info-between">
|
|
|
|
|
@ -88,11 +109,11 @@
|
|
|
|
|
<view v-if="item.total" class="book-pic-item-info">
|
|
|
|
|
<image style="width:29rpx;height:21rpx;margin-right:21rpx"
|
|
|
|
|
:src="base.imgHost('book-people.png')"></image>
|
|
|
|
|
<view class="book-pic-item-info-between">
|
|
|
|
|
<text>容纳人数:</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="book-pic-item-info-between">
|
|
|
|
|
<text>容纳人数:</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view>{{item.total}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view> -->
|
|
|
|
|
</block>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
@ -101,6 +122,22 @@
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="showBigCode" class="big">
|
|
|
|
|
<view class="big-wrap">
|
|
|
|
|
<view class="big-close" @click='showBigCode=false'>X</view>
|
|
|
|
|
<view class="big-code">
|
|
|
|
|
<uqrcode v-if="myQrcode" ref="uqrcode" canvas-id="qrcode" :value="myQrcode.qrcode" :sizeUnit="'rpx'"
|
|
|
|
|
:size="500" :options="{
|
|
|
|
|
margin: 5,
|
|
|
|
|
foregroundImageSrc: '/static/index_icon1.png',
|
|
|
|
|
}"></uqrcode>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="big-info">
|
|
|
|
|
<view @click="getBookList">点击刷新二维码</view>
|
|
|
|
|
<view>预约日期:{{myQrcode.date}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<tabbar :currentPage="2"></tabbar>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
@ -117,7 +154,11 @@
|
|
|
|
|
can_appointment: false,
|
|
|
|
|
is_schoolmate: 0,
|
|
|
|
|
door_appointments: false, // 当前是否有预约
|
|
|
|
|
siteList: []
|
|
|
|
|
siteList: [],
|
|
|
|
|
book_list: [],
|
|
|
|
|
myQrcode: null,
|
|
|
|
|
showBigCode: false,
|
|
|
|
|
timer:null
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onShareAppMessage() {
|
|
|
|
|
@ -133,9 +174,11 @@
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onShow() {
|
|
|
|
|
this.getUser()
|
|
|
|
|
// this.getUser()
|
|
|
|
|
},
|
|
|
|
|
onLoad() {
|
|
|
|
|
onLoad() {
|
|
|
|
|
// console.log("123",this.isCurrentDateGreaterOrEqual('2024-09-06'))
|
|
|
|
|
this.getBookList()
|
|
|
|
|
this.getSites()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
@ -148,31 +191,56 @@
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getUser() {
|
|
|
|
|
this.$u.api.user().then(res => {
|
|
|
|
|
async getBookList() {
|
|
|
|
|
const res = await this.$u.api.scheduleIndex({
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 999,
|
|
|
|
|
status: 1
|
|
|
|
|
})
|
|
|
|
|
if (res.data.length > 0) {
|
|
|
|
|
res.data.map(item => {
|
|
|
|
|
if (this.isCurrentDateGreaterOrEqual(item.date)) {
|
|
|
|
|
this.myQrcode = item
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 判断已预约的日期是否大于或等于当前日期
|
|
|
|
|
isCurrentDateGreaterOrEqual(targetDate) {
|
|
|
|
|
// 将目标日期转换为Moment对象
|
|
|
|
|
|
|
|
|
|
const target = this.$moment(targetDate, 'YYYY-MM-DD');
|
|
|
|
|
// 获取当前日期
|
|
|
|
|
const now = this.$moment().format('YYYY-MM-DD');
|
|
|
|
|
// 比较当前日期是否大于或等于目标日期
|
|
|
|
|
return this.$moment(now).isSameOrBefore(target);
|
|
|
|
|
},
|
|
|
|
|
async getUser() {
|
|
|
|
|
await this.$u.api.user().then(res => {
|
|
|
|
|
this.is_schoolmate = res.user.is_schoolmate
|
|
|
|
|
if (res.user.appointment_total - res.user.pass_appointments > 0) {
|
|
|
|
|
this.can_appointment = true
|
|
|
|
|
} else {
|
|
|
|
|
this.can_appointment = false
|
|
|
|
|
}
|
|
|
|
|
this.door_appointments = res.door_appointments ? true : false
|
|
|
|
|
// this.door_appointments = res.door_appointments ? true : false
|
|
|
|
|
this.$u.vuex('vuex_user', res.user)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
toUrl(type) {
|
|
|
|
|
async toUrl(type) {
|
|
|
|
|
// if (!this.is_schoolmate) {
|
|
|
|
|
// this.base.toast("您还不是校友,还不能享有该权益")
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
await this.getUser()
|
|
|
|
|
if (!this.can_appointment) {
|
|
|
|
|
this.base.toast("您当前没有可预约次数")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (this.door_appointments) {
|
|
|
|
|
this.base.toast("您当前已有预约")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
// if (this.door_appointments) {
|
|
|
|
|
// this.base.toast("您当前已有预约")
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: '/packages/booksubmit/index?type=' + type
|
|
|
|
|
})
|
|
|
|
|
@ -199,6 +267,28 @@
|
|
|
|
|
height: 100vh;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.qrcode {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 20rpx;
|
|
|
|
|
right: 20rpx;
|
|
|
|
|
font-size: 19rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
z-index:9;
|
|
|
|
|
&-text {
|
|
|
|
|
margin-right: 10rpx;
|
|
|
|
|
|
|
|
|
|
&>text {
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-code {
|
|
|
|
|
width: 100rpx;
|
|
|
|
|
height: 100rpx
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.book-top {
|
|
|
|
|
position: relative;
|
|
|
|
|
padding: 80rpx 0 60rpx 0;
|
|
|
|
|
@ -284,9 +374,12 @@
|
|
|
|
|
padding: 0 30rpx;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #000;
|
|
|
|
|
&>view{
|
|
|
|
|
margin-right:10rpx;
|
|
|
|
|
line-height: 1.8;
|
|
|
|
|
|
|
|
|
|
&>view {
|
|
|
|
|
margin-right: 10rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-between {
|
|
|
|
|
width: 135rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
@ -302,5 +395,49 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.big {
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100vh;
|
|
|
|
|
background-color: rgba(0, 0, 0, 0.7);
|
|
|
|
|
overflow: scroll;
|
|
|
|
|
z-index:10;
|
|
|
|
|
&-wrap {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 50%;
|
|
|
|
|
left: 50%;
|
|
|
|
|
transform: translate(-50%, -50%);
|
|
|
|
|
width: 500rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
}
|
|
|
|
|
&-code{
|
|
|
|
|
width:500rpx;height:500rpx
|
|
|
|
|
}
|
|
|
|
|
&-close {
|
|
|
|
|
width: 80rpx;
|
|
|
|
|
height: 80rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
line-height: 80rpx;
|
|
|
|
|
color: #fff;
|
|
|
|
|
background: #6e6e77;
|
|
|
|
|
border-radius: 80rpx;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: -80rpx;
|
|
|
|
|
right: 0;
|
|
|
|
|
}
|
|
|
|
|
&-info{
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color:#fff;
|
|
|
|
|
text-align: center;
|
|
|
|
|
&>view{
|
|
|
|
|
margin-top:20rpx
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|