合并前
This commit is contained in:
@@ -41,8 +41,8 @@
|
||||
<!-- #endif -->
|
||||
<!-- :autoplay="item.autoPlay" -->
|
||||
<!-- 没有视频权限则显示封面图 -->
|
||||
<image v-else @click="openShowPay(current,index,item.videoUrl);showControls = true" :src="item.titleImg"
|
||||
class="swipers-items-imgsbg" mode="aspectFill"></image>
|
||||
<image v-else @click="openShowPay(current,index,item.videoUrl);showControls = true"
|
||||
:src="item.titleImg" class="swipers-items-imgsbg" mode="aspectFill"></image>
|
||||
<!-- 返回图标 -->
|
||||
<!-- #ifndef MP-TOUTIAO -->
|
||||
<view @click.stop="goBack()" style="color: #ffffff;">
|
||||
@@ -305,11 +305,9 @@
|
||||
// #ifdef MP-WEIXIN || MP-TOUTIAO
|
||||
var videoAd = null;
|
||||
// #endif
|
||||
|
||||
import {
|
||||
returnIsSafari
|
||||
} from '@/utils/app.js'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
tkiQrcode,
|
||||
@@ -654,7 +652,7 @@
|
||||
},
|
||||
onShow() {
|
||||
console.log('onSHow video');
|
||||
|
||||
|
||||
//当应用从后台进入前台时自动播放
|
||||
if (this.videoContext) {
|
||||
this.videoContext.play()
|
||||
@@ -748,7 +746,7 @@
|
||||
this.meunTop = 37
|
||||
// #endif
|
||||
|
||||
|
||||
|
||||
// const windowResizeCallback = (res) => {
|
||||
// console.log('变化后的窗口宽度=' + res.size.windowWidth)
|
||||
// console.log('变化后的窗口高度=' + res.size.windowHeight)
|
||||
@@ -844,7 +842,7 @@
|
||||
event.preventDefault();
|
||||
},
|
||||
//点击封面打开弹窗
|
||||
openShowPay(val,inx,url) {
|
||||
openShowPay(val, inx, url) {
|
||||
console.log(val)
|
||||
console.log(inx)
|
||||
console.log(url)
|
||||
@@ -1462,12 +1460,12 @@
|
||||
this.$forceUpdate()
|
||||
},
|
||||
//选择播放
|
||||
selectPlay(item,type) {//price //videoUrl
|
||||
selectPlay(item, type) { //price //videoUrl
|
||||
// 根据选择的courseDetailsId拿到meunList列表中的相同数据的下标
|
||||
const index = this.meunList.findIndex(menu => menu.courseDetailsId === item.courseDetailsId);
|
||||
this.videoList = [this.meunList[index]]
|
||||
this.current = 0
|
||||
if ( this.videoList[this.current].videoUrl == '' && this.videoList[this.current].price <= 0 && !type ) {
|
||||
if (this.videoList[this.current].videoUrl == '' && this.videoList[this.current].price <= 0 && !type) {
|
||||
this.getDataList(this.courseId, this.courseDetailsId, true, 'select')
|
||||
return;
|
||||
}
|
||||
@@ -1567,8 +1565,8 @@
|
||||
|
||||
let indexs = -1
|
||||
if (courseDetailsId) { //从记录进来的
|
||||
console.log(courseDetailsId)
|
||||
console.log(this.meunList)
|
||||
console.log(courseDetailsId)
|
||||
console.log(this.meunList)
|
||||
this.meunList.map((item, index) => {
|
||||
if (item.courseDetailsId == courseDetailsId) {
|
||||
indexs = index
|
||||
@@ -1577,7 +1575,7 @@
|
||||
console.log(indexs)
|
||||
if (indexs != -1) { //找到了
|
||||
if (Number(indexs + 1) === this.meunList.length) { //最后一条
|
||||
console.log("最后一条")
|
||||
console.log("最后一条")
|
||||
if (this.meunList.length == 1) { //只有一条
|
||||
this.videoList = this.meunList.slice(0,
|
||||
3)
|
||||
@@ -1596,7 +1594,7 @@
|
||||
}
|
||||
|
||||
} else if (Number(indexs) === Number(this.meunList.length - 1)) { //倒数第二条
|
||||
console.log("倒数第二条")
|
||||
console.log("倒数第二条")
|
||||
if (this.meunList.length == 1) { //只有一条
|
||||
this.videoList = this.meunList.slice(0,
|
||||
3)
|
||||
@@ -1618,7 +1616,7 @@
|
||||
} else {
|
||||
console.log("如果不是最后一条,也不是倒数第二条")
|
||||
//如果不是最后一条,也不是倒数第二条,则从找到的位置开始往后拿三条数据放入数组
|
||||
if ( indexs == 0 ) {
|
||||
if (indexs == 0) {
|
||||
this.videoList = [
|
||||
this.meunList[this.meunList
|
||||
.length - 2],
|
||||
@@ -1626,7 +1624,7 @@
|
||||
.length - 1],
|
||||
this.meunList[0],
|
||||
]
|
||||
} else if ( indexs == 1) {
|
||||
} else if (indexs == 1) {
|
||||
this.videoList = [
|
||||
this.meunList[this.meunList
|
||||
.length - 1],
|
||||
@@ -1634,10 +1632,10 @@
|
||||
this.meunList[1],
|
||||
]
|
||||
} else {
|
||||
this.videoList = this.meunList.slice(indexs-2,
|
||||
indexs-2 + 3)
|
||||
this.videoList = this.meunList.slice(indexs - 2,
|
||||
indexs - 2 + 3)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} else {
|
||||
//没找到直接拿前三条数据即可
|
||||
@@ -1645,7 +1643,7 @@
|
||||
}
|
||||
} else { //新的视频
|
||||
// //视频数组//直接拿前三条
|
||||
|
||||
|
||||
this.videoList = this.meunList.slice(0, 3)
|
||||
indexs = 0
|
||||
|
||||
@@ -1700,8 +1698,8 @@
|
||||
|
||||
})
|
||||
|
||||
if ( t == 'select') {
|
||||
this.selectPlay(this.videoList[this.current],true)
|
||||
if (t == 'select') {
|
||||
this.selectPlay(this.videoList[this.current], true)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user