更新修改

master
lion 1 year ago
parent e8c32017ce
commit b1440c7368

@ -1,7 +1,7 @@
const mode = 'production'; //devLocal本地测试、devOnline线上测试、production生产环境
let ROOTPATH = ''; //域名
// let baseUrl = "https://suzhoukeji-test.ali251.langye.net"
let baseUrl = "https://wx.sstbc.com"
let baseUrl = "https://suzhoukeji-test.ali251.langye.net"
// let baseUrl = "https://wx.sstbc.com"
switch (mode) {
case 'devLocal':
ROOTPATH = baseUrl

File diff suppressed because one or more lines are too long

@ -77,7 +77,7 @@
import nextSearchImgSrc from '../../static/search.png'
import noDataImgSrc from '../../static/noData.png'
import nextScrollRightTopSrc from '../../static/top.png'
import pinyin from './js-pinyin/dist/pinyin.js'
import pinyin from './js-pinyin/pinyin.js'
// pinyin

@ -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>

@ -124,7 +124,7 @@
return {
dateShow: false,
isLocked:false,
showTips: false,
showTips: true,
confirmTips: false,
hMin: 0,
hMax: 24,
@ -202,10 +202,10 @@
onReady() {
this.$refs.uForm.setRules(this.rules);
},
onLoad(options) {
async onLoad(options) {
this.appoinementType = options.type ? options.type : ''
this.getUser()
this.getSites()
await this.getUser()
await this.getSites()
},
methods: {
getUser() {
@ -358,8 +358,7 @@
// console.log("res",res)
// })
this.$refs.uForm.validate(valid => {
if (valid) {
if (valid) {
start_time = this.form.date + ' ' + this.form.start_time + ':00'
end_time = this.form.date + ' ' + this.form.end_time + ':00'
this.form.accompany_total = this.form.accompany.length
@ -377,14 +376,11 @@
this.form.plate = _plate.join(',')
console.log("plate", this.form)
// return
if(!this.confirmTips){
this.showTips = true
return
}
if(this.isLocked){
return
}
this.isLocked = true
// if(this.isLocked){
// return
// }
// this.isLocked = true
this.$u.api.scheduleSave({
...this.form,
start_time: start_time,
@ -414,7 +410,7 @@
uni.redirectTo({
url: '/packages/mybook/index'
})
}, 1000)
}, 500)
})
} else {
//
@ -433,7 +429,7 @@
uni.redirectTo({
url: '/packages/mybook/index'
})
}, 1000)
}, 500)
})
},
fail(err) {
@ -442,7 +438,7 @@
uni.redirectTo({
url: '/packages/mybook/index'
})
}, 1000)
}, 500)
})
}
})
@ -452,7 +448,7 @@
uni.redirectTo({
url: '/packages/mybook/index'
})
}, 1000)
}, 500)
})
}
}
@ -465,7 +461,7 @@
uni.redirectTo({
url: '/packages/mybook/index'
})
}, 1000)
}, 500)
})
//
}

@ -54,7 +54,7 @@
} 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)
})
},
@ -64,10 +64,10 @@
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/appointment'
})

Loading…
Cancel
Save