|
|
@ -90,9 +90,9 @@ |
|
|
|
<view class="left-line"></view> |
|
|
|
<view class="left-line"></view> |
|
|
|
<span>课程安排</span> |
|
|
|
<span>课程安排</span> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="plan-box acea-row-nowrap" v-for="(item,index) in detail.courseScheduleList" :key="index"> |
|
|
|
<view class="plan-box acea-row-nowrap" v-for="(item,index) in detail.scheduleList" :key="index"> |
|
|
|
<!-- <text class="plan-time">第{{index+1}}天</text> --> |
|
|
|
<!-- <text class="plan-time">第{{index+1}}天</text> --> |
|
|
|
<text>{{item.courseContent}}</text> |
|
|
|
<text>{{item}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="recommend-box content" id="content3"> |
|
|
|
<view class="recommend-box content" id="content3"> |
|
|
@ -132,20 +132,24 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="footer-right"> |
|
|
|
<view class="footer-right"> |
|
|
|
|
|
|
|
|
|
|
|
<view class="btn-box acea-row row-between-wrapper" v-if="detail.enterState == 0"> |
|
|
|
<view class="btn-box acea-row row-between-wrapper" v-if="yhStatus == 1 || yhStatus == 3 "> |
|
|
|
<view class="count-down"> |
|
|
|
<view class="count-down"> |
|
|
|
<view>距离截止时间还剩</view> |
|
|
|
<view>距离截止时间还剩</view> |
|
|
|
<uni-countdown color="#F99C10" :day="day" :hour="hour" :minute="minute" :second="second" /> |
|
|
|
<uni-countdown color="#F99C10" :day="day" :hour="hour" :minute="minute" :second="second" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="signin-btn" @click="signInClick(2)">立即报名</view> |
|
|
|
<view class="signin-btn" @click="signInClick(2)">立即报名</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 在线直播 --> |
|
|
|
<view class="signin-btn" v-if="yhStatus == 2 ">报名已截止 请关注下期</view> |
|
|
|
<view class="signin-btn call-btn default-btn" v-if="detail.enterState == 1 && detail.status == 1 && detail.courseType == 1" @click="signInClick(3)" >立即观看</view> |
|
|
|
<!-- <view class="btn-box acea-row row-between-wrapper" v-if="yhStatus == 2 "> |
|
|
|
|
|
|
|
|
|
|
|
<view class="signin-btn call-btn default-btn" v-if="detail.enterState == 1 && detail.status == 0" @click="signInClick(1)" >等待确认 联系服务老师</view> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
|
|
|
|
<view class="signin-btn call-btn default-btn" v-if="detail.signState == 1" >已签到</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 在线直播 --> |
|
|
|
|
|
|
|
<view class="signin-btn call-btn" v-if="yhStatus == 4 " @click="signInClick(3)" >立即观看</view> |
|
|
|
|
|
|
|
<view class="signin-btn call-btn" v-if="yhStatus == 5 " @click="signInClick(3)" >查看回放</view> |
|
|
|
|
|
|
|
<view class="signin-btn call-btn default-btn" v-if="yhStatus == 6" >未签到</view> |
|
|
|
|
|
|
|
<view class="signin-btn call-btn default-btn" v-if="yhStatus == 7" >未签到</view> |
|
|
|
|
|
|
|
<view class="signin-btn call-btn" v-if="yhStatus == 8 " @click="signInClick(1)" >等待确认 联系服务老师</view> |
|
|
|
|
|
|
|
|
|
|
|
<!-- #ifdef MP-WEIXIN --> |
|
|
|
<!-- #ifdef MP-WEIXIN --> |
|
|
|
<button open-type="getPhoneNumber" |
|
|
|
<button open-type="getPhoneNumber" |
|
|
@ -161,17 +165,17 @@ |
|
|
|
<view class="close" @click="closeDialog()">×</view> |
|
|
|
<view class="close" @click="closeDialog()">×</view> |
|
|
|
<view class="dialog-top acea-row-nowrap row-center-wrapper"> |
|
|
|
<view class="dialog-top acea-row-nowrap row-center-wrapper"> |
|
|
|
<image src="../../static/error-icon.png"></image> |
|
|
|
<image src="../../static/error-icon.png"></image> |
|
|
|
<view class="word">{{teacher.msg}}</view> |
|
|
|
<view class="word">您还没有绑定服务老师,请点击按钮联系服务老师进行绑定!</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="dialog-btm"> |
|
|
|
<view class="dialog-btm"> |
|
|
|
<view class="l-box acea-row row-between-wrapper"> |
|
|
|
<view class="l-box acea-row row-between-wrapper"> |
|
|
|
<view class="acea-row row-middle"> |
|
|
|
<!-- <view class="acea-row row-middle"> |
|
|
|
<image :src="teacher.imgPath"></image> |
|
|
|
<image :src="teacher.imgPath"></image> |
|
|
|
<view> |
|
|
|
<view> |
|
|
|
<view>{{teacher.name}}</view> |
|
|
|
<view>{{teacher.name}}</view> |
|
|
|
<view>{{teacher.phone}}</view> |
|
|
|
<view>{{teacher.phone}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
<view class="call-btn" @click="call">拨打电话</view> |
|
|
|
<view class="call-btn" @click="call">拨打电话</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -206,6 +210,7 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
yhStatus:0, |
|
|
|
id: '', |
|
|
|
id: '', |
|
|
|
teacherId:null, |
|
|
|
teacherId:null, |
|
|
|
validCode:null, |
|
|
|
validCode:null, |
|
|
@ -215,7 +220,7 @@ |
|
|
|
heightArr:[], |
|
|
|
heightArr:[], |
|
|
|
tabInitTop:'', |
|
|
|
tabInitTop:'', |
|
|
|
isFixedTop: false, |
|
|
|
isFixedTop: false, |
|
|
|
maskDialog:false, |
|
|
|
maskDialog: false, |
|
|
|
showSignUp: false, |
|
|
|
showSignUp: false, |
|
|
|
times: 0, |
|
|
|
times: 0, |
|
|
|
day:'', |
|
|
|
day:'', |
|
|
@ -236,15 +241,13 @@ |
|
|
|
this.courseId = this.$yroute.query.courseId; |
|
|
|
this.courseId = this.$yroute.query.courseId; |
|
|
|
this.validCode = this.$yroute.query.validCode; |
|
|
|
this.validCode = this.$yroute.query.validCode; |
|
|
|
this.teacherId = this.$yroute.query.teacherId; |
|
|
|
this.teacherId = this.$yroute.query.teacherId; |
|
|
|
} else{ //普通进入详情页 |
|
|
|
} else{ //列表进入详情页 |
|
|
|
this.courseId = this.$yroute.query.id; |
|
|
|
this.courseId = this.$yroute.query.id; |
|
|
|
} |
|
|
|
} |
|
|
|
if(this.userInfo.uid){ |
|
|
|
this.getDetail() |
|
|
|
this.getDetail() |
|
|
|
this.$nextTick(()=>{ |
|
|
|
this.$nextTick(()=>{ |
|
|
|
this.getHeightArr() |
|
|
|
this.getHeightArr() |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
computed:{ |
|
|
|
computed:{ |
|
|
@ -259,7 +262,7 @@ |
|
|
|
this.getDetail() |
|
|
|
this.getDetail() |
|
|
|
}, |
|
|
|
}, |
|
|
|
onShareAppMessage: function(res) { |
|
|
|
onShareAppMessage: function(res) { |
|
|
|
console.log(this.detail.id) |
|
|
|
// console.log(this.detail.id) |
|
|
|
return { |
|
|
|
return { |
|
|
|
title: this.detail.courseName, |
|
|
|
title: this.detail.courseName, |
|
|
|
imageUrl:this.detail.coverImg, |
|
|
|
imageUrl:this.detail.coverImg, |
|
|
@ -329,6 +332,41 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
test(){ |
|
|
|
|
|
|
|
let yhStatus = 0; |
|
|
|
|
|
|
|
let detail = this.detail; |
|
|
|
|
|
|
|
if ( !detail.enterState ){ |
|
|
|
|
|
|
|
yhStatus = 0; |
|
|
|
|
|
|
|
if( new Date(detail.enterEndTime) >= new Date() && new Date(detail.enterStartTime) <= new Date() ){ |
|
|
|
|
|
|
|
yhStatus = 1; // 可报名 |
|
|
|
|
|
|
|
}else if(new Date(detail.enterEndTime) < new Date()){ |
|
|
|
|
|
|
|
yhStatus = 2; // 超过报名时间 |
|
|
|
|
|
|
|
}else if(new Date(detail.enterStartTime) > new Date()){ |
|
|
|
|
|
|
|
yhStatus = 3; // 报名时间没开始 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
// 是否已经超过课程时间 |
|
|
|
|
|
|
|
if (detail.status == 1 && detail.courseType == 1){ |
|
|
|
|
|
|
|
if( new Date(detail.courseEndTime) >= new Date() ){ |
|
|
|
|
|
|
|
yhStatus = 4; // 直播中 |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
yhStatus = 5; //查看回放 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}else if (detail.status == 1 && detail.courseType == 0){ |
|
|
|
|
|
|
|
if (detail.signState == 0){ |
|
|
|
|
|
|
|
yhStatus = 6; //线下课程未签到 |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
yhStatus = 7; //已签到 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
if ( detail.status == 0 ){ |
|
|
|
|
|
|
|
yhStatus = 8; // 报名没有被确认 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.yhStatus = yhStatus; |
|
|
|
|
|
|
|
}, |
|
|
|
getDetail(){ |
|
|
|
getDetail(){ |
|
|
|
uni.showLoading({ |
|
|
|
uni.showLoading({ |
|
|
|
title:'正在加载中...' |
|
|
|
title:'正在加载中...' |
|
|
@ -337,7 +375,8 @@ |
|
|
|
getCourseDetail({id:this.courseId}).then((res)=>{ |
|
|
|
getCourseDetail({id:this.courseId}).then((res)=>{ |
|
|
|
uni.hideLoading() |
|
|
|
uni.hideLoading() |
|
|
|
//res.data.courseIntroduce = res.data.courseIntroduce.replace(/\<img/g, "<img style='width: 100%;'") |
|
|
|
//res.data.courseIntroduce = res.data.courseIntroduce.replace(/\<img/g, "<img style='width: 100%;'") |
|
|
|
this.detail = res.data |
|
|
|
this.detail = res.data; |
|
|
|
|
|
|
|
this.test(); |
|
|
|
let t = res.data.signEndTime.replace(/-/g, '/'); |
|
|
|
let t = res.data.signEndTime.replace(/-/g, '/'); |
|
|
|
let endTime = Date.parse(new Date(t))/1000 |
|
|
|
let endTime = Date.parse(new Date(t))/1000 |
|
|
|
this.times = endTime - nowTime; |
|
|
|
this.times = endTime - nowTime; |
|
|
@ -364,7 +403,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else{ |
|
|
|
} else{ |
|
|
|
if(type == 2){ |
|
|
|
if(type == 2){ //立即报名 |
|
|
|
uni.showModal({ |
|
|
|
uni.showModal({ |
|
|
|
title:'提示!', |
|
|
|
title:'提示!', |
|
|
|
content:'是否确定报名?', |
|
|
|
content:'是否确定报名?', |
|
|
@ -372,45 +411,42 @@ |
|
|
|
if(res.confirm){ |
|
|
|
if(res.confirm){ |
|
|
|
this.sign() |
|
|
|
this.sign() |
|
|
|
}else if (res.cancel) { |
|
|
|
}else if (res.cancel) { |
|
|
|
console.log('用户点击取消'); |
|
|
|
console.log('用户点击取消'); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}else if(type == 3){ |
|
|
|
}else if(type == 3){ //查看回放 |
|
|
|
console.log("进入直播间"); |
|
|
|
|
|
|
|
let roomId = this.detail.roomId; |
|
|
|
let roomId = this.detail.roomId; |
|
|
|
let customParams = encodeURIComponent(JSON.stringify({ path: 'pages/index/index', pid: 1 })) |
|
|
|
let customParams = encodeURIComponent(JSON.stringify({ path: 'pages/user/liveWelcome/index', pid: 1 })) |
|
|
|
wx.navigateTo({ |
|
|
|
wx.navigateTo({ |
|
|
|
url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${roomId}&custom_params=${customParams}` |
|
|
|
url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${roomId}&custom_params=${customParams}` |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
} else if(type == 1){ //已报名等待确认 联系服务老师 |
|
|
|
|
|
|
|
uni.makePhoneCall({ |
|
|
|
|
|
|
|
phoneNumber: this.userInfo.sellerPhone |
|
|
|
|
|
|
|
}); |
|
|
|
} else{ |
|
|
|
} else{ |
|
|
|
this.sign() |
|
|
|
this.sign() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
sign(){ |
|
|
|
sign(){ |
|
|
|
|
|
|
|
if(!this.userInfo.spreadUid){ |
|
|
|
|
|
|
|
this.maskDialog = true |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
enterCourse({ |
|
|
|
enterCourse({ |
|
|
|
courseId:this.courseId, |
|
|
|
lessionId: this.courseId |
|
|
|
sellerId:this.teacherId, |
|
|
|
|
|
|
|
validCode:this.validCode |
|
|
|
|
|
|
|
}).then((res)=>{ |
|
|
|
}).then((res)=>{ |
|
|
|
if(res.data.state == 0){ |
|
|
|
if(res.data.state == 1){ |
|
|
|
this.maskDialog = true |
|
|
|
//直接成功 刷新页面 |
|
|
|
this.teacher = res.data |
|
|
|
uni.showToast({ |
|
|
|
} else if(res.data.state == 1){ |
|
|
|
title: res.data.msg |
|
|
|
if(this.detail.courseType == 1){ //直播课程弹出引导下载小程序 |
|
|
|
}); |
|
|
|
this.showSignUp = true |
|
|
|
setTimeout(()=>{ |
|
|
|
setTimeout(()=>{ |
|
|
|
this.getDetail() |
|
|
|
this.getDetail() |
|
|
|
},1500) |
|
|
|
},1500) |
|
|
|
|
|
|
|
} else{ |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: '报名成功!' |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
|
|
|
this.getDetail() |
|
|
|
|
|
|
|
},2000) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else if(res.data.state == 2){ |
|
|
|
} else if(res.data.state == 2){ |
|
|
|
this.payment(res.data.payData) |
|
|
|
this.payment(res.data.payData) |
|
|
|
} else{ |
|
|
|
} else{ |
|
|
@ -430,8 +466,8 @@ |
|
|
|
signType: 'MD5', |
|
|
|
signType: 'MD5', |
|
|
|
package:orderInfo.packageValue, |
|
|
|
package:orderInfo.packageValue, |
|
|
|
success: success => { |
|
|
|
success: success => { |
|
|
|
if(this.detail.courseType == 1){ //直播课程弹出引导下载app |
|
|
|
if(this.detail.courseType == 1){ |
|
|
|
this.showSignUp = true |
|
|
|
// this.showSignUp = true |
|
|
|
this.getDetail() |
|
|
|
this.getDetail() |
|
|
|
} else{ |
|
|
|
} else{ |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
@ -439,7 +475,7 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
setTimeout(()=>{ |
|
|
|
setTimeout(()=>{ |
|
|
|
this.getDetail() |
|
|
|
this.getDetail() |
|
|
|
},2000) |
|
|
|
},1500) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
fail: error => { |
|
|
|
fail: error => { |
|
|
@ -454,7 +490,7 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
call(){ |
|
|
|
call(){ |
|
|
|
uni.makePhoneCall({ |
|
|
|
uni.makePhoneCall({ |
|
|
|
phoneNumber: this.teacher.phone |
|
|
|
phoneNumber: '15623111593' |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
closeDialog(){ |
|
|
|
closeDialog(){ |
|
|
@ -479,7 +515,7 @@ |
|
|
|
//selectAll会选择所要含有该类名的盒子 |
|
|
|
//selectAll会选择所要含有该类名的盒子 |
|
|
|
uni.createSelectorQuery().selectAll('.content').boundingClientRect((rect) => { |
|
|
|
uni.createSelectorQuery().selectAll('.content').boundingClientRect((rect) => { |
|
|
|
}).exec((res) => { |
|
|
|
}).exec((res) => { |
|
|
|
console.log('res',res) |
|
|
|
// console.log('res',res) |
|
|
|
res[0].forEach((item)=>{ |
|
|
|
res[0].forEach((item)=>{ |
|
|
|
h+=item.top; |
|
|
|
h+=item.top; |
|
|
|
heightArr.push(h); |
|
|
|
heightArr.push(h); |
|
|
@ -586,6 +622,7 @@ |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
line-height: 60rpx; |
|
|
|
line-height: 60rpx; |
|
|
|
color: #6E85EB; |
|
|
|
color: #6E85EB; |
|
|
|
|
|
|
|
margin: 0 auto; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -987,14 +1024,16 @@ |
|
|
|
.colR{ |
|
|
|
.colR{ |
|
|
|
color: #F99C10; |
|
|
|
color: #F99C10; |
|
|
|
} |
|
|
|
} |
|
|
|
.signin-btn{ |
|
|
|
} |
|
|
|
width: 178rpx; |
|
|
|
.signin-btn{ |
|
|
|
height: 100%; |
|
|
|
min-width: 178rpx; |
|
|
|
line-height: 84rpx; |
|
|
|
height: 100%; |
|
|
|
font-size: 32rpx; |
|
|
|
line-height: 84rpx; |
|
|
|
color: #fff; |
|
|
|
padding: 0 12rpx; |
|
|
|
background: #F99C10; |
|
|
|
font-size: 32rpx; |
|
|
|
} |
|
|
|
border-radius: 44px; |
|
|
|
|
|
|
|
color: #fff; |
|
|
|
|
|
|
|
background: #F99C10; |
|
|
|
} |
|
|
|
} |
|
|
|
.call-btn{ |
|
|
|
.call-btn{ |
|
|
|
width: 268rpx; |
|
|
|
width: 268rpx; |
|
|
|