Commit 2a731e673f423084d274a5241f4e33f8237ca9b9
1 parent
0027ba62
注释底部导航
Showing
8 changed files
with
82 additions
and
48 deletions
app.js
@@ -36,30 +36,31 @@ App({ | @@ -36,30 +36,31 @@ App({ | ||
36 | "borderStyle": "white",// | 36 | "borderStyle": "white",// |
37 | "backgroundColor": "#ffffff",//背景color | 37 | "backgroundColor": "#ffffff",//背景color |
38 | "iscustom":'', | 38 | "iscustom":'', |
39 | + "url":"", | ||
39 | "list": [ | 40 | "list": [ |
40 | { | 41 | { |
41 | "weappurl": "/pages/index/index/index", | 42 | "weappurl": "/pages/index/index/index", |
42 | "nav_name": "首页", | 43 | "nav_name": "首页", |
43 | - "src": "/images/bar/index.png", | ||
44 | - "src_sele": "/images/bar/index_on.png" | 44 | + "src": "/miniapp/images/bar/index.png", |
45 | + "src_sele": "/miniapp/images/bar/index_on.png" | ||
45 | }, | 46 | }, |
46 | { | 47 | { |
47 | "weappurl": "/pages/goods/categoryList/categoryList", | 48 | "weappurl": "/pages/goods/categoryList/categoryList", |
48 | "nav_name": "分类", | 49 | "nav_name": "分类", |
49 | - "src": "/images/bar/fl.png", | ||
50 | - "src_sele": "/images/bar/fl_on.png" | 50 | + "src": "/miniapp/images/bar/fl.png", |
51 | + "src_sele": "/miniapp/images/bar/fl_on.png" | ||
51 | }, | 52 | }, |
52 | { | 53 | { |
53 | "weappurl": "/pages/cart/cart/cart", | 54 | "weappurl": "/pages/cart/cart/cart", |
54 | "nav_name": "购物车", | 55 | "nav_name": "购物车", |
55 | - "src": "/images/bar/car.png", | ||
56 | - "src_sele": "/images/bar/car_on.png" | 56 | + "src": "/miniapp/images/bar/car.png", |
57 | + "src_sele": "/miniapp/images/bar/car_on.png" | ||
57 | }, | 58 | }, |
58 | { | 59 | { |
59 | "weappurl": "/pages/user/index/index", | 60 | "weappurl": "/pages/user/index/index", |
60 | "nav_name": "我的", | 61 | "nav_name": "我的", |
61 | - "src": "/images/bar/user.png", | ||
62 | - "src_sele": "/images/bar/user_on.png" | 62 | + "src": "/miniapp/images/bar/user.png", |
63 | + "src_sele": "/miniapp/images/bar/user_on.png" | ||
63 | } | 64 | } |
64 | ] | 65 | ] |
65 | }, | 66 | }, |
app.json
@@ -111,7 +111,38 @@ | @@ -111,7 +111,38 @@ | ||
111 | "backgroundColor": "#ffffff", | 111 | "backgroundColor": "#ffffff", |
112 | "enablePullDownRefresh": true | 112 | "enablePullDownRefresh": true |
113 | }, | 113 | }, |
114 | - | 114 | + "tabBar": { |
115 | + "color": "#6e6d6b", | ||
116 | + "selectedColor": "#f23030", | ||
117 | + "borderStyle": "white", | ||
118 | + "backgroundColor": "#ffffff", | ||
119 | + "list": [ | ||
120 | + { | ||
121 | + "pagePath": "pages/index/index/index", | ||
122 | + "text": "首页", | ||
123 | + "iconPath": "packageA/images/bar/index.png", | ||
124 | + "selectedIconPath": "packageA/images/bar/index_on.png" | ||
125 | + }, | ||
126 | + { | ||
127 | + "pagePath": "pages/goods/categoryList/categoryList", | ||
128 | + "text": "分类", | ||
129 | + "iconPath": "packageA/images/bar/fl.png", | ||
130 | + "selectedIconPath": "packageA/images/bar/fl_on.png" | ||
131 | + }, | ||
132 | + { | ||
133 | + "pagePath": "pages/cart/cart/cart", | ||
134 | + "text": "购物车", | ||
135 | + "iconPath": "packageA/images/bar/car.png", | ||
136 | + "selectedIconPath": "packageA/images/bar/car_on.png" | ||
137 | + }, | ||
138 | + { | ||
139 | + "pagePath": "pages/user/index/index", | ||
140 | + "text": "我的", | ||
141 | + "iconPath": "packageA/images/bar/user.png", | ||
142 | + "selectedIconPath": "packageA/images/bar/user_on.png" | ||
143 | + } | ||
144 | + ] | ||
145 | + }, | ||
115 | "debug": false, | 146 | "debug": false, |
116 | "sitemapLocation": "sitemap.json" | 147 | "sitemapLocation": "sitemap.json" |
117 | } | 148 | } |
118 | \ No newline at end of file | 149 | \ No newline at end of file |
pages/cart/cart/cart.wxml
@@ -183,7 +183,7 @@ | @@ -183,7 +183,7 @@ | ||
183 | 183 | ||
184 | 184 | ||
185 | <warn id="warn"></warn> | 185 | <warn id="warn"></warn> |
186 | -<view wx:if="{{isTabBar == true}}"> | 186 | +<!-- <view wx:if="{{isTabBar == true}}"> |
187 | <import src="../../tabbar/tabbar.wxml" /> | 187 | <import src="../../tabbar/tabbar.wxml" /> |
188 | <template is="tabBar" data="{{tabBar}}" /> | 188 | <template is="tabBar" data="{{tabBar}}" /> |
189 | -</view> | ||
190 | \ No newline at end of file | 189 | \ No newline at end of file |
190 | +</view> --> | ||
191 | \ No newline at end of file | 191 | \ No newline at end of file |
pages/goods/categoryList/categoryList.wxml
@@ -487,7 +487,7 @@ | @@ -487,7 +487,7 @@ | ||
487 | </block> | 487 | </block> |
488 | 488 | ||
489 | </block> | 489 | </block> |
490 | -<view wx:if="{{isTabBar == true}}"> | 490 | +<!-- <view wx:if="{{isTabBar == true}}"> |
491 | <import src="../../tabbar/tabbar.wxml" /> | 491 | <import src="../../tabbar/tabbar.wxml" /> |
492 | <template is="tabBar" data="{{tabBar}}" /> | 492 | <template is="tabBar" data="{{tabBar}}" /> |
493 | -</view> | ||
494 | \ No newline at end of file | 493 | \ No newline at end of file |
494 | +</view> --> | ||
495 | \ No newline at end of file | 495 | \ No newline at end of file |
pages/index/index/index.js
@@ -106,37 +106,39 @@ Page({ | @@ -106,37 +106,39 @@ Page({ | ||
106 | async onShow() { | 106 | async onShow() { |
107 | var th = this; | 107 | var th = this; |
108 | //获取底部导航 | 108 | //获取底部导航 |
109 | - await getApp().request.promiseGet("/api/weshop/storeFooter/get/"+o.stoid, { | 109 | + // await getApp().request.promiseGet("/api/weshop/storeFooter/get/"+o.stoid, { |
110 | 110 | ||
111 | - }).then(res => { | ||
112 | - var e = res; | ||
113 | - console.log(e) | ||
114 | - if(e.data.code != -1){ | ||
115 | - getApp().globalData.isTabBar = true | ||
116 | - //console.log(JSON.parse(e)) | ||
117 | - var itemList = e.data.data.data; | 111 | + // }).then(res => { |
112 | + // var e = res; | ||
113 | + // console.log(e) | ||
114 | + // if(e.data.code != -1){ | ||
115 | + // getApp().globalData.isTabBar = true | ||
116 | + // //console.log(JSON.parse(e)) | ||
117 | + // var itemList = e.data.data.data; | ||
118 | 118 | ||
119 | - itemList = JSON.parse(itemList) | ||
120 | - for(var i=0; i<itemList.length; i++){ | ||
121 | - itemList[i]['active'] = false | ||
122 | - } | ||
123 | - console.log(itemList) | ||
124 | - getApp().globalData.tabBar.backgroundColor = e.data.data.bkcolor | ||
125 | - getApp().globalData.tabBar.selectedColor = e.data.data.fontcolor_sele | ||
126 | - getApp().globalData.tabBar.color = e.data.data.fontcolor | ||
127 | - getApp().globalData.tabBar.list = itemList | ||
128 | - getApp().globalData.tabBar.iscustom = '1' | ||
129 | - wx.hideTabBar({}) | ||
130 | - }else{ | ||
131 | - getApp().globalData.isTabBar = true | ||
132 | - getApp().globalData.tabBar.iscustom = '2' | ||
133 | - } | ||
134 | - th.setData({ | ||
135 | - isTabBar: getApp().globalData.isTabBar, | ||
136 | - }); | ||
137 | - }) | ||
138 | - console.log("isTabBar:="+getApp().globalData.isTabBar) | ||
139 | - t.editTabBar(); //显示自定义的底部导航 | 119 | + // itemList = JSON.parse(itemList) |
120 | + // for(var i=0; i<itemList.length; i++){ | ||
121 | + // itemList[i]['active'] = false | ||
122 | + // } | ||
123 | + // console.log(itemList) | ||
124 | + // getApp().globalData.tabBar.backgroundColor = e.data.data.bkcolor | ||
125 | + // getApp().globalData.tabBar.selectedColor = e.data.data.fontcolor_sele | ||
126 | + // getApp().globalData.tabBar.color = e.data.data.fontcolor | ||
127 | + // getApp().globalData.tabBar.list = itemList | ||
128 | + // getApp().globalData.tabBar.iscustom = '1' | ||
129 | + // getApp().globalData.tabBar.url = ""; | ||
130 | + // wx.hideTabBar({}) | ||
131 | + // }else{ | ||
132 | + // getApp().globalData.isTabBar = true | ||
133 | + // getApp().globalData.tabBar.iscustom = '2' | ||
134 | + // getApp().globalData.tabBar.url = th.data.url; | ||
135 | + // } | ||
136 | + // th.setData({ | ||
137 | + // isTabBar: getApp().globalData.isTabBar, | ||
138 | + // }); | ||
139 | + // }) | ||
140 | + // console.log("isTabBar:="+getApp().globalData.isTabBar) | ||
141 | + // t.editTabBar(); //显示自定义的底部导航 | ||
140 | 142 | ||
141 | if (getApp().globalData.user_id) getApp().requestCardNum(); | 143 | if (getApp().globalData.user_id) getApp().requestCardNum(); |
142 | await this.init_load(); | 144 | await this.init_load(); |
pages/index/index/index.wxml
@@ -360,8 +360,8 @@ | @@ -360,8 +360,8 @@ | ||
360 | </view> | 360 | </view> |
361 | </block> | 361 | </block> |
362 | <!-- <view wx:if="{{isTabBar == true}}"> --> | 362 | <!-- <view wx:if="{{isTabBar == true}}"> --> |
363 | - <import src="../../tabbar/tabbar.wxml" /> | ||
364 | - <template is="tabBar" data="{{tabBar}}" /> | 363 | + <!-- <import src="../../tabbar/tabbar.wxml" /> |
364 | + <template is="tabBar" data="{{tabBar}}" /> --> | ||
365 | <!-- </view> --> | 365 | <!-- </view> --> |
366 | 366 | ||
367 | 367 |
pages/tabbar/tabbar.wxml
@@ -4,8 +4,8 @@ | @@ -4,8 +4,8 @@ | ||
4 | <view class="tab-bar" style="position:fixed;color: {{tabBar.color}}; background: {{tabBar.backgroundColor}}; {{tabBar.position=='top'? 'top: 0' : 'bottom: 0'}};width:100%;height:50px;z-index:9999999"> | 4 | <view class="tab-bar" style="position:fixed;color: {{tabBar.color}}; background: {{tabBar.backgroundColor}}; {{tabBar.position=='top'? 'top: 0' : 'bottom: 0'}};width:100%;height:50px;z-index:9999999"> |
5 | <block wx:for="{{tabBar.list}}" wx:key="weappurl"> | 5 | <block wx:for="{{tabBar.list}}" wx:key="weappurl"> |
6 | <navigator url="{{item.weappurl}}" bindtap="goto({{item.weappurl}})" class="tabbar_item {{item.clas}}" style="{{item.active? 'color: '+(item.selectedColor? item.selectedColor : tabBar.selectedColor) : ''}};position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> | 6 | <navigator url="{{item.weappurl}}" bindtap="goto({{item.weappurl}})" class="tabbar_item {{item.clas}}" style="{{item.active? 'color: '+(item.selectedColor? item.selectedColor : tabBar.selectedColor) : ''}};position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> |
7 | - <view style="width:50%;height:50%;margin-left:25%;"><image src="{{item.src_sele}}" wx:if="{{item.active&&item.src_sele}}" class="img" style="width:100%;height:100%"></image> | ||
8 | - <image src="{{item.src}}" wx:if="{{!item.active&&item.src}}" class="img" style="width:100%;height:100%"></image></view> | 7 | + <view style="width:50%;height:50%;margin-left:25%;"><image src="{{tabBar.url}}{{item.src_sele}}" wx:if="{{item.active&&item.src_sele}}" class="img" style="width:100%;height:100%"></image> |
8 | + <image src="{{tabBar.url}}{{item.src}}" wx:if="{{!item.active&&item.src}}" class="img" style="width:100%;height:100%"></image></view> | ||
9 | <view style="width:100%;height:100%;"><text class="tabbar_text" wx:if="{{item.nav_name}}" style="font-size:0.8rem">{{item.nav_name}}</text></view> | 9 | <view style="width:100%;height:100%;"><text class="tabbar_text" wx:if="{{item.nav_name}}" style="font-size:0.8rem">{{item.nav_name}}</text></view> |
10 | </navigator> | 10 | </navigator> |
11 | </block> | 11 | </block> |
pages/user/index/index.wxml
@@ -297,7 +297,7 @@ | @@ -297,7 +297,7 @@ | ||
297 | </view> | 297 | </view> |
298 | 298 | ||
299 | <pop_txt id="pop_txt"></pop_txt> | 299 | <pop_txt id="pop_txt"></pop_txt> |
300 | -<view wx:if="{{isTabBar == true}}"> | 300 | +<!-- <view wx:if="{{isTabBar == true}}"> |
301 | <import src="../../tabbar/tabbar.wxml" /> | 301 | <import src="../../tabbar/tabbar.wxml" /> |
302 | <template is="tabBar" data="{{tabBar}}" /> | 302 | <template is="tabBar" data="{{tabBar}}" /> |
303 | -</view> | ||
304 | \ No newline at end of file | 303 | \ No newline at end of file |
304 | +</view> --> | ||
305 | \ No newline at end of file | 305 | \ No newline at end of file |