视频列表组件代码更新
This commit is contained in:
@@ -4,12 +4,13 @@
|
|||||||
<video class="u-flex-1 video" :show-fullscreen-btn="false" @controlstoggle="controlstoggles" v-if="showVideo"
|
<video class="u-flex-1 video" :show-fullscreen-btn="false" @controlstoggle="controlstoggles" v-if="showVideo"
|
||||||
@waiting="waiting()" object-fit="cover"
|
@waiting="waiting()" object-fit="cover"
|
||||||
@pause="onpause"
|
@pause="onpause"
|
||||||
|
@click="videoClick()"
|
||||||
@play="videoPlay('myVideo'+item.courseDetailsId,item.courseDetailsId)" :play-strategy="2"
|
@play="videoPlay('myVideo'+item.courseDetailsId,item.courseDetailsId)" :play-strategy="2"
|
||||||
:show-loading="true" codec="software" :muted="false" :show-center-play-btn="true" :loop="false"
|
: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"
|
:enable-progress-gesture="false" :poster="item.titleImg" :ref="'myVideo'+item.courseDetailsId"
|
||||||
:autoplay="autoplay" @ended="ended" :id="'myVideo'+item.courseDetailsId" :src="item.videoUrl"></video>
|
: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>
|
</image>
|
||||||
|
|
||||||
<view class="info" v-if="!isCommand" :style="infoStyle">
|
<view class="info" v-if="!isCommand" :style="infoStyle">
|
||||||
@@ -151,7 +152,10 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
let isPlying=false
|
||||||
function videoPlay() {
|
function videoPlay() {
|
||||||
|
isPlying=true
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
emits('controlstoggles', {
|
emits('controlstoggles', {
|
||||||
detail:{show:true}
|
detail:{show:true}
|
||||||
@@ -161,6 +165,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onpause(){
|
function onpause(){
|
||||||
|
isPlying=false
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
emits('controlstoggles', {
|
emits('controlstoggles', {
|
||||||
detail:{show:false}
|
detail:{show:false}
|
||||||
@@ -187,6 +192,15 @@
|
|||||||
function popupShow(key) {
|
function popupShow(key) {
|
||||||
emits('popupShow', key)
|
emits('popupShow', key)
|
||||||
}
|
}
|
||||||
|
function videoClick(){
|
||||||
|
if(video){
|
||||||
|
if(isPlying){
|
||||||
|
video.pause()
|
||||||
|
}else{
|
||||||
|
video.play()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let first = true
|
let first = true
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
:showControls="control.showControls" :current="current" :isCollect="isCollect"
|
:showControls="control.showControls" :current="current" :isCollect="isCollect"
|
||||||
@toDetail="toDetail(item,index)" @controlstoggles="controlstoggles" :playSpeeds="playSpeeds"
|
@toDetail="toDetail(item,index)" @controlstoggles="controlstoggles" :playSpeeds="playSpeeds"
|
||||||
:index="index" :nowIndex="nowIndex" @dianzanClick="dianzanClick(item,index)" @share="share(item)"
|
: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-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
@itemMounted="itemMounted" @controlstoggles="controlstoggles" :index="index" :instance="instance"
|
@itemMounted="itemMounted" @controlstoggles="controlstoggles" :index="index" :instance="instance"
|
||||||
:nowIndex="nowIndex" @appear="appear($event,item,index)" :playSpeeds="playSpeeds"
|
:nowIndex="nowIndex" @appear="appear($event,item,index)" :playSpeeds="playSpeeds"
|
||||||
@disappear="disappear(item,index)" @dianzanClick="dianzanClick(item,index)" @share="share(item)"
|
@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>
|
</view>
|
||||||
</cell>
|
</cell>
|
||||||
</list>
|
</list>
|
||||||
@@ -80,15 +80,19 @@
|
|||||||
<text class=" color-999 u-font-24">每日前10次付款均可获取抽奖机会,抽奖保底抽中付款金额等额红包,红包可直接提现。当前为第1次付款</text>
|
<text class=" color-999 u-font-24">每日前10次付款均可获取抽奖机会,抽奖保底抽中付款金额等额红包,红包可直接提现。当前为第1次付款</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="colo-333 pay-list font-bold u-font-28 u-m-t-20">
|
<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>
|
<image class="hot" src="@/static/images/hot.png" mode=""></image>
|
||||||
<text class="u-font-28 font-bold">{{info.price}}元解锁全剧</text>
|
<text class="u-font-28 font-bold">{{info.price}}元解锁全剧</text>
|
||||||
</view>
|
</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>
|
<image class="hot" src="@/static/images/hot.png" mode=""></image>
|
||||||
<text class="u-font-28 font-bold">{{nowDanjiPrice*jinbiBili}}金币解锁单集视频</text>
|
<text class="u-font-28 font-bold">{{nowDanjiPrice*jinbiBili}}金币解锁单集视频</text>
|
||||||
</view>
|
</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> -->
|
<!-- <image class="hot" src="@/static/images/hot.png" mode=""></image> -->
|
||||||
<text class="u-font-28 font-bold">{{nowDanjiPrice}}元解锁单集视频</text>
|
<text class="u-font-28 font-bold">{{nowDanjiPrice}}元解锁单集视频</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -121,7 +125,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-flex-row u-m-t-30 u-flex-y-center u-font-28">
|
<view class="u-flex u-flex-row u-m-t-30 u-flex-y-center u-font-28">
|
||||||
<view class="u-flex-y-center">
|
<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>
|
||||||
<view class="u-flex u-flex-row u-flex-y-center">
|
<view class="u-flex u-flex-row u-flex-y-center">
|
||||||
<text class="u-font-28 color-333">我已经阅读并同意</text>
|
<text class="u-font-28 color-333">我已经阅读并同意</text>
|
||||||
@@ -129,7 +133,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
</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>
|
<text class="u-font-28 color-fff">确认支付</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -287,7 +291,9 @@
|
|||||||
show: false,
|
show: false,
|
||||||
pay: false,
|
pay: false,
|
||||||
payTips: false,
|
payTips: false,
|
||||||
speed: false
|
speed: false,
|
||||||
|
data:null,
|
||||||
|
payType:null
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@@ -321,12 +327,22 @@
|
|||||||
|
|
||||||
//确认支付
|
//确认支付
|
||||||
function payConfirm() {
|
function payConfirm() {
|
||||||
|
console.log(isAgree.value);
|
||||||
if (!isAgree.value) {
|
if (!isAgree.value) {
|
||||||
return infoBox.showToast('请阅读并同意 《付费须知说明》')
|
return infoBox.showToast('请阅读并同意 《付费须知说明》')
|
||||||
}
|
}
|
||||||
|
let data = {
|
||||||
|
courseId: this.courseId
|
||||||
|
}
|
||||||
|
if(popup.payType=='all'){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function payBtnClick() {
|
function payBtnClick(type,num) {
|
||||||
|
popup.payType=`${type}-${num}`
|
||||||
popupClose()
|
popupClose()
|
||||||
popupShow('payTips')
|
popupShow('payTips')
|
||||||
}
|
}
|
||||||
@@ -384,8 +400,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function popupShow(key = 'show') {
|
function popupShow(key = 'show',item,index) {
|
||||||
|
console.log(item);
|
||||||
popup[key] = true
|
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 nowIndex = ref(0)
|
||||||
let current = ref(0)
|
let current = ref(0)
|
||||||
let videoList = ref([])
|
let videoList = ref([])
|
||||||
@@ -537,10 +540,6 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function posterHide() {
|
|
||||||
posterData.show = false
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const insertHistory = debounce(() => {
|
const insertHistory = debounce(() => {
|
||||||
@@ -603,7 +602,7 @@
|
|||||||
}
|
}
|
||||||
console.log(videoList.value);
|
console.log(videoList.value);
|
||||||
if (!item.videoUrl) {
|
if (!item.videoUrl) {
|
||||||
popupShow('pay')
|
popupShow('pay',item,index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user