| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <template>
- <div class="title">
- <h4>
- 热点精选
- </h4>
- </div>
- <!-- 列表 -->
- <ul class="rightList">
- <li v-for="item in hotNewsList">
- <NuxtLink :to="item.linkurl" v-if="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>
- </template>
- <script setup>
- const hotNewsList = ref([])
- async function getPageData() {
- const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
- method: 'GET',
- query: {
- 'textnum': 0,
- 'imgnum': 5,
- 'level': 5,
- 'placeid': 0,
- 'id': 0
- },
- });
- console.log("获取热点精选", mkdata);
- if (mkdata.code == 200) {
- for (let item of mkdata.data.img) {
- if (item.imgurl) {
- hotNewsList.value.push(item)
- if (hotNewsList.value.length == 5) {
- break;
- }
- }
- }
- // 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>
- .title {
- width: 100%;
- overflow: hidden;
- >h4 {
- width: 100%;
- height: 70px;
- line-height: 70px;
- background-size: 100% 100%;
- background: url('../../public/index/reconewsh2.gif') no-repeat #158d91;
- font-size: 22px;
- color: #fff;
- font-weight: bold;
- padding-left: 30px;
- box-sizing: border-box;
- >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;
- }
- }
- }
- .rightList {
- padding-top: 20px;
- background-color: #f1f1f1;
- padding-bottom: 30px;
- >li {
- width: 90%;
- margin: 0 auto;
- border-bottom: 1px dashed #ccc;
- background: url(../../public/index/reconlia.png) no-repeat 0 20px;
- padding-left: 20px;
- box-sizing: border-box;
- a {
- display: block;
- width: 100%;
- height: 50px;
- line-height: 50px;
- font-size: 14px;
- color: #333;
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- }
- }
- }
- .title>h4 {
- height: 55PX;
- line-height: 55PX;
- font-size: 20PX;
- }
- .rightList {}
- .rightList>li a {
- height: 44PX;
- line-height: 44PX;
- font-size: 16PX;
- }
- .rightList>li {
- background-position-y: center;
- }
- @media screen and (min-width: 1401px) {
- //你的样式
- }
- @media screen and (max-width: 1400px) {}
- @media screen and (min-width: 801px) and (max-width: 1400px) {
- //你的样式
- }
- @media screen and (max-width: 800px) {
- .title>h4 {
- height: 55px;
- line-height: 55px;
- font-size: 20px;
- }
- .rightList {}
- .rightList>li {
- padding-left: 26px;
- }
- .rightList>li a {
- height: 55px;
- line-height: 55px;
- font-size: 22px;
- }
- }
- </style>
|