Merge branch 'dev' of gitee.com:zongzhige/shopxo-uniapp into dev-sws

master
sws 2024-10-17 10:50:42 +08:00
commit bd0688eefc
5 changed files with 135 additions and 32 deletions

120
App.vue
View File

@ -7,12 +7,12 @@
data: {
//
//
request_url: 'http://shopxo.com/',
// request_url:'https://new.shopxo.vip/',
// request_url: 'http://shopxo.com/',
request_url:'https://new.shopxo.vip/',
// publicpublichttps://d1.shopxo.vip/public/
static_url: 'http://shopxo.com/',
// static_url:'https://new.shopxo.vip/',
// static_url: 'http://shopxo.com/',
static_url:'https://new.shopxo.vip/',
// default
system_type: 'default',
@ -59,6 +59,9 @@
],
//
// 使0, 1
is_use_native_tabbar: 0,
// 使0, 1
is_share_use_image: 1,
@ -942,7 +945,8 @@
* 当前地址是否存在底部菜单tabbar中
*/
is_tabbar_pages(url = null) {
return this.is_tabbar_pages_handle(this.app_tabbar_pages(), url);
var pages = (this.data.is_use_native_tabbar == 1) ? this.data.system_tabbar : this.app_tabbar_pages();
return this.is_tabbar_pages_handle(pages, url);
},
/**
@ -970,7 +974,9 @@
//
system_hide_tabbar() {
uni.hideTabBar();
if(this.data.is_use_native_tabbar != 1) {
uni.hideTabBar();
}
},
/**
@ -1177,20 +1183,35 @@
* value 显示的文本超过 4 个字符则显示成 ...type参数为1的情况下有效
*/
set_tab_bar_badge(type, value = 0) {
//
if ((type || null) != null) {
var key = this.data.cache_tabbar_badge_key+'-'+type;
if ((value || null) == null) {
uni.removeStorageSync(key);
} else {
uni.setStorageSync(key, value);
// 使
if(this.data.is_use_native_tabbar == 1) {
if(type == 'cart') {
if ((value || 0) == 0) {
uni.removeTabBarBadge({
index: 2
});
} else {
uni.setTabBarBadge({
index: 2,
text: value.toString()
});
}
}
} else {
//
if ((type || null) != null) {
var key = this.data.cache_tabbar_badge_key+'-'+type;
if ((value || null) == null) {
uni.removeStorageSync(key);
} else {
uni.setStorageSync(key, value);
}
}
//
var obj = this.get_page_object() || null;
if(obj != null && (obj.$vm || null) != null && (obj.$vm.$refs || null) != null && (obj.$vm.$refs.common || null) != null) {
obj.$vm.$refs.common.footer_init();
}
}
//
var obj = this.get_page_object() || null;
if(obj != null && (obj.$vm || null) != null && (obj.$vm.$refs || null) != null && (obj.$vm.$refs.common || null) != null) {
obj.$vm.$refs.common.footer_init();
}
},
@ -1452,6 +1473,9 @@
//
self.set_theme_value(data.plugins_themestyle_data);
//
self.set_tabbar(data.plugins_themestyle_data);
//
self.user_auto_login_handle();
},
@ -2496,6 +2520,64 @@
uni.setStorageSync('theme', value || this.data.default_theme);
},
//
set_tabbar(theme) {
if(this.data.is_use_native_tabbar == 1) {
//
if ((theme || null) == null) {
theme = this.get_theme_value();
}
//
uni.setTabBarStyle({
selectedColor: this.get_theme_color(theme),
color: '#333',
backgroundColor: '#fff',
borderStyle: 'black'
});
//
uni.setTabBarItem({
index: 0,
iconPath: 'static/images/common/tabbar/home.png',
selectedIconPath: 'static/images/' + theme + '/tabbar/home.png',
text: i18n.t('common.home'),
});
uni.setTabBarItem({
index: 1,
iconPath: 'static/images/common/tabbar/category.png',
selectedIconPath: 'static/images/' + theme + '/tabbar/category.png',
text: i18n.t('common.category'),
});
uni.setTabBarItem({
index: 2,
iconPath: 'static/images/common/tabbar/cart.png',
selectedIconPath: 'static/images/' + theme + '/tabbar/cart.png',
text: i18n.t('common.cart'),
});
uni.setTabBarItem({
index: 3,
iconPath: 'static/images/common/tabbar/user.png',
selectedIconPath: 'static/images/' + theme + '/tabbar/user.png',
text: i18n.t('common.my'),
});
}
},
//
group_arry(arry, sub_group_length) {
let index = 0;
let new_arry = [];
if (arry.length > sub_group_length) {
while (index < arry.length) {
new_arry.push(arry.slice(index, (index += sub_group_length)));
}
} else {
new_arry = [arry];
}
return new_arry;
},
//
group_arry(arry, sub_group_length) {
let index = 0;

View File

@ -1296,10 +1296,17 @@
},
//
page_style_handle() {
var value = (this.propCartNavBottomValue > 0) ? (parseInt(this.propCartNavBottomValue*2)+20) : 20;
page_style_handle() {
var value = 0;
if(app.globalData.data.is_use_native_tabbar == 1) {
// #ifdef H5
value += (uni.getWindowInfo().windowBottom || 50)+40;
// #endif
} else {
value += ((this.propCartNavBottomValue-8)*2)+20;
}
this.setData({
bottom_fixed_style: 'bottom:'+(((this.propCartNavBottomValue-8)*2)+20)+'rpx'
bottom_fixed_style: 'bottom:'+value+'rpx'
});
}
},
@ -1530,7 +1537,7 @@
z-index: 1002 !important;
}
.discount_detail-popup {
margin-bottom: 122rpx;
margin-bottom: 140rpx;
height: calc(70vh - 122rpx);
overflow-y: auto;
}

View File

@ -94,7 +94,9 @@
//
on_show() {
//tabbar
app.globalData.system_hide_tabbar();
if(app.globalData.data.is_use_native_tabbar != 1) {
app.globalData.system_hide_tabbar();
}
//
this.init_config();
@ -145,7 +147,7 @@
//
footer_init() {
var upd_data = {
is_tabbar: app.globalData.is_tabbar_pages()
is_tabbar: (app.globalData.data.is_use_native_tabbar == 1) ? false : app.globalData.is_tabbar_pages()
};
if(upd_data['is_tabbar']) {
upd_data['key'] = Math.random();

View File

@ -101,7 +101,7 @@
//
init_handle() {
//
var tabbar_height = (this.propPosition == 'bottom' && app.globalData.is_tabbar_pages()) ? ((app.globalData.app_tabbar_height_value()*2)+20) : 0;
var tabbar_height = (app.globalData.data.is_use_native_tabbar != 1 && this.propPosition == 'bottom' && app.globalData.is_tabbar_pages()) ? ((app.globalData.app_tabbar_height_value()*2)+20) : 0;
//
var left = 0;

View File

@ -22,7 +22,7 @@
</block>
<view class="category-container">
<!-- 分类内容 -->
<view :class="'category-content bs-bb pr ' + (category_show_level == 0 ? 'goods-model' : '')" :style="'height:calc(100vh - ' + search_height + 'px);'">
<view :class="'category-content bs-bb pr ' + (category_show_level == 0 ? 'goods-model' : '')" :style="'height:calc(100vh - ' + (search_height + window_bottom_height) + 'px);'">
<block v-if="category_show_level == 1">
<!-- 一级模式 -->
<scroll-view scroll-y class="ht-auto" :show-scrollbar="false">
@ -91,7 +91,7 @@
<!-- 商品列表 -->
<view :class="'goods-right-content bg-white pa bs-bb ' + (category_one_subset_count > 0 ? '' : 'category-one-subset-content')">
<scroll-view :scroll-y="true" :show-scrollbar="false" class="ht-auto goods-list" :scroll-top="scroll_top" @scroll="scroll_event" @scrolltolower="scroll_lower" lower-threshold="60">
<view class="padding-left-sm" :style="right_content_actual_style">
<view class="padding-left-main" :style="right_content_actual_style">
<!-- 操作导航 -->
<view class="goods-list-top-nav bg-white">
<!-- 排序 -->
@ -444,6 +444,11 @@
popup_status: false,
//
search_height: 0,
// tab - H5
window_bottom_height: 0,
// #ifdef H5
window_bottom_height: (app.globalData.data.is_use_native_tabbar == 1) ? (uni.getWindowInfo().windowBottom || 50) : 0,
// #endif
//
left_content_actual_style: '',
right_content_actual_style: '',
@ -679,21 +684,28 @@
//
content_actual_size_handle() {
// 使
var left_style_value = 0;
var botton_style_value = 0;
if(app.globalData.data.is_use_native_tabbar != 1) {
left_style_value = this.footer_height_value+20;
botton_style_value = this.footer_height_value;
}
//
var left_style = '';
if(this.category_goods_is_show_cart_nav == 1) {
left_style = 'height: calc(100% - 120rpx - '+(this.footer_height_value+20)+'rpx);';
left_style = 'height: calc(100% - 120rpx - '+left_style_value+'rpx);';
}
//
var right_style = '';
if(this.category_goods_is_show_cart_nav == 1 && this.common_site_type != 1) {
right_style = 'padding-bottom: calc(120rpx + '+(this.footer_height_value+20)+'rpx);';
right_style = 'padding-bottom: calc(120rpx + '+left_style_value+'rpx);';
}
this.setData({
left_content_actual_style: left_style,
right_content_actual_style: right_style,
botton_nav_style: 'bottom: calc(20rpx + '+this.footer_height_value+'rpx);',
cart_content_style: 'bottom: calc(150rpx + '+this.footer_height_value+'rpx);',
botton_nav_style: 'bottom: calc(20rpx + '+botton_style_value+'rpx);',
cart_content_style: 'bottom: calc(150rpx + '+botton_style_value+'rpx);',
});
},