Browse Source

上传代码

master
杨豪 3 years ago
parent
commit
649b7c5e3d
  1. 5
      config/index.js
  2. 8
      pages.json
  3. 127
      pages/course/detail.vue
  4. 2
      pages/course/index.vue
  5. 22
      pagesB/pages/user/liveWelcome/index.vue
  6. BIN
      static/蒙版组 39@2x.png

5
config/index.js

@ -1,10 +1,9 @@
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api'; // export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
// export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api' // export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/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 = 'http://192.168.0.111:8088/api' // export const VUE_APP_API_URL = 'http://192.168.0.111:8088/api'
// export const VUE_APP_API_URL = 'https://www.cyjyyjy.com/api' export const VUE_APP_API_URL = 'https://www.cyjyyjy.com/api'
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api'; // 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://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_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'

8
pages.json

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

127
pages/course/detail.vue

@ -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 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 --> <!-- #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:'是否确定报名?',
@ -376,41 +415,38 @@
} }
} }
}) })
}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
} 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.data.msg
}); });
setTimeout(()=>{ setTimeout(()=>{
this.getDetail() this.getDetail()
},2000) },1500)
}
} 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,15 +1024,17 @@
.colR{ .colR{
color: #F99C10; color: #F99C10;
} }
}
.signin-btn{ .signin-btn{
width: 178rpx; min-width: 178rpx;
height: 100%; height: 100%;
line-height: 84rpx; line-height: 84rpx;
padding: 0 12rpx;
font-size: 32rpx; font-size: 32rpx;
border-radius: 44px;
color: #fff; color: #fff;
background: #F99C10; background: #F99C10;
} }
}
.call-btn{ .call-btn{
width: 268rpx; width: 268rpx;
height: 80rpx; height: 80rpx;

2
pages/course/index.vue

@ -183,7 +183,7 @@
}) })
var cid = null; var cid = null;
this.active == null ? cid = this.currentTab.id : cid = this.active this.active == null ? cid = this.currentTab.id : cid = this.active
getCourses({categoryId: cid,listState:0,uid:this.userInfo.uid}).then((res) => { getCourses({categoryId: cid,listState:0}).then((res) => {
if (res.success) { if (res.success) {
this.courseList = res.data this.courseList = res.data
} }

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>

BIN
static/蒙版组 39@2x.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Loading…
Cancel
Save