123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <template>
- <!-- <div class="title">
- <h4>
- 热点精选
- </h4>
- </div> -->
- <!-- 列表 -->
- <!-- <ul class="rightList">
- <li v-for="item in hotNewsList">
- <NuxtLink :to="item.linkurl" v-show="item.islink == 1" :title="item.title">
- <img class="hotNewsImg" :src="item.imgurl">
- <p>{{ item.title }}</p>
- </NuxtLink>
- <NuxtLink :to="`/${item.pinyin}/${item.id}.html`" v-if="item.islink == 0" :title="item.title">
- <img class="hotNewsImg" :src="item.imgurl">
- <p>{{ item.title }}</p>
- </NuxtLink>
- </li>
- </ul> -->
- <div class="hotNews">
- <div class="hotNews_title">
- 热点精选
- </div>
- <ul class="hotNews_message">
- <li class="hotNews_messageList" v-for="(item, index) in hotNewsList" :key="index">
- <span class="number">{{ index + 1 }}</span>
- <NuxtLink
- :href="getLinkPathDetail(item)"
- :title="item.title"
- :key="item.id"
- :target="item.islink == 1 ? '_blank' : '_self'"
- >
- <span class="hotlist_text">{{ item.title }}</span>
- </NuxtLink>
- </li>
- </ul>
- </div>
- </template>
- <script setup>
- const getLinkPathDetail = (item) => {
- if (item.islink == 1) {
- return `${item.linkurl}`;
- } else {
- return `/${item.pinyin}/${item.id}.html`;
- }
- }
- const hotNewsList = ref([])
- async function getPageData() {
- const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
- method: 'GET',
- query: {
- 'pageSize': 8,
- 'level': 5,
- 'placeid': 0,
- 'id': 0
- },
- });
- if (mkdata.code == 200) {
- hotNewsList.value = mkdata.data;
- } else {
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- console.log("错误位置:获取热点精选")
- console.log("后端错误反馈:", mkdata.message)
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- }
- }
- getPageData();
- </script>
- <style lang="less" scoped>
- .hotNews {
- width: 270px;
- height: 597px;
- border-top: 2px solid #dd7d18;
- margin-top: 40px;
- //标题
- .hotNews_title {
- width: 100px;
- height: 40px;
- line-height: 40px;
- font-family: Microsoft YaHei, Microsoft YaHei;
- font-weight: bold;
- margin: 20px 0 15px;
- font-size: 20px;
- color: #333333;
- }
- //新闻列表
- .hotNews_message {
- width: 270px;
- .hotNews_messageList {
- width: 270px;
- height: 64px;
- line-height: 64px;
- border-bottom: 1px solid #E4E4E4;
- font-weight: 400;
- font-size: 18px;
- color: #333333;
- ;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- a {
- color: #333333;
- }
- .number {
- color: #999999;
- margin-right: 13px;
- font-family: DingTalk JinBuTi, DingTalk JinBuTi;
- }
- }
- .hotNews_messageList:nth-child(1) {
- .number {
- color: #dd7d18;
- }
- }
- .hotNews_messageList:nth-child(2) {
- .number {
- color: #dd7d18;
- }
- }
- .hotNews_messageList:nth-child(3) {
- .number {
- color: #dd7d18;
- }
- }
- .hotNews_messageList:hover {
- color: #dd7d18;
- a {
- color: #dd7d18;
- }
- }
- }
- }
- </style>
|