tabbar.wxml
7.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!--pages/tabbar.wxml-->
<template name="tabBar">
<!-- 如果是自定义的话 -->
<view hidden="{{tabBar.iscustom=='2'}}" class="tab-bar" style="width:100%;height:{{tabBar.isIpx ? '168rpx' : '100rpx'}};position:fixed;color: {{tabBar.color}}; background: {{tabBar.backgroundColor}}; bottom: 0;z-index:9999999;">
<block wx:for="{{tabBar.list}}" wx:key="weappurl">
<block wx:if="{{!item.active}}">
<navigator url="{{item.weappurl}}" open-type="redirect" class="tabbar_item {{item.clas}}" style="position:relative;width:{{100 / tabBar.length}}%;height:100%;float:left;text-align:center;padding:5px 0;">
<view wx:if="{{item.nav_name=='购物车'}}" class="menu_red">
{{tabBar.cartGoodsNum}}
</view>
<view style="width:35%;height:30px;margin-left:33%;">
<image src="{{item.src}}" wx:if="{{!item.active}}" mode="widthFix" class="img" style="max-width:100%;max-height:100%"></image>
</view>
<view style="height:20px;line-height:15px; position: relative; top: -15rpx"><text class="tabbar_text" wx:if="{{item.nav_name}}" style="font-size:0.6rem">{{item.nav_name}}</text></view>
</navigator>
</block>
<block wx:else>
<view class="tabbar_item {{item.clas}}" style="color: {{item.selectedColor? item.selectedColor :tabBar.selectedColor}};position:relative;width:{{100 / tabBar.length}}%;height:100%;float:left;text-align:center;padding:5px 0;">
<view wx:if="{{item.nav_name=='购物车'}}" class="menu_red">
{{tabBar.cartGoodsNum}}
</view>
<view style="width:35%;height:30px;margin-left:33%;">
<block wx:if="{{item.active}}">
<image src="{{item.src_sele}}" mode="widthFix" class="img" style="max-width:100%;max-height:100%"></image>
</block>
<block wx:else>
<navigator url="{{item.weappurl}}">
<image src="{{item.src}}" wx:if="{{!item.active}}" mode="widthFix" class="img" style="max-width:100%;max-height:100%"></image>
</navigator>
</block>
</view>
<view style="height:20px;line-height:15px; position: relative; top: -15rpx"><text class="tabbar_text" wx:if="{{item.nav_name}}" style="font-size:0.6rem">{{item.nav_name}}</text></view>
</view>
</block>
</block>
</view>
<!-- 如果是默认的话 -->
<view hidden="{{tabBar.iscustom=='1'}}" class="tab-bar" style="width:100%;height:{{tabBar.isIpx ? '168rpx' : '100rpx'}};position:fixed;color:#6e6d6b; background:#ffffff; bottom: 0;z-index:9999999;padding:2px 0;">
<!-- 1 -->
<block wx:if="{{tabBar.active!='/pages/index/index/index'}}">
<navigator url="/pages/index/index/index" class="tabbar_item {{item.clas}}" open-type="redirect" style="position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
<view style="width:30%;height:57rpx;margin-left:35%;">
<image src="{{tabBar.url}}/miniapp/images/bar/index.png" class="img" style="width:100%;height:100%"></image>
</view>
<view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">首页</text></view>
</navigator>
</block>
<block wx:else>
<view class="tabbar_item {{item.clas}}" style="color:#f23030;position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
<view style="width:30%;height:57rpx;margin-left:35%;">
<image src="{{tabBar.url}}/miniapp/images/bar/index_on.png" class="img" style="width:100%;height:100%"></image>
</view>
<view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">首页</text></view>
</view>
</block>
<!-- 2 -->
<block wx:if="{{tabBar.active!='/pages/goods/categoryList/categoryList'}}">
<navigator url="/pages/goods/categoryList/categoryList" class="tabbar_item {{tabBar.clas}}" open-type="redirect" style="position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
<view style="width:30%;height:57rpx;margin-left:35%;">
<image src="{{tabBar.url}}/miniapp/images/bar/fl.png" class="img" style="width:100%;height:100%"></image>
</view>
<view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" wx:if="分类" style="font-size:0.6rem">分类</text></view>
</navigator>
</block>
<block wx:else>
<view class="tabbar_item {{tabBar.clas}}" style="color:#f23030;position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
<view style="width:30%;height:57rpx;margin-left:35%;">
<image src="{{tabBar.url}}/miniapp/images/bar/fl_on.png" class="img" style="width:100%;height:100%"></image>
</view>
<view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" wx:if="分类" style="font-size:0.6rem">分类</text></view>
</view>
</block>
<!-- 3 -->
<block wx:if="{{tabBar.active!='/pages/cart/cart/cart'}}">
<navigator url="/pages/cart/cart/cart" open-type="redirect" class="tabbar_item {{tabBar.clas}}" style="position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
<view class="menu_default_red">
{{tabBar.cartGoodsNum}}
</view><view style="width:30%;height:57rpx;margin-left:35%;">
<image src="{{tabBar.url}}/miniapp/images/bar/car.png" class="img" style="width:100%;height:100%"></image>
</view>
<view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">购物车</text></view>
</navigator>
</block>
<block wx:else>
<view class="tabbar_item {{tabBar.clas}}" style="color: #f23030;position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
<view class="menu_default_red">
{{tabBar.cartGoodsNum}}
</view><view style="width:30%;height:57rpx;margin-left:35%;">
<image src="{{tabBar.url}}/miniapp/images/bar/car_on.png" class="img" style="width:100%;height:100%"></image>
</view>
<view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">购物车</text></view>
</view>
</block>
<!-- 4 -->
<block wx:if="{{tabBar.active!='/pages/user/index/index'}}">
<navigator url="/pages/user/index/index" open-type="redirect" class="tabbar_item {{tabBar.clas}}" style="position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
<view style="width:30%;height:57rpx;margin-left:35%;">
<image src="{{tabBar.url}}/miniapp/images/bar/user.png" class="img" style="width:100%;height:100%"></image>
</view>
<view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">我的</text></view>
</navigator>
</block>
<block wx:else>
<view class="tabbar_item {{tabBar.clas}}" style="color: #f23030;position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
<view style="width:30%;height:57rpx;margin-left:35%;">
<image src="{{tabBar.url}}/miniapp/images/bar/user_on.png" class="img" style="width:100%;height:100%"></image>
</view>
<view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">我的</text></view>
</view>
</block>
</view>
</template>