Browse Source

修改课时详情页

master
Loki 3 years ago
parent
commit
d7aaf7439e
  1. 15
      config/index.js
  2. 8
      pages.json
  3. 78
      pages/course/detail.vue
  4. 22
      pagesB/pages/user/liveWelcome/index.vue

15
config/index.js

@ -1,16 +1,3 @@
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
// export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api'
<<<<<<< HEAD
// export const VUE_APP_API_URL = 'http://139.186.134.205:9006/api'
export const VUE_APP_API_URL = 'http://192.168.0.112:8088/api' export const VUE_APP_API_URL = 'http://192.168.0.112:8088/api'
// export const VUE_APP_API_URL = 'https://www.cyjyyjy.com:8096/api' // export const VUE_APP_API_URL = 'https://www.cyjyyjy.com/api'
=======
// export const VUE_APP_API_URL = 'http://192.168.0.112:8088/api'
// export const VUE_APP_API_URL = 'http://192.168.0.114:8088/api'
export const VUE_APP_API_URL = 'https://www.cyjyyjy.com/api'
>>>>>>> 1521d49cdb4b0c5490ac953afbe9910a0a287c45
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
// export const VUE_APP_API_URL = 'https://thapi.xinxintuan.co/api'
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
export const VUE_APP_RESOURCES_URL = 'https://h5.yixiang.co/static' export const VUE_APP_RESOURCES_URL = 'https://h5.yixiang.co/static'

8
pages.json

@ -608,6 +608,14 @@
"navigationBarTitleText": "直播列表" "navigationBarTitleText": "直播列表"
} }
} }
,{
"path" : "pages/user/liveWelcome/index",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
] ]
} }
], ],

78
pages/course/detail.vue

@ -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{

22
pagesB/pages/user/liveWelcome/index.vue

@ -0,0 +1,22 @@
<template>
<view>
<text> 欢迎访问禅易直播间,请从课程页面进入直播 </text>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>
Loading…
Cancel
Save