2022-06-20 18:38:56 +08:00
|
|
|
<!--
|
|
|
|
* @Author: hisense.liangjunhua
|
|
|
|
* @Date: 2022-06-08 15:25:33
|
|
|
|
* @LastEditors: hisense.liangjunhua
|
|
|
|
* @LastEditTime: 2022-06-14 11:30:52
|
2022-06-21 11:42:06 +08:00
|
|
|
* @Description: 应用展示 视频播放
|
2022-06-20 18:38:56 +08:00
|
|
|
-->
|
|
|
|
<template>
|
2022-06-21 11:42:06 +08:00
|
|
|
<div class="application-presentation" v-if="flag">
|
2022-06-20 18:38:56 +08:00
|
|
|
<detals-title title="组件展示" type="IMAGE&VIDEO"></detals-title>
|
2022-07-18 16:39:11 +08:00
|
|
|
<div class="box">
|
|
|
|
<div class="left" @click="chagneShow()"></div>
|
|
|
|
<div
|
|
|
|
class="main"
|
|
|
|
:style="`${img}background-position:center;background-size:cover;`"
|
|
|
|
v-if="
|
|
|
|
showArr.length > 0 && showArr[showFlag].attrType == '组件视频介绍'
|
|
|
|
"
|
|
|
|
>
|
|
|
|
<div class="play" @click="showModal"></div>
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
class="main2"
|
|
|
|
v-if="showArr.length > 0 && showArr[showFlag].attrType == '组件图片'"
|
|
|
|
>
|
|
|
|
<a-image
|
|
|
|
:width="700"
|
|
|
|
:height="340"
|
|
|
|
:src="showArr[showFlag].attrValue"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="right" @click="chagneShow()"></div>
|
2022-06-20 18:38:56 +08:00
|
|
|
</div>
|
|
|
|
<a-modal
|
|
|
|
v-model:visible="visible"
|
|
|
|
title="视频预览"
|
|
|
|
:width="750"
|
|
|
|
destroyOnClose
|
|
|
|
>
|
|
|
|
<template #footer></template>
|
|
|
|
<div style="width: 100%; display: flex; justify-content: center">
|
|
|
|
<div style="width: 100%; height: 100%">
|
|
|
|
<vue3VideoPlay v-bind="options" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</a-modal>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script setup>
|
|
|
|
import { ref, reactive, defineProps, watch } from 'vue'
|
|
|
|
import DetalsTitle from '@/views/detailsAll/components/DetalsTitle.vue'
|
|
|
|
const visible = ref(false)
|
|
|
|
const options = reactive({
|
|
|
|
width: '7.00rem', //播放器宽度
|
|
|
|
height: '4.00rem', //播放器高度
|
|
|
|
color: '#409eff', //主题色
|
|
|
|
title: '', //视频名称
|
|
|
|
src: '', //视频源
|
|
|
|
muted: false, //静音
|
|
|
|
webFullScreen: false,
|
|
|
|
speedRate: ['0.75', '1.0', '1.25', '1.5', '2.0'], //播放倍速
|
|
|
|
autoPlay: true, //自动播放
|
|
|
|
loop: false, //循环播放
|
|
|
|
mirror: false, //镜像画面
|
|
|
|
ligthOff: false, //关灯模式
|
|
|
|
volume: 0.3, //默认音量大小
|
|
|
|
control: true, //是否显示控制
|
|
|
|
controlBtns: [
|
|
|
|
'audioTrack',
|
|
|
|
'quality',
|
|
|
|
'speedRate',
|
|
|
|
'volume',
|
|
|
|
'setting',
|
|
|
|
'pip',
|
|
|
|
'pageFullScreen',
|
|
|
|
'fullScreen',
|
|
|
|
], //显示所有按钮,
|
|
|
|
})
|
2022-07-18 16:39:11 +08:00
|
|
|
const showFlag = ref(0)
|
|
|
|
const showArr = ref([])
|
|
|
|
const chagneShow = () => {
|
|
|
|
if (showArr.value.length > 1) {
|
|
|
|
showFlag.value = showFlag.value == 0 ? 1 : 0
|
|
|
|
}
|
|
|
|
}
|
2022-06-20 18:38:56 +08:00
|
|
|
const showModal = () => {
|
|
|
|
visible.value = true
|
|
|
|
}
|
|
|
|
const props = defineProps({
|
|
|
|
dataList: { type: Object, default: null },
|
|
|
|
})
|
|
|
|
const flag = ref(true)
|
2022-06-21 11:42:06 +08:00
|
|
|
const img = ref({})
|
2022-06-20 18:38:56 +08:00
|
|
|
console.log('111111111111111111111,', props.dataList)
|
|
|
|
if (props.dataList.infoList) {
|
2022-07-18 16:39:11 +08:00
|
|
|
showArr.value = props.dataList.infoList.filter(
|
|
|
|
(item) => item.attrType === '组件视频介绍' || item.attrType === '组件图片'
|
|
|
|
)
|
2022-06-20 18:38:56 +08:00
|
|
|
let obj = props.dataList.infoList.filter(
|
|
|
|
(item) => item.attrType === '组件视频介绍'
|
|
|
|
)[0]
|
2022-07-18 16:39:11 +08:00
|
|
|
console.log('视频==============>', showArr.value)
|
|
|
|
if (showArr.value.length == 0) {
|
2022-06-20 18:38:56 +08:00
|
|
|
flag.value = false
|
|
|
|
} else {
|
2022-07-18 16:39:11 +08:00
|
|
|
if (obj) {
|
|
|
|
options.src = obj.attrValue
|
2022-06-21 11:42:06 +08:00
|
|
|
}
|
2022-06-20 18:38:56 +08:00
|
|
|
}
|
2022-07-18 16:39:11 +08:00
|
|
|
// if (!obj) {
|
|
|
|
// flag.value = false
|
|
|
|
// } else {
|
|
|
|
// let imgindex = props.dataList.infoList.filter(
|
|
|
|
// (item) => item.attrType === '组件图片'
|
|
|
|
// )[0]
|
|
|
|
// options.src = obj.attrValue
|
|
|
|
// if (imgindex) {
|
|
|
|
// img.value = 'background:' + 'url(' + imgindex.attrValue + ') no-repeat;'
|
|
|
|
// }
|
|
|
|
// }
|
2022-06-20 18:38:56 +08:00
|
|
|
}
|
|
|
|
watch(
|
|
|
|
() => props.dataList,
|
|
|
|
(val) => {
|
|
|
|
if (val) {
|
2022-07-18 16:39:11 +08:00
|
|
|
showArr.value = props.dataList.infoList.filter(
|
|
|
|
(item) =>
|
|
|
|
item.attrType === '组件视频介绍' || item.attrType === '组件图片'
|
|
|
|
)
|
2022-06-20 18:38:56 +08:00
|
|
|
let obj = val.infoList.filter(
|
|
|
|
(item) => item.attrType === '组件视频介绍'
|
|
|
|
)[0]
|
2022-07-18 16:39:11 +08:00
|
|
|
console.log('视频==============>', showArr.value)
|
|
|
|
if (showArr.value.length == 0) {
|
2022-06-20 18:38:56 +08:00
|
|
|
flag.value = false
|
|
|
|
} else {
|
2022-07-18 16:39:11 +08:00
|
|
|
if (obj) {
|
|
|
|
options.src = obj.attrValue
|
2022-06-21 11:42:06 +08:00
|
|
|
}
|
2022-06-20 18:38:56 +08:00
|
|
|
}
|
2022-07-18 16:39:11 +08:00
|
|
|
// if (!obj) {
|
|
|
|
// flag.value = false
|
|
|
|
// } else {
|
|
|
|
// let imgindex = props.dataList.infoList.filter(
|
|
|
|
// (item) => item.attrType === '组件图片'
|
|
|
|
// )[0]
|
|
|
|
// options.src = obj.attrValue
|
|
|
|
// if (imgindex) {
|
|
|
|
// img.value =
|
|
|
|
// 'background:' + 'url(' + imgindex.attrValue + ') no-repeat;'
|
|
|
|
// }
|
|
|
|
// }
|
2022-06-20 18:38:56 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
2022-06-21 11:42:06 +08:00
|
|
|
.application-presentation {
|
|
|
|
padding: 0.8rem 3rem 0;
|
2022-06-20 18:38:56 +08:00
|
|
|
.main {
|
2022-07-18 16:39:11 +08:00
|
|
|
width: 13.14rem;
|
2022-06-20 18:38:56 +08:00
|
|
|
height: 3.4rem;
|
|
|
|
border-radius: 0.1rem;
|
2022-06-21 11:42:06 +08:00
|
|
|
background: url('~@/assets/detailsAll/sf_video_bg.png') no-repeat;
|
|
|
|
background-size: 100%;
|
2022-06-20 18:38:56 +08:00
|
|
|
margin-top: 0.4rem;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
.play {
|
|
|
|
width: 0.96rem;
|
|
|
|
height: 0.96rem;
|
|
|
|
background: url('~@/assets/detailsAll/sf_video_play.png') no-repeat;
|
|
|
|
background-size: 100%;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
}
|
2022-07-18 16:39:11 +08:00
|
|
|
.main2 {
|
|
|
|
width: 13.14rem;
|
|
|
|
height: 3.4rem;
|
|
|
|
border-radius: 0.1rem;
|
|
|
|
background-size: 100%;
|
|
|
|
margin-top: 0.4rem;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.box {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-around;
|
|
|
|
align-items: center;
|
|
|
|
margin-bottom: 0.8rem;
|
|
|
|
.left {
|
|
|
|
width: 0.37rem;
|
|
|
|
height: 0.6rem;
|
|
|
|
cursor: pointer;
|
|
|
|
margin-right: 0.2rem;
|
|
|
|
background: url('~@/assets/detailsAll/business/business_previous.png')
|
|
|
|
no-repeat;
|
|
|
|
background-size: 100%;
|
|
|
|
background-position: center;
|
|
|
|
}
|
|
|
|
.right {
|
|
|
|
width: 0.37rem;
|
|
|
|
height: 0.6rem;
|
|
|
|
cursor: pointer;
|
|
|
|
margin-left: 0.2rem;
|
|
|
|
background: url('~@/assets/detailsAll/business/business_next.png')
|
|
|
|
no-repeat;
|
|
|
|
background-size: 100%;
|
|
|
|
background-position: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.ant-image-img) {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
object-fit: contain;
|
2022-06-20 18:38:56 +08:00
|
|
|
}
|
|
|
|
</style>
|