| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- <template>
- <div class="listNewsBox">
- <div class="listNewsTitle_skin2">
- <span>
- <NuxtLink
- v-if="titleLink.cid"
- :href="getLinkPath(titleLink)"
- :title="titleLink.alias"
- >
- {{titleLink.alias}}
- </NuxtLink>
- </span>
- </div>
- <!--样式1-->
- <div class="listNewsContent" v-if="componentStyle==1">
- <div class="listNewsContentTop">
- <NuxtLink
- :href="getLinkPathDetail(item)"
- :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'"
- v-for="item in component_style1_News1Array"
- >
- <img :src="item.imgurl" />
- <div class="listNewsContentTopTitle">{{ item.title }}</div>
- </NuxtLink>
- </div>
- <div class="listNewsContentBottom">
- <div v-for="item in component_style1_News2Array">
- <NuxtLink
- :href="getLinkPathDetail(item)"
- :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'"
- >
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- </div>
- <!--样式2-->
- <div class="listNewsContent listNewsStyle2" v-if="componentStyle==2">
- <div class="listNewsContentBottom">
- <div v-for="item in component_style1_News2Array">
- <NuxtLink
- :href="getLinkPathDetail(item)"
- :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'"
- >
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- <div class="listNewsContentTop">
- <NuxtLink
- :href="getLinkPathDetail(item)"
- :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'"
- v-for="item in component_style1_News1Array"
- >
- <img :src="item.imgurl" />
- <div class="listNewsContentTopTitle">{{ item.title }}</div>
- </NuxtLink>
- </div>
- </div>
- <!-- 样式3 -->
- <div class="listNewsContent listNewsStyle3" v-if="componentStyle == 3">
- <div class="listNewsContentTop">
- <NuxtLink
- :href="getLinkPathDetail(item)"
- :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'"
- v-for="item in component_style1_News1Array"
- >
- <img :src="item.imgurl" />
- <div class="listNewsContentTopTitle">{{ item.title }}</div>
- </NuxtLink>
- </div>
- <div class="listNewsContentBottom">
- <div v-for="item in component_style1_News2Array">
- <NuxtLink
- :href="getLinkPathDetail(item)"
- :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'"
- >
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- </div>
- <!-- 样式4 -->
- <div class="listNewsContent listNewsStyle4" v-if="componentStyle == 4">
- <div class="listNewsContentBottom">
- <div v-for="item in component_style1_News2Array">
- <NuxtLink
- :href="getLinkPathDetail(item)"
- :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'"
- >
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- <div class="listNewsContentTop">
- <NuxtLink
- :href="getLinkPathDetail(item)"
- :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'"
- v-for="item in component_style1_News1Array"
- >
- <img :src="item.imgurl" />
- <div class="listNewsContentTopTitle">{{ item.title }}</div>
- </NuxtLink>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- //引入vue
- import {ref} from 'vue';
- //获得新闻数据
- const props = defineProps({
- titleLink:Object,//板块名称
- templateData:Array,//新闻数据
- componentStyle:Number,//样式编号
- });
- const component_style1_News1Array = ref([]);
- const component_style1_News2Array = ref([]);
- component_style1_News1Array.value = props.templateData.imgnum.slice(0,1);
- component_style1_News2Array.value = props.templateData.textnum.slice(0,3);
- </script>
- <style lang="less" scoped>
- //基本样式 start ---------------------------------------->
- .listNewsBox {
- position: relative;
- .listNewsTitle_skin2 {
- font-size:22px;
- font-weight:bold;
- height: 40px;
- line-height: 40px;
- border-bottom: 2px solid #A91B33;
- color:#A91B33;
- margin-bottom: 20px;
- box-sizing: border-box;
- a {
- color:#A91B33;
- display: block;
- height: 25px;
- line-height: 25px;
- }
- span {
- color:#A91B33;
- height: 25px;
- line-height: 25px;
- border-left: 3px solid #A91B33;
- padding-left: 12px;
- display: block;
- }
- }
- .listNewsContent {
- .listNewsContentTop {
- position: relative;
- width: 450px;
- height: 245px;
- margin-bottom: 17px;
- img {
- display: block;
- width: 450px;
- height: 245px;
- }
- .listNewsContentTopTitle {
- position: absolute;
- font-size: 18px;
- height: 44px;
- line-height: 44px;
- padding:0 10px;
- box-sizing: border-box;
- width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- bottom: 0;
- color:#fff;
- background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
- }
- }
- .listNewsContentBottom {
- height: 112px;
- div{
- height: 24px;
- line-height: 24px;
- margin-bottom: 20px;
- font-size: 18px;
- color: #333333;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- a {
- color: #333333;
- }
- &:last-child {
- margin-bottom: 0;
- }
- &:first-child {
- font-weight: bold;
- }
- }
- }
- }
- }
- //基本样式 end ---------------------------------------->
- //样式2 start ---------------------------------------->
- .listNewsStyle2 {
- .listNewsContentTop {
- margin-bottom:0;
- margin-top: 17px;
- }
- }
- //样式2 end ---------------------------------------->
- //样式3
- .listNewsBox {
- .listNewsStyle3 {
- .listNewsContentBottom {
- div{
- &:nth-child(1) {
- font-weight: 400;
- }
- }
- }
- }
- }
- //样式4
- .listNewsBox {
- .listNewsStyle4 {
- .listNewsContentBottom {
- margin-bottom: 17px;
- div{
- &:nth-child(1) {
- font-weight: 400;
- }
- }
- }
- }
- }
- </style>
|