|
@@ -1,103 +1,164 @@
|
|
<template>
|
|
<template>
|
|
- <div>
|
|
|
|
- <div class="headLineStyle1">
|
|
|
|
- <div class="headLineTitle">
|
|
|
|
- <img src="http://img.bjzxtw.org.cn/pre/image/png/20250603/1748932387576488.png"/>
|
|
|
|
- <NuxtLink
|
|
|
|
- :href="getLinkPathDetail(templateData[0])"
|
|
|
|
- :title="templateData[0].title"
|
|
|
|
- :target="templateData[0].islink == 1 ? '_blank' : '_self'">
|
|
|
|
- <div class="left_content">
|
|
|
|
- {{ templateData[0].title }}
|
|
|
|
- </div>
|
|
|
|
- </NuxtLink>
|
|
|
|
- </div>
|
|
|
|
- <div class="headLineContent">
|
|
|
|
|
|
+ <div class="headLineStyle1" v-if="style=='1'">
|
|
|
|
+ <div class="headLineTitle">
|
|
|
|
+ <img src="http://img.bjzxtw.org.cn/pre/image/png/20250603/1748932387576488.png"/>
|
|
|
|
+ <NuxtLink
|
|
|
|
+ :href="getLinkPathDetail(component_style1_News1)"
|
|
|
|
+ :title="component_style1_News1.title"
|
|
|
|
+ :target="component_style1_News1.islink == 1 ? '_blank' : '_self'"
|
|
|
|
+ >
|
|
|
|
+ {{ component_style1_News1.title }}
|
|
|
|
+ </NuxtLink>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="headLineContent">
|
|
|
|
+ <div v-for="item in component_style1_News2Array" :key="item.id">
|
|
<NuxtLink
|
|
<NuxtLink
|
|
- :href="getLinkPathDetail(templateData[0])"
|
|
|
|
- :title="templateData[0].title"
|
|
|
|
- :target="templateData[0].islink == 1 ? '_blank' : '_self'">
|
|
|
|
- <div class="left_content">
|
|
|
|
- {{ templateData[0].title }}
|
|
|
|
- </div>
|
|
|
|
|
|
+ :href="getLinkPathDetail(item)"
|
|
|
|
+ :title="item.title"
|
|
|
|
+ :target="item.islink == 1 ? '_blank' : '_self'"
|
|
|
|
+ >
|
|
|
|
+ {{ item.title }}
|
|
</NuxtLink>
|
|
</NuxtLink>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <!-- <div class="headLineStyle1_skin2" v-if="this.$store.state.template.editWebsiteClass==2">
|
|
|
|
- <div class="headTip">
|
|
|
|
- <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250626/1750901450165042.jpg">
|
|
|
|
- </div>
|
|
|
|
- <div class="headLineContentBox" ref="contentBox">
|
|
|
|
- <div class="headLineSlider" :style="sliderStyle">
|
|
|
|
- <div class="headLineTitleBox">
|
|
|
|
- <div class="headLineTop">
|
|
|
|
- 深入推进周边命运共同体建设 以人工智能引领科研范式变革
|
|
|
|
- </div>
|
|
|
|
- <div class="headLineBottom">
|
|
|
|
- <div>深刻理解新形势下中国周边工作的理念与行动</div>
|
|
|
|
- <div>构建周边命运共同体 携手开创亚洲新未来</div>
|
|
|
|
- <div>抢抓人工智能发展的历史性机遇</div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ </div>
|
|
|
|
+ <div class="headLineStyle1_skin2" v-if="style=='2'">
|
|
|
|
+ <div class="headTip">
|
|
|
|
+ <img src="http://img.bjzxtw.org.cn/pre/image/jpeg/20250626/1750901450165042.jpg">
|
|
|
|
+ </div>
|
|
|
|
+ <div class="headLineContentBox" ref="contentBox">
|
|
|
|
+ <div class="headLineSlider" :style="sliderStyle" v-if="templateData.length > 0">
|
|
|
|
+ <div class="headLineTitleBox">
|
|
|
|
+ <div class="headLineTop">
|
|
|
|
+ <NuxtLink
|
|
|
|
+ :href="getLinkPathDetail(component_style2_News1)"
|
|
|
|
+ :title="component_style2_News1.title"
|
|
|
|
+ :target="component_style2_News1.islink == 1 ? '_blank' : '_self'"
|
|
|
|
+ >
|
|
|
|
+ {{ component_style2_News1.title }}
|
|
|
|
+ </NuxtLink>
|
|
</div>
|
|
</div>
|
|
- <div class="headLineTitleBox">
|
|
|
|
- <div class="headLineTop">
|
|
|
|
- 民航局:禁止旅客携带无3C标识及被召回的充电宝乘坐境内航班
|
|
|
|
- </div>
|
|
|
|
- <div class="headLineBottom">
|
|
|
|
- <div>深刻理解新形势下中国周边工作的理念与行动</div>
|
|
|
|
- <div>构建周边命运共同体 携手开创亚洲新未来</div>
|
|
|
|
- <div>抢抓人工智能发展的历史性机遇</div>
|
|
|
|
|
|
+ <div class="headLineBottom">
|
|
|
|
+ <div v-for="item in component_style2_News1Array" :key="item.id">
|
|
|
|
+ <NuxtLink
|
|
|
|
+ :href="getLinkPathDetail(item)"
|
|
|
|
+ :title="item.title"
|
|
|
|
+ :target="item.islink == 1 ? '_blank' : '_self'"
|
|
|
|
+ >
|
|
|
|
+ {{ item.title }}
|
|
|
|
+ </NuxtLink>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="headLineTitleBox">
|
|
|
|
- <div class="headLineTop">
|
|
|
|
- 吴奇隆刘诗诗一家三口同框 共同带孩子回家破婚变传闻
|
|
|
|
|
|
+ </div>
|
|
|
|
+ <div class="headLineTitleBox" v-if="templateData.length > 4">
|
|
|
|
+ <div class="headLineTop">
|
|
|
|
+ <NuxtLink
|
|
|
|
+ :href="getLinkPathDetail(component_style2_News2)"
|
|
|
|
+ :title="component_style2_News2.title"
|
|
|
|
+ :target="component_style2_News2.islink == 1 ? '_blank' : '_self'"
|
|
|
|
+ >
|
|
|
|
+ {{ component_style2_News2.title }}
|
|
|
|
+ </NuxtLink>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="headLineBottom">
|
|
|
|
+ <div v-for="item in component_style2_News2Array" :key="item.id">
|
|
|
|
+ <NuxtLink
|
|
|
|
+ :href="getLinkPathDetail(item)"
|
|
|
|
+ :title="item.title"
|
|
|
|
+ :target="item.islink == 1 ? '_blank' : '_self'"
|
|
|
|
+ >
|
|
|
|
+ {{ item.title }}
|
|
|
|
+ </NuxtLink>
|
|
</div>
|
|
</div>
|
|
- <div class="headLineBottom">
|
|
|
|
- <div>深刻理解新形势下中国周边工作的理念与行动</div>
|
|
|
|
- <div>构建周边命运共同体 携手开创亚洲新未来</div>
|
|
|
|
- <div>抢抓人工智能发展的历史性机遇</div>
|
|
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="headLineTitleBox" v-if="templateData.length > 8">
|
|
|
|
+ <div class="headLineTop">
|
|
|
|
+ <NuxtLink
|
|
|
|
+ :href="getLinkPathDetail(component_style2_News3)"
|
|
|
|
+ :title="component_style2_News3.title"
|
|
|
|
+ :target="component_style2_News3.islink == 1 ? '_blank' : '_self'"
|
|
|
|
+ >
|
|
|
|
+ {{ component_style2_News3.title }}
|
|
|
|
+ </NuxtLink>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="headLineBottom">
|
|
|
|
+ <div v-for="item in component_style2_News3Array" :key="item.id">
|
|
|
|
+ <NuxtLink
|
|
|
|
+ :href="getLinkPathDetail(item)"
|
|
|
|
+ :title="item.title"
|
|
|
|
+ :target="item.islink == 1 ? '_blank' : '_self'"
|
|
|
|
+ >
|
|
|
|
+ {{ item.title }}
|
|
|
|
+ </NuxtLink>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="headLineIcon">
|
|
|
|
- <div @mouseover="setActive(0)" :class="{active: activeIndex === 0}"></div>
|
|
|
|
- <div @mouseover="setActive(1)" :class="{active: activeIndex === 1}"></div>
|
|
|
|
- <div @mouseover="setActive(2)" :class="{active: activeIndex === 2}"></div>
|
|
|
|
- </div>
|
|
|
|
- </div> -->
|
|
|
|
|
|
+ </div>
|
|
|
|
+ <div class="headLineIcon">
|
|
|
|
+ <div @mouseover="setActive(0)" :class="{active: activeIndex === 0}" v-if="templateData.length > 0"></div>
|
|
|
|
+ <div @mouseover="setActive(1)" :class="{active: activeIndex === 1}" v-if="templateData.length > 4"></div>
|
|
|
|
+ <div @mouseover="setActive(2)" :class="{active: activeIndex === 2}" v-if="templateData.length > 8"></div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
//引入vue
|
|
//引入vue
|
|
-import { ref,onMounted } from 'vue';
|
|
|
|
|
|
+import {ref} from 'vue';
|
|
//获得新闻数据
|
|
//获得新闻数据
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
|
+ style:String,//组件样式
|
|
templateData:Array,//新闻数据
|
|
templateData:Array,//新闻数据
|
|
});
|
|
});
|
|
|
|
+//组件样式1 start ---------------------------------------->
|
|
|
|
+const component_style1_News1 = ref({});
|
|
|
|
+const component_style1_News2Array = ref([]);
|
|
|
|
+component_style1_News1.value = props.templateData[0];
|
|
|
|
+component_style1_News2Array.value = props.templateData.slice(1,4);
|
|
|
|
+//组件样式1 end ---------------------------------------->
|
|
|
|
|
|
|
|
+//组件样式2 start ---------------------------------------->
|
|
|
|
+const component_style2_News1 = ref({})
|
|
|
|
+const component_style2_News1Array = ref([])
|
|
|
|
+const component_style2_News2 = ref({})
|
|
|
|
+const component_style2_News2Array = ref([])
|
|
|
|
+const component_style2_News3 = ref({})
|
|
|
|
+const component_style2_News3Array = ref([])
|
|
|
|
|
|
-//样式2的效果 start ---------------------------------------->
|
|
|
|
-//选中的
|
|
|
|
-const activeIndex = ref(0);
|
|
|
|
-const setActive = (index) => {
|
|
|
|
- activeIndex.value = index;
|
|
|
|
|
|
+if(props.templateData.length>0){
|
|
|
|
+ if(props.templateData.length>0){
|
|
|
|
+ component_style2_News1.value = props.templateData[0]
|
|
|
|
+ component_style2_News1Array.value = props.templateData.slice(1,4)
|
|
|
|
+ }
|
|
|
|
+ if(props.templateData.length>4){
|
|
|
|
+ component_style2_News2.value = props.templateData[4]
|
|
|
|
+ component_style2_News2Array.value = props.templateData.slice(5,8)
|
|
|
|
+ }
|
|
|
|
+ if(props.templateData.length>8){
|
|
|
|
+ component_style2_News3.value = props.templateData[8]
|
|
|
|
+ component_style2_News3Array.value = props.templateData.slice(9,12)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-const sliderStyle = () => {
|
|
|
|
|
|
+
|
|
|
|
+const activeIndex = ref(0);
|
|
|
|
+const sliderStyle = computed(() => {
|
|
// 每个headLineTitleBox的高度是70px + 间距30px = 100px
|
|
// 每个headLineTitleBox的高度是70px + 间距30px = 100px
|
|
- const translateY = -(this.activeIndex * 100);
|
|
|
|
|
|
+ const translateY = -(activeIndex.value * 100);
|
|
return {
|
|
return {
|
|
transform: `translateY(${translateY}px)`,
|
|
transform: `translateY(${translateY}px)`,
|
|
transition: 'transform 0.3s ease-in-out'
|
|
transition: 'transform 0.3s ease-in-out'
|
|
};
|
|
};
|
|
-}
|
|
|
|
-//样式2的效果 end ---------------------------------------->
|
|
|
|
-
|
|
|
|
|
|
+});
|
|
|
|
+const setActive = (index) => {
|
|
|
|
+ activeIndex.value = index;
|
|
|
|
+};
|
|
|
|
+//组件样式2 end ---------------------------------------->
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
<style lang="less">
|
|
|
|
+//皮肤1 样式1 start---------------------------------------->
|
|
.headLineStyle1 {
|
|
.headLineStyle1 {
|
|
width: 1200px;
|
|
width: 1200px;
|
|
height: 140px;
|
|
height: 140px;
|
|
@@ -108,34 +169,38 @@ const sliderStyle = () => {
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
justify-content: center;
|
|
justify-content: center;
|
|
- font-size: 30px;
|
|
|
|
- font-weight: bold;
|
|
|
|
- color: #004564;
|
|
|
|
margin-bottom: 10px;
|
|
margin-bottom: 10px;
|
|
|
|
+ a {
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ font-size: 30px;
|
|
|
|
+ color: #004564;
|
|
|
|
+ }
|
|
img {
|
|
img {
|
|
margin-right: 20px;
|
|
margin-right: 20px;
|
|
}
|
|
}
|
|
- a {
|
|
|
|
- color: #004564;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
.headLineContent{
|
|
.headLineContent{
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
justify-content: center;
|
|
justify-content: center;
|
|
- font-size: 18px;
|
|
|
|
- color:#333333;
|
|
|
|
div {
|
|
div {
|
|
margin-right: 40px;
|
|
margin-right: 40px;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
|
|
+ a {
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ color:#333333;
|
|
|
|
+ }
|
|
&:last-child {
|
|
&:last-child {
|
|
margin-right: 0;
|
|
margin-right: 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+//皮肤1 样式1 end---------------------------------------->
|
|
|
|
+
|
|
|
|
+//皮肤2 样式1 start---------------------------------------->
|
|
.headLineStyle1_skin2 {
|
|
.headLineStyle1_skin2 {
|
|
border:1px solid #E4E4E4;
|
|
border:1px solid #E4E4E4;
|
|
width: 1200px;
|
|
width: 1200px;
|
|
@@ -167,10 +232,12 @@ const sliderStyle = () => {
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
justify-content: center;
|
|
.headLineTop {
|
|
.headLineTop {
|
|
- font-size: 30px;
|
|
|
|
- color:#A91B33;
|
|
|
|
- margin-bottom: 15px;
|
|
|
|
|
|
+ margin-bottom: 8px;
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
|
|
+ a {
|
|
|
|
+ font-size: 30px;
|
|
|
|
+ color:#A91B33;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.headLineBottom {
|
|
.headLineBottom {
|
|
display: flex;
|
|
display: flex;
|
|
@@ -179,11 +246,13 @@ const sliderStyle = () => {
|
|
div {
|
|
div {
|
|
width: 32%;
|
|
width: 32%;
|
|
margin-right: 30px;
|
|
margin-right: 30px;
|
|
- font-size: 18px;
|
|
|
|
- color:#333333;
|
|
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
text-overflow: ellipsis;
|
|
|
|
+ a {
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ color:#333333;
|
|
|
|
+ }
|
|
&:last-child {
|
|
&:last-child {
|
|
margin-right: 0;
|
|
margin-right: 0;
|
|
}
|
|
}
|
|
@@ -210,4 +279,5 @@ const sliderStyle = () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+//皮肤2 样式1 start---------------------------------------->
|
|
</style>
|
|
</style>
|