master
lion 2 years ago
parent 1e86382124
commit 748b9cd3e4

@ -1,21 +1,27 @@
<script>
export default {
onLaunch: function() {
this.$nextTick(() => {
// uni.login({
// provider: 'weixin',
// success: (res) => {
// console.log(res.code);
// this.$u.api.login({
// code: res.code
// }).then(res => {
// this.$u.api.user().then(res=>{
// this.$u.vuex('vuex_user', res)
// })
// })
// }
// });
})
// this.$nextTick(() => {
// uni.login({
// provider: 'weixin',
// success: (res) => {
// console.log(res.code);
// this.$u.api.login({
// code: res.code
// }).then(res1 => {
// uni.request({
// url:'/api/mobile/user/get-user-info',
// header:{
// Authorization:`Bearer ${res1.token}`
// },
// success() {
// this.$u.vuex('vuex_user', res)
// }
// })
// })
// }
// });
// })
},

@ -85,8 +85,7 @@ const install = (Vue, vm) => {
}
}) // showConfirm end
return
} else {
console.log("res.",res.data)
} else {
uni.showToast({
icon: "none",
title: res.data.errmsg,
@ -95,7 +94,6 @@ const install = (Vue, vm) => {
}
return false;
} else {
return res.data;
}
} else {
@ -104,7 +102,6 @@ const install = (Vue, vm) => {
title: '' + res.statusCode,
duration: 2000
})
return false;
}
}

@ -28,7 +28,7 @@ const base = {
uni.showToast({
icon: "none",
title: msg,
duration: time || 1500,
duration: time || 2000,
success: function(res) {
if (callback && typeof(callback) == 'function') {
console.log(callback)
@ -73,7 +73,6 @@ const base = {
title:"苏州科技商学院",
imageUrl:"/static/share.jpg"
}
},
// 检查是否空对象
isEmptyObject : (obj) => {

@ -190,7 +190,7 @@
.btns .agree {
width: 320rpx;
background: #ba8b45;
background: #b79373;
color: #fff;
font-size: 16px;

@ -183,44 +183,56 @@
})
this.apply_form = _arr
console.log("this.apply_form", this.apply_form,this.form)
// return
// return
this.$refs.uForm.validate(valid => {
if (valid) {
this.saveUser()
// this.saveUser()
this.applyCourse()
} else {
console.log('验证失败');
this.base.toast("验证失败")
// this.base.toast("")
}
});
},
saveUser() {
saveUser() {
let that = this
this.$u.api.saveUser(this.form).then(res => {
// this.base.toast("")
console.log("user")
this.$u.api.user().then(res => {
// let stor = uni.getStorageSync('stbc_lifeData')
// stor.vuex_user = res.user
// uni.setStorageSync('stbc_lifeData',stor)
this.$u.vuex('vuex_user', res.user)
if(that.is_fee){
that.newsSubscription()
}else{
uni.redirectTo({
url: '/packages/mycourse/index'
})
}
})
}).then(res=>{
if(that.is_fee){
that.newsSubscription()
}else{
uni.redirectTo({
url: '/packages/mycourse/index'
})
}
})
},
applyCourse() {
applyCourse() {
let that = this
this.$u.api.courseSign({
course_id: this.course_id,
data: this.apply_form
}).then(res => {
this.base.toast("报名成功")
if(this.is_fee){
this.newsSubscription()
}else{
uni.redirectTo({
url: '/packages/mycourse/index'
})
}
this.base.toast("报名成功",2000,function(){
setTimeout(function(){
that.saveUser()
},1500)
})
})
},
//
@ -236,7 +248,8 @@
} else {
//
uni.requestSubscribeMessage({
tmplIds: ['6bkRNahvR88pG4Tpk0c2aY81kszvFpdaIV-CdC_ENTM'],
tmplIds: ['6bkRNahvR88pG4Tpk0c2aY81kszvFpdaIV-CdC_ENTM','CCEUrg9t8aW40NEDoqEk7NY7pyllW_0GEHfjwg_DF6A',
'0WMaFZ_0FOS5gtxEAi-fM3pFcYPySRMwYFNASz9oig0','XsR1BJRdE8JtFUC1o3w7DDcscXkCEGu62J8_smMofZI'],
success(res) {
that.base.toast("订阅成功",1500,function(){
uni.redirectTo({

@ -181,9 +181,12 @@
openTime() {
this.$refs.timeslot.open()
},
//
confirmTime(e) {
console.log(e)
//
confirmTime(e) {
//
//
let nowTime = this.$moment().format("HH:mm")
console.log("nowtime",nowTime)
this.form.timeRange = e.start.hour + ":" + e.start.min + '~' + e.end.hour + ":" + e.end.min
this.form.start_time = e.start.hour + ":" + e.start.min
this.form.end_time = e.end.hour + ":" + e.end.min
@ -195,7 +198,6 @@
})
},
siteConfirm(e) {
console.log("e", e)
this.form.site = this.siteList[e[0]].id
this.form.siteName = this.siteList[e[0]].name
this.siteTotal = this.siteList[e[0]].total
@ -295,9 +297,10 @@
this.base.toast("车辆数量已经大于预约人数了")
return
}
this.plateList.map(item=>{
_plate+=item.plate+','
})
_plate = this.plateList.join(',')
// this.plateList.map(item=>{
// _plate+=item.plate+','
// })
}
this.form.plate = _plate
console.log("plate",this.form)
@ -306,7 +309,7 @@
start_time:start_time,
end_time:end_time
}).then(res => {
this.base.toast("预约成功",1500,function(){
this.base.toast("预约成功",2000,function(){
uni.redirectTo({
url:'/packages/mybook/index'
})

@ -1,88 +1,165 @@
<template>
<view class="container">
<image class="cbg" :src="base.imgHost('course-bg.png')"></image>
<view class="detail">
<view class="detail-title">{{info.name}}</view>
<view class="detail-time" v-if="info.start_date">
<u-icon name="clock"></u-icon>
<text>开课日期{{info.start_date}} {{info.end_date}}</text>
</view>
<block v-if="imgList.length>0">
<view v-for="item in imgList">
<image mode="widthFix" :src="item.url"></image>
</view>
</block>
<block v-else>
<view v-html="info.content"></view>
</block>
<block v-else>
<view class="detail-noinfo">
<image mode="widthFix" :src="base.imgHost('mycourse-status.png')"></image>
<text>课程详情敬请期待...</text>
</view>
</block>
</view>
<view class="detail-btn" >
<view @click="apply">线</view>
<view class="detail-btn">
<view @click="toApply">
<image class="course-btn" :src="base.imgHost('course-btn.png')"></image>
<text>我要报名</text>
</view>
</view>
<view class="modal">
<u-popup v-model="showRegister" mode="bottom">
<view class="modal-tip">提示</view>
<view class="modal-content">
<view>如您已是我方校友请先绑定账号</view>
<view>如您还不是我方校友请先注册</view>
<u-popup v-model="showRegister" mode="bottom">
<view class="modal-tip">提示</view>
<view class="modal-content">
<view>如您已是我方校友请先绑定账号</view>
<view>如您还不是我方校友请先注册</view>
</view>
<view class="modal-btn">
<u-button type="primary" @click="showBind = true,showRegister=false">绑定</u-button>
<u-button type="primary" @click="toApply"></u-button>
<view class="modal-btn">
<u-button type="primary" @click="showBind = true,showRegister=false">绑定</u-button>
<u-button type="primary" @click="toApply"></u-button>
</view>
</u-popup>
</view>
<view class="modal">
<u-popup v-model="showBind" mode="bottom">
<view class="modal-tip">提示</view>
<view class="modal-content">
<view>
<u-input v-model="form.mobile" placeholder="手机号" type="number" :maxlength="11"/>
</view>
<view style="display: flex;justify-content: space-between;">
<u-input v-model="form.code" placeholder="验证码"/>
<u-button type="primary" @click="getSmsCode"></u-button>
</view>
</view>
<view class="modal-btn">
<u-button type="primary" @click="toBind"></u-button>
</view>
</u-popup>
</view>
<tabbar :currentPage="1"></tabbar>
<view class="modal">
<u-popup v-model="showRegister" mode="bottom">
<view>
<view class="modal-tip">提示</view>
<view class="modal-content">
<view>如您已是我方校友请先绑定账号</view>
<view @click="goBind" class="modal-bind">
去绑定
</view>
<view>如您还不是我方校友请先注册</view>
<view @click="toRegister" class="modal-register">
去注册
</view>
</view>
</view>
</u-popup>
</view>
</view>
</template>
<script>
import tabbar from '@/components/tabbar/tabbar.vue';
import {
ROOTPATH as baseUrl
} from "@/common/config.js"
export default {
components: {
tabbar,
},
data() {
return {
hasMobile:false,
showBind:false,
form:{
mobile:'',
code:''
},
course_id:'',
return {
showRegister: false,
hasMobile: false,
course_id: '',
info: {},
imgList: [],
showRegister:false
imgList: [],
showRegister: false
}
},
onShareAppMessage(res) {
return {
path: "/packages/course/detail?id=" + this.course_id, // onload(data){let id=data.id;}
title: this.info.name,
imageUrl: '/static/share.jpg'
}
},
onShareTimeline() {
return {
path: "/packages/course/detail?id=" + this.course_id, // onload(data){let id=data.id;}
title: this.info.name,
imageUrl: '/static/share.jpg'
}
},
onLoad(options) {
onLoad(options) {
this.course_id = options.id
this.getCourseDetail(options.id)
let user = uni.getStorageSync("stbc_lifeData")?uni.getStorageSync("stbc_lifeData").vuex_user:{}
if(!this.base.isNull(user.mobile)){
this.hasMobile = true
}else{
this.hasMobile = false
let token = uni.getStorageSync('stbc_lifeData') ? uni.getStorageSync('stbc_lifeData').vuex_token : ''
if (this.base.isNull(token)) {
this.getToken()
} else {
let user = uni.getStorageSync("stbc_lifeData") ? uni.getStorageSync("stbc_lifeData").vuex_user : {}
if (!this.base.isNull(user.mobile)) {
this.hasMobile = true
} else {
this.hasMobile = false
}
this.getCourseDetail(this.course_id)
}
},
methods: {
async getCourseDetail(id) {
async getToken() {
let that = this
await uni.login({
provider: 'weixin',
success: (res) => {
this.$u.api.login({
code: res.code
}).then(res1 => {
uni.setStorageSync("stbc_lifeData", {
'vuex_token': res1.token
})
uni.request({
url: baseUrl + '/api/mobile/user/get-user-info',
header: {
Authorization: `Bearer ${res1.token}`
},
method: "GET",
success(res2) {
uni.setStorageSync("stbc_lifeData", {
'vuex_token': res1.token,
"vuex_user": res2.data.user
})
if (!that.base.isNull(res2.data.user.mobile)) {
that.hasMobile = true
} else {
that.hasMobile = false
}
that.getCourseDetail(that.course_id)
},
fail(err) {
console.log("err", err)
}
})
}).catch(err => {
console.log('login-error:', JSON.stringify(err))
})
},
fail: (res) => {
console.log("errtoken", JSON.stringify(res))
}
});
},
async getCourseDetail(id) {
const res = await this.$u.api.courseDetail({
course_id: id
})
@ -90,73 +167,43 @@
if (res.publicize && res.publicize.length > 0) {
this.imgList = res.publicize
}
},
//
//
apply(){
if(this.hasMobile){
this.toApply()
}else{
this.showRegister = true
// this.toRegister()
}
},
//
toRegister() {
uni.navigateTo({
url:'/packages/apply/register?id='+this.course_id
},
//
//
//
toApply() {
// total
//
if (!this.info.is_fee && (this.info.total && this.info.total > 0)) {
//
if (this.info.course_signs_count >= this.info.total) {
this.base.toast("当前报名人数已满")
return
}
}
//
if (!this.hasMobile) {
this.showRegister = true
return
} else {
uni.navigateTo({
url: '/packages/apply/index?id=' + this.course_id
})
}
},
//
goBind() {
console.log("qwe")
uni.navigateTo({
url: '/packages/register/login?id=' + this.course_id
})
},
//
toApply() {
//
uni.navigateTo({
url:'/packages/apply/index?id='+this.course_id
},
//
toRegister() {
uni.navigateTo({
url: '/packages/register/index?id=' + this.course_id
})
},
//
getSmsCode(){
if(this.base.isNull(this.form.mobile)){
this.base.toast('手机号码不能为空')
return
}
if(!this.base.isMobile(this.form.mobile)){
this.base.toast('手机号码错误')
return
}
this.$u.api.sendSms({
mobile:this.form.mobile
}).then(res=>{
this.base.toast("发送成功")
})
},
//
toBind(){
if(this.base.isNull(this.form.mobile)){
this.base.toast('手机号码不能为空')
return
}
if(!this.base.isMobile(this.form.mobile)){
this.base.toast('手机号码错误')
return
}
if(this.base.isNull(this.form.code)){
this.base.toast('验证码不能为空')
return
}
this.$u.api.bindMobile({
mobile:this.form.mobile,
code:this.form.code,
is_bind:this.form.is_bind
}).then(res=>{
this.base.toast("绑定成功")
this.showBind = false
uni.navigateTo({
url:'/packages/apply/index?id='+this.course_id
})
})
},
}
@ -166,47 +213,115 @@
<style lang="scss" scoped>
.container {
width: 100%;
height: 100vh;
.cbg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100vh;
}
.detail {
width: 100%;
padding-bottom: 120rpx;
height: 100vh;
overflow: scroll;
padding: 40rpx 80rpx;
position: relative;
padding-bottom: 340rpx;
image {
width: 100%;
}
&-title {
font-size: 32rpx;
color: #000096;
text-align: center;
padding: 40rpx 0rpx;
}
&-time {
display: flex;
align-items: center;
padding-bottom: 40rpx;
color: rgba(0, 0, 0, 0.4);
justify-content: center;
&>text {
margin-left: 10rpx;
}
}
&-noinfo {
width: calc(100% -160rpx);
position: absolute;
top: calc(50% - 340rpx);
left: 50%;
transform: translate(-50%, 0%);
&>image {
width: 100%;
}
&>text {
font-size: 42rpx;
color: #000;
}
}
}
.detail-btn {
width: 100%;
height: 199rpx;
position: fixed;
left: 0;
bottom: 0;
padding: 20rpx 0;
bottom: 160rpx;
text-align: center;
&>view {
width: 70%;
>image {
width: 580rpx;
height: 199rpx;
margin: 0 auto;
display: block;
}
>text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #fff;
font-size: 32rpx;
}
}
}
.modal {
&-tip {
text-align: center;
margin: 0 auto;
color: #fff;
background-color: #010296;
border-radius: 10rpx;
padding: 20rpx;
padding: 30rpx;
font-size: 28rpx;
}
&-content {
height: 300rpx;
padding: 0 30rpx;
}
&-btn {
display: flex;
justify-content: space-between;
padding: 30rpx;
u-button {
width: 45%;
}
}
}
.modal{
&-tip{
text-align: center;
padding:30rpx;
font-size: 28rpx;
}
&-content{
height:300rpx;
padding:0 30rpx;
}
&-btn{
display: flex;
justify-content: space-between;
padding:30rpx;
u-button{
width:45%;
}
}
}
}
</style>

@ -7,10 +7,14 @@
<view class="list-item" @click="toDetail(item.id)" v-for="item in book_list">
<view class="list-item-top">
<view style="display: flex;justify-content: space-between;align-items: center;">
<image
<!-- <image
:src="item.appointment_config.name==='车辆到闸'?base.imgHost('mybook-icon2.png'):base.imgHost('mybook-icon1.png')">
</image>
{{item.appointment_config.name==='车辆到闸'?'车辆预约':'场地预约'}}
{{item.appointment_config.name==='车辆到闸'?'车辆预约':'场地预约'}} -->
<image
:src="base.imgHost('mybook-icon1.png')">
</image>
场地预约
</view>
<view>
<text :class="{'success':item.status===1,'warn':item.status>1}">{{item.status_text}}</text>
@ -23,7 +27,7 @@
</view>
<view>
<image :src="base.imgHost('mybook-icon4.png')" style="width:20rpx;height: 26rpx;"></image>
{{item.appointment_config.name}}
{{item.appointment_config?item.appointment_config.name:''}}
</view>
<view>
<image :src="base.imgHost('mybook-icon5.png')" style="width:21rpx;height: 23rpx;"></image>
@ -61,16 +65,6 @@
total_page: 0,
load_status: '',
book_list: [],
course_status: [{
type: 'primary',
value: '未开始'
}, {
type: 'warning',
value: '进行中'
}, {
type: 'info',
value: '已结束'
}]
}
},
onLoad() {

@ -128,12 +128,14 @@
fee_status:3
}).then(res=>{
this.base.toast("上传成功")
this.getCourseDetail(this.course_id)
//
if(this.hasFeeFiles){
this.getCourseDetail(this.course_id)
}else{
//
if(!this.base.isNull(this.userInfo.plate)){
if(this.base.isNull(this.userInfo.plate)){
this.showPark = true
}
}

@ -1,163 +1,208 @@
<template>
<view class="container">
<image class="cbg" :src="base.imgHost('common_bg.png')"></image>
<view class="wrap">
<topBanner :banner_list="banner_list"></topBanner>
<view class="list">
<view>
<view class="list-title">进行中</view>
<view v-if="list.length>0">
<view class="list-item" @click="toUrl(item.id)" v-for="item in list">
<view class="list-item-name">{{item.name}}</view>
<view class="list-item-buttom">
<view>
<image :src="base.imgHost('mycourse-share.png')"></image>
<text>分享</text>
</view>
<view class="list-item-btn" @click="toUrl(item.id)">
进入
</view>
</view>
</view>
</view>
</view>
<view v-if="historyList.length>0">
<view class="list-title">历史课程</view>
<view v-if="historyList.length>0">
<view class="list-item" @click="toUrl(item.id)" v-for="item in historyList">
<view class="list-item-name list-item-hisname">{{item.name}}</view>
<view class="list-item-buttom">
<view>
<image :src="base.imgHost('mycourse-share.png')"></image>
<text>分享</text>
</view>
<view class="list-item-btn" @click="toUrl(item.id)">
进入
</view>
</view>
</view>
</view>
</view>
</view>
<view class="wrap">
<topBanner :banner_list="banner_list"></topBanner>
<view class="list">
<view>
<view class="list-title">进行中</view>
<view v-if="list.length>0">
<view class="list-item" v-for="item in list">
<view class="list-item-name">{{item.name}}</view>
<view class="list-item-buttom">
<view>
<u-button size="mini" :custom-style="{'color':'#b79373',
'border-color':'transparent','font-size': '26rpx',
'padding': 0}" :hair-line="false" @click="clickShareId(item)" shape="circle" open-type="share">
<image :src="base.imgHost('mycourse-share.png')"></image>
<text>分享</text>
</u-button>
</view>
<view class="list-item-btn" @click="toUrl(item.id)">
进入
</view>
</view>
</view>
</view>
</view>
<view v-if="historyList.length>0">
<view class="list-title">历史课程</view>
<view v-if="historyList.length>0">
<view class="list-item" v-for="item in historyList">
<view class="list-item-name list-item-hisname">{{item.name}}</view>
<view class="list-item-buttom">
<view>
<u-button size="mini" :custom-style="{'color':'#b79373',
'border-color':'transparent','font-size': '26rpx',
'padding': 0}" :hair-line="false" @click="clickShareId(item)" shape="circle" open-type="share">
<image :src="base.imgHost('mycourse-share.png')"></image>
<text>分享</text>
</u-button>
</view>
<view class="list-item-btn" @click="toUrl(item.id)">
进入
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import topBanner from '@/components/topBanner.vue'
<script>
import topBanner from '@/components/topBanner.vue'
export default {
components: {
components: {
topBanner
},
data() {
return {
banner_list:[],
list:[],
historyList:[]
return {
banner_list: [],
list: [],
historyList: [],
shareObj: {}
}
},
onLoad() {
console.log("selectOptions",this.selectOptions)
this.getMyCourse()
onShareAppMessage(res) {
console.log("res", res)
console.log("this.shareObj", this.shareObj)
if (res.from === 'button') {
return {
path: "/packages/course/detail?id=" + this.shareObj.id, // onload(data){let id=data.id;}
title: this.shareObj.name,
imageUrl: '/static/share.jpg'
}
}
return this.base.shareInfo
},
//
onShareTimeline(res) {
if (res.from === 'button') {
return {
path: "/packages/course/detail?id=" + this.shareObj.id, // onload(data){let id=data.id;}
title: this.shareObj.name,
imageUrl: '/static/share.jpg'
}
}
return this.base.shareInfo
},
onLoad() {
console.log("selectOptions", this.selectOptions)
this.getMyCourse()
this.getBannerList()
},
methods:{
async getMyCourse(){
const res = await this.$u.api.courseMy()
res.list.data.map(item=>{
if(item.date_status==='课程已结束'){
this.historyList.push(item)
}else{
this.list.push(item)
}
})
},
toUrl(id){
uni.navigateTo({
url:'/packages/mycourse/detail?id='+id
})
},
async getBannerList(){
const res = await this.$u.api.otherBanner({
position:1
})
this.banner_list = res
},
},
methods: {
async getMyCourse() {
const res = await this.$u.api.courseMy()
res.list.data.map(item => {
if (item.date_status === '课程已结束') {
this.historyList.push(item)
} else {
this.list.push(item)
}
})
},
clickShareId(item) {
this.shareObj = item
},
toUrl(id) {
uni.navigateTo({
url: '/packages/mycourse/detail?id=' + id
})
},
async getBannerList() {
const res = await this.$u.api.otherBanner({
position: 1
})
this.banner_list = res
},
}
}
</script>
<style scoped lang="scss">
.container{
padding: 30rpx;
width:100%;
height:100vh;
.cbg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100vh;
}
.wrap{
position: relative;
height:100%;
overflow-x: hidden;
overflow-y: scroll;
.list{
margin-top:50rpx;
&-title{
margin-bottom:30rpx;
color:#333;
font-size: 42rpx;
}
&-item{
background-color: #fff;
padding:30rpx;
margin-bottom: 30rpx;
border-radius: 20rpx;
border-bottom: 2px solid #b79373;
&-name{
height:80rpx;
border-bottom: 1px solid #f5f5f5;
padding-bottom:20rpx;
}
&-hisname{
color:#888888
}
&-buttom{
display: flex;
justify-content: space-between;
align-items: center;
color:#b79373;
margin-top:20rpx;
&>view:first-child{
display: flex;
align-items: center;
image{
width:26rpx;
height:26rpx;
margin:0 10rpx;
}
}
}
&-btn{
background: linear-gradient(to right,#5e5fbc,#0d0398);
border-radius: 30rpx;
color:#fff;
text-align: center;
padding:10rpx 20rpx;
width:140rpx;
}
}
}
}
}
<style scoped lang="scss">
.container {
padding: 30rpx;
width: 100%;
height: 100vh;
.cbg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100vh;
}
.wrap {
position: relative;
height: 100%;
overflow-x: hidden;
overflow-y: scroll;
.list {
margin-top: 50rpx;
&-title {
margin-bottom: 30rpx;
color: #333;
font-size: 42rpx;
}
&-item {
background-color: #fff;
padding: 30rpx;
margin-bottom: 30rpx;
border-radius: 20rpx;
border-bottom: 2px solid #b79373;
&-name {
height: 80rpx;
border-bottom: 1px solid #f5f5f5;
padding-bottom: 20rpx;
}
&-hisname {
color: #888888
}
&-buttom {
display: flex;
justify-content: space-between;
align-items: center;
color: #b79373;
margin-top: 20rpx;
&>view:first-child {
display: flex;
align-items: center;
image {
width: 26rpx;
height: 26rpx;
margin: 0 10rpx;
}
}
}
&-btn {
background: linear-gradient(to right, #5e5fbc, #0d0398);
border-radius: 30rpx;
color: #fff;
text-align: center;
padding: 10rpx 20rpx;
width: 140rpx;
}
}
}
}
}
</style>

@ -210,6 +210,7 @@
company_type: '',
company_industry: '',
}
this.current = 0
this.getMyCourseTxl()
},
confirmSearch() {

@ -1,34 +1,37 @@
<template>
<view class="container">
<image class="cbg" :src="base.imgHost('common_bg.png')"></image>
<view class="book-top">
<image :src="base.imgHost('book-top.png')"></image>
<image class="cbg" :src="base.imgHost('common_bg.png')"></image>
<view class="book-top">
<text class="book-top-line"></text>
<image :src="base.imgHost('book-top.png')"></image>
</view>
<view class="book">
<view class="book">
<view class="book-pic">
<view class="book-pic-item">
<image :src="base.imgHost('book-pic1.png')"></image>
<view>
<view>图书馆</view>
<view>
<text class="colortext">1</text>
<text>/1</text>
</view>
<block v-for="(item,index) in siteList">
<view class="book-pic-item" v-if="item.files.length>0">
<block>
<swiper circular indicator-dots
indicator-active-color="#b79373"
indicator-color="#fff"
style="height:350rpx" :autoplay="false" >
<swiper-item v-for="file in item.files">
<image :src="file.url" />
</swiper-item>
</swiper>
<view>
<view>{{item.name}}</view>
<!-- <view>
<text class="colortext">{{item['current_swiper']}}</text>
<text>/{{item.files.length}}</text>
</view> -->
</view>
</block>
</view>
</view>
<view class="book-pic-item">
<image :src="base.imgHost('book-pic1.png')"></image>
<view>
<view>会议室</view>
<view>
<text class="colortext">1</text>
<text>/1</text>
</view>
</view>
</view>
</block>
</view>
<view class="book-block">
<image @click="toUrl(1)" :src="base.imgHost('book-icon1.png')"></image>
<view class="book-block">
<image @click="toUrl(1)" :src="base.imgHost('book-icon1.png')"></image>
<image @click="toUrl(2)" :src="base.imgHost('book-icon2.png')"></image>
</view>
@ -48,36 +51,73 @@
user: {},
can_appointment: false,
is_schoolmate: 0,
door_appointments: false, //
siteList:[]
}
},
onShow(){
this.getUser()
onShareAppMessage() {
return this.base.shareInfo
},
onShareTimeline() {
return this.base.shareInfo
},
onShow() {
this.getUser()
},
onLoad() {
this.getSites()
},
methods: {
methods: {
//
getSites() {
this.$u.api.otherConfig().then(res => {
let _arr = res.appointment.filter(item=>item.status===1)
_arr.map(site=>{
site.current_swiper = 1
})
this.siteList = this.base.deepCopy(_arr)
})
},
// changeCurrent(e,item){
// console.log(e,item)
// if(e.detail.current+2>item.files.length){
// this.$set(item,'current_swiper',e.detail.current+2)
// }else{
// this.$set(item,'current_swiper',e.detail.current+2)
// }
// // item.current_swiper = e.detail.current+1
// // this.siteList[index]['current_swiper'] = e.detail.current + 1
// console.log("item.current_swiper",item.current_swiper)
// },
getUser() {
this.$u.api.user().then(res => {
console.log("res", 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.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.$u.vuex('vuex_user', res.user)
})
},
toUrl(type) {
if (type === 1) {
if (this.can_appointment) {
uni.navigateTo({
url: '/packages/booksubmit/index'
})
} else {
if (!this.can_appointment) {
this.base.toast("您当前没有可预约次数")
return
}
if (this.door_appointments) {
this.base.toast("您当前已有预约")
return
}
uni.navigateTo({
url: '/packages/booksubmit/index'
})
} else if (type === 2) {
if (this.is_schoolmate) {
@ -108,57 +148,78 @@
width: 100%;
height: 100vh;
}
.book-top{
position: relative;
padding:80rpx 0 60rpx 0;
image{
width:539rpx;
height:88rpx;
display: block;
margin:0 auto;
}
.book-top {
position: relative;
padding: 80rpx 0 60rpx 0;
image {
width: 539rpx;
height: 88rpx;
display: block;
margin: 0 auto;
}
text {
width: 1rpx;
height: 220rpx;
background-color: #271f8e;
display: block;
position: absolute;
top: 50rpx;
left: 60rpx;
z-index: 99;
}
}
.book {
position: relative;
padding:0 30rpx;
height:calc(100vh - 400rpx);
padding: 0 30rpx;
height: calc(100vh - 400rpx);
overflow: scroll;
&-block {
display: flex;
align-items: center;
justify-content: space-between;
image{
width:330rpx;
height:126rpx;
image {
width: 330rpx;
height: 126rpx;
}
}
&-pic {
&-item {
font-size: 0;
border-radius: 10rpx;
margin-bottom: 30rpx;
image {
width: 100%;
height: 350rpx;
}
&>view {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 30rpx;
background-color: #fff;
font-size: 28rpx;
color: #000;
border-radius: 0 0 10rpx 10rpx;
text {
color: #666;
font-size: 24rpx;
}
.colortext {
color: #b79373;
}
}
}
}
&-pic{
&-item{
font-size: 0;
border-radius: 10rpx;
margin-bottom:30rpx;
image{
width:100%;
height:350rpx;
}
&>view{
display: flex;
align-items: center;
justify-content: space-between;
padding:20rpx 30rpx;
background-color: #fff;
font-size: 28rpx;
color:#000;
border-radius: 0 0 10rpx 10rpx;
text{
color:#666;
font-size: 24rpx;
}
.colortext{
color:#b79373;
}
}
}
}
}

@ -5,13 +5,16 @@
<scroll-view :scroll-y="true" @scrolltolower="scrollGet" class="list">
<topBanner :banner_list="banner_list"></topBanner>
<view v-if="hasData" style="padding-bottom: 200rpx;">
<view class="list-item" :class="{'list-end':item.sign_date_status==='已结束','list-start':item.sign_date_status==='未开始'||item.sign_date_status==='待定'}"
v-for="item in course_list">
<view class="list-item"
:class="{'list-end':item.sign_date_status==='已结束','list-start':item.sign_date_status==='未开始'||item.sign_date_status==='待定'}"
v-for="item in course_list">
<view class="list-item-wrap">
<view class="list-item-wrap-time">
<view v-if="!item.sign_start_date || item.sign_date_status==='待定'">
<view class="bigFont" style="border-bottom: none;">{{convertToChineseMonth(item.sign_start_date,item.sign_date_status).month}}</view>
<view class="bigFont" style="border-bottom: none;">{{convertToChineseMonth(item.sign_start_date,item.sign_date_status).year}}</view>
<view class="list-item-wrap-time">
<view v-if="!item.sign_start_date || item.sign_date_status==='待定'">
<view class="bigFont" style="border-bottom: none;">
{{convertToChineseMonth(item.sign_start_date,item.sign_date_status).month}}</view>
<view class="bigFont" style="border-bottom: none;">
{{convertToChineseMonth(item.sign_start_date,item.sign_date_status).year}}</view>
</view>
<view v-else>
<view>{{convertToChineseMonth(item.sign_start_date).month}}</view>
@ -42,33 +45,33 @@
</view>
</scroll-view>
<tabbar :currentPage="1"></tabbar>
<view class="modal">
<u-popup v-model="showRegister" mode="bottom">
<view>
<view class="modal-tip">提示</view>
<view class="modal-content">
<view>如您已是我方校友请先绑定账号</view>
<view @click="goBind" class="modal-bind">
去绑定
</view>
<view>如您还不是我方校友请先注册</view>
<view @click="toRegister" class="modal-register">
去注册
</view>
</view>
<!-- <view class="modal-btn">
<view @click="goBind" class="modal-btn-bind">
去绑定
</view>
<view @click="toRegister" class="modal-btn-register">
去注册
</view>
</view> -->
</view>
</u-popup>
<tabbar :currentPage="1"></tabbar>
<view class="modal">
<u-popup v-model="showRegister" mode="bottom">
<view>
<view class="modal-tip">提示</view>
<view class="modal-content">
<view>如您已是我方校友请先绑定账号</view>
<view @click="goBind" class="modal-bind">
去绑定
</view>
<view>如您还不是我方校友请先注册</view>
<view @click="toRegister" class="modal-register">
去注册
</view>
</view>
<!-- <view class="modal-btn">
<view @click="goBind" class="modal-btn-bind">
去绑定
</view>
<view @click="toRegister" class="modal-btn-register">
去注册
</view>
</view> -->
</view>
</u-popup>
</view>
</view>
</template>
@ -82,42 +85,37 @@
topBanner
},
data() {
return {
showRegister:false,
return {
showRegister: false,
banner_list: [],
hasMobile: false,
go_course_id:'',
hasMobile: false,
go_course_id: '',
hasData: true,
current_page: 1,
total_page: 0,
load_status: '',
course_list: [],
course_status: [{
type: 'primary',
value: '未开始'
}, {
type: 'warning',
value: '进行中'
}, {
type: 'info',
value: '已结束'
}],
}
},
onShareAppMessage() {
return this.base.shareInfo
},
onShareTimeline() {
return this.base.shareInfo
},
onLoad() {
this.getBannerList()
},
onShow() {
this.getCourseList()
this.showRegister = false
let user = uni.getStorageSync("stbc_lifeData") ? uni.getStorageSync("stbc_lifeData").vuex_user : {}
if(!this.base.isNull(user.mobile)){
this.hasMobile = true
}else{
this.hasMobile = false
}
this.getBannerList()
this.getCourseList()
},
onShow() {
this.showRegister = false
let user = uni.getStorageSync("stbc_lifeData") ? uni.getStorageSync("stbc_lifeData").vuex_user : {}
if (!this.base.isNull(user.mobile)) {
this.hasMobile = true
} else {
this.hasMobile = false
}
},
onReachBottom() {
// console.log("this.onReachBottom", this.current_page, this.total_page)
@ -129,18 +127,20 @@
if (!this.hasData) {
return
}
this.current_page = this.current_page + 1
if (this.current_page > this.total_page) {
this.base.toast('没有更多了')
return
}
this.current_page = this.current_page + 1
this.getCourseList()
},
async getCourseList() {
this.load_status = 'loading'
const res = await this.$u.api.courseIndex({
page: this.current_page,
page_size: 10
page_size: 10,
// status:1
})
this.total_page = res.last_page
if (res.data.length === 0 && this.current_page === 1) {
@ -149,72 +149,78 @@
this.course_list.push(...res.data)
},
convertToChineseMonth(dateString,dateStatus) {
if (this.base.isNull(dateString) || dateStatus==='待定') {
return {
month:'',
year:"定"
convertToChineseMonth(dateString, dateStatus) {
if (this.base.isNull(dateString) || dateStatus === '待定') {
return {
month: '',
year: "定"
}
} else {
//
const dateParts = dateString.split('-');
const year = parseInt(dateParts[0], 10);
const monthNumber = parseInt(dateParts[1], 10);
const day = parseInt(dateParts[2], 10);
//
const chineseMonths = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
//
const chineseMonth = chineseMonths[monthNumber - 1];
return {
year: year,
month: chineseMonth,
day: day
}
}else{
//
const dateParts = dateString.split('-');
const year = parseInt(dateParts[0], 10);
const monthNumber = parseInt(dateParts[1], 10);
const day = parseInt(dateParts[2], 10);
//
const chineseMonths = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
//
const chineseMonth = chineseMonths[monthNumber - 1];
return {
year: year,
month: chineseMonth,
day: day
}
}
},
},
//
toDetail(item) {
this.go_course_id = item.id
// total
//
if(!item.is_fee && (item.total && item.total>0)){
//
if(item.sign_total>=item.total){
this.base.toast("当前报名人数已满")
return
}
}
if(!this.hasMobile){
this.showRegister = true
return
}else{
uni.navigateTo({
url:'/packages/apply/index?id='+this.go_course_id
})
toDetail(item) {
uni.navigateTo({
url: '/packages/course/detail?id=' + item.id
})
return
this.go_course_id = item.id
// total
//
if (!item.is_fee && (item.total && item.total > 0)) {
//
if (item.course_signs_count >= item.total) {
this.base.toast("当前报名人数已满")
return
}
}
},
//
goBind(){
console.log("qwe")
uni.navigateTo({
url:'/packages/register/login?id='+this.go_course_id
})
},
//
toRegister(){
uni.navigateTo({
url:'/packages/register/index?id='+this.go_course_id
})
if (!this.hasMobile) {
this.showRegister = true
return
} else {
uni.navigateTo({
url: '/packages/apply/index?id=' + this.go_course_id
})
}
},
//
goBind() {
console.log("qwe")
uni.navigateTo({
url: '/packages/register/login?id=' + this.go_course_id
})
},
//
toRegister() {
uni.navigateTo({
url: '/packages/register/index?id=' + this.go_course_id
})
},
async getBannerList() {
const res = await this.$u.api.otherBanner({
position:1,
position: 1,
})
this.banner_list = res
},
@ -344,6 +350,7 @@
}
}
}
&-btn {
width: 150rpx;
font-size: 24rpx;
@ -351,123 +358,144 @@
color: #fff;
padding: 10rpx 20rpx;
border-radius: 30rpx;
margin: 20rpx;
margin: 20rpx;
text-align: center;
}
}
//
&-start{
.list-item-wrap{
width:100%;
&-time{
background: linear-gradient(to bottom,#cf847d,#b00d10);
}
&-status{
border-right:none;
&-type {
&>text {
background: linear-gradient(to right,#cf847d,#b00d10);
}
}
&-label {
&:before {
content: " ";
background: #cfcfcf;
}
}
}
}
.list-item-btn{
display: none;
}
}
//
&-end{
.list-item-wrap{
width:100%;
&-time{
background: linear-gradient(to bottom,#e4cdb4,#c69c6d);
}
&-status{
border-right:none;
&-type {
&>text {
background: linear-gradient(to right,#e4cdb4,#c69c6d);
}
}
&-label {
&:before {
content: " ";
background: #cfcfcf;
}
}
}
}
.list-item-btn{
display: none;
}
}
}
.modal{
::v-deep .u-drawer-bottom{
border-radius: 40rpx;
}
&-tip{
text-align: center;
padding:30rpx;
font-size: 32rpx;
}
&-content{
height:450rpx;
padding:0 30rpx;
font-size: 32rpx;
text-align: center;
&>view{
margin:30rpx auto;
}
}
&-bind {
width: 45%;
text-align: center;
margin: 0 auto;
color: #fff;
border-radius: 30rpx;
padding: 20rpx;
background: linear-gradient(to right, #e4cdb4, #c69c6d);
}
&-register {
width: 45%;
text-align: center;
margin: 0 auto;
color: #fff;
border-radius: 30rpx;
padding: 20rpx;
background: linear-gradient(to right, #5e5fbc, #0d0398);
}
&-btn{
display: flex;
justify-content: space-between;
padding:30rpx;
&>view{
width:45%;
text-align: center;
margin: 0 auto;
color: #fff;
border-radius: 30rpx;
padding: 20rpx;
}
&-bind{
background: linear-gradient(to right, #e4cdb4, #c69c6d);
}
&-register{
background: linear-gradient(to right, #5e5fbc, #0d0398);
}
}
}
//
&-start {
.list-item-wrap {
width: 100%;
&-time {
background: linear-gradient(to bottom, #cf847d, #b00d10);
}
&-status {
border-right: none;
&-type {
&>text {
background: linear-gradient(to right, #cf847d, #b00d10);
}
}
&-label {
&:before {
content: " ";
background: #cfcfcf;
}
}
}
}
.list-item-btn {
display: none;
}
}
//
&-end {
.list-item-wrap {
width: 100%;
&-time {
background: linear-gradient(to bottom, #e4cdb4, #c69c6d);
}
&-status {
border-right: none;
&-type {
&>text {
background: linear-gradient(to right, #e4cdb4, #c69c6d);
}
}
&-label {
&:before {
content: " ";
background: #cfcfcf;
}
}
}
}
.list-item-btn {
display: none;
}
}
}
.modal {
::v-deep .u-drawer-bottom {
border-radius: 40rpx;
}
&-tip {
text-align: center;
padding: 30rpx;
font-size: 32rpx;
}
&-content {
height: 450rpx;
padding: 0 30rpx;
font-size: 32rpx;
text-align: center;
&>view {
margin: 30rpx auto;
}
}
&-bind {
width: 45%;
text-align: center;
margin: 0 auto;
color: #fff;
border-radius: 30rpx;
padding: 20rpx;
background: linear-gradient(to right, #e4cdb4, #c69c6d);
}
&-register {
width: 45%;
text-align: center;
margin: 0 auto;
color: #fff;
border-radius: 30rpx;
padding: 20rpx;
background: linear-gradient(to right, #5e5fbc, #0d0398);
}
&-btn {
display: flex;
justify-content: space-between;
padding: 30rpx;
&>view {
width: 45%;
text-align: center;
margin: 0 auto;
color: #fff;
border-radius: 30rpx;
padding: 20rpx;
}
&-bind {
background: linear-gradient(to right, #e4cdb4, #c69c6d);
}
&-register {
background: linear-gradient(to right, #5e5fbc, #0d0398);
}
}
}
}
</style>

@ -1,5 +1,9 @@
<template>
<view class="container">
<view class="container">
<!-- #ifdef MP-WEIXIN -->
<privacy-popup ref="privacyComponent" @agree-privacy="onAgreePrivacy"
@reject-privacy="onRejectPrivacy"></privacy-popup>
<!-- #endif -->
<view class="container-top">
<u-navbar :is-back="false" :is-fixed="false" :height="topNavHeight" :background="topbg" title-color="#fff"
title-size="32" :border-bottom="false" title="苏州科技商学院"></u-navbar>
@ -14,7 +18,6 @@
</view>
<view class="container-content">
<image :src="base.imgHost('index_bg.png')" width="100%" height="100%"></image>
<view class="container-content-icons">
<view @click="tourl(1)">
<image :src="base.imgHost('index_icon2.png')"></image>
@ -57,12 +60,17 @@
</template>
<script>
import tabbar from '@/components/tabbar/tabbar.vue';
import topBanner from '@/components/topBanner.vue'
import {
ROOTPATH as baseUrl
} from "@/common/config.js"
import tabbar from '@/components/tabbar/tabbar.vue';
import topBanner from '@/components/topBanner.vue';
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue';
export default {
components: {
tabbar,
topBanner
tabbar,
topBanner,
PrivacyPopup
},
data() {
return {
@ -70,23 +78,41 @@
topbg: {
backgroundColor: 'transparent'
},
showWx: true,
banner_list:[],
notices_list:[]
showWx: true,
banner_list: [],
notices_list: []
}
},
onShareAppMessage() {
return this.base.shareInfo
},
onShareTimeline() {
return this.base.shareInfo
},
onLoad() {
let menuButtonObject = uni.getMenuButtonBoundingClientRect();
this.topNavHeight = menuButtonObject.height + 8
let token = uni.getStorageSync('stbc_lifeData') ? uni.getStorageSync('stbc_lifeData').vuex_token : ''
if (this.base.isNull(token)) {
this.getToken()
}
this.getNoticesList()
}
this.getNoticesList()
this.getBannerList()
},
methods: {
changeCurrent(e) {
methods: {
onAgreePrivacy() {
//
//
console.log('User agreed to the privacy policy');
// this.getToken()
},
onRejectPrivacy() {
//
//
// wx.exitMiniProgram();
console.log('User rejected the privacy policy');
},
changeCurrent(e) {
this.show_current_swiper = e.detail.current + 1
},
changeInfo(e) {
@ -94,15 +120,31 @@
},
async getToken() {
let that = this
await uni.login({
provider: 'weixin',
success: (res) => {
this.$u.api.login({
code: res.code
}).then(res => {
this.$u.vuex('token', res.token)
this.$u.api.user().then(res => {
this.$u.vuex('vuex_user', res)
}).then(res1 => {
uni.setStorageSync("stbc_lifeData", {
'vuex_token': res1.token
})
uni.request({
url: baseUrl + '/api/mobile/user/get-user-info',
header: {
Authorization: `Bearer ${res1.token}`
},
method: "GET",
success(res2) {
uni.setStorageSync("stbc_lifeData", {
'vuex_token': res1.token,
"vuex_user": res2.data.user
})
},
fail(err) {
console.log("err", err)
}
})
}).catch(err => {
console.log('login-error:', JSON.stringify(err))
@ -112,45 +154,45 @@
console.log("errtoken", JSON.stringify(res))
}
});
},
async getBannerList(){
const res = await this.$u.api.otherBanner({
position:1
})
this.banner_list = res
},
async getNoticesList(){
const res = await this.$u.api.courseNews({
page:1,
page_size:5,
})
this.notices_list = res.rows
},
tourl(type,url){
if(type===1){
uni.navigateTo({
url:'/packages/webview/index?type=1'
})
}else if(type===2){
uni.switchTab({
url:'/pages/course/index'
})
}else if(type===3){
uni.switchTab({
url:'/pages/book/index'
})
}else if(type===4){
//
uni.navigateTo({
url:'/packages/webview/index?type=2'
})
}else if(type===5){
//
uni.navigateTo({
url:'/packages/webview/index?type=3&url='+url
})
}
},
async getBannerList() {
const res = await this.$u.api.otherBanner({
position: 1
})
this.banner_list = res
},
async getNoticesList() {
const res = await this.$u.api.courseNews({
page: 1,
page_size: 5,
})
this.notices_list = res.rows
},
tourl(type, url) {
if (type === 1) {
uni.navigateTo({
url: '/packages/webview/index?type=1'
})
} else if (type === 2) {
uni.switchTab({
url: '/pages/course/index'
})
} else if (type === 3) {
uni.switchTab({
url: '/pages/book/index'
})
} else if (type === 4) {
//
uni.navigateTo({
url: '/packages/webview/index?type=2'
})
} else if (type === 5) {
//
uni.navigateTo({
url: '/packages/webview/index?type=3&url=' + url
})
}
}
}

@ -59,7 +59,7 @@
foregroundImageSrc: '/static/index_icon1.png',
}"></uqrcode>
</view>
<view style="margin-top:20rpx;font-size:24rpx">点击二维码刷新</view>
<view @click="refreshCode" style="margin-top:20rpx;font-size:24rpx">点击二维码刷新</view>
</view>
<view class="modal-xyk-item modal-xyk-name">
<view>
@ -67,8 +67,9 @@
<text>{{userInfo.username}}</text>
</view>
<view>
<text>学籍</text>
<text></text>
<text>学籍</text>
<text class="courseName"
v-if="userInfo.course_signs.length>0">{{userInfo.course_signs[0]['course'].name}}</text>
</view>
</view>
</view>
@ -97,15 +98,6 @@
去注册
</view>
</view>
<!-- <view class="modal-btn">
<view @click="goBind" class="modal-btn-bind">
去绑定
</view>
<view @click="toRegister" class="modal-btn-register">
去注册
</view>
</view> -->
</view>
</u-popup>
@ -131,6 +123,12 @@
showCard: false,
userInfo: {}
}
},
onShareAppMessage() {
return this.base.shareInfo
},
onShareTimeline() {
return this.base.shareInfo
},
onShow() {
this.showRegister = false

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Loading…
Cancel
Save