| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462 |
- <template>
- <div class="NewsHyjjSectorBox">
- <!-- 标题样式1-4 -->
- <div class="NewsHyjjSectorTitle" v-if="componentStyle <= 4">
- <NuxtLink v-if="titleLink.cid" :href="getLinkPath(titleLink)" :title="titleLink.alias">
- <div>{{ titleLink.alias }}</div>
- </NuxtLink>
- </div>
- <!--样式1-->
- <div class="NewsHyjjSectorContent" v-if="componentStyle == 1">
- <!-- 左 -->
- <div class="newsAllPictureSectorLeft">
- <div class="leftImg">
- <NuxtLink v-for="item in component_style1_News1" :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <img :src="item.imgurl" alt="">
- <div class="Left_mask"></div>
- <div class="Left_title">{{ item.title }}</div>
- </NuxtLink>
- </div>
- <div class="rightImg">
- <NuxtLink v-for="item in component_style1_News2" :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <img :src="item.imgurl" alt="">
- <div class="Left_mask1"></div>
- <div class="Left_title1">{{ item.title }}</div>
- </NuxtLink>
- </div>
- </div>
- <!-- 中 -->
- <div class="newsAllPictureSectorMid">
- <NuxtLink v-for="item in component_style1_News3" :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <img :src="item.imgurl" alt="">
- <div class="mask"></div>
- <div class="title">{{ item.title }}</div>
- </NuxtLink>
- </div>
- <!-- 右 -->
- <div class="newsAllPictureSectorRight">
- <div class="leftImg">
- <NuxtLink v-for="item in component_style1_News4" :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <img :src="item.imgurl" alt="">
- <div class="right_mask"></div>
- <div class="right_title">{{ item.title }}</div>
- </NuxtLink>
- </div>
- <div class="rightImg">
- <NuxtLink v-for="item in component_style1_News5" :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <img :src="item.imgurl" alt="">
- <div class="right_mask1"></div>
- <div class="right_title1">{{ item.title }}</div>
- </NuxtLink>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- //引入vue
- import { ref } from 'vue';
- //获得新闻数据
- const props = defineProps({
- titleLink: Object,//板块名称
- templateData: Array,//新闻数据
- componentStyle: Number,//样式编号
- });
- //样式1与样式2共用 start ---------------------------------------->
- const component_style1_News = ref({});
- // 样式1
- const component_style1_News1 = ref({});
- const component_style1_News2 = ref({});
- const component_style1_News3 = ref({});
- const component_style1_News4 = ref({});
- const component_style1_News5 = ref({});
- // 样式2
- const component_style1_News6 = ref({});
- const component_style1_News7 = ref({});
- const component_style1_News8 = ref({});
- const component_style1_News9 = ref({});
- const component_style1_News10 = ref({});
- // 样式3
- const component_style1_News11 = ref({});
- const component_style1_News12 = ref({});
- const component_style1_News13 = ref({});
- const component_style1_News14 = ref({});
- const component_style1_News15 = ref({});
- component_style1_News.value = props.templateData.imgnum;
- // 样式1
- component_style1_News1.value = props.templateData.imgnum.slice(0, 2);
- component_style1_News2.value = props.templateData.imgnum.slice(2, 3);
- component_style1_News3.value = props.templateData.imgnum.slice(3, 4);
- component_style1_News4.value = props.templateData.imgnum.slice(4, 6);
- component_style1_News5.value = props.templateData.imgnum.slice(6, 7);
- // 样式1
- component_style1_News6.value = props.templateData.imgnum.slice(0, 2);
- component_style1_News7.value = props.templateData.imgnum.slice(2, 3);
- component_style1_News8.value = props.templateData.imgnum.slice(3, 4);
- component_style1_News9.value = props.templateData.imgnum.slice(4, 6);
- component_style1_News10.value = props.templateData.imgnum.slice(6, 7);
- // 样式1
- component_style1_News11.value = props.templateData.imgnum.slice(0, 2);
- component_style1_News12.value = props.templateData.imgnum.slice(2, 3);
- component_style1_News13.value = props.templateData.imgnum.slice(3, 4);
- component_style1_News14.value = props.templateData.imgnum.slice(4, 6);
- component_style1_News15.value = props.templateData.imgnum.slice(6, 7);
- //样式1与样式2共用 end ---------------------------------------->
- </script>
- <style lang="less" scoped>
- //基本样式 start ---------------------------------------->
- .NewsHyjjSectorBox {
- width: 1200px;
- height: 430px;
- position: relative;
- // 标题
- .NewsHyjjSectorTitle {
- display: flex;
- align-items: flex-start;
- justify-content: flex-start;
- border-bottom: 1px solid #999999;
- height: 38px;
- margin-bottom: 20px;
- a {
- color: #3848A0;
- }
- 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;
- }
- }
- // 内容
- .NewsHyjjSectorContent {
- width: 100%;
- height: 320px;
- display: flex;
- align-items: flex-start;
- justify-content: flex-start;
- .newsAllPictureSectorLeft {
- position: relative;
- width: 390px;
- height: 320px;
- margin-right: 13px;
- display: flex;
- align-items: flex-start;
- justify-content: flex-start;
- .leftImg {
- width: 190px;
- height: 320px;
- margin-right: 10px;
- a {
- width: 190px;
- height: 150px;
- display: block;
- position: relative;
- margin-bottom: 20px;
- div {
- font-size: 16px;
- font-weight: 400;
- height: 32px;
- line-height: 32px;
- color: transparent;
- }
- img {
- width: 190px;
- height: 150px;
- border-radius: 4px;
- }
- &:last-child {
- margin-bottom: 0;
- }
- }
- a:hover {
- .Left_mask {
- position: absolute;
- top: 0;
- left: 0;
- width: 190px;
- height: 150px;
- background-color: rgba(0, 0, 0, 0.6);
- border-radius: 4px;
- }
- .Left_title {
- position: absolute;
- bottom: 0;
- left: 0;
- color: transparent;
- color: #fff;
- padding-left: 10px;
- width: 180px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
- }
- .rightImg {
- position: relative;
- width: 190px;
- height: 320px;
- border-radius: 4px;
- a {
- width: 100%;
- height: 320px;
- img {
- width: 190px;
- height: 320px;
- border-radius: 4px;
- }
- div {
- position: absolute;
- bottom: 0;
- left: 0;
- color: transparent;
- height: 50px;
- line-height: 50px;
- font-size: 18px;
- font-weight: 400;
- }
- }
- }
- .rightImg:hover {
- position: relative;
- .Left_mask1 {
- position: absolute;
- top: 0;
- left: 0;
- width: 190px;
- height: 320px;
- background-color: rgba(0, 0, 0, 0.6);
- border-radius: 4px;
- }
- .Left_title1 {
- position: absolute;
- bottom: 0;
- left: 0;
- color: transparent;
- color: #fff;
- padding-left: 10px;
- width: 180px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
- }
- .newsAllPictureSectorMid {
- position: relative;
- width: 390px;
- height: 320px;
- margin-right: 13px;
- a {
- img {
- width: 390px;
- height: 320px;
- border-radius: 4px;
- }
- div {
- position: absolute;
- bottom: 0;
- left: 0;
- width: 585px;
- height: 60px;
- line-height: 60px;
- color: transparent;
- font-size: 18px;
- font-weight: bold;
- }
- }
- }
- .newsAllPictureSectorMid:hover {
- .mask {
- position: absolute;
- top: 0;
- left: 0;
- width: 390px;
- height: 320px;
- background-color: rgba(0, 0, 0, 0.6);
- border-radius: 4px;
- }
- .title {
- position: absolute;
- bottom: 0;
- left: 0;
- color: #fff;
- padding-left: 10px;
- width: 380px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
- .newsAllPictureSectorRight {
- position: relative;
- width: 390px;
- height: 320px;
- display: flex;
- align-items: flex-start;
- justify-content: flex-start;
- .leftImg {
- width: 190px;
- height: 320px;
- margin-right: 10px;
- a {
- width: 190px;
- height: 150px;
- display: block;
- position: relative;
- margin-bottom: 20px;
- div {
- font-size: 16px;
- font-weight: 400;
- height: 32px;
- line-height: 32px;
- color: transparent;
- }
- img {
- width: 190px;
- height: 150px;
- border-radius: 4px;
- }
- &:last-child {
- margin-bottom: 0;
- }
- }
- a:hover {
- .right_mask {
- position: absolute;
- top: 0;
- left: 0;
- width: 190px;
- height: 150px;
- background-color: rgba(0, 0, 0, 0.6);
- border-radius: 4px;
- }
- .right_title {
- position: absolute;
- bottom: 0;
- left: 0;
- color: transparent;
- color: #fff;
- padding-left: 10px;
- width: 180px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
- }
- .rightImg {
- position: relative;
- width: 190px;
- height: 320px;
- border-radius: 4px;
- a {
- width: 100%;
- height: 320px;
- img {
- width: 190px;
- height: 320px;
- border-radius: 4px;
- }
- div {
- position: absolute;
- bottom: 0;
- left: 0;
- color: transparent;
- height: 50px;
- line-height: 50px;
- font-size: 18px;
- font-weight: 400;
- }
- }
- }
- .rightImg:hover {
- position: relative;
- .right_mask1 {
- position: absolute;
- top: 0;
- left: 0;
- width: 190px;
- height: 320px;
- background-color: rgba(0, 0, 0, 0.6);
- border-radius: 4px;
- }
- .right_title1 {
- position: absolute;
- bottom: 0;
- left: 0;
- color: transparent;
- color: #fff;
- padding-left: 10px;
- width: 175px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
- }
- }
- // 标题虚线
- // .dashed {
- // border-bottom: 1px dashed #999999;
- // }
- }
- //基本样式 end ----------------------------------------></style>
|