master
lion 1 year ago
parent d35a45c5b2
commit f39c08853a

@ -39,40 +39,12 @@
<view v-if="item.content" class="book-pic-item-info"> <view v-if="item.content" class="book-pic-item-info">
<view v-html="item.content"></view> <view v-html="item.content"></view>
</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">
<text></text>
<text></text>
</view>
<view>{{item.floor}}</view>
</view>
<view v-if="item.start_time" class="book-pic-item-info">
<image style="width:24rpx;height:24rpx;margin-right:26rpx"
:src="base.imgHost('book-time.png')"></image>
<text></text>
<view class="book-pic-item-info-between">
<text></text>
<text></text>
</view>
<view>{{item.start_time}}-{{item.end_time}}</view>
</view>
<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>
<view>{{item.total}}</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"
indicator-color="#fff" style="height:350rpx" :autoplay="false"> indicator-color="#fff" style="height:350rpx" :autoplay="false">
<swiper-item> <swiper-item>
<image :src="base.imgHost('index_swiper.png')" /> <image :src="base.imgHost('index_swiper1.png')" />
</swiper-item> </swiper-item>
</swiper> </swiper>
<view class="book-pic-item-book"> <view class="book-pic-item-book">
@ -85,32 +57,6 @@
<view v-if="item.content" class="book-pic-item-info"> <view v-if="item.content" class="book-pic-item-info">
<view v-html="item.content"></view> <view v-html="item.content"></view>
</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">
<text></text>
<text></text>
</view>
<view>{{item.floor}}</view>
</view>
<view v-if="item.start_time" class="book-pic-item-info">
<image style="width:24rpx;height:24rpx;margin-right:26rpx"
:src="base.imgHost('book-time.png')"></image>
<view class="book-pic-item-info-between">
<text></text>
<text></text>
</view>
<view>{{item.start_time}}-{{item.end_time}}</view>
</view>
<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>{{item.total}}</view>
</view> -->
</block> </block>
</view> </view>

@ -38,8 +38,8 @@
</view> </view>
</view> </view>
<view class="list-item-bottom"> <view class="list-item-bottom">
<text @click.stop="cancelBook(item)" v-if="item.status<1 && isCanCancel(item.start_time)"></text> <text @click.stop="cancelBook(item)" v-if="item.status<2 && isCanCancel(item.start_time)"></text>
<text v-if="item.status<1 && isCanCancel(item.start_time)">|</text> <text v-if="item.status<2 && isCanCancel(item.start_time)">|</text>
<text>查看</text> <text>查看</text>
</view> </view>

@ -14,13 +14,15 @@
<text>{{userInfo.username?userInfo.username:'-'}}</text> <text>{{userInfo.username?userInfo.username:'-'}}</text>
</view> </view>
<view class="usersigns" v-if="course_signs.length>0"> <view class="usersigns" v-if="course_signs.length>0">
<text>学籍</text> <block v-if="course_signs[0]['course']">
<text>{{course_signs[0]['course'].year?course_signs[0]['course'].year+'年':''}}{{course_signs[0]['course'].type_detail?course_signs[0]['course']['type_detail'].name+"|":''}}{{course_signs[0]['course'].name}}</text> <text>学籍</text>
<text>{{course_signs[0]['course'].year?course_signs[0]['course'].year+'年':''}}{{course_signs[0]['course'].type_detail?course_signs[0]['course']['type_detail'].name+"|":''}}{{course_signs[0]['course'].name}}</text>
</block>
</view> </view>
</view> </view>
<view class="usercode" @click="showBigCode=true"> <view class="usercode" @click="showBigCode=true">
<uqrcode v-if="myQrcode" ref="uqrcode" canvas-id="qrcode" :value="myQrcode" :sizeUnit="'rpx'" <uqrcode v-if="myQrcode" ref="uqrcode" canvas-id="qrcode" :value="myQrcode"
:size="160" :options="{ :sizeUnit="'rpx'" :size="160" :options="{
margin: 10, margin: 10,
foregroundImageSrc: '/static/index_icon1.png', foregroundImageSrc: '/static/index_icon1.png',
}"></uqrcode> }"></uqrcode>
@ -97,8 +99,8 @@
<view class="modal-xyk-between"> <view class="modal-xyk-between">
<view class="modal-xyk-item"> <view class="modal-xyk-item">
<view style="display: flex;justify-content: center;" @click="bigCode"> <view style="display: flex;justify-content: center;" @click="bigCode">
<uqrcode v-if="myQrcode" ref="uqrcode" canvas-id="qrcode" :value="myQrcode" :sizeUnit="'rpx'" <uqrcode v-if="myQrcode" ref="uqrcode" canvas-id="qrcode" :value="myQrcode"
:size="160" :options="{ :sizeUnit="'rpx'" :size="160" :options="{
margin: 10, margin: 10,
foregroundImageSrc: '/static/index_icon1.png', foregroundImageSrc: '/static/index_icon1.png',
}"></uqrcode> }"></uqrcode>
@ -109,10 +111,11 @@
<text>姓名</text> <text>姓名</text>
<text>{{userInfo.username}}</text> <text>{{userInfo.username}}</text>
</view> </view>
<view class="modal-xyk-name-course" v-if="course_signs.length>0"> <view class="modal-xyk-name-course" v-if="course_signs.length>0">
<text>学籍</text> <block v-if="course_signs[0]['course']">
<text>{{course_signs[0]['course'].year?course_signs[0]['course'].year+'年':''}}{{course_signs[0]['course'].type_detail?course_signs[0]['course']['type_detail'].name+"|":''}}{{course_signs[0]['course'].name}}</text> <text>学籍</text>
<text>{{course_signs[0]['course'].year?course_signs[0]['course'].year+'年':''}}{{course_signs[0]['course'].type_detail?course_signs[0]['course']['type_detail'].name+"|":''}}{{course_signs[0]['course'].name}}</text>
</block>
</view> </view>
</view> </view>
</view> </view>
@ -152,14 +155,15 @@
</u-popup> </u-popup>
</view> </view>
<view v-if="showBigCode" class="big"> <view v-if="showBigCode" class="big">
<view class="big-wrap"> <view class="big-wrap">
<view class="big-close" @click='showBigCode=false'>X</view> <view class="big-close" @click='showBigCode=false'>X</view>
<uqrcode v-if="myQrcode" ref="uqrcode" canvas-id="qrcode" :value="myQrcode" :sizeUnit="'rpx'" :size="500" :options="{ <uqrcode v-if="myQrcode" ref="uqrcode" canvas-id="qrcode" :value="myQrcode" :sizeUnit="'rpx'"
margin: 10, :size="500" :options="{
foregroundImageSrc: '/static/index_icon1.png', margin: 10,
}"></uqrcode> foregroundImageSrc: '/static/index_icon1.png',
</view> }"></uqrcode>
</view>
</view> </view>
<tabbar :currentPage="3"></tabbar> <tabbar :currentPage="3"></tabbar>
</view> </view>
@ -181,10 +185,10 @@
showCard: false, showCard: false,
userInfo: {}, userInfo: {},
hasMobile: false, hasMobile: false,
course_signs: [], course_signs: [],
showBigCode:false, showBigCode: false,
myQrcode:'STBC', myQrcode: 'STBC',
timer:null timer: null
} }
}, },
onShareAppMessage() { onShareAppMessage() {
@ -201,28 +205,28 @@
}, },
onShow() { onShow() {
this.showRegister = false this.showRegister = false
this.getUserInfo() this.getUserInfo()
let that = this let that = this
if(!this.timer){ if (!this.timer) {
this.timer = setInterval(function(){ this.timer = setInterval(function() {
that.getQrCode() that.getQrCode()
},3*60*1000) }, 3 * 60 * 1000)
} }
}, },
onLoad() { onLoad() {
}, },
onUnload() { onUnload() {
if(this.timer){ if (this.timer) {
clearInterval(this.timer) clearInterval(this.timer)
this.timer = null this.timer = null
} }
}, },
onHide() { onHide() {
if(this.timer){ if (this.timer) {
clearInterval(this.timer) clearInterval(this.timer)
this.timer = null this.timer = null
} }
}, },
methods: { methods: {
refreshCode() { refreshCode() {
@ -232,10 +236,10 @@
return return
} }
this.showCard = true this.showCard = true
}, },
bigCode(){ bigCode() {
this.showCard = false this.showCard = false
this.showBigCode = true this.showBigCode = true
}, },
toUrl(type) { toUrl(type) {
if (type === 1 || type === 2 || type === 3) { if (type === 1 || type === 2 || type === 3) {
@ -272,8 +276,8 @@
console.log("res", res) console.log("res", res)
this.$u.vuex('vuex_user', res.user) this.$u.vuex('vuex_user', res.user)
this.userInfo = res.user this.userInfo = res.user
this.course_signs = res.user.course_signs ? res.user.course_signs : [], this.course_signs = res.user.course_signs ? res.user.course_signs : [],
this.myQrcode = res.course_signs?res.course_signs.qrcode:'STBC' this.myQrcode = res.course_signs ? res.course_signs.qrcode : 'STBC'
if (this.base.isNull(res.user.mobile)) { if (this.base.isNull(res.user.mobile)) {
this.showRegister = true this.showRegister = true
this.hasMobile = false this.hasMobile = false
@ -282,17 +286,17 @@
this.hasMobile = true this.hasMobile = true
} }
}) })
}, },
getQrCode(){ getQrCode() {
uni.showLoading({ uni.showLoading({
title: '...' title: '...'
}) })
this.$u.api.user().then(res => { this.$u.api.user().then(res => {
this.myQrcode = res.course_signs?res.course_signs.qrcode:'STBC' this.myQrcode = res.course_signs ? res.course_signs.qrcode : 'STBC'
setTimeout(function() { setTimeout(function() {
uni.hideLoading() uni.hideLoading()
}, 500) }, 500)
}) })
}, },
// //
goBind() { goBind() {
@ -542,8 +546,8 @@
&-reload { &-reload {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 10rpx 40rpx; padding: 10rpx 40rpx;
font-size:24rpx; font-size: 24rpx;
image { image {
width: 27rpx; width: 27rpx;
@ -562,52 +566,53 @@
// margin-bottom: 20rpx; // margin-bottom: 20rpx;
} }
&-course { &-course {
display: flex; display: flex;
&>text:first-child { &>text:first-child {
width: 100rpx; width: 100rpx;
} }
&>text:last-child { &>text:last-child {
width: calc(100% - 100rpx); width: calc(100% - 100rpx);
} }
} }
} }
} }
.big {
position: fixed; .big {
top: 0; position: fixed;
left: 0; top: 0;
width: 100%; left: 0;
height: 100vh; width: 100%;
background-color: rgba(0, 0, 0, 0.7); height: 100vh;
overflow: scroll; background-color: rgba(0, 0, 0, 0.7);
overflow: scroll;
&-wrap {
position: absolute; &-wrap {
top: 50%; position: absolute;
left: 50%; top: 50%;
transform: translate(-50%, -50%); left: 50%;
width: 500rpx; transform: translate(-50%, -50%);
text-align: center; width: 500rpx;
display: flex; text-align: center;
justify-content: center; display: flex;
flex-wrap: wrap; justify-content: center;
} flex-wrap: wrap;
}
&-close {
width: 80rpx; &-close {
height: 80rpx; width: 80rpx;
text-align: center; height: 80rpx;
line-height: 80rpx; text-align: center;
color: #fff; line-height: 80rpx;
background: #6e6e77; color: #fff;
border-radius: 80rpx; background: #6e6e77;
position: absolute; border-radius: 80rpx;
top: -80rpx; position: absolute;
right: 0; top: -80rpx;
} right: 0;
}
} }
} }
</style> </style>
Loading…
Cancel
Save