Commit 5c2c8c1b06f1680b92f3c72d80d0212c294e3334
1 parent
aa05ad8d
优化商品分类&添加自定义底部导航3
Showing
4 changed files
with
84 additions
and
0 deletions
pages/tabbar/tabbar.js
0 → 100644
| 1 | +// pages/tabbar.js | |
| 2 | +var d = getApp().globalData; | |
| 3 | +Page({ | |
| 4 | + | |
| 5 | + /** | |
| 6 | + * 页面的初始数据 | |
| 7 | + */ | |
| 8 | + data: { | |
| 9 | + isTabBar:d.isTabBar | |
| 10 | + }, | |
| 11 | + | |
| 12 | + /** | |
| 13 | + * 生命周期函数--监听页面加载 | |
| 14 | + */ | |
| 15 | + onLoad: function (options) { | |
| 16 | + | |
| 17 | + }, | |
| 18 | + | |
| 19 | + /** | |
| 20 | + * 生命周期函数--监听页面初次渲染完成 | |
| 21 | + */ | |
| 22 | + onReady: function () { | |
| 23 | + | |
| 24 | + }, | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 生命周期函数--监听页面显示 | |
| 28 | + */ | |
| 29 | + onShow: function () { | |
| 30 | + | |
| 31 | + }, | |
| 32 | + | |
| 33 | + /** | |
| 34 | + * 生命周期函数--监听页面隐藏 | |
| 35 | + */ | |
| 36 | + onHide: function () { | |
| 37 | + | |
| 38 | + }, | |
| 39 | + | |
| 40 | + /** | |
| 41 | + * 生命周期函数--监听页面卸载 | |
| 42 | + */ | |
| 43 | + onUnload: function () { | |
| 44 | + | |
| 45 | + }, | |
| 46 | + | |
| 47 | + /** | |
| 48 | + * 页面相关事件处理函数--监听用户下拉动作 | |
| 49 | + */ | |
| 50 | + onPullDownRefresh: function () { | |
| 51 | + | |
| 52 | + }, | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 页面上拉触底事件的处理函数 | |
| 56 | + */ | |
| 57 | + onReachBottom: function () { | |
| 58 | + | |
| 59 | + }, | |
| 60 | + | |
| 61 | + /** | |
| 62 | + * 用户点击右上角分享 | |
| 63 | + */ | |
| 64 | + onShareAppMessage: function () { | |
| 65 | + | |
| 66 | + } | |
| 67 | +}) | |
| 0 | 68 | \ No newline at end of file | ... | ... |
pages/tabbar/tabbar.json
0 → 100644
pages/tabbar/tabbar.wxml
0 → 100644
| 1 | +<!--pages/tabbar.wxml--> | |
| 2 | + | |
| 3 | + <template name="tabBar"> | |
| 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"> | |
| 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> | |
| 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> | |
| 11 | + </block> | |
| 12 | + </view> | |
| 13 | + </template> | ... | ... |
pages/tabbar/tabbar.wxss
0 → 100644