合并master后

This commit is contained in:
@fawn-nine
2024-09-09 14:16:48 +08:00
10 changed files with 3106 additions and 3129 deletions

View File

@@ -3,24 +3,24 @@
<view style="width: 100%; height: 200px">
<view v-if="showCountDown" class="showCountDownd" style="">
<view class="">
<text class="nextText">{{secondCountDown}} 秒后播放下一个视频</text><br/>
<view >
<text class="cancelNext" @click="hideNextVideo">取消下一个</text>
<!-- <text class="cancelNext" @click="replayVideo">重新播放</text> -->
<text class="nextText">{{secondCountDown}} 秒后播放下一个视频</text><br />
<view>
<text class="cancelNext" @click="hideNextVideo">取消下一个</text>
<!-- <text class="cancelNext" @click="replayVideo">重新播放</text> -->
</view>
<!-- <view class="cancelNext" @click="hideNextVideo">重新播放</view> -->
</view>
</view>
<view v-if="show"
style="height: 100%;display: flex;align-items:center;justify-content:center;color: #fff;font-size: 38rpx;text-align: center;">
{{errorTxt}}</view>
{{errorTxt}}
</view>
<div class="" v-else style="background-color: #000" ref="videoContent" @tap="renderScript.handleClick"
id="url-player-test" :videoData="videoData" :winWidth="winWidth" :winHeight="winHeight"
:currentVideoList="currentVideoList" :firstTime="firstTime" :isfresh="isfresh" :platform="platform"
:isSetFirstTime="isSetFirstTime" :isChange="isChange" :change:videoData="renderScript.receiveMsg"
:replayVideoFlag="replayVideoFlag"
:change:winWidth="renderScript.receiveWinWidth" :change:winHeight="renderScript.receiveWinHeight"
:change:firstTime="renderScript.receiveFirstTime"
:replayVideoFlag="replayVideoFlag" :change:winWidth="renderScript.receiveWinWidth"
:change:winHeight="renderScript.receiveWinHeight" :change:firstTime="renderScript.receiveFirstTime"
:change:replayVideoFlag="renderScript.receiveReplayVideoFlag"
:change:isSetFirstTime="renderScript.receiveisSetFirstTime"
:change:isfresh="renderScript.receiveIsfresh" :change:platform="renderScript.receiveplatform"
@@ -71,7 +71,7 @@
} from "vuex";
export default {
props: ["currentVideo", "currentVideoList", "videoTitle",'secondCountDown'],
props: ["currentVideo", "currentVideoList", "videoTitle", 'secondCountDown'],
data() {
return {
reaquestFlag: false,
@@ -83,13 +83,13 @@
isChange: false,
isControl: true,
timer: null,
replayVideoFlag:false,
replayVideoFlag: false,
// secondCountDown: 5,
showCountDown: false,
playEndBlank:false,
playEndBlank: false,
// videoTitle: "",
videoList: [],
replayVideoLock:false,// 重播操作锁
replayVideoLock: false, // 重播操作锁
firstTime: 0,
options: {},
playAuth: "",
@@ -142,40 +142,42 @@
},
methods: {
replayVideo(){
if(!this.replayVideoFlag){
replayVideo() {
if (!this.replayVideoFlag) {
this.getLive(true, this.currentVideo)
console.log('this.currentVideo',this.currentVideo.id);
this.hideNextVideo()
console.log('this.currentVideo', this.currentVideo.id);
this.hideNextVideo()
this.replayVideoFlag = true
}
},
replayVideoFlagFalse(){
console.log('复原replayVideoFlag',this.replayVideoFlag);
replayVideoFlagFalse() {
console.log('复原replayVideoFlag', this.replayVideoFlag);
this.replayVideoFlag = false
},
UnlockChangeVideo(){
UnlockChangeVideo() {
this.$emit('unlockChangeVideo')
},
hideNextVideo(){
hideNextVideo() {
this.showCountDown = false
this.playEndBlank = false
this.$emit('hideNextVideo')
},
loadNextVideo() {
loadNextVideo() {
this.playEndBlank = true
var _list = [...this.currentVideoList]
_list = _list.map(item => { return item.id})
var thisIndex = _list.findIndex(item=>{
_list = _list.map(item => {
return item.id
})
var thisIndex = _list.findIndex(item => {
return item == this.currentVideo.id
})
console.log('播放列表',_list,this.currentVideo.id, thisIndex);
if(thisIndex < this.currentVideoList.length-1){
console.log('播放列表', _list, this.currentVideo.id, thisIndex);
if (thisIndex < this.currentVideoList.length - 1) {
this.showCountDown = true
this.$emit('startNextVideoCountDown')
}
},
openShow(data) {
@@ -233,7 +235,7 @@
this.videoId = this.options.video;
console.log("这是苹果视屏id", this.videoId);
await this.getLive(isChange,this.options);
await this.getLive(isChange, this.options);
},
// 配置播放项
async getData(data, isChange) {
@@ -303,7 +305,7 @@
},
// 获取播放凭证
async getLive(isChange, newVideoData) {
console.log('获取播放凭证',newVideoData.id);
console.log('获取播放凭证11111111111111', newVideoData);
if (this.reaquestFlag) {
uni.showToast({
title: '操作太快了,歇一下吧',
@@ -332,7 +334,7 @@
},
})
.then(async (res) => {
this.reaquestFlag = false
if (this.$platform == 'ios') {
if (this.currentVideo.type == 1 && res.video.m3u8Url == null || this.currentVideo
@@ -451,7 +453,7 @@
var curStatus = null
var diff = 0
var pauseTime = 0
var myplayer = undefined
var myplayer = undefined
import $ from 'jquery'
export default {
components: {
@@ -481,7 +483,7 @@
},
methods: {
handleClick(event, ownerInstance) {
console.log('是否了走了点击video事件', event)
console.log('是否了走了点击video事件', event)
},
emitData(event, ownerInstance) {
var that = this;
@@ -492,24 +494,24 @@
},
receiveReplayVideoFlag(newValue, oldValue, ownerVm, vm) {
console.log('newValue重新播放',newValue,myplayer);
console.log('newValue重新播放', newValue, myplayer);
ReplayVideoFlag = newValue
if(newValue){
if (newValue) {
$('.videoContent8').click()
// ReplayVideoFlag = newValue
// // myplayer.replay()
// $('.videoContent7').click()
// myplayer.seek(0)
// // myplayer.replay()
// $('.videoContent7').click()
// myplayer.seek(0)
// myplayer.play()
}
},
emitReplayVideoFlagFalse(event, ownerInstance) {
ownerInstance.callMethod('replayVideoFlagFalse')
ownerInstance.callMethod('replayVideoFlagFalse')
},
emitUnlockChangeVideo(event, ownerInstance) {
ownerInstance.callMethod('UnlockChangeVideo')
ownerInstance.callMethod('UnlockChangeVideo')
},
async receiveFirstTime(newValue, oldValue, ownerVm, vm) {
@@ -576,10 +578,10 @@
},
// renderjs阿里云播放器引入与配置
getLive() {
console.log('这是这只只是666666:', this.firstTime, this.videoData)
$('#url-player-test').empty();
console.log('这是这只只是666666:', this.firstTime, this.videoData)
$('#url-player-test').empty();
pauseTime = 0
var fullScreenButtonComponent = Aliplayer.Component({
/**
@@ -614,7 +616,7 @@
this.$html.show();
// this.$html.hide();
},
});
// console.log('这是查看是否获取到hlstoken', this.videoData)
var playerOptions = {
@@ -760,9 +762,9 @@
$('.videoContent9').click()
})
player.on('play', function() {
console.log('开始播放------');
console.log('开始播放------');
$('.videoContent7').click()
if(pauseTime > 0){
if (pauseTime > 0) {
player.seek(pauseTime);
}
})
@@ -772,21 +774,21 @@
// if(ReplayVideoFlag){
// player.seek(0);
// }else{
var videoDurationTimes = parseInt(player.getDuration())
// var firstTime = parseInt(player.getCurrentTime())
console.log('视频总长度',parseInt(player.getDuration()),parseInt(player.getCurrentTime()));
if(videoData.firstTime < videoDurationTimes){
var videoDurationTimes = parseInt(player.getDuration())
// var firstTime = parseInt(player.getCurrentTime())
console.log('视频总长度', parseInt(player.getDuration()), parseInt(player.getCurrentTime()));
if (videoData.firstTime < videoDurationTimes) {
player.seek(videoData.firstTime);
}else{
player.seek(0);
}
} else {
player.seek(0);
}
//}
})
myplayer.on('playing', function() {
console.log('正在播放...')
})
myplayer.on('timeupdate', function() {
let that = this
var _time = parseInt(player.getCurrentTime())
@@ -808,12 +810,12 @@
$('.videoContent2').click()
$('.videoContent6').click()
})
player.on('pause', function() {
player.on('pause', function() {
pauseTime = parseInt(player.getCurrentTime())
player.pause(true)
console.log('触发暂停', pauseTime)
console.log('触发暂停', pauseTime)
})
myplayer.on('error', function() {
console.log('播放出错')
$('.videoContent5').click()
@@ -873,8 +875,8 @@
//数据变化
videoData = newValue
if (videoData) {
return
console.log('切换后的播放数据videoData',videoData.type);
return
console.log('切换后的播放数据videoData', videoData.type);
if (videoData.type == 1) {
if (videoData.m3u8Url != '' && videoData.m3u8Url != null) {
// myplayer.source(videoData.m3u8Url)
@@ -942,29 +944,40 @@
}
</script>
<style>
.cancelNext{display: inline-block; margin-right: 20rpx;
border-radius: 10rpx; margin-top: 10rpx;
padding: 10rpx 20rpx !important; background-color: #fff !important;
color: #000; text-align: center; line-height: 50rpx;}
.cancelNext {
display: inline-block;
margin-right: 20rpx;
border-radius: 10rpx;
margin-top: 10rpx;
padding: 10rpx 20rpx !important;
background-color: #fff !important;
color: #000;
text-align: center;
line-height: 50rpx;
}
/* .cancelNext:last-child{margin-left: 10rpx;} */
.nextText{}
.showCountDownd {
box-sizing: border-box;
height: 100%; width: 100%; background-color: rgba(0, 0, 0, 0.6);
.nextText {}
.showCountDownd {
box-sizing: border-box;
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, 0.6);
display: flex;
align-items: center;
justify-content:flex-end;
justify-content: flex-end;
color: #fff;
font-size: 38rpx;
text-align: center;
position: absolute;
top: 0; right: 10rpx;
top: 0;
right: 10rpx;
z-index: 4;
text{
}
text {}
}
.container {

View File

@@ -3,7 +3,10 @@
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<!-- <z-nav-bar :title="pageTitle ? pageTitle : '课程详情'"> -->
<z-nav-bar title="课程介绍">
<z-nav-bar title="课程介绍">
<!-- <view class="curseSet" slot="right" @click="newOnShare">
<uni-icons type="redo" size="26"></uni-icons><text style="font-size: 26rpx;"></text> 分享课程
</view> -->
</z-nav-bar>
<view class="contentBox commonPageContentBox">
@@ -49,11 +52,11 @@
position: relative;
display: flex;
align-items: center;
" @click="isHideCourseInfo = !isHideCourseInfo">
">
<view :class="`${isHideCourseInfo ? 'hidden2' : ''}`"
style="width: calc(100% - 50rpx); font-size: 30rpx;" v-html="course.content">
</view>
<text
<text @click="isHideCourseInfo = !isHideCourseInfo"
style="
position: absolute;
bottom: 0;
@@ -69,7 +72,7 @@
</view>
</view>
</view>
<!-- 小班入口 -->
<!-- 小班入口 -->
<view class="classEntrance" v-if="linkClassList.length > 0">
<view class="flex_box" style="justify-content: space-between;">
<view class="flex_box classTitleBox">
@@ -475,7 +478,25 @@
fatherIndex: null,
supportFlag: false,
selectGoodsData: {},
buyOptions: [],
buyOptions: [
// {
// icon: 'chat',
// text: '客服'
// },
// {
// icon: 'shop',
// text: '店铺',
// // info: 2,
// infoBackgroundColor: '#007aff',
// infoColor: "#f5f5f5"
// },
// {
// icon: 'cart',
// text: '购物车',
// info: 2
// }
],
customButtonGroup1: [{
with: 200,
text: "立即购买",
@@ -501,14 +522,14 @@
// this.pageTitle = e.title
console.log(e, "传入分类id");
this.getUserInfo();
this.courseId = e.id;
this.courseId = e.id;
// this.getCateList(this.courseId)
// await this.getData(e.id);
this.getSayList();
this.getOS()
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
if (this.scrollTop > 500) {
@@ -529,7 +550,7 @@
// #ifdef APP-PLUS
plus.screen.unlockOrientation();
plus.screen.lockOrientation("portrait-primary");
// #endif
// #endif
this.getLinkClassList()
},
onUnload() {
@@ -594,6 +615,31 @@
})
})
},
getClassList(){
$http.request({
url: '/common/class/getClassByUser',
method: "POST",
data: {
"courseId": this.courseId
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
this.classInfo = {}
console.log('获取班级列表',res.result);
if(res.code == 0 && res.result != null){
if(res.result.id){
this.classInfo = res.result
}
}
console.log('获取班级列表++++++',this.classList);
}).catch(e => {
console.log('获取班级列表失败',e);
this.classInfo = {}
});
},
// 获得操作系统
getOS() {
let oprateOs = "";
@@ -692,7 +738,7 @@
v.isAudition == 1 && this.userMsg.vip == 0 && this.librayList[this.curIndex].isBuy == 0 ?
noRecored = true : ''
uni.navigateTo({
url: `${_myurl}?courseId=${this.course.id}&navTitle=${this.pageTitle}&title=${v.title}&id=${v.id}&conditions=${v.conditions}&noRecored=${noRecored}`,
url: `${_myurl}?navTitle=${this.pageTitle}&title=${v.title}&id=${v.id}&conditions=${v.conditions}&noRecored=${noRecored}`,
});
} else {
this.$commonJS.showToast("请先购买课程");
@@ -745,8 +791,7 @@
if (res.code == 0) {
this.getCourseDescriptionData();
// this.$commonJS.showToast("");
}
}
this.$forceUpdate();
});
} else {
@@ -1013,31 +1058,6 @@
console.log("提交报错", e);
});
},
getClassList(){
$http.request({
url: '/common/class/getClassByUser',
method: "POST",
data: {
"courseId": this.courseId
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
this.classInfo = {}
console.log('获取班级列表',res.result);
if(res.code == 0){
if(res.result.id){
this.classInfo = res.result
}
}
console.log('获取班级列表++++++',this.classList);
}).catch(e => {
console.log('获取班级列表失败',e);
this.classInfo = {}
});
},
// 查询课程的评论
getSayList() {
this.status = 1;
@@ -1215,9 +1235,7 @@
this.courseList = [];
// console.log("at line 1167:", "调用了几次");
var that = this;
uni.showLoading({
title:'正在加载'
})
await $http
.request({
url: "sociology/course/getCourseDetail",
@@ -1303,10 +1321,8 @@
// console.log("list at line 1233:", list);
}
}
uni.hideLoading()
})
.catch((e) => {
uni.hideLoading()
console.log(e, "获取目录数据报错");
});
},
@@ -1434,16 +1450,16 @@
});
},
goClassLIst(url, id,title){
uni.navigateTo({
url: `${url}?courseId=${id}&courseTitle=${title}`,
});
},
uni.navigateTo({
url: `${url}?courseId=${id}&courseTitle=${title}`,
});
},
},
};
</script>
<style lang="scss" scoped>
@import "@/style/mixin.scss";
.classEntrance{background-color: #d0ecc1; padding:20rpx;
.classEntrance{background-color: #d0ecc1; padding:20rpx;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
.flex_box{align-items: center;}
}
@@ -1477,7 +1493,7 @@
}
img {
max-width: 260rpx;
width: 20px;
}
.u-upload__button {
@@ -1514,12 +1530,14 @@
.contentBox {
width: calc(100% - 60rpx);
// img{width: 100rpx !important;
// height: 100rpx !important;}
}
// .img{ width: 60rpx;
// height: 60rpx;
// image{width:60rpx; height: 60rpx; border-radius: 100%;}
// }
.img{ width: 60rpx;
height: 60rpx;
image{width:60rpx; height: 60rpx; border-radius: 100%;}
}
}
.chooseImgType {
@@ -2147,8 +2165,9 @@
color: #333;
// background-color: #f0f0f0;
// margin-bottom: 10rpx;
}
::v-deep .prof img{ width: 100px; height: 100px;}
.catalogueTitle {
justify-content: space-between;
overflow: hidden;

View File

@@ -1012,6 +1012,7 @@
},
})
.then(async (res) => {
this.buyingFlag = false
console.log("res at line 598:", res);
if (res.code == 0) {
if (res.orderSn == null) {
@@ -1041,8 +1042,7 @@
title: "加载中",
});
console.log(res, "支付支付");
if (res.success) {
this.buyingFlag = false
if (res.success) {
uni.showToast({
title: "支付成功",
});
@@ -1062,7 +1062,7 @@
}, 1000);
} else {
console.log("失败失败失败");
this.buyingFlag = false
// this.buyingFlag = false
// that.$commonJS.showToast('支付是失败')
setTimeout(() => {
console.log("延迟调用 失败提示");
@@ -1091,7 +1091,7 @@
};
setWXPay(data1, (res) => {
if (res.success) {
this.buyingFlag = false
// this.buyingFlag = false
uni.showToast({
title: "支付成功",
});
@@ -1111,7 +1111,7 @@
}
}, 1000);
} else {
this.buyingFlag = false
// this.buyingFlag = false
console.log(res, "微信支付111111111111111");
if (res.data.errMsg.indexOf("User canceled") != -1) {
uni.showToast({
@@ -1129,7 +1129,7 @@
}
});
} else if (this.payType == 4) {
this.buyingFlag = false
// this.buyingFlag = false
// 天医币支付
uni.showToast({
title: "购买成功",
@@ -1149,6 +1149,8 @@
}
}
}
}).catch(e => {
this.buyingFlag = false
});
},

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -94,7 +94,7 @@
</template>
<script>
const paperBack = require('@/data/paperBack.json')
// const paperBack = require('@/data/paperBack.json')
import $http from '@/config/requestConfig.js';
import {
mapState