bug+bug+bug

This commit is contained in:
gaoyuanwei 2022-07-18 13:56:27 +08:00
parent aa84a66a0b
commit a168e10105
7 changed files with 926 additions and 756 deletions

View File

@ -13,7 +13,7 @@
<div class="assign-case-detail-page-header-son">
<div
class="assign-case-detail-page-header-son-left"
:style="`background:url(${dataFrom.note1})`"
:style="`background-image:url(${dataFrom.note1})`"
></div>
<div class="assign-case-detail-page-header-son-right">
<div class="assign-case-detail-page-header-son-right-title">

View File

@ -17,7 +17,14 @@
</a-layout-sider>
</div>
<div class="right">
<div class="title">数据需求</div>
<div
class="title"
v-if="
!(whoShow1 && whoShow1.itShowXiHaiAn && detailsType === '应用资源')
"
>
数据需求
</div>
<a-list
class="demo-loadmore-list"
:loading="initLoading"
@ -87,6 +94,7 @@
const pageSize = ref(8)
const total = ref()
const showKey = ref(0)
const whoShow1 = ref(whoShow)
const menuList = [
{
key: '1',
@ -179,93 +187,80 @@
})
</script>
<style lang="less" scoped>
.main-cont {
margin-top: 64px;
width: 100%;
height: calc(100%-90px);
background: url('~@/assets/demandCenter/bj.png') no-repeat;
background-position-x: center;
.main-cont {
margin-top: 64px;
width: 100%;
height: calc(100%-90px);
background: url('~@/assets/demandCenter/bj.png') no-repeat;
background-position-x: center;
display: flex;
justify-content: center;
.main {
width: 1200px;
height: 100%;
padding-top: 30px;
display: flex;
justify-content: center;
.main {
width: 1200px;
height: 100%;
padding-top: 30px;
display: flex;
.left {
width: 15%;
.ant-card {
background: transparent;
border: none;
.ant-card-grid {
height: 50px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 10px;
border: 1px solid #fff;
background-color: #fff;
cursor: pointer;
}
}
.ant-layout-sider {
background-color: transparent;
:deep(.ant-menu-item) {
height: 100px;
font-size: 18px;
color: #333333;
border: 1px solid #dee8f5;
margin: 0;
&::after {
margin-top: 30px;
height: 40px;
width: 4px;
background-color: #0087ff;
}
}
:deep(.ant-menu-item-selected) {
background-color: #e9f4ff;
}
.left {
width: 15%;
.ant-card {
background: transparent;
border: none;
.ant-card-grid {
height: 50px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 10px;
border: 1px solid #fff;
background-color: #fff;
cursor: pointer;
}
}
.right {
flex: 1;
margin-left: 30px;
height: 850px;
background-color: #ffffff;
box-shadow: 10px 8px 10px 3px #9dc6ea;
padding: 20px;
.title {
font-size: 22px;
font-weight: 500;
color: #1492ff;
}
.ant-list {
height: 730px;
overflow-y: scroll;
:deep(.ant-list-item-meta-title) {
display: flex;
justify-content: space-between;
.name {
width: 800px;
font-size: 18px;
color: #1492ff;
display: -webkit-box;
/*设置为弹性盒子*/
-webkit-line-clamp: 1;
/*最多显示2行*/
overflow: hidden;
/*超出隐藏*/
text-overflow: ellipsis;
/*超出显示为省略号*/
-webkit-box-orient: vertical;
word-break: break-all;
}
.ant-layout-sider {
background-color: transparent;
:deep(.ant-menu-item) {
height: 100px;
font-size: 18px;
color: #333333;
border: 1px solid #dee8f5;
margin: 0;
&::after {
margin-top: 30px;
height: 40px;
width: 4px;
background-color: #0087ff;
}
:deep(.ant-list-item-meta-description) {
}
:deep(.ant-menu-item-selected) {
background-color: #e9f4ff;
}
}
}
.right {
flex: 1;
margin-left: 30px;
height: 850px;
background-color: #ffffff;
box-shadow: 10px 8px 10px 3px #9dc6ea;
padding: 20px;
.title {
font-size: 22px;
font-weight: 500;
color: #1492ff;
}
.ant-list {
height: 730px;
overflow-y: scroll;
:deep(.ant-list-item-meta-title) {
display: flex;
justify-content: space-between;
.name {
width: 800px;
font-size: 18px;
color: #1492ff;
display: -webkit-box;
/*设置为弹性盒子*/
-webkit-line-clamp: 2;
-webkit-line-clamp: 1;
/*最多显示2行*/
overflow: hidden;
/*超出隐藏*/
@ -275,20 +270,33 @@
word-break: break-all;
}
}
//
.ant-list::-webkit-scrollbar {
display: none;
}
.ant-pagination {
margin-top: 10px;
:deep(.ant-list-item-meta-description) {
display: -webkit-box;
/*设置为弹性盒子*/
-webkit-line-clamp: 2;
/*最多显示2行*/
overflow: hidden;
/*超出隐藏*/
text-overflow: ellipsis;
/*超出显示为省略号*/
-webkit-box-orient: vertical;
word-break: break-all;
}
}
//
.ant-list::-webkit-scrollbar {
display: none;
}
.ant-pagination {
margin-top: 10px;
}
}
}
}
</style>
<style>
body,
html {
height: unset;
}
body,
html {
height: unset;
}
</style>

View File

@ -10,159 +10,195 @@
<!-- 头部基本信息 -->
<algorithm-top-details :dataList="dataList.data"></algorithm-top-details>
<!-- 导航 -->
<algorithm-navigation :dataList="dataList.data" :class="{ fixed: scrollTop >= 600 }" :selectNow="selectNow">
</algorithm-navigation>
<algorithm-navigation
:dataList="dataList.data"
:class="{ fixed: scrollTop >= 600 }"
:selectNow="selectNow"
></algorithm-navigation>
<!-- 关联能力 -->
<algorithm-associated-ability v-if="!loading" :associatedComponents="associatedComponents"
id="algorithm-associated-ability" class="scrollBox"></algorithm-associated-ability>
<algorithm-associated-ability
v-if="!loading"
:associatedComponents="associatedComponents"
id="algorithm-associated-ability"
class="scrollBox"
></algorithm-associated-ability>
<!-- 算法展示 视频 -->
<algorithm-display :dataList="dataList.data" id="algorithm-display" class="scrollBox"></algorithm-display>
<algorithm-display
:dataList="dataList.data"
id="algorithm-display"
class="scrollBox"
></algorithm-display>
<!-- 算法优势 -->
<algorithm-advantage :dataList="dataList.data" id="algorithm-advantage" class="scrollBox"></algorithm-advantage>
<algorithm-advantage
:dataList="dataList.data"
id="algorithm-advantage"
class="scrollBox"
></algorithm-advantage>
<!-- 应用场景和应用案例 -->
<!-- <application-scenarios-and-case
id="application-scenarios-and-case"
class="scrollBox"
></application-scenarios-and-case> -->
<algorithm-application-scenarios :dataList="dataList.data" id="application-scenarios" class="scrollBox">
</algorithm-application-scenarios>
<algorithm-application-case :dataList="dataList.data" id="application-case" class="scrollBox">
</algorithm-application-case>
<algorithm-application-scenarios
:dataList="dataList.data"
id="application-scenarios"
class="scrollBox"
></algorithm-application-scenarios>
<algorithm-application-case
:dataList="dataList.data"
id="application-case"
class="scrollBox"
></algorithm-application-case>
<!-- 算法试用 -->
<algorithm-on-trial :dataList="dataList.data" id="algorithm-on-trial" class="scrollBox"></algorithm-on-trial>
<algorithm-on-trial
:dataList="dataList.data"
id="algorithm-on-trial"
class="scrollBox"
></algorithm-on-trial>
<!-- 计费标准 -->
<algorithm-charging-standard :dataList="dataList.data" id="charging-standard" class="scrollBox">
</algorithm-charging-standard>
<algorithm-charging-standard
:dataList="dataList.data"
id="charging-standard"
class="scrollBox"
></algorithm-charging-standard>
<!-- 使用方式 -->
<algorithm-usage-mode :dataList="dataList.data" id="usage-mode" class="scrollBox"></algorithm-usage-mode>
<algorithm-usage-mode
:dataList="dataList.data"
id="usage-mode"
class="scrollBox"
></algorithm-usage-mode>
<!-- 常见问题-->
<algorithm-common-problem :dataList="dataList.data" id="common-problem" class="scrollBox">
</algorithm-common-problem>
<algorithm-common-problem
:dataList="dataList.data"
id="common-problem"
class="scrollBox"
></algorithm-common-problem>
</div>
</template>
<script setup>
import AlgorithmTopDetails from '@/views/detailsAll/components/Algorithm/AlgorithmTopDetails.vue'
import AlgorithmAssociatedAbility from '@/views/detailsAll/components/Algorithm/AlgorithmAssociatedAbility.vue'
import AlgorithmNavigation from '@/views/detailsAll/components/Algorithm/AlgorithmNavigation.vue'
import AlgorithmDisplay from '@/views/detailsAll/components/Algorithm/AlgorithmDisplay.vue'
import AlgorithmAdvantage from '@/views/detailsAll/components/Algorithm/AlgorithmAdvantage.vue'
import AlgorithmOnTrial from '@/views/detailsAll/components/Algorithm/AlgorithmOnTrial.vue'
import AlgorithmApplicationScenarios from '@/views/detailsAll/components/Algorithm/AlgorithmApplicationScenarios'
import AlgorithmApplicationCase from '@/views/detailsAll/components/Algorithm/AlgorithmApplicationCase'
import AlgorithmUsageMode from '@/views/detailsAll/components/Algorithm/AlgorithmUsageMode' //使
import AlgorithmChargingStandard from '@/views/detailsAll/components/Algorithm/AlgorithmChargingStandard' //
import AlgorithmCommonProblem from '@/views/detailsAll/components/Algorithm/AlgorithmCommonProblem' //
import { ref, onMounted, onBeforeUnmount, reactive } from 'vue'
import { useRouter } from 'vue-router'
import {
updateVisits,
selectOne,
queryPartAppByKeyId2,
browsingInsert,
} from '@/api/home'
import mybus from '@/myplugins/mybus'
const router = useRouter()
const scrollTop = ref(0)
const domArr = ref([])
const loading = ref(true)
const selectNow = ref('')
const dataList = reactive({ data: {} })
const id = router.currentRoute.value.query.id
const obj = JSON.parse(window.sessionStorage.getItem('preview'))
const associatedComponents = ref([{ type: '应用资源', dataList: [] }])
document.documentElement.style.transition = 'all 0.3s ease'
document.documentElement.scrollTop = 0
document.body.style.transition = 'all 0.3s ease'
document.body.scrollTop = 0
mybus.on('flyToView', (id) => {
let top = document.querySelector('#' + id).offsetTop - 50
// console.log(top, document.querySelector('#' + id).offsetTop)
document.documentElement.scrollTop = top
document.body.scrollTop = top
})
onMounted(() => {
// console.clear()
window.addEventListener('scroll', () => {
domArr.value = document.querySelectorAll('.scrollBox')
scrollTop.value =
document.documentElement.scrollTop || document.body.scrollTop
for (let i = 0; i < domArr.value.length; i++) {
if (i === 0) {
if (scrollTop.value <= domArr.value[i + 1].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else if (i == domArr.value.length - 1) {
if (scrollTop.value >= domArr.value[i].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else {
if (
scrollTop.value >= domArr.value[i].offsetTop - 50 &&
scrollTop.value <= domArr.value[i + 1].offsetTop - 50
) {
selectNow.value = domArr.value[i].id
}
}
}
import AlgorithmTopDetails from '@/views/detailsAll/components/Algorithm/AlgorithmTopDetails.vue'
import AlgorithmAssociatedAbility from '@/views/detailsAll/components/Algorithm/AlgorithmAssociatedAbility.vue'
import AlgorithmNavigation from '@/views/detailsAll/components/Algorithm/AlgorithmNavigation.vue'
import AlgorithmDisplay from '@/views/detailsAll/components/Algorithm/AlgorithmDisplay.vue'
import AlgorithmAdvantage from '@/views/detailsAll/components/Algorithm/AlgorithmAdvantage.vue'
import AlgorithmOnTrial from '@/views/detailsAll/components/Algorithm/AlgorithmOnTrial.vue'
import AlgorithmApplicationScenarios from '@/views/detailsAll/components/Algorithm/AlgorithmApplicationScenarios'
import AlgorithmApplicationCase from '@/views/detailsAll/components/Algorithm/AlgorithmApplicationCase'
import AlgorithmUsageMode from '@/views/detailsAll/components/Algorithm/AlgorithmUsageMode' //使
import AlgorithmChargingStandard from '@/views/detailsAll/components/Algorithm/AlgorithmChargingStandard' //
import AlgorithmCommonProblem from '@/views/detailsAll/components/Algorithm/AlgorithmCommonProblem' //
import { ref, onMounted, onBeforeUnmount, reactive } from 'vue'
import { useRouter } from 'vue-router'
import {
updateVisits,
selectOne,
queryPartAppByKeyId2,
browsingInsert,
} from '@/api/home'
import mybus from '@/myplugins/mybus'
const router = useRouter()
const scrollTop = ref(0)
const domArr = ref([])
const loading = ref(true)
const selectNow = ref('')
const dataList = reactive({ data: {} })
const id = router.currentRoute.value.query.id
const obj = JSON.parse(window.sessionStorage.getItem('preview'))
const associatedComponents = ref([{ type: '应用资源', dataList: [] }])
document.documentElement.style.transition = 'all 0.3s ease'
document.documentElement.scrollTop = 0
document.body.style.transition = 'all 0.3s ease'
document.body.scrollTop = 0
mybus.on('flyToView', (id) => {
let top = document.querySelector('#' + id).offsetTop - 50
// console.log(top, document.querySelector('#' + id).offsetTop)
document.documentElement.scrollTop = top
document.body.scrollTop = top
})
onMounted(() => {
// console.clear()
window.addEventListener('scroll', () => {
domArr.value = document.querySelectorAll('.scrollBox')
scrollTop.value =
document.documentElement.scrollTop || document.body.scrollTop
for (let i = 0; i < domArr.value.length; i++) {
if (i === 0) {
if (scrollTop.value <= domArr.value[i + 1].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else if (i == domArr.value.length - 1) {
if (scrollTop.value >= domArr.value[i].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else {
if (
scrollTop.value >= domArr.value[i].offsetTop - 50 &&
scrollTop.value <= domArr.value[i + 1].offsetTop - 50
) {
selectNow.value = domArr.value[i].id
}
}
}
})
})
})
const init = (id) => {
console.log(id, '-------------------------------------------------')
if (id) {
selectOne(id).then((res) => {
// console.clear()
dataList.data = res.data.data
console.log('初始化详情页=========================>', dataList.data)
const arrList = ref([])
arrList.value = JSON.parse(window.sessionStorage.getItem('visits'))
if (arrList.value.indexOf(id) === -1) {
arrList.value.push(id)
updateVisits({
id: res.data.data.id,
visits: res.data.data.visits || '0',
const init = (id) => {
console.log(id, '-------------------------------------------------')
if (id) {
selectOne(id).then((res) => {
// console.clear()
dataList.data = res.data.data
console.log('初始化详情页=========================>', dataList.data)
const arrList = ref([])
arrList.value = JSON.parse(window.sessionStorage.getItem('visits'))
if (arrList.value.indexOf(id) === -1) {
arrList.value.push(id)
updateVisits({
id: res.data.data.id,
visits: res.data.data.visits || '0',
}).then(() => {
window.sessionStorage.setItem(
'visits',
JSON.stringify(arrList.value)
)
})
}
//
browsingInsert({
resourceId: res.data.data.id,
}).then(() => {
window.sessionStorage.setItem(
'visits',
JSON.stringify(arrList.value)
)
console.log('浏览记录+1')
})
}
//
browsingInsert({
resourceId: res.data.data.id,
}).then(() => {
console.log('浏览记录+1')
})
})
associatedComponents.value.map((item, index) => {
let queryPartAppByKeyIdParams = {
keyId: id,
}
queryPartAppByKeyId2(queryPartAppByKeyIdParams).then((res) => {
associatedComponents.value[index].dataList = res.data.data
loading.value = false
associatedComponents.value.map((item, index) => {
let queryPartAppByKeyIdParams = {
keyId: id,
}
queryPartAppByKeyId2(queryPartAppByKeyIdParams).then((res) => {
associatedComponents.value[index].dataList = res.data.data
loading.value = false
})
})
})
} else if (obj) {
dataList.data = obj
console.log('预览==============', obj)
} else if (obj) {
dataList.data = obj
console.log('预览==============', obj)
}
}
}
init(id)
onBeforeUnmount(() => {
mybus.off('flyToView')
})
init(id)
onBeforeUnmount(() => {
mybus.off('flyToView')
})
</script>
<style lang="less" scoped>
.fixed {
position: fixed;
z-index: 2000;
top: 0;
left: 0;
}
.fixed {
position: fixed;
z-index: 2000;
top: 0;
left: 50%;
margin-left: -9.56rem;
}
.fixed2>div:nth-of-type(3) {
margin-top: 0.84rem;
}
.fixed2 > div:nth-of-type(3) {
margin-top: 0.84rem;
}
</style>

View File

@ -8,172 +8,205 @@
<template>
<div class="application-details" :class="{ fixed2: scrollTop >= 600 }">
<!-- 头部基本信息 -->
<application-top-details :dataList="dataList.data"></application-top-details>
<application-top-details
:dataList="dataList.data"
></application-top-details>
<!-- 导航 -->
<application-navigation :dataList="dataList.data" :associatedComponents="associatedComponents"
:class="{ fixed: scrollTop >= 600 }" :selectNow="selectNow"></application-navigation>
<application-navigation
:dataList="dataList.data"
:associatedComponents="associatedComponents"
:class="{ fixed: scrollTop >= 600 }"
:selectNow="selectNow"
></application-navigation>
<!-- 关联能力 -->
<application-associated-ability v-if="!loading" :associatedComponents="associatedComponents"
id="application-associated-ability" class="scrollBox"></application-associated-ability>
<application-associated-ability
v-if="!loading"
:associatedComponents="associatedComponents"
id="application-associated-ability"
class="scrollBox"
></application-associated-ability>
<!-- 应用展示 视频 -->
<application-presentation :dataList="dataList.data" id="application-presentation" class="scrollBox">
</application-presentation>
<application-presentation
:dataList="dataList.data"
id="application-presentation"
class="scrollBox"
></application-presentation>
<!-- 关联组件 -->
<application-associated-components :dataList="dataList.data" id="application-associated-components"
class="scrollBox" v-if="false"></application-associated-components>
<application-associated-components
:dataList="dataList.data"
id="application-associated-components"
class="scrollBox"
v-if="false"
></application-associated-components>
<!-- 功能介绍-->
<application-function-intorduction :dataList="dataList.data" id="function-introduction" class="scrollBox">
</application-function-intorduction>
<application-function-intorduction
:dataList="dataList.data"
id="function-introduction"
class="scrollBox"
></application-function-intorduction>
<!-- 使用能力 -->
<application-ability-toise :dataList="dataList.data" id="ability-to-use" class="scrollBox">
</application-ability-toise>
<application-ability-toise
:dataList="dataList.data"
id="ability-to-use"
class="scrollBox"
></application-ability-toise>
<!-- 部署与安全-->
<application-deployment-and-security :dataList="dataList.data" id="deployment-and-security" class="scrollBox">
</application-deployment-and-security>
<application-deployment-and-security
:dataList="dataList.data"
id="deployment-and-security"
class="scrollBox"
></application-deployment-and-security>
<!-- 归属部门与服务商-->
<application-owning-department-and-service-provider :dataList="dataList.data" id="department-and-service-provider"
class="scrollBox"></application-owning-department-and-service-provider>
<application-owning-department-and-service-provider
:dataList="dataList.data"
id="department-and-service-provider"
class="scrollBox"
></application-owning-department-and-service-provider>
<!-- 常见问题-->
<application-common-problem :dataList="dataList.data" id="common-problem" class="scrollBox">
</application-common-problem>
<application-common-problem
:dataList="dataList.data"
id="common-problem"
class="scrollBox"
></application-common-problem>
</div>
</template>
<script setup>
import ApplicationAbilityToise from '@/views/detailsAll/components/Application/ApplicationAbilityToise.vue'
import ApplicationAssociatedComponents from '@/views/detailsAll/components/Application/ApplicationAssociatedComponents.vue'
import ApplicationAssociatedAbility from '@/views/detailsAll/components/Application/ApplicationAssociatedAbility.vue'
import ApplicationOwningDepartmentAndServiceProvider from '@/views/detailsAll/components/Application/ApplicationOwningDepartmentAndServiceProvider.vue'
import ApplicationFunctionIntorduction from '@/views/detailsAll/components/Application/ApplicationFunctionIntorduction.vue'
import ApplicationDeploymentAndSecurity from '@/views/detailsAll/components/Application/ApplicationDeploymentAndSecurity.vue'
import ApplicationTopDetails from '@/views/detailsAll/components/Application/ApplicationTopDetails.vue'
import ApplicationNavigation from '@/views/detailsAll/components/Application/ApplicationNavigation.vue'
import ApplicationPresentation from '@/views/detailsAll/components/Application/ApplicationPresentation.vue'
import ApplicationCommonProblem from '@/views/detailsAll/components/Application/ApplicationCommonProblem' //
import { ref, onMounted, onBeforeUnmount, reactive } from 'vue'
import { useRouter } from 'vue-router'
import {
updateVisits,
selectOne,
queryPartAppByKeyId,
browsingInsert,
} from '@/api/home'
import mybus from '@/myplugins/mybus'
const associatedComponents = ref([{ type: '组件服务', dataList: [] }])
let loading = ref(true)
const router = useRouter()
const scrollTop = ref(0)
const domArr = ref([])
const selectNow = ref('')
const dataList = reactive({ data: {} })
const id = router.currentRoute.value.query.id
const obj = JSON.parse(window.sessionStorage.getItem('preview'))
document.documentElement.style.transition = 'all 0.3s ease'
document.documentElement.scrollTop = 0
document.body.style.transition = 'all 0.3s ease'
document.body.scrollTop = 0
mybus.on('flyToView', (id) => {
let top = document.querySelector('#' + id).offsetTop - 50
// console.log(top, document.querySelector('#' + id).offsetTop-50)
document.documentElement.scrollTop = top
document.body.scrollTop = top
})
onMounted(() => {
// console.clear()
window.addEventListener('scroll', () => {
domArr.value = document.querySelectorAll('.scrollBox')
scrollTop.value =
document.documentElement.scrollTop || document.body.scrollTop
for (let i = 0; i < domArr.value.length; i++) {
if (i === 0) {
if (scrollTop.value <= domArr.value[i + 1].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else if (i == domArr.value.length - 1) {
if (scrollTop.value >= domArr.value[i].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else {
if (
scrollTop.value >= domArr.value[i].offsetTop - 50 &&
scrollTop.value <= domArr.value[i + 1].offsetTop - 50
) {
selectNow.value = domArr.value[i].id
}
}
}
import ApplicationAbilityToise from '@/views/detailsAll/components/Application/ApplicationAbilityToise.vue'
import ApplicationAssociatedComponents from '@/views/detailsAll/components/Application/ApplicationAssociatedComponents.vue'
import ApplicationAssociatedAbility from '@/views/detailsAll/components/Application/ApplicationAssociatedAbility.vue'
import ApplicationOwningDepartmentAndServiceProvider from '@/views/detailsAll/components/Application/ApplicationOwningDepartmentAndServiceProvider.vue'
import ApplicationFunctionIntorduction from '@/views/detailsAll/components/Application/ApplicationFunctionIntorduction.vue'
import ApplicationDeploymentAndSecurity from '@/views/detailsAll/components/Application/ApplicationDeploymentAndSecurity.vue'
import ApplicationTopDetails from '@/views/detailsAll/components/Application/ApplicationTopDetails.vue'
import ApplicationNavigation from '@/views/detailsAll/components/Application/ApplicationNavigation.vue'
import ApplicationPresentation from '@/views/detailsAll/components/Application/ApplicationPresentation.vue'
import ApplicationCommonProblem from '@/views/detailsAll/components/Application/ApplicationCommonProblem' //
import { ref, onMounted, onBeforeUnmount, reactive } from 'vue'
import { useRouter } from 'vue-router'
import {
updateVisits,
selectOne,
queryPartAppByKeyId,
browsingInsert,
} from '@/api/home'
import mybus from '@/myplugins/mybus'
const associatedComponents = ref([{ type: '组件服务', dataList: [] }])
let loading = ref(true)
const router = useRouter()
const scrollTop = ref(0)
const domArr = ref([])
const selectNow = ref('')
const dataList = reactive({ data: {} })
const id = router.currentRoute.value.query.id
const obj = JSON.parse(window.sessionStorage.getItem('preview'))
document.documentElement.style.transition = 'all 0.3s ease'
document.documentElement.scrollTop = 0
document.body.style.transition = 'all 0.3s ease'
document.body.scrollTop = 0
mybus.on('flyToView', (id) => {
let top = document.querySelector('#' + id).offsetTop - 50
// console.log(top, document.querySelector('#' + id).offsetTop-50)
document.documentElement.scrollTop = top
document.body.scrollTop = top
})
onMounted(() => {
// console.clear()
window.addEventListener('scroll', () => {
domArr.value = document.querySelectorAll('.scrollBox')
scrollTop.value =
document.documentElement.scrollTop || document.body.scrollTop
for (let i = 0; i < domArr.value.length; i++) {
if (i === 0) {
if (scrollTop.value <= domArr.value[i + 1].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else if (i == domArr.value.length - 1) {
if (scrollTop.value >= domArr.value[i].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else {
if (
scrollTop.value >= domArr.value[i].offsetTop - 50 &&
scrollTop.value <= domArr.value[i + 1].offsetTop - 50
) {
selectNow.value = domArr.value[i].id
}
}
}
})
})
})
const init = (id) => {
if (id) {
selectOne(id).then((res) => {
// console.clear()
dataList.data = res.data.data
const arrList = ref([])
arrList.value = JSON.parse(window.sessionStorage.getItem('visits'))
console.log(
'初始化详情页=========================>',
dataList.data,
arrList.value
)
if (arrList.value && arrList.value.indexOf(id) === -1) {
arrList.value.push(id)
updateVisits({
id: res.data.data.id,
visits: res.data.data.visits || '0',
const init = (id) => {
if (id) {
selectOne(id).then((res) => {
// console.clear()
dataList.data = res.data.data
const arrList = ref([])
arrList.value = JSON.parse(window.sessionStorage.getItem('visits'))
console.log(
'初始化详情页=========================>',
dataList.data,
arrList.value
)
if (arrList.value && arrList.value.indexOf(id) === -1) {
arrList.value.push(id)
updateVisits({
id: res.data.data.id,
visits: res.data.data.visits || '0',
}).then(() => {
window.sessionStorage.setItem(
'visits',
JSON.stringify(arrList.value)
)
})
}
//
browsingInsert({
resourceId: res.data.data.id,
}).then(() => {
window.sessionStorage.setItem(
'visits',
JSON.stringify(arrList.value)
)
console.log('浏览记录+1')
})
}
//
browsingInsert({
resourceId: res.data.data.id,
}).then(() => {
console.log('浏览记录+1')
})
})
associatedComponents.value.map((item, index) => {
let queryPartAppByKeyIdParams = {
keyId: id,
type: item.type,
}
queryPartAppByKeyId(queryPartAppByKeyIdParams).then((res) => {
associatedComponents.value[0].dataList = res.data.data
loading.value = false
associatedComponents.value.map((item, index) => {
let queryPartAppByKeyIdParams = {
keyId: id,
type: item.type,
}
queryPartAppByKeyId(queryPartAppByKeyIdParams).then((res) => {
associatedComponents.value[0].dataList = res.data.data
loading.value = false
})
})
})
} else if (obj) {
dataList.data = obj
console.log('预览==============', obj)
} else if (obj) {
dataList.data = obj
console.log('预览==============', obj)
}
}
}
const associatedComponentsFunction = () => {
if (
associatedComponents.value[0].dataList.length > 0 ||
associatedComponents.value[1].dataList.length > 0 ||
associatedComponents.value[2].dataList.length > 0
) {
return associatedComponents.value
const associatedComponentsFunction = () => {
if (
associatedComponents.value[0].dataList.length > 0 ||
associatedComponents.value[1].dataList.length > 0 ||
associatedComponents.value[2].dataList.length > 0
) {
return associatedComponents.value
}
}
}
init(id)
onBeforeUnmount(() => {
mybus.off('flyToView')
})
init(id)
onBeforeUnmount(() => {
mybus.off('flyToView')
})
</script>
<style lang="less" scoped>
.fixed {
position: fixed;
z-index: 2000;
top: 0;
left: 0;
}
.fixed {
position: fixed;
z-index: 2000;
top: 0;
left: 50%;
margin-left: -9.56rem;
}
.fixed2>div:nth-of-type(3) {
margin-top: 0.84rem;
}
.fixed2 > div:nth-of-type(3) {
margin-top: 0.84rem;
}
</style>

View File

@ -10,149 +10,178 @@
<!-- 头部基本信息 -->
<business-top-details :dataList="dataList.data"></business-top-details>
<!-- 导航 -->
<business-navigation :dataList="dataList.data" :associatedComponents="associatedComponents"
:class="{ fixed: scrollTop >= 600 }" :selectNow="selectNow"></business-navigation>
<business-navigation
:dataList="dataList.data"
:associatedComponents="associatedComponents"
:class="{ fixed: scrollTop >= 600 }"
:selectNow="selectNow"
></business-navigation>
<!-- 关联能力 -->
<business-associated-ability v-if="!loading" :associatedComponents="associatedComponents"
id="business-associated-ability" class="scrollBox"></business-associated-ability>
<business-associated-ability
v-if="!loading"
:associatedComponents="associatedComponents"
id="business-associated-ability"
class="scrollBox"
></business-associated-ability>
<!-- 组件展示 -->
<business-presentation :dataList="dataList.data" id="business-presentation" class="scrollBox">
</business-presentation>
<business-presentation
:dataList="dataList.data"
id="business-presentation"
class="scrollBox"
></business-presentation>
<!-- 功能介绍-->
<business-function-intorduction :dataList="dataList.data" id="function-introduction" class="scrollBox">
</business-function-intorduction>
<business-function-intorduction
:dataList="dataList.data"
id="function-introduction"
class="scrollBox"
></business-function-intorduction>
<!-- 应用场景 -->
<business-application-scenarios :dataList="dataList.data" id="application-scenarios" class="scrollBox">
</business-application-scenarios>
<business-application-scenarios
:dataList="dataList.data"
id="application-scenarios"
class="scrollBox"
></business-application-scenarios>
<!-- 应用案例 -->
<business-application-case :dataList="dataList.data" id="application-case" class="scrollBox">
</business-application-case>
<business-application-case
:dataList="dataList.data"
id="application-case"
class="scrollBox"
></business-application-case>
<!-- 使用方式 -->
<business-usage-mode :dataList="dataList.data" id="business-usage-mode" class="scrollBox"></business-usage-mode>
<business-usage-mode
:dataList="dataList.data"
id="business-usage-mode"
class="scrollBox"
></business-usage-mode>
<!-- 常见问题-->
<business-common-problem :dataList="dataList.data" id="common-problem" class="scrollBox"></business-common-problem>
<business-common-problem
:dataList="dataList.data"
id="common-problem"
class="scrollBox"
></business-common-problem>
</div>
</template>
<script setup>
import BusinessApplicationCase from '@/views/detailsAll/components/Business/BusinessApplicationCase.vue' //
import BusinessAssociatedAbility from '@/views/detailsAll/components/Business/BusinessAssociatedAbility.vue'
import BusinessApplicationScenarios from '@/views/detailsAll/components/Business/BusinessApplicationScenarios.vue' //
import BusinessFunctionIntorduction from '@/views/detailsAll/components/Business/BusinessFunctionIntorduction.vue' //
import BusinessTopDetails from '@/views/detailsAll/components/Business/BusinessTopDetails.vue' //
import BusinessNavigation from '@/views/detailsAll/components/Business/BusinessNavigation.vue' //
import BusinessPresentation from '@/views/detailsAll/components/Business/BusinessPresentation.vue' //
import BusinessUsageMode from '@/views/detailsAll/components/Business/BusinessUsageMode.vue' //使
import BusinessCommonProblem from '@/views/detailsAll/components/Business/BusinessCommonProblem' //
import { ref, onMounted, onBeforeUnmount, reactive } from 'vue'
import { useRouter } from 'vue-router'
import {
updateVisits,
selectOne,
queryPartAppByKeyId2,
browsingInsert,
} from '@/api/home'
import mybus from '@/myplugins/mybus'
const router = useRouter()
const scrollTop = ref(0)
const domArr = ref([])
const selectNow = ref('')
const dataList = reactive({ data: {} })
const id = router.currentRoute.value.query.id
const obj = JSON.parse(window.sessionStorage.getItem('preview'))
const associatedComponents = ref([{ type: '应用资源', dataList: [] }])
let loading = ref(true)
document.documentElement.style.transition = 'all 0.3s ease'
document.documentElement.scrollTop = 0
document.body.style.transition = 'all 0.3s ease'
document.body.scrollTop = 0
mybus.on('flyToView', (id) => {
let top = document.querySelector('#' + id).offsetTop - 50
// console.log(top, document.querySelector('#' + id).offsetTop)
document.documentElement.scrollTop = top
document.body.scrollTop = top
})
onMounted(() => {
// console.clear()
window.addEventListener('scroll', () => {
domArr.value = document.querySelectorAll('.scrollBox')
scrollTop.value =
document.documentElement.scrollTop || document.body.scrollTop
for (let i = 0; i < domArr.value.length; i++) {
if (i === 0) {
if (scrollTop.value <= domArr.value[i + 1].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else if (i == domArr.value.length - 1) {
if (scrollTop.value >= domArr.value[i].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else {
if (
scrollTop.value >= domArr.value[i].offsetTop - 50 &&
scrollTop.value <= domArr.value[i + 1].offsetTop - 50
) {
selectNow.value = domArr.value[i].id
}
}
}
import BusinessApplicationCase from '@/views/detailsAll/components/Business/BusinessApplicationCase.vue' //
import BusinessAssociatedAbility from '@/views/detailsAll/components/Business/BusinessAssociatedAbility.vue'
import BusinessApplicationScenarios from '@/views/detailsAll/components/Business/BusinessApplicationScenarios.vue' //
import BusinessFunctionIntorduction from '@/views/detailsAll/components/Business/BusinessFunctionIntorduction.vue' //
import BusinessTopDetails from '@/views/detailsAll/components/Business/BusinessTopDetails.vue' //
import BusinessNavigation from '@/views/detailsAll/components/Business/BusinessNavigation.vue' //
import BusinessPresentation from '@/views/detailsAll/components/Business/BusinessPresentation.vue' //
import BusinessUsageMode from '@/views/detailsAll/components/Business/BusinessUsageMode.vue' //使
import BusinessCommonProblem from '@/views/detailsAll/components/Business/BusinessCommonProblem' //
import { ref, onMounted, onBeforeUnmount, reactive } from 'vue'
import { useRouter } from 'vue-router'
import {
updateVisits,
selectOne,
queryPartAppByKeyId2,
browsingInsert,
} from '@/api/home'
import mybus from '@/myplugins/mybus'
const router = useRouter()
const scrollTop = ref(0)
const domArr = ref([])
const selectNow = ref('')
const dataList = reactive({ data: {} })
const id = router.currentRoute.value.query.id
const obj = JSON.parse(window.sessionStorage.getItem('preview'))
const associatedComponents = ref([{ type: '应用资源', dataList: [] }])
let loading = ref(true)
document.documentElement.style.transition = 'all 0.3s ease'
document.documentElement.scrollTop = 0
document.body.style.transition = 'all 0.3s ease'
document.body.scrollTop = 0
mybus.on('flyToView', (id) => {
let top = document.querySelector('#' + id).offsetTop - 50
// console.log(top, document.querySelector('#' + id).offsetTop)
document.documentElement.scrollTop = top
document.body.scrollTop = top
})
onMounted(() => {
// console.clear()
window.addEventListener('scroll', () => {
domArr.value = document.querySelectorAll('.scrollBox')
scrollTop.value =
document.documentElement.scrollTop || document.body.scrollTop
for (let i = 0; i < domArr.value.length; i++) {
if (i === 0) {
if (scrollTop.value <= domArr.value[i + 1].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else if (i == domArr.value.length - 1) {
if (scrollTop.value >= domArr.value[i].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else {
if (
scrollTop.value >= domArr.value[i].offsetTop - 50 &&
scrollTop.value <= domArr.value[i + 1].offsetTop - 50
) {
selectNow.value = domArr.value[i].id
}
}
}
})
})
})
const init = (id) => {
if (id) {
selectOne(id).then((res) => {
// console.clear()
dataList.data = res.data.data
console.log('初始化详情页=========================>', dataList.data)
const arrList = ref([])
arrList.value = JSON.parse(window.sessionStorage.getItem('visits'))
if (arrList.value && arrList.value.indexOf(id) === -1) {
arrList.value.push(id)
updateVisits({
id: res.data.data.id,
visits: res.data.data.visits || '0',
const init = (id) => {
if (id) {
selectOne(id).then((res) => {
// console.clear()
dataList.data = res.data.data
console.log('初始化详情页=========================>', dataList.data)
const arrList = ref([])
arrList.value = JSON.parse(window.sessionStorage.getItem('visits'))
if (arrList.value && arrList.value.indexOf(id) === -1) {
arrList.value.push(id)
updateVisits({
id: res.data.data.id,
visits: res.data.data.visits || '0',
}).then(() => {
window.sessionStorage.setItem(
'visits',
JSON.stringify(arrList.value)
)
})
}
//
browsingInsert({
resourceId: res.data.data.id,
}).then(() => {
window.sessionStorage.setItem(
'visits',
JSON.stringify(arrList.value)
)
console.log('浏览记录+1')
})
}
//
browsingInsert({
resourceId: res.data.data.id,
}).then(() => {
console.log('浏览记录+1')
})
})
associatedComponents.value.map((item, index) => {
let queryPartAppByKeyIdParams = {
keyId: id,
}
queryPartAppByKeyId2(queryPartAppByKeyIdParams).then((res) => {
associatedComponents.value[index].dataList = res.data.data
loading.value = false
associatedComponents.value.map((item, index) => {
let queryPartAppByKeyIdParams = {
keyId: id,
}
queryPartAppByKeyId2(queryPartAppByKeyIdParams).then((res) => {
associatedComponents.value[index].dataList = res.data.data
loading.value = false
})
})
})
} else if (obj) {
dataList.data = obj
console.log('预览==============', obj)
} else if (obj) {
dataList.data = obj
console.log('预览==============', obj)
}
}
}
init(id)
onBeforeUnmount(() => {
mybus.off('flyToView')
})
init(id)
onBeforeUnmount(() => {
mybus.off('flyToView')
})
</script>
<style lang="less" scoped>
.fixed {
position: fixed;
z-index: 2000;
top: 0;
left: 0;
}
.fixed {
position: fixed;
z-index: 2000;
top: 0;
left: 50%;
margin-left: -9.56rem;
}
.fixed2>div:nth-of-type(3) {
margin-top: 0.84rem;
}
.fixed2 > div:nth-of-type(3) {
margin-top: 0.84rem;
}
</style>

View File

@ -10,157 +10,188 @@
<!-- 头部基本信息 -->
<developer-top-details :dataList="dataList.data"></developer-top-details>
<!-- 导航 -->
<developer-navigation :dataList="dataList.data" :associatedComponents="associatedComponentsFunction()"
:class="{ fixed: scrollTop >= 600 }" :selectNow="selectNow"></developer-navigation>
<developer-navigation
:dataList="dataList.data"
:associatedComponents="associatedComponentsFunction()"
:class="{ fixed: scrollTop >= 600 }"
:selectNow="selectNow"
></developer-navigation>
<!-- 关联能力 -->
<developer-associated-ability v-if="!loading" :associatedComponents="associatedComponents"
id="developer-associated-ability" class="scrollBox"></developer-associated-ability>
<developer-associated-ability
v-if="!loading"
:associatedComponents="associatedComponents"
id="developer-associated-ability"
class="scrollBox"
></developer-associated-ability>
<!-- 组件展示 视频 -->
<Developer-presentation :dataList="dataList.data" id="eveloper-presentation" class="scrollBox">
</Developer-presentation>
<Developer-presentation
:dataList="dataList.data"
id="eveloper-presentation"
class="scrollBox"
></Developer-presentation>
<!-- 功能介绍-->
<developer-function-intorduction :dataList="dataList.data" id="function-introduction" class="scrollBox">
</developer-function-intorduction>
<developer-function-intorduction
:dataList="dataList.data"
id="function-introduction"
class="scrollBox"
></developer-function-intorduction>
<!-- 应用场景 -->
<developer-application-scenarios :dataList="dataList.data" id="application-scenarios" class="scrollBox">
</developer-application-scenarios>
<developer-application-scenarios
:dataList="dataList.data"
id="application-scenarios"
class="scrollBox"
></developer-application-scenarios>
<!-- 应用案例 -->
<developer-application-case :dataList="dataList.data" id="application-case" class="scrollBox">
</developer-application-case>
<developer-application-case
:dataList="dataList.data"
id="application-case"
class="scrollBox"
></developer-application-case>
<!-- 组件试用 -->
<developer-trial :dataList="dataList.data" id="developer-trial" class="scrollBox"></developer-trial>
<developer-trial
:dataList="dataList.data"
id="developer-trial"
class="scrollBox"
></developer-trial>
<!-- 归属部门与服务商-->
<developer-owning-department-and-service-provider :dataList="dataList.data" id="department-and-service-provider"
class="scrollBox"></developer-owning-department-and-service-provider>
<developer-owning-department-and-service-provider
:dataList="dataList.data"
id="department-and-service-provider"
class="scrollBox"
></developer-owning-department-and-service-provider>
<!-- 常见问题-->
<developer-common-problem :dataList="dataList.data" id="common-problem" class="scrollBox">
</developer-common-problem>
<developer-common-problem
:dataList="dataList.data"
id="common-problem"
class="scrollBox"
></developer-common-problem>
</div>
</template>
<script setup>
import DeveloperApplicationScenarios from '@/views/detailsAll/components/Developer/DeveloperApplicationScenarios.vue' //
import DeveloperAssociatedAbility from '@/views/detailsAll/components/Developer/DeveloperAssociatedAbility.vue'
import DeveloperOwningDepartmentAndServiceProvider from '@/views/detailsAll/components/Developer/DeveloperOwningDepartmentAndServiceProvider.vue' //使
import DeveloperFunctionIntorduction from '@/views/detailsAll/components/Developer/DeveloperFunctionIntorduction.vue' //
import DeveloperApplicationCase from '@/views/detailsAll/components/Developer/DeveloperApplicationCase' //
import DeveloperTopDetails from '@/views/detailsAll/components/Developer/DeveloperTopDetails.vue' //
import DeveloperNavigation from '@/views/detailsAll/components/Developer/DeveloperNavigation.vue'
import DeveloperPresentation from '@/views/detailsAll/components/Developer/DeveloperPresentation.vue' //
import DeveloperCommonProblem from '@/views/detailsAll/components/Developer/DeveloperCommonProblem' //
import DeveloperTrial from '@/views/detailsAll/components/Developer/DeveloperTrial' //
import { ref, onMounted, onBeforeUnmount, reactive } from 'vue'
import { useRouter } from 'vue-router'
import {
updateVisits,
selectOne,
queryPartAppByKeyId2,
browsingInsert,
} from '@/api/home'
import mybus from '@/myplugins/mybus'
const router = useRouter()
const scrollTop = ref(0)
const domArr = ref([])
const selectNow = ref('')
const dataList = reactive({ data: {} })
const id = router.currentRoute.value.query.id
const obj = JSON.parse(window.sessionStorage.getItem('preview'))
const associatedComponents = ref([{ type: '应用资源', dataList: [] }])
let loading = ref(true)
document.documentElement.style.transition = 'all 0.3s ease'
document.documentElement.scrollTop = 0
document.body.style.transition = 'all 0.3s ease'
document.body.scrollTop = 0
mybus.on('flyToView', (id) => {
let top = document.querySelector('#' + id).offsetTop - 50
// console.log(top, document.querySelector('#' + id).offsetTop)
document.documentElement.scrollTop = top
document.body.scrollTop = top
})
onMounted(() => {
// console.clear()
window.addEventListener('scroll', () => {
domArr.value = document.querySelectorAll('.scrollBox')
scrollTop.value =
document.documentElement.scrollTop || document.body.scrollTop
for (let i = 0; i < domArr.value.length; i++) {
if (i === 0) {
if (scrollTop.value <= domArr.value[i + 1].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else if (i == domArr.value.length - 1) {
if (scrollTop.value >= domArr.value[i].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else {
if (
scrollTop.value >= domArr.value[i].offsetTop - 50 &&
scrollTop.value <= domArr.value[i + 1].offsetTop - 50
) {
selectNow.value = domArr.value[i].id
}
}
}
import DeveloperApplicationScenarios from '@/views/detailsAll/components/Developer/DeveloperApplicationScenarios.vue' //
import DeveloperAssociatedAbility from '@/views/detailsAll/components/Developer/DeveloperAssociatedAbility.vue'
import DeveloperOwningDepartmentAndServiceProvider from '@/views/detailsAll/components/Developer/DeveloperOwningDepartmentAndServiceProvider.vue' //使
import DeveloperFunctionIntorduction from '@/views/detailsAll/components/Developer/DeveloperFunctionIntorduction.vue' //
import DeveloperApplicationCase from '@/views/detailsAll/components/Developer/DeveloperApplicationCase' //
import DeveloperTopDetails from '@/views/detailsAll/components/Developer/DeveloperTopDetails.vue' //
import DeveloperNavigation from '@/views/detailsAll/components/Developer/DeveloperNavigation.vue'
import DeveloperPresentation from '@/views/detailsAll/components/Developer/DeveloperPresentation.vue' //
import DeveloperCommonProblem from '@/views/detailsAll/components/Developer/DeveloperCommonProblem' //
import DeveloperTrial from '@/views/detailsAll/components/Developer/DeveloperTrial' //
import { ref, onMounted, onBeforeUnmount, reactive } from 'vue'
import { useRouter } from 'vue-router'
import {
updateVisits,
selectOne,
queryPartAppByKeyId2,
browsingInsert,
} from '@/api/home'
import mybus from '@/myplugins/mybus'
const router = useRouter()
const scrollTop = ref(0)
const domArr = ref([])
const selectNow = ref('')
const dataList = reactive({ data: {} })
const id = router.currentRoute.value.query.id
const obj = JSON.parse(window.sessionStorage.getItem('preview'))
const associatedComponents = ref([{ type: '应用资源', dataList: [] }])
let loading = ref(true)
document.documentElement.style.transition = 'all 0.3s ease'
document.documentElement.scrollTop = 0
document.body.style.transition = 'all 0.3s ease'
document.body.scrollTop = 0
mybus.on('flyToView', (id) => {
let top = document.querySelector('#' + id).offsetTop - 50
// console.log(top, document.querySelector('#' + id).offsetTop)
document.documentElement.scrollTop = top
document.body.scrollTop = top
})
})
const init = (id) => {
if (id) {
let queryPartAppByKeyIdParams = {
keyId: id,
}
queryPartAppByKeyId2(queryPartAppByKeyIdParams).then((res) => {
associatedComponents.value[0].dataList = res.data.data
loading.value = false
})
selectOne(id).then((res) => {
// console.clear()
dataList.data = res.data.data
console.log('初始化详情页=========================>', dataList.data)
const arrList = ref([])
arrList.value = JSON.parse(window.sessionStorage.getItem('visits'))
if (arrList.value && arrList.value.indexOf(id) === -1) {
arrList.value.push(id)
updateVisits({
id: res.data.data.id,
visits: res.data.data.visits || '0',
}).then(() => {
window.sessionStorage.setItem(
'visits',
JSON.stringify(arrList.value)
)
})
onMounted(() => {
// console.clear()
window.addEventListener('scroll', () => {
domArr.value = document.querySelectorAll('.scrollBox')
scrollTop.value =
document.documentElement.scrollTop || document.body.scrollTop
for (let i = 0; i < domArr.value.length; i++) {
if (i === 0) {
if (scrollTop.value <= domArr.value[i + 1].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else if (i == domArr.value.length - 1) {
if (scrollTop.value >= domArr.value[i].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else {
if (
scrollTop.value >= domArr.value[i].offsetTop - 50 &&
scrollTop.value <= domArr.value[i + 1].offsetTop - 50
) {
selectNow.value = domArr.value[i].id
}
}
}
//
browsingInsert({
resourceId: res.data.data.id,
}).then(() => {
console.log('浏览记录+1')
})
})
associatedComponents.value.map((item, index) => { })
} else if (obj) {
dataList.data = obj
console.log('预览==============', obj)
})
const init = (id) => {
if (id) {
let queryPartAppByKeyIdParams = {
keyId: id,
}
queryPartAppByKeyId2(queryPartAppByKeyIdParams).then((res) => {
associatedComponents.value[0].dataList = res.data.data
loading.value = false
})
selectOne(id).then((res) => {
// console.clear()
dataList.data = res.data.data
console.log('初始化详情页=========================>', dataList.data)
const arrList = ref([])
arrList.value = JSON.parse(window.sessionStorage.getItem('visits'))
if (arrList.value && arrList.value.indexOf(id) === -1) {
arrList.value.push(id)
updateVisits({
id: res.data.data.id,
visits: res.data.data.visits || '0',
}).then(() => {
window.sessionStorage.setItem(
'visits',
JSON.stringify(arrList.value)
)
})
}
//
browsingInsert({
resourceId: res.data.data.id,
}).then(() => {
console.log('浏览记录+1')
})
})
associatedComponents.value.map((item, index) => {})
} else if (obj) {
dataList.data = obj
console.log('预览==============', obj)
}
}
}
init(id)
const associatedComponentsFunction = () => {
if (associatedComponents.value[0].dataList.length > 0) {
return associatedComponents.value
init(id)
const associatedComponentsFunction = () => {
if (associatedComponents.value[0].dataList.length > 0) {
return associatedComponents.value
}
}
}
onBeforeUnmount(() => {
mybus.off('flyToView')
})
onBeforeUnmount(() => {
mybus.off('flyToView')
})
</script>
<style lang="less" scoped>
.fixed {
position: fixed;
z-index: 2000;
top: 0;
left: 0;
}
.fixed {
position: fixed;
z-index: 2000;
top: 0;
left: 50%;
margin-left: -9.56rem;
}
.fixed2>div:nth-of-type(3) {
margin-top: 0.84rem;
}
.fixed2 > div:nth-of-type(3) {
margin-top: 0.84rem;
}
</style>

View File

@ -8,156 +8,189 @@
<template>
<div class="application-details" :class="{ fixed2: scrollTop >= 600 }">
<!-- 头部基本信息 -->
<layer-service-top-details :dataList="dataList.data"></layer-service-top-details>
<layer-service-top-details
:dataList="dataList.data"
></layer-service-top-details>
<!-- 导航 -->
<layer-service-navigation :dataList="dataList.data" :associatedComponents="associatedComponents"
:class="{ fixed: scrollTop >= 600 }" :selectNow="selectNow"></layer-service-navigation>
<layer-service-navigation
:dataList="dataList.data"
:associatedComponents="associatedComponents"
:class="{ fixed: scrollTop >= 600 }"
:selectNow="selectNow"
></layer-service-navigation>
<!-- 关联能力 -->
<layer-service-associated-ability :associatedComponents="associatedComponents" id="layer-service-associated-ability"
class="scrollBox" v-if="!loading"></layer-service-associated-ability>
<layer-service-associated-ability
:associatedComponents="associatedComponents"
id="layer-service-associated-ability"
class="scrollBox"
v-if="!loading"
></layer-service-associated-ability>
<!-- 图层展示 视频 -->
<layer-service-presentation :dataList="dataList.data" id="service-presentation" class="scrollBox">
</layer-service-presentation>
<layer-service-presentation
:dataList="dataList.data"
id="service-presentation"
class="scrollBox"
></layer-service-presentation>
<!-- 图层信息-->
<layer-service-information :dataList="dataList.data" id="service-information" class="scrollBox">
</layer-service-information>
<layer-service-information
:dataList="dataList.data"
id="service-information"
class="scrollBox"
></layer-service-information>
<!-- 应用场景 -->
<layer-service-application-scenarios :dataList="dataList.data" id="service-application-scenarios" class="scrollBox">
</layer-service-application-scenarios>
<layer-service-application-scenarios
:dataList="dataList.data"
id="service-application-scenarios"
class="scrollBox"
></layer-service-application-scenarios>
<!-- 应用案例 -->
<layer-service-application-case :dataList="dataList.data" id="service-application-case" class="scrollBox">
</layer-service-application-case>
<layer-service-application-case
:dataList="dataList.data"
id="service-application-case"
class="scrollBox"
></layer-service-application-case>
<!-- 图层预览 -->
<layer-service-preview :dataList="dataList.data" id="service-preview" class="scrollBox"></layer-service-preview>
<layer-service-preview
:dataList="dataList.data"
id="service-preview"
class="scrollBox"
></layer-service-preview>
<!-- 使用方式-->
<layer-service-usage-mode :dataList="dataList.data" id="service-usage-mode" class="scrollBox">
</layer-service-usage-mode>
<layer-service-usage-mode
:dataList="dataList.data"
id="service-usage-mode"
class="scrollBox"
></layer-service-usage-mode>
<!-- 常见问题-->
<layer-service-common-problem :dataList="dataList.data" id="service-common-problem" class="scrollBox">
</layer-service-common-problem>
<layer-service-common-problem
:dataList="dataList.data"
id="service-common-problem"
class="scrollBox"
></layer-service-common-problem>
</div>
</template>
<script setup>
import LayerServiceApplicationCase from '@/views/detailsAll/components/LayerService/LayerServiceApplicationCase' //
import LayerServiceAssociatedAbility from '@/views/detailsAll/components/LayerService/LayerServiceAssociatedAbility.vue'
import LayerServiceApplicationScenarios from '@/views/detailsAll/components/LayerService/LayerServiceApplicationScenarios.vue' //
import LayerServiceCommonProblem from '@/views/detailsAll/components/LayerService/LayerServiceCommonProblem' //
import LayerServiceInformation from '@/views/detailsAll/components/LayerService/LayerServiceInformation.vue' //
import LayerServiceNavigation from '@/views/detailsAll/components/LayerService/LayerServiceNavigation.vue' //
import LayerServicePresentation from '@/views/detailsAll/components/LayerService/LayerServicePresentation.vue' //
import LayerServicePreview from '@/views/detailsAll/components/LayerService/LayerServicePreview.vue' //
import LayerServiceTopDetails from '@/views/detailsAll/components/LayerService/LayerServiceTopDetails.vue' //
import LayerServiceUsageMode from '@/views/detailsAll/components/LayerService/LayerServiceUsageMode.vue' //使
import { ref, onMounted, onBeforeUnmount, reactive } from 'vue'
import { useRouter } from 'vue-router'
import {
updateVisits,
selectOne,
queryPartAppByKeyId2,
browsingInsert,
} from '@/api/home'
import mybus from '@/myplugins/mybus'
const router = useRouter()
const scrollTop = ref(0)
const domArr = ref([])
const selectNow = ref('')
const dataList = reactive({ data: {} })
const id = router.currentRoute.value.query.id
const obj = JSON.parse(window.sessionStorage.getItem('preview'))
const associatedComponents = ref([{ type: '应用资源', dataList: [] }])
let loading = ref(true)
document.documentElement.style.transition = 'all 0.3s ease'
document.documentElement.scrollTop = 0
document.body.style.transition = 'all 0.3s ease'
document.body.scrollTop = 0
mybus.on('flyToView', (id) => {
let top = document.querySelector('#' + id).offsetTop - 50
// console.log(top, document.querySelector('#' + id).offsetTop)
document.documentElement.scrollTop = top
document.body.scrollTop = top
})
onMounted(() => {
// console.clear()
window.addEventListener('scroll', () => {
domArr.value = document.querySelectorAll('.scrollBox')
scrollTop.value =
document.documentElement.scrollTop || document.body.scrollTop
for (let i = 0; i < domArr.value.length; i++) {
if (i === 0) {
if (scrollTop.value <= domArr.value[i + 1].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else if (i == domArr.value.length - 1) {
if (scrollTop.value >= domArr.value[i].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else {
if (
scrollTop.value >= domArr.value[i].offsetTop - 50 &&
scrollTop.value <= domArr.value[i + 1].offsetTop - 50
) {
selectNow.value = domArr.value[i].id
}
}
}
import LayerServiceApplicationCase from '@/views/detailsAll/components/LayerService/LayerServiceApplicationCase' //
import LayerServiceAssociatedAbility from '@/views/detailsAll/components/LayerService/LayerServiceAssociatedAbility.vue'
import LayerServiceApplicationScenarios from '@/views/detailsAll/components/LayerService/LayerServiceApplicationScenarios.vue' //
import LayerServiceCommonProblem from '@/views/detailsAll/components/LayerService/LayerServiceCommonProblem' //
import LayerServiceInformation from '@/views/detailsAll/components/LayerService/LayerServiceInformation.vue' //
import LayerServiceNavigation from '@/views/detailsAll/components/LayerService/LayerServiceNavigation.vue' //
import LayerServicePresentation from '@/views/detailsAll/components/LayerService/LayerServicePresentation.vue' //
import LayerServicePreview from '@/views/detailsAll/components/LayerService/LayerServicePreview.vue' //
import LayerServiceTopDetails from '@/views/detailsAll/components/LayerService/LayerServiceTopDetails.vue' //
import LayerServiceUsageMode from '@/views/detailsAll/components/LayerService/LayerServiceUsageMode.vue' //使
import { ref, onMounted, onBeforeUnmount, reactive } from 'vue'
import { useRouter } from 'vue-router'
import {
updateVisits,
selectOne,
queryPartAppByKeyId2,
browsingInsert,
} from '@/api/home'
import mybus from '@/myplugins/mybus'
const router = useRouter()
const scrollTop = ref(0)
const domArr = ref([])
const selectNow = ref('')
const dataList = reactive({ data: {} })
const id = router.currentRoute.value.query.id
const obj = JSON.parse(window.sessionStorage.getItem('preview'))
const associatedComponents = ref([{ type: '应用资源', dataList: [] }])
let loading = ref(true)
document.documentElement.style.transition = 'all 0.3s ease'
document.documentElement.scrollTop = 0
document.body.style.transition = 'all 0.3s ease'
document.body.scrollTop = 0
mybus.on('flyToView', (id) => {
let top = document.querySelector('#' + id).offsetTop - 50
// console.log(top, document.querySelector('#' + id).offsetTop)
document.documentElement.scrollTop = top
document.body.scrollTop = top
})
onMounted(() => {
// console.clear()
window.addEventListener('scroll', () => {
domArr.value = document.querySelectorAll('.scrollBox')
scrollTop.value =
document.documentElement.scrollTop || document.body.scrollTop
for (let i = 0; i < domArr.value.length; i++) {
if (i === 0) {
if (scrollTop.value <= domArr.value[i + 1].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else if (i == domArr.value.length - 1) {
if (scrollTop.value >= domArr.value[i].offsetTop - 50) {
selectNow.value = domArr.value[i].id
}
} else {
if (
scrollTop.value >= domArr.value[i].offsetTop - 50 &&
scrollTop.value <= domArr.value[i + 1].offsetTop - 50
) {
selectNow.value = domArr.value[i].id
}
}
}
})
})
})
const init = (id) => {
if (id) {
selectOne(id).then((res) => {
// console.clear()
dataList.data = res.data.data
console.log('初始化详情页=========================>', dataList.data)
const arrList = ref([])
arrList.value = JSON.parse(window.sessionStorage.getItem('visits'))
if (arrList.value && arrList.value.indexOf(id) === -1) {
arrList.value.push(id)
updateVisits({
id: res.data.data.id,
visits: res.data.data.visits || '0',
const init = (id) => {
if (id) {
selectOne(id).then((res) => {
// console.clear()
dataList.data = res.data.data
console.log('初始化详情页=========================>', dataList.data)
const arrList = ref([])
arrList.value = JSON.parse(window.sessionStorage.getItem('visits'))
if (arrList.value && arrList.value.indexOf(id) === -1) {
arrList.value.push(id)
updateVisits({
id: res.data.data.id,
visits: res.data.data.visits || '0',
}).then(() => {
window.sessionStorage.setItem(
'visits',
JSON.stringify(arrList.value)
)
})
}
//
browsingInsert({
resourceId: res.data.data.id,
}).then(() => {
window.sessionStorage.setItem(
'visits',
JSON.stringify(arrList.value)
)
console.log('浏览记录+1')
})
}
//
browsingInsert({
resourceId: res.data.data.id,
}).then(() => {
console.log('浏览记录+1')
})
})
associatedComponents.value.map((item, index) => {
let queryPartAppByKeyIdParams = {
keyId: id,
}
queryPartAppByKeyId2(queryPartAppByKeyIdParams).then((res) => {
associatedComponents.value[index].dataList = res.data.data
loading.value = false
associatedComponents.value.map((item, index) => {
let queryPartAppByKeyIdParams = {
keyId: id,
}
queryPartAppByKeyId2(queryPartAppByKeyIdParams).then((res) => {
associatedComponents.value[index].dataList = res.data.data
loading.value = false
})
})
})
} else if (obj) {
dataList.data = obj
console.log('预览==============', obj)
} else if (obj) {
dataList.data = obj
console.log('预览==============', obj)
}
}
}
init(id)
onBeforeUnmount(() => {
mybus.off('flyToView')
})
init(id)
onBeforeUnmount(() => {
mybus.off('flyToView')
})
</script>
<style lang="less" scoped>
.fixed {
position: fixed;
z-index: 2000;
top: 0;
left: 0;
}
.fixed {
position: fixed;
z-index: 2000;
top: 0;
left: 50%;
margin-left: -9.56rem;
}
.fixed2>div:nth-of-type(3) {
margin-top: 0.84rem;
}
.fixed2 > div:nth-of-type(3) {
margin-top: 0.84rem;
}
</style>