| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475 |
- <template>
- <div class="listNewsBox">
- <div class="listNewsTitle_skin5">
- <span>
- <NuxtLink v-if="titleLink.cid" :href="getLinkPath(titleLink)" :title="titleLink.alias">
- <div>{{ titleLink.alias }}</div>
- </NuxtLink>
- </span>
- </div>
- <!--样式1-->
- <div class="listNewsContent" v-if="componentStyle == 1">
- <div class="listNewsContentItemTop">
- <div v-for="item in component_style1_News2Array">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <span>精选</span>
- <em></em>
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- <div class="listNewsContentItemBottom">
- <div class="contenBottomLeft" v-if="component_style1_News1Array.length > 0">
- <NuxtLink :href="getLinkPathDetail(component_style1_News1Array[active])"
- :title="component_style1_News1Array[active].title"
- :target="component_style1_News1Array[active].islink == 1 ? '_blank' : '_self'">
- <img :src="component_style1_News1Array[active].imgurl" alt="">
- </NuxtLink>
- </div>
- <div class="contentBottomRIght">
- <div v-for="(item, index) in component_style1_News1Array" :key="item.id"
- @mouseenter="active = index">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- </div>
- </div>
- <!--样式2-->
- <div class="listNewsContent style2" v-if="componentStyle == 2">
- <div class="listNewsContentItemBottom">
- <div class="contenBottomLeft" v-if="component_style1_News1Array.length > 0">
- <NuxtLink :href="getLinkPathDetail(component_style1_News1Array[active])"
- :title="component_style1_News1Array[active].title"
- :target="component_style1_News1Array[active].islink == 1 ? '_blank' : '_self'">
- <img :src="component_style1_News1Array[active].imgurl" alt="">
- </NuxtLink>
- </div>
- <div class="contentBottomRIght">
- <div v-for="(item, index) in component_style1_News1Array" :key="item.id"
- @mouseenter="active = index">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- </div>
- <div class="listNewsContentItemTop">
- <div v-for="item in component_style1_News2Array">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <span>精选</span>
- <em></em>
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- </div>
- <!--样式3-->
- <div class="listNewsContent" v-if="componentStyle == 3">
- <div class="listNewsContentItemTop">
- <div v-for="item in component_style1_News2Array">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <span>精选</span>
- <em></em>
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- <div class="listNewsContentItemBottom">
- <div class="contenBottomLeft" v-if="component_style1_News1Array.length > 0">
- <NuxtLink :href="getLinkPathDetail(component_style1_News1Array[active])"
- :title="component_style1_News1Array[active].title"
- :target="component_style1_News1Array[active].islink == 1 ? '_blank' : '_self'">
- <img :src="component_style1_News1Array[active].imgurl" alt="">
- </NuxtLink>
- </div>
- <div class="contentBottomRIght bg_blue">
- <div v-for="(item, index) in component_style1_News1Array" :key="item.id"
- @mouseenter="active = index">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- </div>
- </div>
- <!--样式4-->
- <div class="listNewsContent style4" v-if="componentStyle == 4">
- <div class="listNewsContentItemBottom">
- <div class="contenBottomLeft" v-if="component_style1_News1Array.length > 0">
- <NuxtLink :href="getLinkPathDetail(component_style1_News1Array[active])"
- :title="component_style1_News1Array[active].title"
- :target="component_style1_News1Array[active].islink == 1 ? '_blank' : '_self'">
- <img :src="component_style1_News1Array[active].imgurl" alt="">
- </NuxtLink>
- </div>
- <div class="contentBottomRIght bg_blue">
- <div v-for="(item, index) in component_style1_News1Array" :key="item.id"
- @mouseenter="active = index">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- </div>
- <div class="listNewsContentItemTop">
- <div v-for="item in component_style1_News2Array">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <span>精选</span>
- <em></em>
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- </div>
- <!--样式5-->
- <div class="listNewsContent style5" v-if="componentStyle == 5">
- <div class="listNewsContentItemTop">
- <div v-for="item in component_style1_News2Array">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <span>精选</span>
- <em></em>
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- <div class="listNewsContentItemBottom">
- <div class="contentBottomRIght">
- <div v-for="(item, index) in component_style1_News1Array" :key="item.id"
- @mouseenter="active = index">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- <div class="contenBottomLeft" v-if="component_style1_News1Array.length > 0">
- <NuxtLink :href="getLinkPathDetail(component_style1_News1Array[active])"
- :title="component_style1_News1Array[active].title"
- :target="component_style1_News1Array[active].islink == 1 ? '_blank' : '_self'">
- <img :src="component_style1_News1Array[active].imgurl" alt="">
- </NuxtLink>
- </div>
- </div>
- </div>
- <!--样式6-->
- <div class="listNewsContent style6" v-if="componentStyle == 6">
- <div class="listNewsContentItemBottom">
- <div class="contentBottomRIght">
- <div v-for="(item, index) in component_style1_News1Array" :key="item.id"
- @mouseenter="active = index">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- <div class="contenBottomLeft" v-if="component_style1_News1Array.length > 0">
- <NuxtLink :href="getLinkPathDetail(component_style1_News1Array[active])"
- :title="component_style1_News1Array[active].title"
- :target="component_style1_News1Array[active].islink == 1 ? '_blank' : '_self'">
- <img :src="component_style1_News1Array[active].imgurl" alt="">
- </NuxtLink>
- </div>
- </div>
- <div class="listNewsContentItemTop">
- <div v-for="item in component_style1_News2Array">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <span>精选</span>
- <em></em>
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- </div>
- <!--样式7-->
- <div class="listNewsContent style7" v-if="componentStyle == 7">
- <div class="listNewsContentItemTop">
- <div v-for="item in component_style1_News2Array">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <span>精选</span>
- <em></em>
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- <div class="listNewsContentItemBottom">
- <div class="contentBottomRIght bg_blue">
- <div v-for="(item, index) in component_style1_News1Array" :key="item.id"
- @mouseenter="active = index">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- <div class="contenBottomLeft" v-if="component_style1_News1Array.length > 0">
- <NuxtLink :href="getLinkPathDetail(component_style1_News1Array[active])"
- :title="component_style1_News1Array[active].title"
- :target="component_style1_News1Array[active].islink == 1 ? '_blank' : '_self'">
- <img :src="component_style1_News1Array[active].imgurl" alt="">
- </NuxtLink>
- </div>
- </div>
- </div>
- <!--样式8-->
- <div class="listNewsContent style8" v-if="componentStyle == 8">
- <div class="listNewsContentItemBottom">
- <div class="contentBottomRIght bg_blue">
- <div v-for="(item, index) in component_style1_News1Array" :key="item.id"
- @mouseenter="active = index">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- <div class="contenBottomLeft" v-if="component_style1_News1Array.length > 0">
- <NuxtLink :href="getLinkPathDetail(component_style1_News1Array[active])"
- :title="component_style1_News1Array[active].title"
- :target="component_style1_News1Array[active].islink == 1 ? '_blank' : '_self'">
- <img :src="component_style1_News1Array[active].imgurl" alt="">
- </NuxtLink>
- </div>
- </div>
- <div class="listNewsContentItemTop">
- <div v-for="item in component_style1_News2Array">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <span>精选</span>
- <em></em>
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- //引入vue
- import { ref } from 'vue';
- //获得新闻数据
- const props = defineProps({
- titleLink: Object,//板块名称
- templateData: Array,//新闻数据
- componentStyle: Number,//样式编号
- });
- //定义变量并赋值 start ---------------------------------------->
- const active = ref(0);
- const component_style1_News1Array = ref({});
- const component_style1_News2Array = ref([]);
- component_style1_News1Array.value = props.templateData.imgnum.slice(0, 5);
- component_style1_News2Array.value = props.templateData.textnum.slice(0, 5);
- //定义变量并赋值 end ---------------------------------------->
- </script>
- <style lang="less" scoped>
- //基本样式 start ---------------------------------------->
- .listNewsBox {
- position: relative;
- .listNewsTitle_skin5 {
- display: flex;
- align-items: flex-start;
- justify-content: flex-start;
- border-bottom: 1px solid #999999;
- height: 38px;
- margin-bottom: 20px;
- div {
- height: 35px;
- width: 138px;
- line-height: 32px;
- font-size: 22px;
- font-weight: bold;
- color: #333333;
- cursor: pointer;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- color: #3848A0;
- background: url("https://img.bjzxtw.org.cn/pre/image/png/20251104/1762224944805589.png") bottom left no-repeat;
- }
- }
- }
- //基本样式 end ---------------------------------------->
- //样式1 start ---------------------------------------->
- .listNewsBox {
- .listNewsContent {
- margin-bottom: 20px;
- .listNewsContentItemTop {
- width: 100%;
- height: 220px;
- margin-bottom: 25px;
- div {
- width: 580px;
- color: #333333;
- font-size: 18px;
- margin-bottom: 23px;
- cursor: pointer;
- overflow: hidden;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- span {
- display: inline-block;
- width: 36px;
- height: 24px;
- line-height: 24px;
- font-size: 18px;
- font-weight: bold;
- color: #3848A0;
- padding-right: 15px;
- }
- em {
- display: inline-block;
- width: 1px;
- height: 15px;
- background-color: #b3b3b3;
- margin-right: 15px;
- }
- &:last-child {
- margin-bottom: 0;
- }
- a {
- color: #333333;
- }
- }
- }
- .listNewsContentItemBottom {
- width: 100%;
- height: 190px;
- background-color: #f9fafb;
- display: flex;
- .contenBottomLeft {
- width: 285px;
- height: 190px;
- position: relative;
- a {
- img {
- position: absolute;
- top: 0;
- left: 0;
- width: 285px;
- height: 190px;
- }
- }
- }
- .contentBottomRIght {
- height: 190px;
- padding-left: 20px;
- padding: 5px 0 5px 16px;
- div {
- width: 260px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- height: 24px;
- line-height: 24px;
- font-size: 18px;
- color: #333333;
- margin-bottom: 15px;
- padding-left: 16px;
- background: url("https://img.bjzxtw.org.cn/pre/image/png/20251111/1762854924444085.png") no-repeat left center;
- &:last-child {
- margin-bottom: 0;
- }
- &:hover {
- font-weight: bold;
- }
- a {
- color: #333333;
- }
- }
- }
- //文字前缀为主题色蓝色
- .bg_blue {
- div {
- background: url("https://img.bjzxtw.org.cn/pre/image/png/20251112/1762909332941464.png") no-repeat left center;
- }
- }
- }
- }
- //样式2
- .style2,
- .style4 {
- .listNewsContentItemBottom {
- margin-bottom: 25px;
- }
- .listNewsContentItemTop {
- margin-bottom: 0px;
- }
- }
- // 样式5
- .style5,
- .style7 {
- .listNewsContentItemBottom {
- .contenBottomLeft {
- margin-right: 0px;
- }
- .contentBottomRIght {
- margin-right: 7px;
- }
- }
- }
- // 样式6
- .style6,
- .style8 {
- .listNewsContentItemBottom {
- margin-bottom: 25px;
- .contenBottomLeft {
- margin-right: 0px;
- }
- .contentBottomRIght {
- margin-right: 7px;
- }
- }
- .listNewsContentItemTop {
- margin-bottom: 0px;
- }
- }
- }
- </style>
|