Explorar el Código

feat: 首页 轮播 公告

DaMowang hace 3 años
padre
commit
d3730d7642
Se han modificado 1 ficheros con 9 adiciones y 19 borrados
  1. 9 19
      src/pages/index/index.vue

+ 9 - 19
src/pages/index/index.vue

@@ -20,7 +20,7 @@
                 </view>
                 <swiper class="notice_swiper" vertical autoplay circular :interval="5000" :duration="1000">
                     <swiper-item v-for="(item, index) in not_list" :key="index">
-                        <text class="not_list ellipsis1">{{ item.contentTitle }}</text>
+                        <text class="not_list ellipsis1">{{ item.content }}</text>
                         <text class="not_ico iconfont">&#xe62e;</text>
                     </swiper-item>
                 </swiper>
@@ -28,12 +28,12 @@
             <!-- 公告-end -->
 
             <!-- 金刚区 -->
-            <view class="head_area">
+            <!-- <view class="head_area">
                 <view class="area_list" v-for="(item, index) in area_list" :key="index" @click="setPageUrl(item)">
                     <image class="area_img" :src="item.url"></image>
                     <view class="area_name">{{ item.name }}</view>
                 </view>
-            </view>
+            </view> -->
             <!-- 金刚区-end -->
 
             <!-- 活动 -->
@@ -80,7 +80,7 @@ export default {
             this.$refs.goodslist.loadData();
         })
         this.getBanner(); //获取轮播图
-        // this.getAnnounce(); //获取公告列表
+        this.getAnnounce(); //获取公告列表
         // this.getImageTwo(); //金刚区
         // this.getImage(); //获取活动列表
     },
@@ -99,24 +99,14 @@ export default {
         },
         // 获取公告列表
         getAnnounce() {
-            post("ShuZiTeaYW/announce/getAnnounce", {
-                status: 2,
-            }).then((res) => {
-                if (res.status == 200) {
-                    this.not_list = res.announce;
-                }
-            });
-        },
-        // 获取公告列表
-        getAnnounce() {
-            post("ShuZiTeaYW/announce/getAnnounce", {
-                status: 2,
-            }).then((res) => {
-                if (res.status == 200) {
-                    this.not_list = res.announce;
+            post("notice").then((res) => {
+                console.log(res);
+                if (res.code === 0) {
+                    this.not_list = [res.data.data];
                 }
             });
         },
+        
         // 获取金刚区列表
         getImageTwo() {
             post("ShuZiTeaSpecial/special/imageTwo").then((res) => {