H5中0元支付弹窗修改

This commit is contained in:
GaoHao
2024-12-19 14:52:19 +08:00
parent 8e7d038dba
commit a0e49f9830
4 changed files with 111 additions and 60 deletions

View File

@@ -41,7 +41,7 @@
<!-- #endif -->
<!-- :autoplay="item.autoPlay" -->
<!-- 没有视频权限则显示封面图 -->
<image v-else @click="openShowPay();showControls = true" :src="item.titleImg"
<image v-else @click="openShowPay(current,index,item.videoUrl);showControls = true" :src="item.titleImg"
class="swipers-items-imgsbg" mode="aspectFill"></image>
<!-- 返回图标 -->
<!-- #ifndef MP-TOUTIAO -->
@@ -84,7 +84,7 @@
<image src="../../static/images/me/share.png" mode=""></image>
</view>
<view class="swipers-items-right-item-txt">
分享
分享{{current}}
</view>
</view>
<!-- #endif -->
@@ -103,7 +103,7 @@
<image src="../../static/images/me/shuqian.png" style="height: 60rpx;" mode=""></image>
</view>
<view class="swipers-items-right-item-txt">
追剧
追剧{{index}}
</view>
</view>
</view>
@@ -654,6 +654,7 @@
},
onShow() {
console.log('onSHow video');
//当应用从后台进入前台时自动播放
if (this.videoContext) {
this.videoContext.play()
@@ -843,7 +844,11 @@
event.preventDefault();
},
//点击封面打开弹窗
openShowPay() {
openShowPay(val,inx,url) {
console.log(val)
console.log(inx)
console.log(url)
console.log(this.videoList[this.current])
this.zongPrice = this.info.price
this.countPrice = this.videoList[this.current].price
this.showPay = true
@@ -1562,13 +1567,17 @@
let indexs = -1
if (courseDetailsId) { //从记录进来的
console.log(courseDetailsId)
console.log(this.meunList)
this.meunList.map((item, index) => {
if (item.courseDetailsId == courseDetailsId) {
indexs = index
}
})
console.log(indexs)
if (indexs != -1) { //找到了
if (Number(indexs + 1) === this.meunList.length) { //最后一条
console.log("最后一条")
if (this.meunList.length == 1) { //只有一条
this.videoList = this.meunList.slice(0,
3)
@@ -1577,14 +1586,17 @@
3)
} else {
this.videoList = [
this.meunList[this.meunList
.length - 3],
this.meunList[this.meunList
.length - 2],
this.meunList[this.meunList
.length - 1],
this.meunList[0],
this.meunList[1],
]
}
} else if (Number(indexs) === Number(this.meunList.length - 1)) { //倒数第二条
console.log("倒数第二条")
if (this.meunList.length == 1) { //只有一条
this.videoList = this.meunList.slice(0,
3)
@@ -1604,9 +1616,28 @@
}
} else {
console.log("如果不是最后一条,也不是倒数第二条")
//如果不是最后一条,也不是倒数第二条,则从找到的位置开始往后拿三条数据放入数组
this.videoList = this.meunList.slice(indexs,
indexs + 3)
if ( indexs == 0 ) {
this.videoList = [
this.meunList[this.meunList
.length - 2],
this.meunList[this.meunList
.length - 1],
this.meunList[0],
]
} else if ( indexs == 1) {
this.videoList = [
this.meunList[this.meunList
.length - 1],
this.meunList[0],
this.meunList[1],
]
} else {
this.videoList = this.meunList.slice(indexs-2,
indexs-2 + 3)
}
}
} else {
//没找到直接拿前三条数据即可
@@ -1614,12 +1645,17 @@
}
} else { //新的视频
// //视频数组//直接拿前三条
this.videoList = this.meunList.slice(0, 3)
indexs = 0
}
console.log(this.videoList, '111111111111')
console.log(this.videoList);
this.videoList.map((item, index) => {
if (item.courseDetailsId == courseDetailsId) {
this.current = index
}
})
//重新计算当前在播放哪个视频
this.comNumVideo()
if (indexs != -1 && this.meunList.length > 0) {
@@ -1707,6 +1743,7 @@
},
//swiper上下切换事件
change(e) {
console.log(e)
//拿出当前的swiper索引
let current = Number(e.detail.current)
// 根据courseDetailsId在meunList中找到这个数据的下标
@@ -1875,6 +1912,7 @@
},
//监听视频播放完成
ended() {
console.log(this.current)
if (this.current == 2) {
this.current = 0
} else {