更新修改

master
lion 2 years ago
parent e8c32017ce
commit b1440c7368

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

File diff suppressed because one or more lines are too long

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

@ -1,6 +1,21 @@
<template> <template>
<view class="container"> <view class="container">
<image class="cbg" :src="base.imgHost('common_bg.png')"></image> <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"> <view class="book-top">
<text class="book-top-line"></text> <text class="book-top-line"></text>
<image :src="base.imgHost('book-top.png')"></image> <image :src="base.imgHost('book-top.png')"></image>
@ -24,7 +39,10 @@
</view> </view>
</view> </view>
<view class="book-pic-item-introduce" v-if="item.introduce">{{item.introduce}}</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" <image style="width:20rpx;height:26rpx;margin-right:30rpx"
:src="base.imgHost('book-address.png')"></image> :src="base.imgHost('book-address.png')"></image>
<view class="book-pic-item-info-between"> <view class="book-pic-item-info-between">
@ -46,12 +64,12 @@
<view v-if="item.total" class="book-pic-item-info"> <view v-if="item.total" class="book-pic-item-info">
<image style="width:29rpx;height:21rpx;margin-right:21rpx" <image style="width:29rpx;height:21rpx;margin-right:21rpx"
:src="base.imgHost('book-people.png')"></image> :src="base.imgHost('book-people.png')"></image>
<view class="book-pic-item-info-between"> <view class="book-pic-item-info-between">
<text>容纳</text> <text>容纳</text>
<text>人数</text> <text>人数</text>
</view> </view>
<view>{{item.total}}</view> <view>{{item.total}}</view>
</view> </view> -->
</block> </block>
<block v-else> <block v-else>
<swiper circular :indicator-dots="false" indicator-active-color="#b79373" <swiper circular :indicator-dots="false" indicator-active-color="#b79373"
@ -67,7 +85,10 @@
</view> </view>
</view> </view>
<view v-if="item.introduce">{{item.introduce}}</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" <image style="width:20rpx;height:26rpx;margin-right:30rpx"
:src="base.imgHost('book-address.png')"></image> :src="base.imgHost('book-address.png')"></image>
<view class="book-pic-item-info-between"> <view class="book-pic-item-info-between">
@ -88,11 +109,11 @@
<view v-if="item.total" class="book-pic-item-info"> <view v-if="item.total" class="book-pic-item-info">
<image style="width:29rpx;height:21rpx;margin-right:21rpx" <image style="width:29rpx;height:21rpx;margin-right:21rpx"
:src="base.imgHost('book-people.png')"></image> :src="base.imgHost('book-people.png')"></image>
<view class="book-pic-item-info-between"> <view class="book-pic-item-info-between">
<text>容纳人数</text> <text>容纳人数</text>
</view> </view>
<view>{{item.total}}</view> <view>{{item.total}}</view>
</view> </view> -->
</block> </block>
</view> </view>
@ -101,6 +122,22 @@
</view> </view>
</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> <tabbar :currentPage="2"></tabbar>
</view> </view>
</template> </template>
@ -117,7 +154,11 @@
can_appointment: false, can_appointment: false,
is_schoolmate: 0, is_schoolmate: 0,
door_appointments: false, // door_appointments: false, //
siteList: [] siteList: [],
book_list: [],
myQrcode: null,
showBigCode: false,
timer:null
} }
}, },
onShareAppMessage() { onShareAppMessage() {
@ -133,9 +174,11 @@
} }
}, },
onShow() { onShow() {
this.getUser() // this.getUser()
}, },
onLoad() { onLoad() {
// console.log("123",this.isCurrentDateGreaterOrEqual('2024-09-06'))
this.getBookList()
this.getSites() this.getSites()
}, },
methods: { methods: {
@ -148,31 +191,56 @@
}) })
}) })
}, },
getUser() { async getBookList() {
this.$u.api.user().then(res => { 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 this.is_schoolmate = res.user.is_schoolmate
if (res.user.appointment_total - res.user.pass_appointments > 0) { if (res.user.appointment_total - res.user.pass_appointments > 0) {
this.can_appointment = true this.can_appointment = true
} else { } else {
this.can_appointment = false 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) this.$u.vuex('vuex_user', res.user)
}) })
}, },
toUrl(type) { async toUrl(type) {
// if (!this.is_schoolmate) { // if (!this.is_schoolmate) {
// this.base.toast("") // this.base.toast("")
// return // return
// } // }
await this.getUser()
if (!this.can_appointment) { if (!this.can_appointment) {
this.base.toast("您当前没有可预约次数") this.base.toast("您当前没有可预约次数")
return return
} }
if (this.door_appointments) { // if (this.door_appointments) {
this.base.toast("您当前已有预约") // this.base.toast("")
return // return
} // }
uni.navigateTo({ uni.navigateTo({
url: '/packages/booksubmit/index?type=' + type url: '/packages/booksubmit/index?type=' + type
}) })
@ -199,6 +267,28 @@
height: 100vh; 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 { .book-top {
position: relative; position: relative;
padding: 80rpx 0 60rpx 0; padding: 80rpx 0 60rpx 0;
@ -284,9 +374,12 @@
padding: 0 30rpx; padding: 0 30rpx;
font-size: 28rpx; font-size: 28rpx;
color: #000; color: #000;
&>view{ line-height: 1.8;
margin-right:10rpx;
&>view {
margin-right: 10rpx;
} }
&-between { &-between {
width: 135rpx; width: 135rpx;
display: flex; 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> </style>

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

@ -54,7 +54,7 @@
} else { } else {
this.can_appointment = false 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) this.$u.vuex('vuex_user', res.user)
}) })
}, },
@ -64,10 +64,10 @@
this.base.toast("您当前没有可预约次数") this.base.toast("您当前没有可预约次数")
return return
} }
if (this.door_appointments) { // if (this.door_appointments) {
this.base.toast("您当前已有预约") // this.base.toast("")
return // return
} // }
uni.navigateTo({ uni.navigateTo({
url: '/packages/booksubmit/appointment' url: '/packages/booksubmit/appointment'
}) })

Loading…
Cancel
Save