diff --git a/App.vue b/App.vue
index ec8901a..ced4bee 100644
--- a/App.vue
+++ b/App.vue
@@ -1,21 +1,27 @@
-
\ No newline at end of file
diff --git a/packages/schoolmate/index.vue b/packages/schoolmate/index.vue
index e935371..0566fba 100644
--- a/packages/schoolmate/index.vue
+++ b/packages/schoolmate/index.vue
@@ -210,6 +210,7 @@
company_type: '',
company_industry: '',
}
+ this.current = 0
this.getMyCourseTxl()
},
confirmSearch() {
diff --git a/pages/book/index.vue b/pages/book/index.vue
index 97bf44c..930bbac 100644
--- a/pages/book/index.vue
+++ b/pages/book/index.vue
@@ -1,34 +1,37 @@
-
-
-
+
+
+
+
-
+
-
-
-
- 图书馆
-
- 1
- /1
-
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
-
-
-
-
- 会议室
-
- 1
- /1
-
-
-
+
+
-
-
+
+
@@ -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;
- }
- }
- }
}
}
diff --git a/pages/course/index.vue b/pages/course/index.vue
index 461e591..e6a0830 100644
--- a/pages/course/index.vue
+++ b/pages/course/index.vue
@@ -5,13 +5,16 @@
-
+
-
-
- {{convertToChineseMonth(item.sign_start_date,item.sign_date_status).month}}
- {{convertToChineseMonth(item.sign_start_date,item.sign_date_status).year}}
+
+
+
+ {{convertToChineseMonth(item.sign_start_date,item.sign_date_status).month}}
+
+ {{convertToChineseMonth(item.sign_start_date,item.sign_date_status).year}}
{{convertToChineseMonth(item.sign_start_date).month}}
@@ -42,33 +45,33 @@
-
-
-
-
- 提示
-
- 如您已是我方校友,请先绑定账号
-
- 去绑定
-
- 如您还不是我方校友,请先注册
-
- 去注册
-
-
-
-
-
-
-
+
+
+
+
+ 提示
+
+ 如您已是我方校友,请先绑定账号
+
+ 去绑定
+
+ 如您还不是我方校友,请先注册
+
+ 去注册
+
+
+
+
+
+
+
@@ -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);
+ }
+ }
}
}
\ No newline at end of file
diff --git a/pages/index/index.vue b/pages/index/index.vue
index a0b2eee..7c76d6d 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -1,5 +1,9 @@
-
+
+
+
+
@@ -14,7 +18,6 @@
-
@@ -57,12 +60,17 @@