支付宝小程序优化
parent
f02261aa37
commit
3d0927bf11
|
|
@ -7,4 +7,5 @@
|
|||
.idea
|
||||
.htaccess
|
||||
*payment_*_respond.php
|
||||
*payment_*_notify.php
|
||||
*payment_*_notify.php
|
||||
.swan
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ return array (
|
|||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
1 => 'app\\plugins\\coupon\\Hook',
|
||||
2 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_navigation_header_handle' =>
|
||||
array (
|
||||
|
|
@ -62,14 +63,17 @@ return array (
|
|||
'plugins_service_goods_spec_extends_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
1 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_view_admin_user_save' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
1 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_user_save_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
1 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_goods_save_handle' =>
|
||||
array (
|
||||
|
|
@ -95,11 +99,13 @@ return array (
|
|||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
1 => 'app\\plugins\\coupon\\Hook',
|
||||
2 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_header_navigation_top_right_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
1 => 'app\\plugins\\coupon\\Hook',
|
||||
2 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_js' =>
|
||||
array (
|
||||
|
|
@ -124,10 +130,35 @@ return array (
|
|||
'plugins_service_order_status_change_history_success_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\coupon\\Hook',
|
||||
1 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_user_register_end' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\coupon\\Hook',
|
||||
),
|
||||
'plugins_service_order_aftersale_audit_handle_end' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_site_extraction_address_list' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_buy_order_insert_end' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_view_goods_detail_base_buy_nav_min_inside' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_view_goods_detail_photo_within' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_view_goods_detail_base_bottom' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
);
|
||||
?>
|
||||
|
|
@ -683,6 +683,40 @@ App({
|
|||
return (user == false) ? null : user.alipay_openid || null;
|
||||
},
|
||||
|
||||
/**
|
||||
* 设置导航reddot
|
||||
* index tabBar 的哪一项,从左边算起(0开始)
|
||||
* type 0 移出, 1 添加 (默认 0 移出)
|
||||
*/
|
||||
set_tab_bar_reddot(index, type) {
|
||||
if (index !== undefined && index !== null)
|
||||
{
|
||||
if ((type || 0) == 0)
|
||||
{
|
||||
my.hideTabBarRedDot({ index: Number(index) });
|
||||
} else {
|
||||
my.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) {
|
||||
my.removeTabBarBadge({ index: Number(index) });
|
||||
} else {
|
||||
my.setTabBarBadge({ index: Number(index), "text": value.toString() });
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 窗口背景色设置
|
||||
set_nav_bg_color_main() {
|
||||
// 窗口和下拉顶部背景色
|
||||
|
|
|
|||
|
|
@ -98,6 +98,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,
|
||||
|
|
@ -279,6 +287,15 @@ Page({
|
|||
swipe_index: null,
|
||||
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)) {
|
||||
|
|
|
|||
|
|
@ -72,6 +72,15 @@ Page({
|
|||
common_app_mini_alipay_scene: data.common_app_mini_alipay_scene || 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);
|
||||
}
|
||||
|
||||
// 在线客服开启,用户openid
|
||||
if(this.data.common_app_is_online_service == 1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -119,6 +119,14 @@ Page({
|
|||
common_app_mini_alipay_scene: data.common_app_mini_alipay_scene || 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);
|
||||
}
|
||||
|
||||
// 在线客服开启,用户openid
|
||||
if(this.data.common_app_is_online_service == 1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -648,7 +648,7 @@ App({
|
|||
if ((type || 0) == 0) {
|
||||
wx.removeTabBarBadge({ index: Number(index) });
|
||||
} else {
|
||||
wx.setTabBarBadge({ "index": Number(index), "text": value.toString() });
|
||||
wx.setTabBarBadge({ index: Number(index), "text": value.toString() });
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"pages": ["pages/index/index",
|
||||
"pages": [
|
||||
"pages/user-membervip/user-membervip",
|
||||
|
||||
"pages/index/index",
|
||||
"pages/goods-category/goods-category",
|
||||
"pages/cart/cart",
|
||||
"pages/user/user",
|
||||
|
|
|
|||
Loading…
Reference in New Issue