|
|
@ -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 call-btn default-btn" v-if="detail.enterState == 1 && detail.status == 1 && detail.courseType == 1" @click="signInClick(3)" >立即观看</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="signin-btn call-btn default-btn" v-if="detail.enterState == 1 && detail.status == 0" @click="signInClick(1)" >等待确认 联系服务老师</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="signin-btn call-btn default-btn" v-if="detail.signState == 1" >已签到</view> |
|
|
|
<view class="btn-box acea-row row-between-wrapper" v-if="yhStatus == 2 "> |
|
|
|
|
|
|
|
<view class="signin-btn" >报名已截止 请关注下期</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 在线直播 --> |
|
|
|
|
|
|
|
<view class="signin-btn call-btn default-btn" v-if="yhStatus == 4 " @click="signInClick(3)" >立即观看</view> |
|
|
|
|
|
|
|
<view class="signin-btn call-btn default-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 default-btn" v-if="yhStatus == 8 " @click="signInClick(1)" >等待确认 联系服务老师</view> |
|
|
|
|
|
|
|
|
|
|
|
<!-- #ifdef MP-WEIXIN --> |
|
|
|
<!-- #ifdef MP-WEIXIN --> |
|
|
|
<button open-type="getPhoneNumber" |
|
|
|
<button open-type="getPhoneNumber" |
|
|
@ -206,6 +210,7 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
yhStatus:0, |
|
|
|
id: '', |
|
|
|
id: '', |
|
|
|
teacherId:null, |
|
|
|
teacherId:null, |
|
|
|
validCode:null, |
|
|
|
validCode:null, |
|
|
@ -267,6 +272,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
|
|
|
|
getPhoneNumber: function(e) { |
|
|
|
getPhoneNumber: function(e) { |
|
|
|
let thit = this |
|
|
|
let thit = this |
|
|
|
// 判断一下这里是不是小程序 如果是小程序,走获取微信手机号进行绑定 |
|
|
|
// 判断一下这里是不是小程序 如果是小程序,走获取微信手机号进行绑定 |
|
|
@ -329,6 +335,41 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
test:function(){ |
|
|
|
|
|
|
|
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 +378,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; |
|
|
@ -377,9 +419,8 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}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}` |
|
|
|
}) |
|
|
|
}) |
|
|
@ -388,29 +429,20 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
sign(){ |
|
|
|
sign(){ |
|
|
|
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 == 0){ |
|
|
|
this.maskDialog = true |
|
|
|
this.maskDialog = true |
|
|
|
this.teacher = res.data |
|
|
|
this.teacher = res.data |
|
|
|
} else if(res.data.state == 1){ |
|
|
|
} else if(res.data.state == 1){ |
|
|
|
if(this.detail.courseType == 1){ //直播课程弹出引导下载小程序 |
|
|
|
//直接成功 刷新页面 |
|
|
|
this.showSignUp = true |
|
|
|
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
|
|
|
this.getDetail() |
|
|
|
|
|
|
|
},1500) |
|
|
|
|
|
|
|
} else{ |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: '报名成功!' |
|
|
|
title: res.msg |
|
|
|
}); |
|
|
|
}); |
|
|
|
setTimeout(()=>{ |
|
|
|
this.getDetail(); |
|
|
|
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{ |
|
|
|