fix:商品详情轮播图添加视频

pull/8/head
kele 2023-03-17 15:11:04 +08:00
parent 5813f98ab1
commit e63fdf3dfc
3 changed files with 15 additions and 10 deletions

View File

@ -1,11 +1,11 @@
<!-- 订单详情 -->
<!-- -->
<template>
<su-video
class="sss"
:uid="guid()"
:src="sheep.$url.cdn(data.videoUrl)"
:poster="sheep.$url.cdn(data.src)"
:height="styles.height"
:height="styles.height * 2"
></su-video>
</template>

View File

@ -32,11 +32,12 @@
<su-video
v-else
:ref="(el) => (refs.videoRef[`video_${index}`] = el)"
:poster="item.poster"
:src="item.src"
:poster="sheep.$url.cdn(item.poster)"
:src="sheep.$url.cdn(item.src)"
:index="index"
:moveX="state.moveX"
:initialTime="item.currentTime || 0"
:height="seizeHeight"
@videoTimeupdate="videoTimeupdate"
></su-video>
</view>
@ -110,7 +111,7 @@
},
autoplay: {
type: Boolean,
default: true,
default: false,
},
interval: {
type: Number,
@ -186,7 +187,6 @@
if (item.type === 'video') {
state.videoPlaySataus = true;
} else {
console.log(item,'item');
sheep.$router.go(item.url);
onPreview();
}
@ -194,11 +194,16 @@
const onPreview = () => {
if (!props.isPreview) return;
props.list.splice(
props.list.findIndex((item) => item.type === 'video'),
1,
);
let previewImage = props.list;
uni.previewImage({
urls:
props.list.length < 1
previewImage.length < 1
? [props.src]
: props.list.reduce((pre, cur) => {
: previewImage.reduce((pre, cur) => {
pre.push(cur.src);
return pre;
}, []),

View File

@ -3,7 +3,7 @@
<video
:id="`sVideo${uid}`"
class="radius"
:style="[{ height: height + 'px' }]"
:style="[{ height: height + 'rpx' }]"
:src="src"
controls
object-fit="contain"
@ -80,7 +80,7 @@
// s
initialTime: {
type: Number,
default: 0,
default: 1,
},
src: {
type: String,