Browse Source

首页修改

sharp-agezi 6 years ago
parent
commit
b6ca82a69d

BIN
images/news/momo.jpg


BIN
images/news/spec_01.png


BIN
images/news/spec_02.png


BIN
images/rexiao_1.png


+ 6 - 10
pages/index/index.js

@@ -93,14 +93,7 @@ Page({
         href: '/pages/patternMenu/patternMenu'
         href: '/pages/patternMenu/patternMenu'
       }
       }
     ],
     ],
-    specArray:[
-      {
-        src:'../../images/news/spec_01.png'
-      },
-      {
-        src: '../../images/news/spec_02.png'
-      }
-    ],
+    specArray:[],
     navList:["推荐","中秋","改良生活","优化办公","智能科技"],
     navList:["推荐","中秋","改良生活","优化办公","智能科技"],
     firstActive: "header_nav_active",
     firstActive: "header_nav_active",
     currentItem : '',
     currentItem : '',
@@ -486,7 +479,7 @@ Page({
       page:1,
       page:1,
     })
     })
     that.getGoodsNews(that)
     that.getGoodsNews(that)
-    that.getSpecList()
+    that.getSpecList(that)
     if (wx.getStorageSync('channelIdObj').channelId) {
     if (wx.getStorageSync('channelIdObj').channelId) {
       that.setData({
       that.setData({
         loginStatic: true,
         loginStatic: true,
@@ -500,7 +493,7 @@ Page({
       url : "/pages/find/index"
       url : "/pages/find/index"
     })
     })
   },
   },
-  getSpecList(){
+  getSpecList(that){
     wx.request({
     wx.request({
       url: host+'/classifyapi/classifyTwoAll',
       url: host+'/classifyapi/classifyTwoAll',
       method:'get',
       method:'get',
@@ -509,6 +502,9 @@ Page({
       },
       },
       success:function(res){
       success:function(res){
         console.log(res)
         console.log(res)
+        that.setData({
+          specArray:res.data.rows
+        })
       }
       }
     })
     })
   },
   },

+ 1 - 1
pages/index/index.wxml

@@ -77,7 +77,7 @@
             <block wx:for="{{specArray}}">
             <block wx:for="{{specArray}}">
               <swiper-item>
               <swiper-item>
               <view class='mar-r20' style='height:100%'>
               <view class='mar-r20' style='height:100%'>
-                <image src="{{item.src}}" class="slide-image" mode="aspectFill" />
+                <image src="{{item.classify_logo}}" class="slide-image" mode="aspectFill" />
               </view>
               </view>
               </swiper-item>
               </swiper-item>
             </block>
             </block>

BIN
rexiao_1.zip