wesley.chen 7 năm trước cách đây
mục cha
commit
a84a46f5db

+ 2 - 1
Furniture/page/homePage/homePage.js

xqd
@@ -42,11 +42,12 @@ Page({
     app.request({
       url: api.setting,
       success: function (e) {
-        //console.log(e.data)
+        console.log(e.data)
         that.setData({
           slide: e.data.banner,
           nav: e.data.navbar,
           sysinfo: e.data.setting,
+          menus: e.data.menus
         }),
           app.avatar = e.data.setting.avatar,
           app.username = e.data.setting.name

+ 37 - 12
Furniture/page/homePage/homePage.wxml

xqd
@@ -49,19 +49,44 @@
       </view>
     </view>
     <view class='weui-flex' style='border-bottom: 2rpx #D3D3D3 solid'>
-      <view class='weui-flex__item'>
-        <image src='../../images/xinpinganniu.png' style='height:110rpx;width:40%;margin-left:30%;margin-top:10rpx'></image>
-      </view>
-      <view class='weui-flex__item'>
-        <image src='../../images/tehuianniu.png' style='height:110rpx;width:40%;margin-left:30%;margin-top:10rpx'></image>
-      </view>
-      <view class='weui-flex__item'>
-        <image src='../../images/pingtuananniu.png' style='height:110rpx;width:40%;margin-left:30%;margin-top:10rpx'></image>
-      </view>
-      <view class='weui-flex__item'>
-        <image src='../../images/miaoshaanniu.png' style='height:110rpx;width:40%;margin-left:30%;margin-top:10rpx'></image>
-      </view>
+    <block>
+  <view class="bus-bg">
+    <view class="bus">
+    <block wx:for="{{menus}}" wx:key="{{index}}" wx:for-item="item">
+      <block wx:if="{{item.open_type == 3}}">
+          <view class="bus-item">
+           <navigator target="miniProgram" open-type="navigate" app-id="{{item.app_id}}" path="{{item.url}}" extra-data="" version="release"><image src='{{item.pic_url}}'></image>
+        </navigator>
+          <text>{{item.name}}</text>
+          </view>
+      </block>
+
+      <block wx:if="{{item.open_type == 4}}">
+          <view class="bus-item" bindtap="navigatorClick" data-url="{{item.url}}" data-open_type="{{item.open_type}}">
+          <image src="{{item.pic_url}}"></image>
+          <text>{{item.name}}</text>
+          </view>
+      </block>
+
+      <block wx:if="{{item.open_type == 1}}">
+          <view class="bus-item" bindtap="navigatorClick" data-phone="{{item.mobile}}" data-open_type="{{item.open_type}}">
+          <image src="{{item.pic_url}}"></image>
+          <text>{{item.name}}</text>
+          </view>
+      </block>
+
+      <block wx:if="{{item.open_type == 2}}">
+          <view class="bus-item" bindtap="navigatorClick" data-address="{{item.address}}" data-lon="{{item.lon}}" data-lat="{{item.lat}}" data-open_type="{{item.open_type}}">
+            <image src="{{item.pic_url}}"></image>
+            <text>{{item.name}}</text>
+          </view>
+      </block>
+    </block>
+    </view>
+  </view>
+</block>
     </view>
+
     <view class="relative" style='height:360rpx;border-bottom: 2rpx #D3D3D3 solid'>
       <image class="pic_background" src="../../images/jiajudapei.png"></image>
       <scroll-view  class="marketlist" scrollX="true">

+ 12 - 0
Furniture/page/homePage/homePage.wxss

xqd
@@ -101,3 +101,15 @@ page{
   text-align: center;
   margin-top: 10rpx;
 }
+
+.bus-bg{ width: 100%; background: white; padding-bottom: 10rpx; }
+.bus{ width: 100%; margin: 0px auto; padding-top:10px; display: flex; justify-content:left; flex-wrap: wrap; }
+.bus-item{ width: 25%; height: 150rpx; text-align: center; }
+.bus-item wx-image{ width: 40px; height: 40px; display: block; margin: 5px auto; }
+.bus-item wx-text{ font-size:13px; color:#333; height:35rpx; display:block; }
+.bus2{ width: 95%; justify-content: center; }
+.bus-item2{ width: 50%; height: 135rpx; text-align: center; }
+.bus-item2 wx-image{ width: 90%; height: 120rpx; display: block; margin: 0 auto; }
+.bus3{ width: 100%; justify-content: space-between; padding-top: 0px; }
+.bus-item3{ width: 32%; height: 175px; margin-top: 13rpx; border: 1px solid #f2f2f2; }
+.bus-item3 wx-image{ height: 175px; display: block; margin: 0 auto; }