Browse Source

上传代码

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

7
config/index.js

@ -1,10 +1,9 @@
// 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 = '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 = '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 = '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_API_URL = 'https://h5api.xinxintuan.co/api';

10
pages.json

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

159
pages/course/detail.vue

@ -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 call-btn default-btn" v-if="detail.signState == 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> -->
<!-- 在线直播 -->
<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,
@ -215,7 +220,7 @@
heightArr:[],
tabInitTop:'',
isFixedTop: false,
maskDialog:false,
maskDialog: false,
showSignUp: false,
times: 0,
day:'',
@ -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()
})
}
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:'是否确定报名?',
@ -372,45 +411,42 @@
if(res.confirm){
this.sign()
}else if (res.cancel) {
console.log('用户点击取消');
console.log('用户点击取消');
}
}
})
}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{
uni.showToast({
title: '报名成功!'
});
setTimeout(()=>{
this.getDetail()
},2000)
}
if(res.data.state == 1){
//
uni.showToast({
title: res.data.msg
});
setTimeout(()=>{
this.getDetail()
},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,14 +1024,16 @@
.colR{
color: #F99C10;
}
.signin-btn{
width: 178rpx;
height: 100%;
line-height: 84rpx;
font-size: 32rpx;
color: #fff;
background: #F99C10;
}
}
.signin-btn{
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;

2
pages/course/index.vue

@ -183,7 +183,7 @@
})
var cid = null;
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) {
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