ソースを参照

修改小轮播图

asd123a20 2 年 前
コミット
8429f87efe
3 ファイル変更7 行追加6 行削除
  1. 3 2
      src/components/banner/banner.vue
  2. 2 2
      src/store/index.js
  3. 2 2
      vue.config.js

+ 3 - 2
src/components/banner/banner.vue

@@ -4,7 +4,7 @@
       <img :src="thumbnail" @click="btn">
       <div class="el-icon-arrow-left left" @click="prev"></div>
       <div class="el-icon-arrow-right right" @click="next"></div>
-      <div class="titlebox">
+      <div class="titlebox" v-if="list && list.data.length > 0">
         <span class="title">{{ title }}</span>
         <ul>
           <li v-for="(i, idx) in list && list.data" :key="idx" :class="{ item: i._id == liID }" @click="liClick(idx)"></li>
@@ -30,7 +30,8 @@ export default {
     };
   },
   async mounted() {
-    this.list = await this.contentsQuery({ bind: '02' });
+    this.list = await this.contentsQuery({ recommend: true });
+    console.log(this.list);
     this.liClick(0);
   },
   methods: {

+ 2 - 2
src/store/index.js

@@ -59,8 +59,8 @@ const actions = {
     commit('imgNewsQuery', res);
     return res;
   },
-  async contentsQuery ({ commit }, { parentCode, bind, limit, title }) {
-    const res = await $axios.get(api.contentsQuery, { title, parentCode, bind, skip: 0, limit: limit || 5 });
+  async contentsQuery ({ commit }, { parentCode, bind, limit, title, recommend }) {
+    const res = await $axios.get(api.contentsQuery, { recommend, title, parentCode, bind, skip: 0, limit: limit || 5 });
     return res;
   },
   async linkTypeQuery ({ commit }) {

+ 2 - 2
vue.config.js

@@ -5,8 +5,8 @@ module.exports = {
     port: 18080,
     proxy: {
       '/api/': {
-        target: 'http://skl.cc-lotus.info'
-        // target: 'http://127.0.0.1:18090'
+        // target: 'http://skl.cc-lotus.info'
+        target: 'http://127.0.0.1:18090'
       },
       '/upload/': {
         // target: 'http://127.0.0.1:9002'