视频列表组件代码更新

This commit is contained in:
2025-01-13 10:52:47 +08:00
parent d28a1e2d09
commit 36028936c7
2 changed files with 47 additions and 34 deletions

View File

@@ -4,12 +4,13 @@
<video class="u-flex-1 video" :show-fullscreen-btn="false" @controlstoggle="controlstoggles" v-if="showVideo"
@waiting="waiting()" object-fit="cover"
@pause="onpause"
@click="videoClick()"
@play="videoPlay('myVideo'+item.courseDetailsId,item.courseDetailsId)" :play-strategy="2"
:show-loading="true" codec="software" :muted="false" :show-center-play-btn="true" :loop="false"
:enable-progress-gesture="false" :poster="item.titleImg" :ref="'myVideo'+item.courseDetailsId"
:autoplay="autoplay" @ended="ended" :id="'myVideo'+item.courseDetailsId" :src="item.videoUrl"></video>
<image class="poster" v-else @click="!item.videoUrl?popupShow('pay'):''" :src="item.titleImg" mode="aspectFill">
<image class="poster" v-else @click="!item.videoUrl?popupShow('pay',item):''" :src="item.titleImg" mode="aspectFill">
</image>
<view class="info" v-if="!isCommand" :style="infoStyle">
@@ -150,8 +151,11 @@
function waiting() {
}
let isPlying=false
function videoPlay() {
isPlying=true
// #ifdef H5
emits('controlstoggles', {
detail:{show:true}
@@ -161,6 +165,7 @@
}
function onpause(){
isPlying=false
// #ifdef H5
emits('controlstoggles', {
detail:{show:false}
@@ -187,7 +192,16 @@
function popupShow(key) {
emits('popupShow', key)
}
function videoClick(){
if(video){
if(isPlying){
video.pause()
}else{
video.play()
}
}
}
let first = true
function appear() {

View File

@@ -10,7 +10,7 @@
:showControls="control.showControls" :current="current" :isCollect="isCollect"
@toDetail="toDetail(item,index)" @controlstoggles="controlstoggles" :playSpeeds="playSpeeds"
:index="index" :nowIndex="nowIndex" @dianzanClick="dianzanClick(item,index)" @share="share(item)"
@zhuijuClick="zhuijuClick(item)" @popupShow="popupShow"></list-item-vue>
@zhuijuClick="zhuijuClick(item)" @popupShow="popupShow($event,item,index)"></list-item-vue>
</swiper-item>
</swiper>
</view>
@@ -27,7 +27,7 @@
@itemMounted="itemMounted" @controlstoggles="controlstoggles" :index="index" :instance="instance"
:nowIndex="nowIndex" @appear="appear($event,item,index)" :playSpeeds="playSpeeds"
@disappear="disappear(item,index)" @dianzanClick="dianzanClick(item,index)" @share="share(item)"
@zhuijuClick="zhuijuClick(item)" @popupShow="popupShow"></list-item-vue>
@zhuijuClick="zhuijuClick(item)" @popupShow="popupShow($event,item,index)"></list-item-vue>
</view>
</cell>
</list>
@@ -80,15 +80,19 @@
<text class=" color-999 u-font-24">每日前10次付款均可获取抽奖机会抽奖保底抽中付款金额等额红包红包可直接提现当前为第1次付款</text>
</view>
<view class="colo-333 pay-list font-bold u-font-28 u-m-t-20">
<view class="pay-list-item" v-if="info&&info.price" @click="payBtnClick">
<view class="pay-list-item" v-if="info&&info.price" @click="payBtnClick('money','all')">
<image class="hot" src="@/static/images/hot.png" mode=""></image>
<text class="u-font-28 font-bold">{{info.price}}元解锁全剧</text>
</view>
<view class="pay-list-item" @click="payBtnClick">
<view class="pay-list-item" v-if="info&&info.wholesalePrice" @click="payBtnClick('money',10)">
<image class="hot" src="@/static/images/hot.png" mode=""></image>
<text class="u-font-28 font-bold">{{info.price}}元解锁全剧</text>
</view>
<view class="pay-list-item" @click="payBtnClick('gold',1)">
<image class="hot" src="@/static/images/hot.png" mode=""></image>
<text class="u-font-28 font-bold">{{nowDanjiPrice*jinbiBili}}金币解锁单集视频</text>
</view>
<view class="pay-list-item" @click="payBtnClick">
<view class="pay-list-item" @click="payBtnClick('money',1)">
<!-- <image class="hot" src="@/static/images/hot.png" mode=""></image> -->
<text class="u-font-28 font-bold">{{nowDanjiPrice}}元解锁单集视频</text>
</view>
@@ -121,7 +125,7 @@
</view>
<view class="u-flex u-flex-row u-m-t-30 u-flex-y-center u-font-28">
<view class="u-flex-y-center">
<up-checkbox usedAlone shape="circle" v-model="isAgree" :activeColor="color.main"></up-checkbox>
<up-checkbox usedAlone shape="circle" v-model:checked="isAgree" :activeColor="color.main"></up-checkbox>
</view>
<view class="u-flex u-flex-row u-flex-y-center">
<text class="u-font-28 color-333">我已经阅读并同意</text>
@@ -129,7 +133,7 @@
</view>
</view>
<view class="u-m-t-30 my-bg-main payConfirm">
<view class="u-m-t-30 my-bg-main payConfirm" @click="payConfirm">
<text class="u-font-28 color-fff">确认支付</text>
</view>
</view>
@@ -287,7 +291,9 @@
show: false,
pay: false,
payTips: false,
speed: false
speed: false,
data:null,
payType:null
})
@@ -321,12 +327,22 @@
//确认支付
function payConfirm() {
console.log(isAgree.value);
if (!isAgree.value) {
return infoBox.showToast('请阅读并同意 《付费须知说明》')
}
let data = {
courseId: this.courseId
}
if(popup.payType=='all'){
}
}
function payBtnClick() {
function payBtnClick(type,num) {
popup.payType=`${type}-${num}`
popupClose()
popupShow('payTips')
}
@@ -384,8 +400,11 @@
}
}
function popupShow(key = 'show') {
function popupShow(key = 'show',item,index) {
console.log(item);
popup[key] = true
popup['data'] = item
popup['index'] = index
}
@@ -419,22 +438,6 @@
}
const posterData = reactive({
show: false,
// 用户姓名
name: '小明',
// 用户头像
logo: '/static/images/share.png',
// 商品名称
title: '精美时尚苹果手机一部',
// 商品价格
money: '5200.90',
// 商品图片(小程序需要换成自己服务器白名单设置的地址)
img: '',
// 商品链接
url: 'https://www.apple.com.cn/iphone/'
})
let nowIndex = ref(0)
let current = ref(0)
let videoList = ref([])
@@ -537,10 +540,6 @@
}
function posterHide() {
posterData.show = false
}
const insertHistory = debounce(() => {
@@ -603,7 +602,7 @@
}
console.log(videoList.value);
if (!item.videoUrl) {
popupShow('pay')
popupShow('pay',item,index)
}
}