123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- <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">
- <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>
- <!-- <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="headLineTitleBox">
- <div class="headLineTop">
- 民航局:禁止旅客携带无3C标识及被召回的充电宝乘坐境内航班
- </div>
- <div class="headLineBottom">
- <div>深刻理解新形势下中国周边工作的理念与行动</div>
- <div>构建周边命运共同体 携手开创亚洲新未来</div>
- <div>抢抓人工智能发展的历史性机遇</div>
- </div>
- </div>
- <div class="headLineTitleBox">
- <div class="headLineTop">
- 吴奇隆刘诗诗一家三口同框 共同带孩子回家破婚变传闻
- </div>
- <div class="headLineBottom">
- <div>深刻理解新形势下中国周边工作的理念与行动</div>
- <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>
- </template>
- <script setup>
- //引入vue
- import { ref,onMounted } from 'vue';
- //获得新闻数据
- const props = defineProps({
- templateData:Array,//新闻数据
- });
- //样式2的效果 start ---------------------------------------->
- //选中的
- const activeIndex = ref(0);
- const setActive = (index) => {
- activeIndex.value = index;
- }
- const sliderStyle = () => {
- // 每个headLineTitleBox的高度是70px + 间距30px = 100px
- const translateY = -(this.activeIndex * 100);
- return {
- transform: `translateY(${translateY}px)`,
- transition: 'transform 0.3s ease-in-out'
- };
- }
- //样式2的效果 end ---------------------------------------->
-
- </script>
- <style lang="less">
- .headLineStyle1 {
- width: 1200px;
- height: 140px;
- margin: 0 auto;
- box-sizing: border-box;
- padding: 30px 100px 30px 100px;
- .headLineTitle {
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 30px;
- font-weight: bold;
- color: #004564;
- margin-bottom: 10px;
- img {
- margin-right: 20px;
- }
- a {
- color: #004564;
- }
- }
- .headLineContent{
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 18px;
- color:#333333;
- div {
- margin-right: 40px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- &:last-child {
- margin-right: 0;
- }
- }
- }
- }
- .headLineStyle1_skin2 {
- border:1px solid #E4E4E4;
- width: 1200px;
- height: 140px;
- box-sizing: border-box;
- padding:32px 15px 32px 40px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .headLineContentBox {
- width: 1000px;
- height: 70px;
- overflow: hidden;
- position: relative;
- .headLineSlider {
- display: flex;
- flex-direction: column; // 改为垂直方向
- width: 100%;
- height: 210px; // 3个titleBox,每个70px高
- }
- }
- .headLineTitleBox {
- text-align: center;
- height: 70px; // 明确设置高度
- width: 100%;
- margin-bottom: 30px;
- flex-shrink: 0; // 防止收缩
- display: flex;
- flex-direction: column;
- justify-content: center;
- .headLineTop {
- font-size: 30px;
- color:#A91B33;
- margin-bottom: 15px;
- font-weight: bold;
- }
- .headLineBottom {
- display: flex;
- align-items: center;
- justify-content: center;
- div {
- width: 32%;
- margin-right: 30px;
- font-size: 18px;
- color:#333333;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- &:last-child {
- margin-right: 0;
- }
- }
- }
- }
- .headLineIcon {
- div {
- width: 10px;
- height: 10px;
- background: #EDEDED;
- margin-bottom: 10px;
- cursor: pointer;
- transition: background 0.3s ease;
- &:last-child {
- margin-bottom: 0;
- }
- &.active {
- background: #A91B33;
- }
- &:hover {
- background: #A91B33;
- }
- }
- }
- }
- </style>
|