|
|
|
@ -90,9 +90,9 @@
|
|
|
|
|
<view class="left-line"></view> |
|
|
|
|
<span>课程安排</span> |
|
|
|
|
</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>{{item.courseContent}}</text> |
|
|
|
|
<text>{{item}}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="recommend-box content" id="content3"> |
|
|
|
@ -132,20 +132,24 @@
|
|
|
|
|
</view> |
|
|
|
|
<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>距离截止时间还剩</view> |
|
|
|
|
<uni-countdown color="#F99C10" :day="day" :hour="hour" :minute="minute" :second="second" /> |
|
|
|
|
</view> |
|
|
|
|
<view class="signin-btn" @click="signInClick(2)">立即报名</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" v-if="yhStatus == 2 ">报名已截止 请关注下期</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.signState == 1" >已签到</view> |
|
|
|
|
</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 --> |
|
|
|
|
<button open-type="getPhoneNumber" |
|
|
|
@ -161,17 +165,17 @@
|
|
|
|
|
<view class="close" @click="closeDialog()">×</view> |
|
|
|
|
<view class="dialog-top acea-row-nowrap row-center-wrapper"> |
|
|
|
|
<image src="../../static/error-icon.png"></image> |
|
|
|
|
<view class="word">{{teacher.msg}}</view> |
|
|
|
|
<view class="word">您还没有绑定服务老师,请点击按钮联系服务老师进行绑定!</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="dialog-btm"> |
|
|
|
|
<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> |
|
|
|
|
<view> |
|
|
|
|
<view>{{teacher.name}}</view> |
|
|
|
|
<view>{{teacher.phone}}</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> --> |
|
|
|
|
<view class="call-btn" @click="call">拨打电话</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -206,6 +210,7 @@
|
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
yhStatus:0, |
|
|
|
|
id: '', |
|
|
|
|
teacherId:null, |
|
|
|
|
validCode:null, |
|
|
|
@ -236,15 +241,13 @@
|
|
|
|
|
this.courseId = this.$yroute.query.courseId; |
|
|
|
|
this.validCode = this.$yroute.query.validCode; |
|
|
|
|
this.teacherId = this.$yroute.query.teacherId; |
|
|
|
|
} else{ //普通进入详情页 |
|
|
|
|
} else{ //列表进入详情页 |
|
|
|
|
this.courseId = this.$yroute.query.id; |
|
|
|
|
} |
|
|
|
|
if(this.userInfo.uid){ |
|
|
|
|
this.getDetail() |
|
|
|
|
this.$nextTick(()=>{ |
|
|
|
|
this.getHeightArr() |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
computed:{ |
|
|
|
@ -259,7 +262,7 @@
|
|
|
|
|
this.getDetail() |
|
|
|
|
}, |
|
|
|
|
onShareAppMessage: function(res) { |
|
|
|
|
console.log(this.detail.id) |
|
|
|
|
// console.log(this.detail.id) |
|
|
|
|
return { |
|
|
|
|
title: this.detail.courseName, |
|
|
|
|
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(){ |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title:'正在加载中...' |
|
|
|
@ -337,7 +375,8 @@
|
|
|
|
|
getCourseDetail({id:this.courseId}).then((res)=>{ |
|
|
|
|
uni.hideLoading() |
|
|
|
|
//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 endTime = Date.parse(new Date(t))/1000 |
|
|
|
|
this.times = endTime - nowTime; |
|
|
|
@ -364,7 +403,7 @@
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} else{ |
|
|
|
|
if(type == 2){ |
|
|
|
|
if(type == 2){ //立即报名 |
|
|
|
|
uni.showModal({ |
|
|
|
|
title:'提示!', |
|
|
|
|
content:'是否确定报名?', |
|
|
|
@ -376,41 +415,38 @@
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}else if(type == 3){ |
|
|
|
|
console.log("进入直播间"); |
|
|
|
|
}else if(type == 3){ //查看回放 |
|
|
|
|
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({ |
|
|
|
|
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{ |
|
|
|
|
this.sign() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
sign(){ |
|
|
|
|
if(!this.userInfo.spreadUid){ |
|
|
|
|
this.maskDialog = true |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
enterCourse({ |
|
|
|
|
courseId:this.courseId, |
|
|
|
|
sellerId:this.teacherId, |
|
|
|
|
validCode:this.validCode |
|
|
|
|
lessionId: this.courseId |
|
|
|
|
}).then((res)=>{ |
|
|
|
|
if(res.data.state == 0){ |
|
|
|
|
this.maskDialog = true |
|
|
|
|
this.teacher = res.data |
|
|
|
|
} else if(res.data.state == 1){ |
|
|
|
|
if(this.detail.courseType == 1){ //直播课程弹出引导下载小程序 |
|
|
|
|
this.showSignUp = true |
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
this.getDetail() |
|
|
|
|
},1500) |
|
|
|
|
} else{ |
|
|
|
|
if(res.data.state == 1){ |
|
|
|
|
//直接成功 刷新页面 |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '报名成功!' |
|
|
|
|
title: res.data.msg |
|
|
|
|
}); |
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
this.getDetail() |
|
|
|
|
},2000) |
|
|
|
|
} |
|
|
|
|
},1500) |
|
|
|
|
} else if(res.data.state == 2){ |
|
|
|
|
this.payment(res.data.payData) |
|
|
|
|
} else{ |
|
|
|
@ -430,8 +466,8 @@
|
|
|
|
|
signType: 'MD5', |
|
|
|
|
package:orderInfo.packageValue, |
|
|
|
|
success: success => { |
|
|
|
|
if(this.detail.courseType == 1){ //直播课程弹出引导下载app |
|
|
|
|
this.showSignUp = true |
|
|
|
|
if(this.detail.courseType == 1){ |
|
|
|
|
// this.showSignUp = true |
|
|
|
|
this.getDetail() |
|
|
|
|
} else{ |
|
|
|
|
uni.showToast({ |
|
|
|
@ -439,7 +475,7 @@
|
|
|
|
|
}); |
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
this.getDetail() |
|
|
|
|
},2000) |
|
|
|
|
},1500) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
fail: error => { |
|
|
|
@ -454,7 +490,7 @@
|
|
|
|
|
}, |
|
|
|
|
call(){ |
|
|
|
|
uni.makePhoneCall({ |
|
|
|
|
phoneNumber: this.teacher.phone |
|
|
|
|
phoneNumber: '15623111593' |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
closeDialog(){ |
|
|
|
@ -479,7 +515,7 @@
|
|
|
|
|
//selectAll会选择所要含有该类名的盒子 |
|
|
|
|
uni.createSelectorQuery().selectAll('.content').boundingClientRect((rect) => { |
|
|
|
|
}).exec((res) => { |
|
|
|
|
console.log('res',res) |
|
|
|
|
// console.log('res',res) |
|
|
|
|
res[0].forEach((item)=>{ |
|
|
|
|
h+=item.top; |
|
|
|
|
heightArr.push(h); |
|
|
|
@ -586,6 +622,7 @@
|
|
|
|
|
text-align: center; |
|
|
|
|
line-height: 60rpx; |
|
|
|
|
color: #6E85EB; |
|
|
|
|
margin: 0 auto; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -987,15 +1024,17 @@
|
|
|
|
|
.colR{ |
|
|
|
|
color: #F99C10; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.signin-btn{ |
|
|
|
|
width: 178rpx; |
|
|
|
|
min-width: 178rpx; |
|
|
|
|
height: 100%; |
|
|
|
|
line-height: 84rpx; |
|
|
|
|
padding: 0 12rpx; |
|
|
|
|
font-size: 32rpx; |
|
|
|
|
border-radius: 44px; |
|
|
|
|
color: #fff; |
|
|
|
|
background: #F99C10; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.call-btn{ |
|
|
|
|
width: 268rpx; |
|
|
|
|
height: 80rpx; |
|
|
|
|