123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <template>
- <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;
- margin-top: 20px;
- //标题
- .hotNews_title {
- width: 100px;
- font-family: Microsoft YaHei, Microsoft YaHei;
- font-weight: bold;
- margin: 30px 0 10px;
- font-size: 20px;
- color: #255590;
- border-left: #255590 5px solid;
- padding-left: 17px;
- }
- //新闻列表
- .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: #255590;
- }
- }
- .hotNews_messageList:nth-child(2) {
- .number {
- color: #255590;
- }
- }
- .hotNews_messageList:nth-child(3) {
- .number {
- color: #255590;
- }
- }
- .hotNews_messageList:hover {
- color: #255590;
- a {
- color: #255590;
- }
- }
- }
- }
- </style>
|