387浏览记录bug

This commit is contained in:
gaoyuanwei 2022-07-06 16:02:30 +08:00
parent 89a73222e6
commit 7b6dfa8b93
6 changed files with 550 additions and 609 deletions

View File

@ -199,7 +199,14 @@ export function updateVisits(params) {
params, params,
}) })
} }
//
export function browsingInsert(data) {
return request({
url: '/resourceBrowse/insert',
method: 'post',
data,
})
}
// //
export function selectNewest(data) { export function selectNewest(data) {
return request({ return request({

View File

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

View File

@ -52,7 +52,12 @@ import ApplicationPresentation from '@/views/detailsAll/components/Application/A
import ApplicationCommonProblem from '@/views/detailsAll/components/Application/ApplicationCommonProblem' // import ApplicationCommonProblem from '@/views/detailsAll/components/Application/ApplicationCommonProblem' //
import { ref, onMounted, onBeforeUnmount, reactive } from 'vue' import { ref, onMounted, onBeforeUnmount, reactive } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { updateVisits, selectOne, queryPartAppByKeyId } from '@/api/home' import {
updateVisits,
selectOne,
queryPartAppByKeyId,
browsingInsert,
} from '@/api/home'
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
const associatedComponents = ref([{ type: '组件服务', dataList: [] }]) const associatedComponents = ref([{ type: '组件服务', dataList: [] }])
let loading = ref(true) let loading = ref(true)
@ -124,6 +129,12 @@ const init = (id) => {
) )
}) })
} }
//
browsingInsert({
resourceId: res.data.data.id,
}).then(() => {
console.log('浏览记录+1')
})
}) })
associatedComponents.value.map((item, index) => { associatedComponents.value.map((item, index) => {
let queryPartAppByKeyIdParams = { let queryPartAppByKeyIdParams = {

View File

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

View File

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

View File

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