| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364 |
- <template>
- <div class="hotNews">
- <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">
- <div class="hotNewsText">
- <div class="textTitle">{{ item.title }}</div>
- <div class="content dot3">{{ item.introduce }}</div>
- </div>
- </NuxtLink>
- <NuxtLink :to="`/${item.pinyin}/${item.id}.html`" v-if="item.islink == 0" :title="item.title">
- <img class="hotNewsImg" :src="item.imgurl">
- <div class="hotNewsText">
- <div class="textTitle dot1">{{ item.title }}</div>
- <div class="content dot3">{{ item.introduce }}</div>
- </div>
- </NuxtLink>
- </li>
- </ul>
- </div>
- </template>
- <script setup>
- const hotNewsList = ref([])
- async function getPageData() {
- const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
- method: 'GET',
- query: {
- 'textnum': 0,
- 'imgnum': 6,
- '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 == 6) {
- break;
- }
- }
- }
- } 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>
- @media screen and (min-width: 1401px) {
- .hotNews {
- font-family: "微软雅黑";
- width: 100%;
- height: auto;
- overflow: hidden;
- border: 1PX solid #C6E9FF;
- border-top-left-radius: 5PX;
- border-top-right-radius: 5PX;
- padding-bottom: 10PX;
- margin-bottom: 10PX;
- box-sizing: border-box;
- .title {
- width: 100%;
- height: 37PX;
- line-height: 37PX;
- overflow: hidden;
- padding: 0 10PX;
- box-sizing: border-box;
- background: url(../../public/index/hotNewsBg.jpg) no-repeat center top;
- background-size: 100% 100%;
- h4 {
- font-size: 18PX;
- color: #fff;
- font-weight: bold;
- }
- }
- .rightList {
- padding-top: 5PX;
- li {
- width: 99%;
- height: auto;
- overflow: hidden;
- margin-top: 10PX;
- padding: 0 20PX;
- box-sizing: border-box;
- a {
- display: flex;
- .hotNewsImg {
- width: 92PX;
- height: 94PX;
- border-radius: 4PX;
- }
- .hotNewsText {
- width: 70%;
- height: 94PX;
- padding-left: 10PX;
- font-size: 14PX;
- color: #000;
- line-height: 24PX;
- .textTitle {
- width: 98%;
- line-height: 30PX;
- font-size: 14PX;
- color: #0293ff;
- font-weight: bold;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .content {
- width: 98%;
- height: 60PX;
- line-height: 20PX;
- font-size: 12PX;
- color: #000;
- }
- }
- }
- }
- }
- }
- .dot3 {
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 3;
- overflow: hidden;
- text-overflow: ellipsis;
- word-break: break-all;
- }
- .hotNewsImg {
- float: left;
- width: 150PX;
- height: 100PX;
- border-radius: 4PX;
- }
- }
- @media screen and (min-width: 801px) and (max-width: 1400px) {
- .hotNews {
- font-family: "微软雅黑";
- width: 100%;
- height: auto;
- overflow: hidden;
- border: 1PX solid #C6E9FF;
- border-top-left-radius: 5PX;
- border-top-right-radius: 5PX;
- padding-bottom: 10PX;
- margin-bottom: 10PX;
- .title {
- width: 100%;
- height: 37PX;
- line-height: 37PX;
- overflow: hidden;
- padding: 0 10PX;
- background: url(../../public/index/hotNewsBg.jpg) no-repeat center top;
- background-size: 100% 100%;
- h4 {
- font-size: 18PX;
- color: #fff;
- font-weight: bold;
- }
- }
- .rightList {
- box-sizing: border-box;
- padding-top: 5PX;
- li {
- width: 100%;
- height: auto;
- overflow: hidden;
- margin-top: 10PX;
- padding: 0 20PX;
- box-sizing: border-box;
- a {
- width: 100%;
- display: flex;
- .hotNewsImg {
- width: 92PX;
- height: 94PX;
- border-radius: 4PX;
- }
- .hotNewsText {
- width: calc(100% - 92PX);
- height: 94PX;
- padding-left: 10PX;
- font-size: 14PX;
- color: #000;
- line-height: 24PX;
- box-sizing: border-box;
- .textTitle {
- width: 98%;
- line-height: 30PX;
- font-size: 14PX;
- color: #0293ff;
- font-weight: bold;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .content {
- width: 98%;
- height: 60PX;
- line-height: 20PX;
- font-size: 12PX;
- color: #000;
- }
- }
- }
- }
- }
- }
- .dot3 {
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 3;
- overflow: hidden;
- text-overflow: ellipsis;
- word-break: break-all;
- }
- .hotNewsImg {
- float: left;
- width: 150PX;
- height: 100PX;
- border-radius: 4PX;
- }
- }
- @media screen and (max-width: 800px) {
- .hotNews {
- font-family: "微软雅黑";
- width: 100%;
- height: auto;
- overflow: hidden;
- border: 2px solid #C6E9FF;
- border-top-left-radius: 10px;
- border-top-right-radius: 10px;
- padding-bottom: 20px;
- margin-bottom: 20px;
- .title {
- width: 100%;
- height: 74px;
- line-height: 74px;
- overflow: hidden;
- padding: 0 20px;
- background: url(../../public/index/hotNewsBg.jpg) no-repeat center top;
- background-size: 100% 100%;
- h4 {
- font-size: 36px;
- color: #fff;
- font-weight: bold;
- }
- }
- .rightList {
- padding-top: 10px;
- li {
- width: 100%;
- height: auto;
- overflow: hidden;
- margin-top: 20px;
- padding: 0 40px;
- box-sizing: border-box;
- font-family: "微软雅黑";
- a {
- display: flex;
- .hotNewsImg {
- float: left;
- width: 224px;
- height: 180px;
- border-radius: 4px;
- }
- .hotNewsText {
- width: 70%;
- height: 180px;
- padding-left: 20px;
- font-size: 28px;
- color: #000;
- line-height: 48px;
- .textTitle {
- width: 98%;
- line-height: 60px;
- font-size: 32px;
- color: #0293ff;
- font-weight: bold;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .content {
- width: 98%;
- height: 120px;
- line-height: 40px;
- font-size: 26px;
- color: #000;
- }
- }
- }
- }
- }
- }
- .dot1 {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .dot3 {
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 3;
- overflow: hidden;
- text-overflow: ellipsis;
- word-break: break-all;
- }
- }
- </style>
|