wangxy 3 年之前
父节点
当前提交
8c886bbff8
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2 2
      components/common/newsComp.vue
  2. 1 1
      pages/index.vue

+ 2 - 2
components/common/newsComp.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <!-- 新闻资讯 PC-->
-    <div class="client-news-information mta-hidden-xs">
+    <div class="client-news-information mta-hidden-xs" v-if="newsData.length">
       <h4 class="client-title">新闻资讯</h4>
       <div class="client-container">
         <div class="industry-information-box">
@@ -28,7 +28,7 @@
 
     <!-- 新闻资讯 手机-->
 
-      <div class="client-newsInfo-phone mta-hidden-sm">
+      <div class="client-newsInfo-phone mta-hidden-sm" v-if="newsData.length">
         <div class="client-container">
         <h4 class="client-title">新闻资讯</h4>
         <el-carousel :interval="5000" type="card" height="300px" indicator-position="none" arrow="never">

+ 1 - 1
pages/index.vue

@@ -157,7 +157,7 @@ export default {
   },
   async asyncData({$axios, store}) {
     let [res1, res2] = await Promise.all([
-      await $axios.$post(`/home/news/carousel`, {newsClassifyId: classifys.shouye.classify, 'keyword': classifys.kaoshixitong.keyword}).then(res => {
+      await $axios.$post(`/home/news/carousel`, {newsClassifyId: classifys.shouye.classify, 'keyword': classifys.shouye.keyword}).then(res => {
         return res;
       }),
       await $axios.$post(`/home/banner/list`, {code: BannerImgs.shouye}).then(res => {