|
@@ -1,15 +1,57 @@
|
|
|
<template>
|
|
|
<div class="hotList">
|
|
|
- <div class="title">
|
|
|
- <h4>
|
|
|
- 最新资讯
|
|
|
- </h4>
|
|
|
+ <h1 class="title">
|
|
|
+ 最新资讯
|
|
|
+ </h1>
|
|
|
+ <div class="hotList_photo_text">
|
|
|
+ <div class="hotList_photo_text1" v-for="(item, index) in hotNewsListdata1" :key="index">
|
|
|
+ <NuxtLink
|
|
|
+ :href="getLinkPathDetail(item)"
|
|
|
+ :title="item.title"
|
|
|
+ :key="item.id"
|
|
|
+ :target="item.islink == 1 ? '_blank' : '_self'"
|
|
|
+ >
|
|
|
+ <img :src="item.imgurl" :alt="item.title">
|
|
|
+ <span class="hotlist_text">{{ item.title }}</span>
|
|
|
+ </NuxtLink>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <ul class="message">
|
|
|
+ <li class="messageList" v-for="(item, index) in hotNewsListdata2" :key="index">
|
|
|
+ <em></em>
|
|
|
+ <NuxtLink
|
|
|
+ :href="getLinkPathDetail(item)"
|
|
|
+ :title="item.title"
|
|
|
+ :key="item.id"
|
|
|
+ :target="item.islink == 1 ? '_blank' : '_self'"
|
|
|
+ >
|
|
|
+ {{ item.title }}
|
|
|
+ </NuxtLink>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ <div class="hotList_photo_text">
|
|
|
+ <div class="hotList_photo_text1" v-for="(item, index) in hotNewsListdata3" :key="index">
|
|
|
+ <NuxtLink
|
|
|
+ :href="getLinkPathDetail(item)"
|
|
|
+ :title="item.title"
|
|
|
+ :key="item.id"
|
|
|
+ :target="item.islink == 1 ? '_blank' : '_self'"
|
|
|
+ >
|
|
|
+ <img :src="item.imgurl" :alt="item.title">
|
|
|
+ <span class="hotlist_text">{{ item.title }}</span>
|
|
|
+ </NuxtLink>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <ul class="messageList">
|
|
|
- <li v-for="(item, index) in hotNewsList">
|
|
|
- <span>{{ index + 1 }}</span>
|
|
|
- <NuxtLink :to="item.linkurl" v-show="item.islink == 1" :title="item.title">{{ item.title }}</NuxtLink>
|
|
|
- <NuxtLink :to="`/${item.pinyin}/${item.id}.html`" v-if="item.islink == 0" :title="item.title">{{ item.title }}
|
|
|
+ <ul class="message">
|
|
|
+ <li class="messageList" v-for="(item, index) in hotNewsListdata4" :key="index">
|
|
|
+ <em></em>
|
|
|
+ <NuxtLink
|
|
|
+ :href="getLinkPathDetail(item)"
|
|
|
+ :title="item.title"
|
|
|
+ :key="item.id"
|
|
|
+ :target="item.islink == 1 ? '_blank' : '_self'"
|
|
|
+ >
|
|
|
+ {{ item.title }}
|
|
|
</NuxtLink>
|
|
|
</li>
|
|
|
</ul>
|
|
@@ -17,18 +59,35 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-const hotNewsList = ref([])
|
|
|
+const getLinkPathDetail = (item) => {
|
|
|
+ if (item.islink == 1) {
|
|
|
+ return `${item.linkurl}`;
|
|
|
+ } else {
|
|
|
+ //return `/${item.aLIas_pinyin}/${item.id}`;
|
|
|
+ //return `/newsDetail/${item.id}`
|
|
|
+ return `/${item.pinyin}/${item.id}.html`;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const hotNewsListdata1 = ref([])
|
|
|
+const hotNewsListdata2 = ref([])
|
|
|
+const hotNewsListdata3 = ref([])
|
|
|
+const hotNewsListdata4 = ref([])
|
|
|
+
|
|
|
async function getPageData() {
|
|
|
const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
|
|
|
method: 'GET',
|
|
|
query: {
|
|
|
- 'pageSize': 14,
|
|
|
+ 'pageSize':8,
|
|
|
'level': 4,
|
|
|
'id': 0,
|
|
|
},
|
|
|
});
|
|
|
if(mkdata.code == 200){
|
|
|
- hotNewsList.value = mkdata.data;
|
|
|
+ hotNewsListdata1.value = mkdata.data.slice(0, 2);
|
|
|
+ hotNewsListdata2.value = mkdata.data.slice(2, 4);
|
|
|
+ hotNewsListdata3.value = mkdata.data.slice(4, 6);
|
|
|
+ hotNewsListdata4.value = mkdata.data.slice(6, 8);
|
|
|
}else{
|
|
|
console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
|
|
|
console.log("错误位置:获取最新资讯")
|
|
@@ -40,110 +99,90 @@ getPageData();
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
+//标题
|
|
|
.hotList {
|
|
|
- background: #fff;
|
|
|
-}
|
|
|
+ width: 270px;
|
|
|
+ border-top: 2px solid #dd7d18;
|
|
|
|
|
|
-.title {
|
|
|
- width: 380px;
|
|
|
- height: 40px;
|
|
|
- line-height: 40px;
|
|
|
- // border-top: 1px solid #139602;
|
|
|
- border-bottom: 1px solid #e7e7e7;
|
|
|
- background-color: #fbfbfb;
|
|
|
-
|
|
|
- >h4 {
|
|
|
+ .title {
|
|
|
+ width: 100px;
|
|
|
+ height: 40px;
|
|
|
+ line-height: 40px;
|
|
|
font-family: Microsoft YaHei, Microsoft YaHei;
|
|
|
- font-weight: 400;
|
|
|
- margin-left: 20px;
|
|
|
+ font-weight: bold;
|
|
|
+ margin: 10px 0;
|
|
|
font-size: 20px;
|
|
|
- color: #000000;
|
|
|
- text-align: left;
|
|
|
- font-style: normal;
|
|
|
- text-transform: none;
|
|
|
+ color: #333333;
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+}
|
|
|
+//今日热点
|
|
|
+// 图文
|
|
|
+.hotList_photo_text {
|
|
|
+ width: 270px;
|
|
|
+
|
|
|
+ .hotList_photo_text1 {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ img {
|
|
|
+ float: left;
|
|
|
+ width: 120px;
|
|
|
+ height: 80px;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
|
|
|
- >span {
|
|
|
- float: right;
|
|
|
- font-family: Microsoft YaHei, Microsoft YaHei;
|
|
|
+ .hotlist_text {
|
|
|
+ float: left;
|
|
|
+ width: 126px;
|
|
|
+ height: 74px;
|
|
|
+ display: -webkit-box;
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
+ -webkit-line-clamp: 3;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ word-break: break-all;
|
|
|
font-weight: 400;
|
|
|
- font-size: 14px;
|
|
|
- margin-right: 10px;
|
|
|
- color: #999999;
|
|
|
- text-align: left;
|
|
|
- font-style: normal;
|
|
|
- text-transform: none;
|
|
|
+ font-size: 18px;
|
|
|
+ color: #333333;
|
|
|
+ padding-top: 3px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .hotList_photo_text1:first-child {
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
+ .hotList_photo_text1:hover{
|
|
|
+ .hotlist_text{
|
|
|
+ color: #dd7d18;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
+// 文字
|
|
|
+.message {
|
|
|
+ width: 270px;
|
|
|
+ margin-top: 20px;
|
|
|
|
|
|
-.messageList {
|
|
|
- height: 563px;
|
|
|
- padding-top: 15px;
|
|
|
- margin-bottom: 30px;
|
|
|
- background-color: #fbfbfb;
|
|
|
-
|
|
|
- >li {
|
|
|
- height: 24px;
|
|
|
- margin-bottom: 16px;
|
|
|
+ .messageList {
|
|
|
+ width: 270px;
|
|
|
white-space: nowrap;
|
|
|
/* 禁止换行 */
|
|
|
overflow: hidden;
|
|
|
/* 隐藏超出部分 */
|
|
|
text-overflow: ellipsis;
|
|
|
/* 超出部分显示省略号 */
|
|
|
+ font-family: Microsoft YaHei, Microsoft YaHei;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 18px;
|
|
|
+ color: #333333;
|
|
|
+ margin-bottom: 20px;
|
|
|
|
|
|
-
|
|
|
- >span {
|
|
|
- display: inline-block;
|
|
|
- width: 24px;
|
|
|
- height: 24px;
|
|
|
- margin-left: 22px;
|
|
|
- line-height: 24px;
|
|
|
- vertical-align: middle;
|
|
|
- text-align: center;
|
|
|
- background-color: #cecece;
|
|
|
- font-family: Microsoft YaHei, Microsoft YaHei;
|
|
|
- font-weight: 400;
|
|
|
- font-size: 18px;
|
|
|
- color: #FFFFFF;
|
|
|
- text-align: center;
|
|
|
- font-style: normal;
|
|
|
- text-transform: none;
|
|
|
- }
|
|
|
-
|
|
|
- >a {
|
|
|
- width: 256px;
|
|
|
- height: 21px;
|
|
|
- font-family: Microsoft YaHei, Microsoft YaHei;
|
|
|
- font-weight: 400;
|
|
|
- font-size: 16px;
|
|
|
+ a {
|
|
|
color: #333333;
|
|
|
- line-height: 19px;
|
|
|
- text-align: left;
|
|
|
- font-style: normal;
|
|
|
- text-transform: none;
|
|
|
- padding-left: 10px;
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
>li:hover>a {
|
|
|
- color: #139602;
|
|
|
+ color: #dd7d18;
|
|
|
}
|
|
|
|
|
|
- >li:nth-child(1)>span {
|
|
|
- background-color: #00c524;
|
|
|
- }
|
|
|
-
|
|
|
- >li:nth-child(2)>span {
|
|
|
- background-color: #ffdf27;
|
|
|
- }
|
|
|
-
|
|
|
- >li:nth-child(3)>span {
|
|
|
- background-color: #f3c57f;
|
|
|
- }
|
|
|
}
|
|
|
</style>
|