Merge branch 'dev' of gitee.com:zongzhige/shopxo-uniapp into dev-sws
commit
bd0688eefc
120
App.vue
120
App.vue
|
|
@ -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/',
|
||||
|
||||
// 静态资源地址(如系统根目录不在public目录下面请在静态地址后面加public目录、如:https://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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);',
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue