|
@@ -9,7 +9,7 @@
|
|
|
<div class="small-title-line"></div>
|
|
|
</div>
|
|
|
<div class="flex ProductServicesbox">
|
|
|
- <div class="boximg" v-for="(item,index) in list" :key="index">
|
|
|
+ <div class="boximg" v-for="(item,index) in list" @click="goto(item)" :key="index">
|
|
|
<div style="width: 100%;">
|
|
|
<img class="boximg_img" :src="item.imgUrl" alt="">
|
|
|
</div>
|
|
@@ -20,8 +20,12 @@
|
|
|
|
|
|
<script setup>
|
|
|
import {onMounted,ref,reactive,watch} from 'vue'
|
|
|
-import {HonorlistByOpen} from '@/http/api/common.js'
|
|
|
+import {HonorlistByOpen,getArticleDetailByOpen} from '@/http/api/common.js'
|
|
|
import {useRouter} from 'vue-router'
|
|
|
+//使用pinia缓存数据
|
|
|
+import { useCounterStore } from '@/stores/counter'
|
|
|
+const counter = useCounterStore()
|
|
|
+
|
|
|
const router=useRouter()
|
|
|
const list = ref([
|
|
|
{
|
|
@@ -100,13 +104,16 @@ onMounted(async() => {
|
|
|
}
|
|
|
|
|
|
});
|
|
|
-const goto = (item) =>{
|
|
|
- console.log('check',item.type,item.id);
|
|
|
+const goto = async (item) =>{
|
|
|
// 1-无跳转地址 2-跳转第三方地址 3-跳转详情页面(通过id获取详情)
|
|
|
if (item.type == '2') {
|
|
|
window.open(item?.toUrl, "_blank");
|
|
|
}else if(item.type == '3'){
|
|
|
- router.push('/CompanyNews?openType=1&id='+item.id)
|
|
|
+ if (item?.detailsContent != '') {
|
|
|
+ counter.detailsContent = item?.detailsContent || '无内容'
|
|
|
+ router.push('/CompanyNews?openType=1&id='+item?.id
|
|
|
+ + '&bodyType=4&title='+item?.honorName)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|