提交 183ce23d 编写于 作者: D devil

细节优化

上级 0f0712f6
......@@ -711,4 +711,38 @@ App({
return true;
},
/**
* 设置导航reddot
* index tabBar 的哪一项,从左边算起(0开始)
* type 0 移出, 1 添加 (默认 0 移出)
*/
set_tab_bar_reddot(index, type) {
if (index !== undefined && index !== null)
{
if ((type || 0) == 0)
{
tt.hideTabBarRedDot({ index: Number(index) });
} else {
tt.showTabBarRedDot({ index: Number(index) });
}
}
},
/**
* 设置导航车badge
* index tabBar 的哪一项,从左边算起(0开始)
* type 0 移出, 1 添加 (默认 0 移出)
* value 显示的文本,超过 4 个字符则显示成 ...(type参数为1的情况下有效)
*/
set_tab_bar_badge(index, type, value) {
if (index !== undefined && index !== null)
{
if ((type || 0) == 0) {
tt.removeTabBarBadge({ index: Number(index) });
} else {
tt.setTabBarBadge({ index: Number(index), "text": value.toString() });
}
}
},
});
\ No newline at end of file
......@@ -29,7 +29,6 @@
"pages/extraction-address/extraction-address",
"pages/plugins/coupon/index/index",
"pages/plugins/coupon/user/user",
"pages/plugins/membershiplevelvip/index/index",
"pages/plugins/membershiplevelvip/buy/buy",
"pages/plugins/membershiplevelvip/user/user",
......@@ -40,7 +39,6 @@
"pages/plugins/membershiplevelvip/statistics/statistics",
"pages/plugins/membershiplevelvip/poster/poster",
"pages/plugins/membershiplevelvip/team/team",
"pages/plugins/distribution/user/user",
"pages/plugins/distribution/order/order",
"pages/plugins/distribution/order-detail/order-detail",
......@@ -53,7 +51,6 @@
"pages/plugins/distribution/extraction-apply/extraction-apply",
"pages/plugins/distribution/extraction-order/extraction-order",
"pages/plugins/distribution/introduce/introduce",
"pages/plugins/wallet/user/user",
"pages/plugins/wallet/recharge/recharge",
"pages/plugins/wallet/cash-auth/cash-auth",
......
......@@ -89,6 +89,14 @@ Page({
common_is_exhibition_mode_btn_text: data.common_is_exhibition_mode_btn_text || '立即咨询',
customer_service_tel: data.customer_service_tel || null,
});
// 导航购物车处理
var cart_total = data.common_cart_total || 0;
if (cart_total <= 0) {
app.set_tab_bar_badge(2, 0);
} else {
app.set_tab_bar_badge(2, 1, cart_total);
}
} else {
this.setData({
data_list_loding_status: 2,
......@@ -261,6 +269,14 @@ Page({
data_list_loding_status: temp_data_list.length == 0 ? 0 : this.data.data_list_loding_status,
});
// 导航购物车处理
var cart_total = res.data.data || 0;
if (cart_total <= 0) {
app.set_tab_bar_badge(2, 0);
} else {
app.set_tab_bar_badge(2, 1, cart_total);
}
app.showToast(((type == 'delete') ? '删除成功' : '收藏成功'), 'success');
} else {
if (app.is_login_check(res.data)) {
......
......@@ -61,6 +61,15 @@ Page({
plugins_limitedtimediscount_data: data.plugins_limitedtimediscount_data || null,
});
// 导航购物车处理
var cart_total = data.common_cart_total || 0;
if (cart_total <= 0)
{
app.set_tab_bar_badge(2, 0);
} else {
app.set_tab_bar_badge(2, 1, cart_total);
}
// 限时秒杀倒计时
if (this.data.common_app_is_limitedtimediscount == 1 && this.data.plugins_limitedtimediscount_data != null)
{
......
......@@ -44,6 +44,7 @@
<!-- 会员中心通知 -->
<view tt:if="{{(user_level || null) != null && (data_base.user_center_notice || null) != null && data_base.user_center_notice.length > 0}}" class="tips-item spacing-mt">
<view class="tips">
<image src="/images/tips.png" mode="aspectFit" class="fl" />
<view tt:for="{{data_base.user_center_notice}}" tt:key="key" class="item">
{{item}}
</view>
......
......@@ -88,6 +88,7 @@
<!-- 会员中心通知 -->
<view tt:if="{{(user_vip || null) != null && (data_base.user_vip_center_notice || null) != null && data_base.user_vip_center_notice.length > 0}}" class="tips-item spacing-mt">
<view class="tips">
<image src="/images/tips.png" mode="aspectFit" class="fl" />
<view tt:for="{{data_base.user_vip_center_notice}}" tt:key="key" class="item">
{{item}}
</view>
......
......@@ -40,6 +40,7 @@
<!-- 通知 -->
<view tt:if="{{(data_base.user_center_notice || null) != null && data_base.user_center_notice.length > 0}}" class="tips-container spacing-mt spacing-mb">
<view class="tips">
<image src="/images/tips.png" mode="aspectFit" class="fl" />
<view tt:for="{{data_base.user_center_notice}}" tt:key="key" class="item">
{{item}}
</view>
......
......@@ -110,6 +110,14 @@ Page({
navigation: data.navigation || [],
common_app_is_head_vice_nav: data.common_app_is_head_vice_nav || 0,
});
// 导航购物车处理
var cart_total = data.common_cart_total || 0;
if (cart_total <= 0) {
app.set_tab_bar_badge(2, 0);
} else {
app.set_tab_bar_badge(2, 1, cart_total);
}
} else {
app.showToast(res.data.msg);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册