master
gongfuxiang 2024-09-25 19:16:14 +08:00
parent 7b59cc3a3d
commit 6eea3f4285
10 changed files with 226 additions and 93 deletions

52
App.vue
View File

@ -48,6 +48,14 @@
// 2.lang
default_language: 'zh',
// tabbar
system_tabbar: [
'/pages/index/index',
'/pages/goods-category/goods-category',
'/pages/cart/cart',
'/pages/user/user'
],
//
// 使0, 1
is_share_use_image: 1,
@ -888,13 +896,17 @@
/**
* 底部菜单页面数tabbar
*/
tabbar_pages_data() {
return [
'/pages/index/index',
'/pages/goods-category/goods-category',
'/pages/cart/cart',
'/pages/user/user'
];
app_tabbar_pages() {
var temp_tabbar = this.data.system_tabbar;
var app_tabber = this.get_config('app_tabber') || null;
if(app_tabber != null && (app_tabber.content || null) != null && (app_tabber.content.nav_content || null) != null) {
temp_tabbar = app_tabber.content.nav_content.map(function(v) {
if((v.link || null) != null && (v.link.page || null) != null) {
return v.link.page;
}
});
}
return temp_tabbar;
},
/**
@ -905,11 +917,8 @@
if ((value || null) == null) {
return false;
}
var temp_tabbar_pages = this.tabbar_pages_data();
for (var i in temp_tabbar_pages) {
if (temp_tabbar_pages[i] == value) {
return true;
}
if(this.data.system_tabbar.indexOf(value) != -1) {
return true;
}
return false;
},
@ -1528,6 +1537,15 @@
//
var is_redirect = parseInt(e.currentTarget.dataset.redirect || 0) == 1;
//
var tabbar = this.app_tabbar_pages();
if(tabbar.indexOf(value) != -1 && this.data.system_tabbar.indexOf(value) == -1) {
var page = this.prev_page();
if(page != null && this.data.system_tabbar.indexOf(page) == -1) {
is_redirect = true;
}
}
// url
this.url_open(value, is_redirect);
},
@ -1938,7 +1956,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.tabbar_pages_data()[0],
path: data.path || this.app_tabbar_pages()[0],
query: this.share_query_handle(data.query || ''),
img: data.img || share_config.pic || this.get_application_logo_square(),
};
@ -2015,7 +2033,7 @@
var prev_page = this.prev_page();
if (prev_page == null) {
uni.switchTab({
url: this.tabbar_pages_data()[0],
url: this.app_tabbar_pages()[0],
});
} else {
uni.navigateBack();
@ -2318,7 +2336,7 @@
var self = this;
self.weixin_privacy_setting_timer = setInterval(function () {
var page = self.get_page_url(false);
if ('/' + page == self.tabbar_pages_data()[0]) {
if ('/' + page == self.app_tabbar_pages()[0]) {
uni.getPrivacySetting({
success: (res) => {
if (res.needAuthorization) {
@ -2772,7 +2790,7 @@
'pages/plugins/ask/index/index',
];
// tab
if(this.tabbar_pages_data().indexOf('/'+url) != -1 || pages_always.indexOf(url) != -1) {
if(this.is_tabbar_pages('/'+url) != -1 || pages_always.indexOf(url) != -1) {
value = '';
}
}
@ -2786,7 +2804,7 @@
//
var value = i18n.t(key);
//
if(this.tabbar_pages_data()[0] == '/'+url) {
if(this.app_tabbar_pages()[0] == '/'+url) {
value = this.get_application_title();
}
}

View File

@ -329,13 +329,6 @@
var common_static_url = app.globalData.get_static_url('common');
var status_bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0, true));
export default {
props: {
//
propSourceType: {
type: String,
default: '', // page
},
},
data() {
return {
status_bar_height: status_bar_height,
@ -415,6 +408,14 @@
window_top: '100rpx',
// #endif
};
},
props: {
//
propSourceType: {
type: String,
default: '', // page
},
},
components: {
@ -423,7 +424,7 @@
componentNavBack,
componentRealstoreCart,
componentBottomLine,
componentPopup,
componentPopup
},
//

View File

@ -0,0 +1,56 @@
<template>
<view>
<componentDiyFooter :key="key" :footerActiveIndex="footer_active_index" :value="app_tabber" @footer-height="footer_height_value_event" @footer-tap="footer_tap_event"></componentDiyFooter>
<view v-if="propIsFooterSeat && footer_height_value > 0" :style="'height:'+footer_height_value+'rpx;'"></view>
</view>
</template>
<script>
const app = getApp();
import componentDiyFooter from '@/components/diy/footer';
export default {
data() {
return {
key: '',
app_tabber: null,
footer_active_index: 0,
footer_height_value: 0,
};
},
props: {
propIsFooterSeat: {
type: Boolean,
default: true,
}
},
components: {
componentDiyFooter
},
//
created: function () {
this.setData({
key: Math.random(),
app_tabber: app.globalData.get_config('app_tabber')
});
},
methods: {
//
footer_height_value_event(value) {
this.setData({
footer_height_value: value*2
});
this.$emit('footer-height', value);
},
//
footer_tap_event(index, data) {
this.setData({
footer_active_index: index
});
console.log(index, data);
},
}
};
</script>
<style scoped>
</style>

View File

@ -4,7 +4,7 @@
<view class="footer-nav-content flex-row jc-c align-c wh" :style="style_container">
<view class="bottom-line-exclude">
<view class="flex-row jc-sa align-c wh padding-0">
<view v-for="(item, index) in nav_content" :key="index" class="flex-1 flex-col jc-c align-c gap-5" :data-index="index" :data-value="item.link.page" @tap="url_event">
<view v-for="(item, index) in nav_content" :key="index" class="flex-1 flex-col jc-c align-c gap-5" :data-index="index" :data-value="item.link.page || ''" @tap="url_event">
<view v-if="nav_style !== 2" class="img-content pr">
<view class="img-item pa border-radius-xs animate-linear" :class="is_active != index ? 'active' : ''">
<image :src="item.img[0].url" class="img dis-block" model="widthFix"></image>
@ -48,7 +48,7 @@
},
created() {
//tabbar
uni.hideTabBar();
// uni.hideTabBar();
},
mounted() {
if ((this.value || null) !== null) {
@ -59,23 +59,31 @@
init() {
const new_content = this.value.content || {};
const new_style = this.value.style || {};
let nav_content = new_content.nav_content || [];
let page = app.globalData.current_page() || null;
let is_active = this.footerActiveIndex;
if(page != null) {
for(var i in nav_content) {
console.log(page, nav_content[i]['link'])
if((nav_content[i]['link'] || null) != null && (nav_content[i]['link']['page'] || null) != null && nav_content[i]['link']['page'] == '/'+page) {
is_active = i;
}
}
}
this.setData({
nav_content: new_content.nav_content || [],
nav_content: nav_content,
nav_style: new_content.nav_style || 0,
is_active: is_active,
default_text_color: 'color:' + new_style.default_text_color || 'rgba(0, 0, 0, 1)',
text_color_checked: 'color:' + new_style.text_color_checked || 'rgba(204, 204, 204, 1)',
style_container: common_styles_computer(new_style.common_style),
});
let footer_height = new_style.common_style.padding_top + new_style.common_style.padding_bottom + new_style.common_style.margin_top + new_style.common_style.margin_bottom + 50;
let footer_height = parseInt(new_style.common_style.padding_top) + parseInt(new_style.common_style.padding_bottom) + parseInt(new_style.common_style.margin_top) + parseInt(new_style.common_style.margin_bottom) + 40;
// #ifndef APP
//
footer_height = footer_height + uni.getSystemInfoSync().statusBarHeight - 40;
footer_height += parseInt(uni.getSystemInfoSync().statusBarHeight);
// #endif
if (footer_height >= 70) {
footer_height = footer_height;
} else {
footer_height = 70;
}
console.log(footer_height)
this.$emit('footer-height', footer_height);
},
//
@ -85,8 +93,8 @@
this.setData({
is_active: index,
});
// app.globalData.url_event(e);
this.$emit('footer-click', index, list_item);
app.globalData.url_event(e);
this.$emit('footer-tap', index, list_item);
},
},
};

View File

@ -1681,6 +1681,12 @@
{
"pagePath": "pages/index/index"
},
{
"pagePath": "pages/goods-category/goods-category"
},
{
"pagePath": "pages/cart/cart"
},
{
"pagePath": "pages/user/user"
}

View File

@ -7,53 +7,58 @@
<component-user-base ref="user_base"></component-user-base>
<!-- app管理 -->
<component-app-admin ref="app_admin"></component-app-admin>
<component-app-admin ref="app_admin"></component-app-admin>
<!-- 公共 -->
<componentCommon></componentCommon>
</view>
</template>
<script>
const app = getApp();
import componentCart from "@/components/cart/cart";
import componentUserBase from '@/components/user-base/user-base';
import componentAppAdmin from '@/components/app-admin/app-admin';
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view()
};
},
components: {
componentCart,
componentUserBase,
componentAppAdmin
},
const app = getApp();
import componentCommon from '@/components/common/common';
import componentCart from "@/components/cart/cart";
import componentUserBase from '@/components/user-base/user-base';
import componentAppAdmin from '@/components/app-admin/app-admin';
export default {
data() {
return {
theme_view: app.globalData.get_theme_value_view()
};
},
components: {
componentCommon,
componentCart,
componentUserBase,
componentAppAdmin
},
onLoad(params) {
//
app.globalData.page_event_onload_handle(params);
},
onLoad(params) {
//
app.globalData.page_event_onload_handle(params);
},
onShow() {
//
app.globalData.page_event_onshow_handle();
onShow() {
//
app.globalData.page_event_onshow_handle();
//
if ((this.$refs.cart || null) != null) {
this.$refs.cart.init();
}
//
if ((this.$refs.cart || null) != null) {
this.$refs.cart.init();
}
// app
if ((this.$refs.app_admin || null) != null) {
this.$refs.app_admin.init();
}
// app
if ((this.$refs.app_admin || null) != null) {
this.$refs.app_admin.init();
}
//
if ((this.$refs.user_base || null) != null) {
this.$refs.user_base.init('cart');
}
},
//
if ((this.$refs.user_base || null) != null) {
this.$refs.user_base.init('cart');
}
},
methods: {},
};
methods: {},
};
</script>
<style>
</style>

View File

@ -54,9 +54,6 @@
.left-nav .nav-active {
background: #fff;
font-weight: 500;
}
.left-content-actual-list {
height: calc(100% - 100rpx);
}
/**
@ -210,9 +207,6 @@
width: 20%;
padding: 20rpx 0;
}
.right-content-actual {
padding-bottom: 105rpx;
}
.goods-right-content {
width: calc(100% - 200rpx);
height: calc(100% - 182rpx);

View File

@ -74,7 +74,7 @@
</component-nav-more>
</view>
<!-- 二级导航 -->
<view v-if="category_one_subset_count > 0" :class="'left-nav '+(category_goods_is_show_cart_nav == 1 ? 'left-content-actual-list' : '')">
<view v-if="category_one_subset_count > 0" class="left-nav" :style="left_content_actual_style">
<scroll-view :scroll-y="true" :show-scrollbar="false" class="ht-auto">
<view :class="'text-size-sm item tc cr-base cp oh ' + (nav_active_item_two_index == -1 ? 'nav-active cr-main nav-left-border' : '')" :data-index="nav_active_index" :data-itemtwoindex="-1" :data-itemthreeindex="-1" @tap="nav_event">
<text>{{ $t('common.all') }}</text>
@ -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 ' + ((category_goods_is_show_cart_nav == 1 && common_site_type != 1 ? 'right-content-actual' : '') + ' pr')">
<view class="padding-left-sm" :style="right_content_actual_style">
<!-- 操作导航 -->
<view class="goods-list-top-nav bg-white">
<!-- 排序 -->
@ -178,7 +178,7 @@
<view class="left-nav ht-auto">
<scroll-view :scroll-y="true" class="ht-auto" :show-scrollbar="false">
<view :class="common_site_type != 1 ? 'left-content-actual ht-auto' : ''">
<view class="left-content-actual-list ht-auto padding-0">
<view class="ht-auto padding-0" :style="left_content_actual_style">
<block v-for="(item, index) in category_list" :key="index">
<view :class="'text-size-sm item tc cr-base cp oh ' + (nav_active_index == index ? 'nav-active cr-main nav-left-border' : '')" :data-index="index" :data-itemindex="-1" @tap="nav_event">
<text>{{ item.name }}</text>
@ -366,12 +366,16 @@
</block>
</view>
</view>
<!-- 公共 -->
<componentCommon @footer-height="footer_height_value_event" :propIsFooterSeat="false"></componentCommon>
</view>
</template>
<script>
const app = getApp();
import base64 from '@/common/js/lib/base64.js';
import componentCommon from '@/components/common/common';
import componentGoodsBuy from '@/components/goods-buy/goods-buy';
import componentSearch from '@/components/search/search';
import componentNoData from '@/components/no-data/no-data';
@ -453,10 +457,15 @@
// #ifdef H5
window_bottom_height: uni.getWindowInfo().windowBottom || 50,
// #endif
//
left_content_actual_style: '',
right_content_actual_style: '',
footer_height_value: 0,
};
},
components: {
componentCommon,
componentGoodsBuy,
componentSearch,
componentNoData,
@ -650,6 +659,9 @@
}, 500);
}
//
this.content_actual_size_handle();
//
this.setData({
is_first: 0,
@ -684,6 +696,24 @@
});
},
//
content_actual_size_handle() {
//
var left_style = '';
if(this.category_goods_is_show_cart_nav == 1) {
left_style = 'height: calc(100% - 100rpx - '+this.footer_height_value+'px);';
}
//
var right_style = '';
if(this.category_goods_is_show_cart_nav == 1 && this.common_site_type != 1) {
right_style = 'padding-bottom: calc(105rpx + '+this.footer_height_value+'px);';
}
this.setData({
left_content_actual_style: left_style,
right_content_actual_style: right_style
});
},
//
get_goods_list(is_mandatory) {
//
@ -1346,6 +1376,14 @@
this.reset_scroll();
this.get_goods_list(1);
},
//
footer_height_value_event(value) {
this.setData({
footer_height_value: value
});
this.content_actual_size_handle();
}
},
};
</script>

View File

@ -278,9 +278,6 @@
<block v-if="load_status == 1 && data_mode != 3">
<component-copyright></component-copyright>
</block>
<!-- 底部菜单 -->
<componentDiyFooter key="" :value="app_tabber" @footer-click="footer_click_event"></componentDiyFooter>
</view>
<block v-if="load_status == 1 && data_mode != 3">
<!-- 在线客服 -->
@ -295,11 +292,15 @@
<!-- app管理 -->
<component-app-admin ref="app_admin"></component-app-admin>
</block>
<!-- 公共 -->
<componentCommon @footer-height="footer_height_value_event"></componentCommon>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
import componentSearch from '@/components/search/search';
import componentQuickNav from '@/components/quick-nav/quick-nav';
import componentIconNav from '@/components/icon-nav/icon-nav';
@ -321,7 +322,6 @@
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));
@ -349,8 +349,6 @@
cart_total: 0,
message_total: 0,
right_icon_list: [],
//
app_tabber: null,
//
data_mode: 0,
//
@ -417,6 +415,7 @@
},
components: {
componentCommon,
componentSearch,
componentQuickNav,
componentIconNav,
@ -437,8 +436,7 @@
componentBindingList,
componentMagicList,
componentAppAdmin,
componentDiy,
componentDiyFooter,
componentDiy
},
props: {},
@ -509,7 +507,6 @@
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');
@ -741,6 +738,11 @@
search_icon_event(e) {
app.globalData.scan_handle();
},
//
footer_height_value_event(value) {
console.log(value)
}
},
};
</script>

View File

@ -166,10 +166,14 @@
<!-- app管理 -->
<component-app-admin ref="app_admin"></component-app-admin>
<!-- 公共 -->
<componentCommon></componentCommon>
</view>
</template>
<script>
const app = getApp();
import componentCommon from '@/components/common/common';
import componentQuickNav from '@/components/quick-nav/quick-nav';
import componentBadge from '@/components/badge/badge';
import componentCopyright from '@/components/copyright/copyright';
@ -212,6 +216,7 @@
},
components: {
componentCommon,
componentQuickNav,
componentBadge,
componentCopyright,