| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- <template>
- <!-- 新闻头条部分 -->
- <div class="topNewsPart">
- <div class="inner">
- <div class="toutiao" v-if="headlinelist">
- <div class="xwtt">
- <NuxtLink v-for="(item, index) in headlinelist" :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'"
- :key="index">
- <h1 class="tttitle">{{ item.title }}</h1>
- </NuxtLink>
- </div>
- <ul class="toutiao1" v-if="headlinelist1">
- <li class="toutiaolist" v-for="item in headlinelist1">
- <NuxtLink :to="{ path: `/${item.pinyin}/${item.id}.html` }" :title="item.title">{{ item.title }}
- </NuxtLink>
- </li>
- </ul>
- </div>
- <div class="messageLeft">
- <div class="lunbo">
- <HomeBigSwiper></HomeBigSwiper>
- </div>
- <div class="messageleft_photo_text" v-if="moveBannerList">
- <div class="messageleft_photo" v-for="item in moveBannerList" :key="index">
- <NuxtLink :to="`/${item.pinyin}/${item.id}.html`" :title="item.title">
- <img :src="item.imgurl">
- <div class="message_text">
- {{ item.title }}
- </div>
- </NuxtLink>
- </div>
- </div>
- </div>
- <div class="messageRight">
- <div class="messageRight_title ">
- 要闻
- </div>
- <!-- <div class="phone_name_box pc_none">
- <a class=" " title="">
- 要闻
- </a>
- </div> -->
- <ul class="messageRight_content" v-if="hotNewsList_data1">
- <li v-for="item in hotNewsList_data1" :key="index" class="messageRight_content_title">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- {{ item.title }}
- </NuxtLink>
- </li>
- </ul>
- <ul class="messageRight_content" v-if="hotNewsList_data2">
- <li v-for="item in hotNewsList_data2" :key="index" class="messageRight_content_title">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- {{ item.title }}
- </NuxtLink>
- </li>
- </ul>
- <ul class="messageRight_content" v-if="hotNewsList_data3">
- <li v-for="item in hotNewsList_data3" :key="index" class="messageRight_content_title">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- {{ item.title }}
- </NuxtLink>
- </li>
- </ul>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- //0.加载必备依赖 start ---------------------------------------->
- import { NuxtLink } from "#components";
- import { ref, onMounted } from "vue"
- const nuxtApp = useNuxtApp();
- const axios = nuxtApp.$axios;
- const getLinkPathDetail = (item) => {
- if (item.islink == 1) {
- return `${item.linkurl}`;
- } else {
- return `/${item.pinyin}/${item.id}.html`;
- }
- }
- //0.加载必备依赖 end ---------------------------------------->
- //1.获得板块数据 start ---------------------------------------->
- //大标题
- const headlinelist = ref([])
- //大标题下面的二级内容
- const headlinelist1 = ref([])
- async function getModelData1() {
- const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
- method: 'GET',
- query: {
- 'imgnum': 0,
- 'textnum': 4,
- 'level': 1,
- 'placeid': 0,
- 'id': ''
- },
- });
- if (mkdata.code == 200) {
- if (mkdata.data.text.length != 0) {
- for (let i = 0; i < mkdata.data.text.length; i++) {
- if (i < 1) {
- headlinelist.value.push(mkdata.data.text[i])
- } else {
- headlinelist1.value.push(mkdata.data.text[i])
- }
- }
- }
- console.log("首页大标题:", headlinelist.value)
- console.log("首页大标题下面的二级内容:", headlinelist1.value)
- } else {
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- console.log("错误位置:设置大标题")
- console.log("后端错误反馈:", mkdata.message)
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- }
- }
- getModelData1()
- const moveBannerList = ref([])
- async function getModelData2() {
- const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
- method: 'GET',
- query: {
- 'imgnum': 2,
- 'textnum': 0,
- 'level': 2,
- 'placeid': 6,
- 'id': 0
- },
- });
- if (mkdata.code == 200) {
- moveBannerList.value = mkdata.data.img;
- } else {
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- console.log("错误位置:获取首页轮播图下面的图文")
- console.log("后端错误反馈:", mkdata.message)
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- }
- }
- getModelData2()
- const hotNewsList_data1 = ref([])
- const hotNewsList_data2 = ref([])
- const hotNewsList_data3 = ref([])
- async function getModelData3() {
- const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
- method: 'GET',
- query: {
- 'imgnum': 0,
- 'textnum': 15,
- 'level': 6,
- 'placeid': 0,
- 'id': ''
- },
- });
- if (mkdata.code == 200) {
- for (let i = 0; i < mkdata.data.text.length; i++) {
- if (i >= 0 && i <= 4) {
- hotNewsList_data1.value.push(mkdata.data.text[i])
- } else if (i >= 5 && i <= 9) {
- hotNewsList_data2.value.push(mkdata.data.text[i])
- } else if (i >= 10 && i <= 14) {
- hotNewsList_data3.value.push(mkdata.data.text[i])
- }
- }
- } else {
- // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- // console.log("错误位置:获取首页今日热点")
- // console.log("后端错误反馈:", mkdata.message)
- // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- }
- }
- getModelData3()
- //1.获得板块数据 end ---------------------------------------->
- </script>
- <style lang="less" scoped>
- @import url('@/assets/css/components/pagemessage.less');
- </style>
- <style lang="less" scoped>
-
- @media screen and (min-width:801px){/*pc*/
-
-
- .pc_none{display:none;}
- }
- @media screen and (max-width:800px){/*ipad_phone*/
- .topNewsPart .inner { margin:0 auto;
- overflow: hidden;
- width: 92%
- }
- .topNewsPart .inner .toutiao .xwtt{width:100%;height:auto;line-height:normal;margin-top:15px;}
- .topNewsPart .inner .toutiao .xwtt a{width:100%;height:auto;line-height:normal;}
- .topNewsPart .inner .toutiao .xwtt h1.tttitle{
- width:100%;height:33px;line-height:33px;font-size:22px;color:#333;
- }
- .topNewsPart .inner .toutiao .toutiao1{width:100%;padding:0px;height:22px;line-height:22px;margin-top:13px;overflow:hidden;text-align:center;}
- .topNewsPart .inner .toutiao .toutiao1 .toutiaolist{
- display:none;height:22px;overflow:hidden;width:90%;margin:0px auto;
- }
- .topNewsPart .inner .toutiao .toutiao1 .toutiaolist a{
- display:block;width:100%;height:22px;line-height:22px;text-align:center;
- word-break: keep-all; white-space: nowrap;overflow:hidden;text-overflow:ellipsis;
- font-size:16px;color:#333;
- }
- .topNewsPart .inner .toutiao .toutiao1 .toutiaolist:nth-of-type(1){display:block;}
- .topNewsPart .inner .messageLeft{width:100%;float:none;}
- .topNewsPart .inner .messageLeft .lunbo{width:100%;height:55vw;overflow:hidden;}
- .topNewsPart .inner .messageRight{width:100%;float:none;}
- .messageRight_title{margin-top:27px;}
- .phone_name_box{
- width:100%;height:50px; margin-top:15px;
- a{
- float:left;height:50px;line-height:50px;font-size:18px;color:#DD7D18;font-weight:bold;
- box-sizing:border-box;
- }
- }
- .topNewsPart .inner .messageRight .messageRight_content{width:100%;display:block;margin:8px auto 15px;overflow:hidden;height:205px;}
- .topNewsPart .inner .messageRight .messageRight_content .messageRight_content_title{
- width:100%!important;display:block;height:40px!important;
- border-bottom:1px solid #E6E6E6;margin:0px!important;
- }
- .topNewsPart .inner .messageRight .messageRight_content .messageRight_content_title:nth-of-type(n+6){
- display:none;
- }
-
- .topNewsPart .inner .messageRight .messageRight_content .messageRight_content_title a{
- width:100%!important;display:block;font-weight:normal!important;
- line-height:40px;height:40px;position:relative;text-indent:18px;
- word-break: keep-all; white-space: nowrap;overflow:hidden;text-overflow:ellipsis;font-size:16px;
- }
- .topNewsPart .inner .messageRight .messageRight_content .messageRight_content_title a::after{
- content: '';display: block;
- position:absolute;left:0px;top:18px;background:#E6E6E6;
- width:6px;height:6px;
- }
- .messageRight .messageRight_content:nth-of-type(n+2){display:none!important;}
- .topNewsPart .inner .messageLeft .messageleft_photo_text{display:none;}
- .phone_none{display:none;}
- }
- </style>
|