视频播放列表更新,增加分享海报生成
This commit is contained in:
@@ -1,19 +1,16 @@
|
||||
<template>
|
||||
<!-- #ifdef H5 -->
|
||||
<view class=" w-full box" style="width: 100vw;">
|
||||
<swiper @longpress="popupShow('speed')"
|
||||
:style="{height:wHeight+'px'}"
|
||||
v-if="videoList.length" @change="swiperChange" :current="current"
|
||||
:circular="true" vertical class="u-flex-1" @transition="transition" :indicator-dots="false"
|
||||
:autoplay="false" :interval="0" :duration="200">
|
||||
<swiper @longpress="popupShow('speed')" :style="{height:wHeight+'px'}" v-if="videoList.length"
|
||||
@change="swiperChange" :current="current" :circular="true" vertical class="u-flex-1"
|
||||
@transition="transition" :indicator-dots="false" :autoplay="false" :interval="0" :duration="200">
|
||||
<swiper-item v-for="(item,index) in videoList" :key="index">
|
||||
<list-item-vue :total="list.length" :item="item"
|
||||
:isCommand="isCommand"
|
||||
: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>
|
||||
<list-item-vue :total="list.length" :item="item" :isCommand="isCommand"
|
||||
:rightStyle="rightStyle" :infoStyle="infoStyle"
|
||||
: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>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
@@ -25,8 +22,8 @@
|
||||
<cell v-for="(item,index) in list" :key="item.courseDetailsId" :ref="setRefList(index)">
|
||||
<view class="swipers-items" :style="boxStyle" @longpress="popupShow('speed')">
|
||||
<list-item-vue :total="list.length" :item="item" :current="current" :isCollect="isCollect"
|
||||
:isCommand="isCommand"
|
||||
@toDetail="toDetail(item,index)"
|
||||
:rightStyle="rightStyle" :infoStyle="infoStyle"
|
||||
:isCommand="isCommand" :showControls="control.showControls" @toDetail="toDetail(item,index)"
|
||||
@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)"
|
||||
@@ -150,8 +147,7 @@
|
||||
</view>
|
||||
</up-popup>
|
||||
|
||||
|
||||
|
||||
<my-poster ref="refPoster"></my-poster>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -177,6 +173,9 @@
|
||||
onMounted,
|
||||
getCurrentInstance
|
||||
} from 'vue';
|
||||
|
||||
const refPoster = ref(null)
|
||||
|
||||
const props = defineProps({
|
||||
list: {
|
||||
type: Array,
|
||||
@@ -184,13 +183,13 @@
|
||||
[]
|
||||
}
|
||||
},
|
||||
isCommand:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
isCommand: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isTabbar:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
isTabbar: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
info: {
|
||||
tpye: Object,
|
||||
@@ -209,11 +208,14 @@
|
||||
showBack: true,
|
||||
showControls: true
|
||||
})
|
||||
|
||||
const customStyle=computed(()=>{
|
||||
// #ifdef APP
|
||||
control.showControls=false
|
||||
// #endif
|
||||
|
||||
const customStyle = computed(() => {
|
||||
// #ifdef H5
|
||||
return {
|
||||
bottom:props.isTabbar?'50px':'0'
|
||||
bottom: props.isTabbar ? '50px' : '0'
|
||||
}
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
@@ -223,6 +225,7 @@
|
||||
|
||||
function controlstoggles(e) {
|
||||
control.showControls = e.detail.show
|
||||
console.log(control.showControls );
|
||||
control.showBack = control.showControls
|
||||
console.log(control);
|
||||
}
|
||||
@@ -243,8 +246,9 @@
|
||||
}],
|
||||
active: 1
|
||||
})
|
||||
|
||||
const $mountedComponents={}
|
||||
|
||||
const $mountedComponents = {}
|
||||
|
||||
function itemMounted(index) {
|
||||
// $mountedComponents[index]=true
|
||||
}
|
||||
@@ -293,9 +297,9 @@
|
||||
|
||||
let cacheIndex = null
|
||||
|
||||
function appear(isFirst,item, index) {
|
||||
if(isFirst){
|
||||
$mountedComponents[index]=true
|
||||
function appear(isFirst, item, index) {
|
||||
if (isFirst) {
|
||||
$mountedComponents[index] = true
|
||||
}
|
||||
if (!initing) {
|
||||
cacheIndex = index
|
||||
@@ -353,7 +357,7 @@
|
||||
function goListPosition(index) {
|
||||
console.log('goListPosition:' + index)
|
||||
const el = refList.value[index]
|
||||
if($mountedComponents[props.list.length-1]){
|
||||
if ($mountedComponents[props.list.length - 1]) {
|
||||
domModule.scrollToElement(el, {
|
||||
animated: false
|
||||
})
|
||||
@@ -361,10 +365,10 @@
|
||||
const item = props.list[index]
|
||||
setVideoList(item)
|
||||
insertHistory()
|
||||
}else{
|
||||
setTimeout(()=>{
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
goListPosition(index)
|
||||
},30)
|
||||
}, 30)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -383,7 +387,7 @@
|
||||
function popupShow(key = 'show') {
|
||||
popup[key] = true
|
||||
}
|
||||
|
||||
|
||||
|
||||
let jinbiBili = ref(0)
|
||||
let wHeight = ref(0)
|
||||
@@ -400,10 +404,10 @@
|
||||
watch(() => props.collect, (newval) => {
|
||||
isCollect.value = newval
|
||||
})
|
||||
|
||||
function toDetail(item,index){
|
||||
|
||||
function toDetail(item, index) {
|
||||
uni.navigateTo({
|
||||
url:'/pages/video/detail?courseId='+item.courseId
|
||||
url: '/pages/video/detail?courseId=' + item.courseId
|
||||
})
|
||||
}
|
||||
|
||||
@@ -510,8 +514,27 @@
|
||||
const urls = returnShareUrl() + '/me/detail/detail?id=' + item.courseId + '&courseDetailsId=' + item
|
||||
.courseDetailsId + '&invitation=' + uni.getStorageSync('invitationCode') + '&qdCode=' + this.qdCode;
|
||||
console.log(urls);
|
||||
posterData.img = item.titleImg
|
||||
posterData.show = true
|
||||
// #ifdef H5
|
||||
refPoster.value.make({
|
||||
qrcode: urls,
|
||||
title: props.info.title,
|
||||
bigImg: item.titleImg,
|
||||
tips: '长按或扫描识别二维码观看'
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #ifndef H5
|
||||
uni.setClipboardData({
|
||||
data: urls,
|
||||
success() {
|
||||
uni.showToast({
|
||||
title: '邀请链接已复制到剪贴板',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
|
||||
}
|
||||
|
||||
function posterHide() {
|
||||
@@ -610,7 +633,30 @@
|
||||
const nowDanjiPrice = computed(() => {
|
||||
return videoList.value[current.value].price
|
||||
})
|
||||
|
||||
const rightStyle=computed(()=>{
|
||||
// #ifdef H5
|
||||
return {
|
||||
transform: `translateX(${!control.showControls?'0':60}px)`
|
||||
}
|
||||
// #endif
|
||||
// #ifdef APP
|
||||
return {
|
||||
transform: `translateX(${control.showControls?'0':60}px)`
|
||||
}
|
||||
// #endif
|
||||
})
|
||||
const infoStyle=computed(()=>{
|
||||
// #ifdef H5
|
||||
return {
|
||||
transform: `translateX(${!control.showControls?0:'-110%'})`
|
||||
}
|
||||
// #endif
|
||||
// #ifdef APP
|
||||
return {
|
||||
transform: `translateX(${control.showControls?0:'-110%'})`
|
||||
}
|
||||
// #endif
|
||||
})
|
||||
function loadmore() {
|
||||
console.log('loadmore');
|
||||
}
|
||||
@@ -810,6 +856,13 @@
|
||||
height: 56rpx;
|
||||
}
|
||||
|
||||
.qrcode {
|
||||
position: fixed;
|
||||
top: -9999px;
|
||||
left: -9999px;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.speed-list {
|
||||
align-items: center;
|
||||
background-color: #eeeeef;
|
||||
|
||||
Reference in New Issue
Block a user