123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <template>
- <div class="hotList">
- <div class="title">
- <h4>
- 最新资讯
- </h4>
- </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 }}
- </NuxtLink>
- </li>
- </ul>
- </div>
- </template>
- <script setup>
- const hotNewsList = ref([])
- async function getPageData() {
- const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
- method: 'GET',
- query: {
- 'pageSize': 14,
- 'level': 4,
- '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>
- .hotList {
- background: #fff;
- }
- .title {
- width: 380px;
- height: 40px;
- line-height: 40px;
- // border-top: 1px solid #139602;
- border-bottom: 1px solid #e7e7e7;
- background-color: #fbfbfb;
- >h4 {
- font-family: Microsoft YaHei, Microsoft YaHei;
- font-weight: 400;
- margin-left: 20px;
- font-size: 20px;
- color: #000000;
- text-align: left;
- font-style: normal;
- text-transform: none;
- >span {
- float: right;
- font-family: Microsoft YaHei, Microsoft YaHei;
- font-weight: 400;
- font-size: 14px;
- margin-right: 10px;
- color: #999999;
- text-align: left;
- font-style: normal;
- text-transform: none;
- }
- }
- }
- .messageList {
- height: 563px;
- padding-top: 15px;
- margin-bottom: 30px;
- background-color: #fbfbfb;
- >li {
- height: 24px;
- margin-bottom: 16px;
- white-space: nowrap;
- /* 禁止换行 */
- overflow: hidden;
- /* 隐藏超出部分 */
- text-overflow: ellipsis;
- /* 超出部分显示省略号 */
- >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;
- color: #333333;
- line-height: 19px;
- text-align: left;
- font-style: normal;
- text-transform: none;
- padding-left: 10px;
- }
- }
- >li:hover>a {
- color: #139602;
- }
- >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>
|