bug修复

This commit is contained in:
gaoyuanwei 2022-07-06 13:35:02 +08:00
parent 2bbfac3363
commit 89a73222e6
2 changed files with 255 additions and 247 deletions

View File

@ -8,12 +8,7 @@
<template> <template>
<div class="application-navigation" v-if="navList.length > 0"> <div class="application-navigation" v-if="navList.length > 0">
<template v-for="nav in navList" :key="nav.key"> <template v-for="nav in navList" :key="nav.key">
<div <div class="nav" :class="{ select: nav.key == select }" v-if="nav.show" @click="selectNav(nav.key)">
class="nav"
:class="{ select: nav.key == select }"
v-if="nav.show"
@click="selectNav(nav.key)"
>
{{ nav.name }} {{ nav.name }}
<span class="line"></span> <span class="line"></span>
</div> </div>
@ -21,177 +16,179 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref, defineProps, watch } from 'vue' import { ref, defineProps, watch } from 'vue'
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { queryPartAppByKeyId } from '@/api/home' import { queryPartAppByKeyId } from '@/api/home'
// //
const router = useRouter() const router = useRouter()
const keyId = router.currentRoute.value.query.id const keyId = router.currentRoute.value.query.id
const navList = ref([ const navList = ref([
{ {
name: '应用展示', name: '应用展示',
key: 'application-presentation', key: 'application-presentation',
}, },
{ {
name: '功能介绍', name: '功能介绍',
key: 'function-introduction', key: 'function-introduction',
}, },
{ {
name: '使用能力', name: '使用能力',
key: 'ability-to-use', key: 'ability-to-use',
}, },
{ {
name: '部署与安全', name: '部署与安全',
key: 'deployment-and-security', key: 'deployment-and-security',
}, },
{ {
name: '归属部门与服务商', name: '归属部门与服务商',
key: 'department-and-service-provider', key: 'department-and-service-provider',
}, },
{ {
name: '常见问题', name: '常见问题',
key: 'common-problem', key: 'common-problem',
}, },
]) ])
const props = defineProps({ const props = defineProps({
selectNow: { type: String, default: '' }, selectNow: { type: String, default: '' },
dataList: { type: Object, default: null }, dataList: { type: Object, default: null },
associatedComponents: { type: Array, default: null }, associatedComponents: { type: Array, default: null },
})
const select = ref('application-associated-ability')
const list = ref([])
// id
if (keyId) {
let params = {
keyId: keyId,
type: '组件服务',
}
queryPartAppByKeyId(params).then((res) => {
console.log('ressssssss', res)
if (res.data.data.length != 0) {
//
navList.value.unshift({
name: '关联组件',
key: 'application-associated-ability',
show: true,
})
list.value.unshift('关联组件')
}
}) })
const select = ref('application-associated-ability') }
const list = ref([]) const selectNav = (key) => {
// id select.value = key
if (keyId) { mybus.emit('flyToView', select.value)
let params = { }
keyId: keyId, if (props.dataList.infoList) {
type: '组件服务', list.value = []
props.dataList.infoList.map((item) => {
if (
item.attrType === '功能介绍' ||
item.attrType === '常见问题' ||
item.attrType === '使用能力' ||
item.attrType === '关联组件'
) {
list.value.push(item.attrType)
} else if (item.attrType === '应用展示视频') {
list.value.push('应用展示')
} }
queryPartAppByKeyId(params).then((res) => { })
console.log('ressssssss', res) list.value.unshift('关联组件')
if (res.data.data.length != 0) { list.value.push('部署与安全')
// list.value.push('归属部门与服务商')
navList.value.unshift({ navList.value.forEach((item) => {
name: '关联组件', console.log(item)
key: 'application-associated-ability', if (list.value.indexOf(item.name) > -1) {
show: true, item.show = true
})
list.value.unshift('关联组件')
}
})
}
const selectNav = (key) => {
select.value = key
mybus.emit('flyToView', select.value)
}
if (props.dataList.infoList) {
list.value = []
props.dataList.infoList.map((item) => {
if (
item.attrType === '算法优势' ||
item.attrType === '常见问题' ||
item.attrType === '使用能力' ||
item.attrType === '关联组件'
) {
list.value.push(item.attrType)
} else if (item.attrType === '应用展示视频') {
list.value.push('应用展示')
}
})
list.value.unshift('关联组件')
navList.value.forEach((item) => {
console.log(item)
if (list.value.indexOf(item.name) > -1) {
item.show = true
}
})
if (list.value.length > 0) {
if (navList.value.filter((item) => item.name === list.value[0])[0]) {
select.value = navList.value.filter(
(item) => (item.name === '关联组件') | (item.name === list.value[0])
)[0].key
}
} }
console.log('11111111111111111111111111', list.value, navList.value) })
} if (list.value.length > 0) {
watch( if (navList.value.filter((item) => item.name === list.value[0])[0]) {
() => props.selectNow, select.value = navList.value.filter(
(newValue) => { (item) => (item.name === '关联组件') | (item.name === list.value[0])
select.value = newValue )[0].key
} }
) }
watch( console.log('11111111111111111111111111', list.value, navList.value)
() => props.dataList, }
(val) => { watch(
if (val) { () => props.selectNow,
list.value = [] (newValue) => {
val.infoList.map((item) => { select.value = newValue
if ( }
item.attrType === '功能介绍' || )
item.attrType === '常见问题' || watch(
item.attrType === '使用能力' || () => props.dataList,
item.attrType === '关联组件' (val) => {
) { if (val) {
list.value.push(item.attrType) list.value = []
} else if (item.attrType === '应用展示视频') { val.infoList.map((item) => {
list.value.push('应用展示') if (
} item.attrType === '功能介绍' ||
}) item.attrType === '常见问题' ||
list.value.unshift('关联组件') item.attrType === '使用能力' ||
list.value.push('部署与安全') item.attrType === '关联组件'
list.value.push('归属部门与服务商') ) {
navList.value.forEach((item) => { list.value.push(item.attrType)
console.log(item) } else if (item.attrType === '应用展示视频') {
if (list.value.indexOf(item.name) > -1) { list.value.push('应用展示')
item.show = true }
} })
}) list.value.unshift('关联组件')
if (list.value.length > 0) { list.value.push('部署与安全')
if (navList.value.filter((item) => item.name === list.value[0])[0]) { list.value.push('归属部门与服务商')
select.value = navList.value.filter( navList.value.forEach((item) => {
(item) => console.log(item)
(item.name === '关联组件') | (item.name === list.value[0]) if (list.value.indexOf(item.name) > -1) {
)[0].key item.show = true
} }
})
if (list.value.length > 0) {
if (navList.value.filter((item) => item.name === list.value[0])[0]) {
select.value = navList.value.filter(
(item) =>
(item.name === '关联组件') | (item.name === list.value[0])
)[0].key
} }
console.log('11111111111111111111111111', list.value, navList.value)
} }
console.log('11111111111111111111111111', list.value, navList.value)
} }
) }
)
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.application-navigation { .application-navigation {
width: 19.12rem; width: 19.12rem;
height: 0.84rem; height: 0.84rem;
line-height: 0.8rem; line-height: 0.8rem;
display: flex;
justify-content: space-around;
font-size: 0.24rem;
color: #666;
background: #fff;
padding: 0 3rem;
box-shadow: 0rem 0.05rem 0.1rem #f2f3fb;
position: relative;
.nav {
cursor: pointer;
display: flex; display: flex;
justify-content: space-around; flex-direction: column;
font-size: 0.24rem; justify-content: space-between;
color: #666; align-items: center;
background: #fff;
padding: 0 3rem;
box-shadow: 0rem 0.05rem 0.1rem #f2f3fb;
position: relative;
.nav { .line {
cursor: pointer; width: 0.4rem;
display: flex; height: 0.04rem;
flex-direction: column;
justify-content: space-between;
align-items: center;
.line {
width: 0.4rem;
height: 0.04rem;
}
}
.select {
color: #526aff;
.line {
background: #526aff;
}
} }
} }
.select {
color: #526aff;
.line {
background: #526aff;
}
}
}
</style> </style>

View File

@ -8,15 +8,10 @@
<template> <template>
<div class="application-presentation" v-if="flag"> <div class="application-presentation" v-if="flag">
<detals-title title="应用展示" type="IMAGE&VIDEO"></detals-title> <detals-title title="应用展示" type="IMAGE&VIDEO"></detals-title>
<div class="main"> <div class="main" :style="`${img}background-position:center;background-size:cover;`">
<div class="play" @click="showModal"></div> <div class="play" @click="showModal"></div>
</div> </div>
<a-modal <a-modal v-model:visible="visible" title="视频预览" :width="750" destroyOnClose>
v-model:visible="visible"
title="视频预览"
:width="750"
destroyOnClose
>
<template #footer></template> <template #footer></template>
<div style="width: 100%; display: flex; justify-content: center"> <div style="width: 100%; display: flex; justify-content: center">
<div style="width: 100%; height: 100%"> <div style="width: 100%; height: 100%">
@ -27,90 +22,106 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref, reactive, defineProps, watch } from 'vue' import { ref, reactive, defineProps, watch } from 'vue'
import DetalsTitle from '@/views/detailsAll/components/DetalsTitle.vue' import DetalsTitle from '@/views/detailsAll/components/DetalsTitle.vue'
const visible = ref(false) const visible = ref(false)
const options = reactive({ const options = reactive({
width: '7.00rem', // width: '7.00rem', //
height: '4.00rem', // height: '4.00rem', //
color: '#409eff', // color: '#409eff', //
title: '', // title: '', //
src: '', // src: '', //
muted: false, // muted: false, //
webFullScreen: false, webFullScreen: false,
speedRate: ['0.75', '1.0', '1.25', '1.5', '2.0'], // speedRate: ['0.75', '1.0', '1.25', '1.5', '2.0'], //
autoPlay: true, // autoPlay: true, //
loop: false, // loop: false, //
mirror: false, // mirror: false, //
ligthOff: false, // ligthOff: false, //
volume: 0.3, // volume: 0.3, //
control: true, // control: true, //
controlBtns: [ controlBtns: [
'audioTrack', 'audioTrack',
'quality', 'quality',
'speedRate', 'speedRate',
'volume', 'volume',
'setting', 'setting',
'pip', 'pip',
'pageFullScreen', 'pageFullScreen',
'fullScreen', 'fullScreen',
], //, ], //,
}) })
const showModal = () => { const showModal = () => {
visible.value = true visible.value = true
} }
const props = defineProps({ const props = defineProps({
dataList: { type: Object, default: null }, dataList: { type: Object, default: null },
}) })
const flag = ref(true) const flag = ref(true)
console.log('111111111111111111111,', props.dataList) const img = ref({})
if (props.dataList.infoList) { console.log('111111111111111111111,', props.dataList)
let obj = props.dataList.infoList.filter( if (props.dataList.infoList) {
(item) => item.attrType === '应用展示视频' let obj = props.dataList.infoList.filter(
(item) => item.attrType === '应用展示视频'
)[0]
console.log('视频==============>', obj)
if (!obj) {
flag.value = false
} else {
let imgindex = props.dataList.infoList.filter(
(item) => item.attrType === '应用图片'
)[0] )[0]
console.log('视频==============>', obj) options.src = obj.attrValue
if (!obj) { if (imgindex) {
flag.value = false img.value = 'background:' + 'url(' + imgindex.attrValue + ') no-repeat;'
} else {
options.src = obj.attrValue
} }
} }
watch( }
() => props.dataList, watch(
(val) => { () => props.dataList,
if (val) { (val) => {
let obj = val.infoList.filter( if (val) {
(item) => item.attrType === '应用展示视频' let obj = val.infoList.filter(
(item) => item.attrType === '应用展示视频'
)[0]
console.log('视频==============>', obj)
if (!obj) {
flag.value = false
} else {
let imgindex = props.dataList.infoList.filter(
(item) => item.attrType === '应用图片'
)[0] )[0]
console.log('视频==============>', obj) options.src = obj.attrValue
if (!obj) { if (imgindex) {
flag.value = false img.value =
} else { 'background:' + 'url(' + imgindex.attrValue + ') no-repeat;'
options.src = obj.attrValue
} }
} }
} }
) }
)
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.application-presentation { .application-presentation {
padding: 0.8rem 3rem 0; padding: 0.8rem 3rem 0;
.main {
height: 3.4rem; .main {
border-radius: 0.1rem; height: 3.4rem;
background: url('~@/assets/detailsAll/sf_video_bg.png') no-repeat; border-radius: 0.1rem;
background: url('~@/assets/detailsAll/sf_video_bg.png') no-repeat;
background-size: 100%;
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%; background-size: 100%;
margin-top: 0.4rem; cursor: pointer;
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;
}
} }
} }
}
</style> </style>