sunlupeng 1 year ago
parent
commit
1d6d1d8ada
1 changed files with 10 additions and 14 deletions
  1. 10 14
      src/views/HomeView/PointsMall.vue

+ 10 - 14
src/views/HomeView/PointsMall.vue

@@ -7,7 +7,7 @@
                     <el-carousel indicator-position="none" height="250px" :interval="5000" v-if="bannerList.length > 0">
                         <el-carousel-item v-for="(item, index) in bannerList" :key="index">
                             <!-- <router-link to="/productTrials"> -->
-                                <img style="width: 100%; height: 100%" :src="item.url" class="banner" />
+                                <img style="width: 100%; height: 100%" :src="item.dictValue" class="banner" />
                             <!-- </router-link> -->
                         </el-carousel-item>
                     </el-carousel>
@@ -166,23 +166,13 @@
     </div>
 </template>
 <script>
-import { integralList, festivalList, notice, welfareType, integralTypes } from "@/api/allApi";
+import { integralList, festivalList, notice, welfareType, dictList } from "@/api/allApi";
 import { getTab } from '@/utils/auth'
 import { debounce } from '@/utils/index'
 export default {
     data() {
         return {
-            bannerList: [
-            {
-                url: require('@/assets/image/banner5.png')
-            },
-            {
-                url: require('@/assets/image/banner6.png')
-            },
-            {
-                url: require('@/assets/image/banner7.png')
-            },
-        ],
+            bannerList: [],
             page: 1,
             pages: 1,
             // tab 列表
@@ -239,6 +229,7 @@ export default {
         };
     },
     created() {
+        this.getBannerList();
         const Tab = getTab();
         if (Tab == 'gift') {
             this.activeName = 'giftNotice';
@@ -249,6 +240,11 @@ export default {
         this.getNotice(this.activeName);
     },
     methods: {
+        getBannerList(){
+            dictList({dictType:'index_lbt'}).then(response=>{
+                this.bannerList = response.data.data; 
+            })
+        },
         handleClickGood(id) {
             this.$router.push({
                 path: '/home/pointsMall/goodDetail',
@@ -271,7 +267,7 @@ export default {
             this.getFirstList();
         },
         getIntegralTypes() {
-            integralTypes({ dictType: 'mall_sku_attribute' }).then(response => {
+            dictList({ dictType: 'mall_sku_attribute' }).then(response => {
                 console.log(response.data.data);
                 const dataList = response.data.data;
                 const data = {