diy
parent
abab4c1e35
commit
d367a84f08
35
App.vue
35
App.vue
|
|
@ -48,9 +48,6 @@
|
|||
// 2.去lang里面各个文件去新增语言翻译
|
||||
default_language: 'zh',
|
||||
|
||||
// tabbar页面
|
||||
tabbar_pages: ['/pages/index/index', '/pages/goods-category/goods-category', '/pages/cart/cart', '/pages/user/user'],
|
||||
|
||||
// 公共配置
|
||||
// 分享及转发使用页面设置的默认图片及系统默认图片(0否, 1是)
|
||||
is_share_use_image: 1,
|
||||
|
|
@ -874,7 +871,10 @@
|
|||
return s_x;
|
||||
},
|
||||
|
||||
// url主要部分
|
||||
/**
|
||||
* url主要部分
|
||||
* url url地址
|
||||
*/
|
||||
get_url_main_part(url) {
|
||||
if (url.indexOf('?') == -1) {
|
||||
var value = url;
|
||||
|
|
@ -885,6 +885,18 @@
|
|||
return value;
|
||||
},
|
||||
|
||||
/**
|
||||
* 底部菜单页面数、tabbar
|
||||
*/
|
||||
tabbar_pages_data() {
|
||||
return [
|
||||
'/pages/index/index',
|
||||
'/pages/goods-category/goods-category',
|
||||
'/pages/cart/cart',
|
||||
'/pages/user/user'
|
||||
];
|
||||
},
|
||||
|
||||
/**
|
||||
* 当前地址是否存在tabbar中
|
||||
*/
|
||||
|
|
@ -893,7 +905,7 @@
|
|||
if ((value || null) == null) {
|
||||
return false;
|
||||
}
|
||||
var temp_tabbar_pages = this.data.tabbar_pages;
|
||||
var temp_tabbar_pages = this.tabbar_pages_data();
|
||||
for (var i in temp_tabbar_pages) {
|
||||
if (temp_tabbar_pages[i] == value) {
|
||||
return true;
|
||||
|
|
@ -1926,7 +1938,7 @@
|
|||
var result = {
|
||||
title: data.title || share_config.title || this.get_application_title(),
|
||||
desc: data.desc || share_config.desc || this.get_application_describe(),
|
||||
path: data.path || this.data.tabbar_pages[0],
|
||||
path: data.path || this.tabbar_pages_data()[0],
|
||||
query: this.share_query_handle(data.query || ''),
|
||||
img: data.img || share_config.pic || this.get_application_logo_square(),
|
||||
};
|
||||
|
|
@ -2003,7 +2015,7 @@
|
|||
var prev_page = this.prev_page();
|
||||
if (prev_page == null) {
|
||||
uni.switchTab({
|
||||
url: this.data.tabbar_pages[0],
|
||||
url: this.tabbar_pages_data()[0],
|
||||
});
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
|
|
@ -2760,7 +2772,7 @@
|
|||
'pages/plugins/ask/index/index',
|
||||
];
|
||||
// 当前tab页面
|
||||
if(this.data.tabbar_pages.indexOf('/'+url) != -1 || pages_always.indexOf(url) != -1) {
|
||||
if(this.tabbar_pages_data().indexOf('/'+url) != -1 || pages_always.indexOf(url) != -1) {
|
||||
value = '';
|
||||
}
|
||||
}
|
||||
|
|
@ -2774,7 +2786,7 @@
|
|||
// 读取语言
|
||||
var value = i18n.t(key);
|
||||
// 首页则读取当前应用名称
|
||||
if(this.data.tabbar_pages[0] == '/'+url) {
|
||||
if(this.tabbar_pages_data()[0] == '/'+url) {
|
||||
value = this.get_application_title();
|
||||
}
|
||||
}
|
||||
|
|
@ -2804,7 +2816,10 @@
|
|||
},
|
||||
|
||||
// 初始化完成时触发(全局只触发一次)
|
||||
onLaunch(params) {},
|
||||
onLaunch(params) {
|
||||
//隐藏tabbar
|
||||
uni.hideTabBar();
|
||||
},
|
||||
|
||||
// 启动,或从后台进入前台显示
|
||||
onShow(params) {
|
||||
|
|
|
|||
27
pages.json
27
pages.json
|
|
@ -1673,33 +1673,16 @@
|
|||
"backgroundColorBottom": "#f5f5f5"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#333",
|
||||
"selectedColor": "#333",
|
||||
"color": "#fff",
|
||||
"borderStyle": "white",
|
||||
"selectedColor": "#fff",
|
||||
"backgroundColor": "#fff",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "static/images/common/tabbar/home.png",
|
||||
"selectedIconPath": "static/images/common/tabbar/home.png",
|
||||
"text": "首页"
|
||||
"pagePath": "pages/index/index"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/goods-category/goods-category",
|
||||
"iconPath": "static/images/common/tabbar/category.png",
|
||||
"selectedIconPath": "static/images/common/tabbar/category.png",
|
||||
"text": "分类"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/cart/cart",
|
||||
"iconPath": "static/images/common/tabbar/cart.png",
|
||||
"selectedIconPath": "static/images/common/tabbar/cart.png",
|
||||
"text": "购物车"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/user/user",
|
||||
"iconPath": "static/images/common/tabbar/user.png",
|
||||
"selectedIconPath": "static/images/common/tabbar/user.png",
|
||||
"text": "我的"
|
||||
"pagePath": "pages/user/user"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
<block v-if="data_mode == 3">
|
||||
<block v-if="data_list !== null">
|
||||
<componentDiy :value="data_list.config" :prop-home-id="data_list.id"></componentDiy>
|
||||
<componentDiyFooter key="" :value="app_tabber" @footer-click="footer_click_event"></componentDiyFooter>
|
||||
</block>
|
||||
</block>
|
||||
<!-- 自动和手动模式 -->
|
||||
|
|
@ -270,14 +271,16 @@
|
|||
</block>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
<block v-if="data_mode != 3">
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</block>
|
||||
|
||||
<!-- 版权信息 -->
|
||||
<block v-if="load_status == 1">
|
||||
<block v-if="load_status == 1 && data_mode != 3">
|
||||
<component-copyright></component-copyright>
|
||||
</block>
|
||||
</view>
|
||||
<block v-if="load_status == 1">
|
||||
<block v-if="load_status == 1 && data_mode != 3">
|
||||
<!-- 在线客服 -->
|
||||
<component-online-service :propIsNav="true" :propIsBar="true" :propIsGrayscale="plugins_mourning_data_is_app"></component-online-service>
|
||||
|
||||
|
|
@ -316,6 +319,7 @@
|
|||
import componentMagicList from '@/components/magic-list/magic-list';
|
||||
import componentAppAdmin from '@/components/app-admin/app-admin';
|
||||
import componentDiy from '@/components/diy/diy';
|
||||
import componentDiyFooter from '@/components/diy/footer';
|
||||
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
|
||||
|
|
@ -343,6 +347,8 @@
|
|||
cart_total: 0,
|
||||
message_total: 0,
|
||||
right_icon_list: [],
|
||||
// 底部菜单
|
||||
app_tabber: null,
|
||||
// 首页数据模式
|
||||
data_mode: 0,
|
||||
// 增加随机数,避免无法监听数据列表内部数据更新
|
||||
|
|
@ -430,6 +436,7 @@
|
|||
componentMagicList,
|
||||
componentAppAdmin,
|
||||
componentDiy,
|
||||
componentDiyFooter
|
||||
},
|
||||
props: {},
|
||||
|
||||
|
|
@ -500,6 +507,7 @@
|
|||
common_app_is_online_service: app.globalData.get_config('config.common_app_is_online_service'),
|
||||
application_title: app.globalData.get_application_title(),
|
||||
application_logo: app.globalData.get_application_logo(),
|
||||
app_tabber: app.globalData.get_config('app_tabber'),
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
|
|
|
|||
Loading…
Reference in New Issue