You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

143 lines
2.9 KiB

1 year ago
<template>
<view class="container">
1 year ago
<image class="cbg" :src="base.imgHost('book-bg.png')"></image>
<view class="schoolmate btn">
<image mode="widthFix" @click="toUrl(2)" :src="base.imgHost('book-schoolmate1.png')"></image>
1 year ago
<!-- <view>加入我们</view> -->
1 year ago
</view>
<view class="book btn">
<image mode="widthFix" @click="toUrl(1)" :src="base.imgHost('book-book1.png')"></image>
1 year ago
<!-- <view>立即预约</view> -->
1 year ago
</view>
1 year ago
<tabbar :currentPage="2"></tabbar>
</view>
</template>
<script>
import tabbar from '@/components/tabbar/tabbar.vue';
export default {
components: {
tabbar
},
data() {
return {
user: {},
1 year ago
can_appointment: false,
1 year ago
enter_schoolmate: 0,
1 year ago
door_appointments: false, // 当前是否有预约
1 year ago
}
1 year ago
},
1 year ago
onShareAppMessage() {
1 year ago
return{
title:"苏州科技商学院",
imageUrl:"/static/share.jpg"
}
1 year ago
},
onShareTimeline() {
1 year ago
return{
title:"苏州科技商学院",
imageUrl:"/static/share.jpg"
}
1 year ago
},
onShow() {
this.getUser()
1 year ago
},
onLoad() {
},
1 year ago
methods: {
1 year ago
getUser() {
this.$u.api.user().then(res => {
console.log("res", res)
1 year ago
this.enter_schoolmate = res.enter_schoolmate
1 year ago
if (res.user.appointment_total - res.user.pass_appointments > 0) {
this.can_appointment = true
} else {
this.can_appointment = false
1 year ago
}
1 year ago
// this.door_appointments = res.door_appointments ? true : false
1 year ago
this.$u.vuex('vuex_user', res.user)
})
},
1 year ago
async toUrl(type) {
if (type === 1) {
1 year ago
uni.navigateTo({
url: '/packages/booksubmit/appointment'
})
// await this.$u.api.user().then(res => {
// if (res.user.appointment_total - res.user.pass_appointments > 0) {
// this.can_appointment = true
// uni.navigateTo({
// url: '/packages/booksubmit/appointment'
// })
// } else {
// this.can_appointment = false
// this.base.toast("您当前没有可预约次数")
// }
// })
1 year ago
} else if (type === 2) {
1 year ago
if (this.enter_schoolmate) {
1 year ago
uni.navigateTo({
url: '/packages/schoolmate/index'
})
} else {
1 year ago
this.base.toast("您还不是校友,无权查看",1000,function(){
setTimeout(function(){
uni.switchTab({
url: '/pages/course/index'
})
1 year ago
},1000)
1 year ago
})
1 year ago
}
}
}
},
}
</script>
<style scoped lang="scss">
.container {
width: 100%;
height: 100vh;
1 year ago
padding-bottom: 200rpx;
.cbg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100vh;
1 year ago
}
1 year ago
.btn{
width:320rpx;
// height:136rpx;
1 year ago
position: absolute;
1 year ago
image{
width:100%;
height:100%;
}
view{
text-align: center;
margin-top:10rpx;
color:#806e5c;
font-size:30rpx;
}
}
.schoolmate{
1 year ago
top: 300rpx;
1 year ago
left: 40rpx;
1 year ago
}
.book{
bottom: 300rpx;
1 year ago
right: 40rpx;
1 year ago
}
1 year ago
1 year ago
}
</style>