购物车导航优化

master
gongfuxiang 2025-03-04 17:39:33 +08:00
parent f65a9bdd58
commit 8c62669829
4 changed files with 41 additions and 9 deletions

View File

@ -1922,6 +1922,12 @@
return uni.upx2px(rpx);
},
// pc
is_pc() {
var arr = ['macos', 'windows'];
return arr.indexOf(uni.getSystemInfoSync().platform) != -1;
},
//
application_client() {
var type = '';

View File

@ -140,7 +140,7 @@
<!-- 操作导航 -->
<block v-if="data_list.length > 0">
<view class="bottom-fixed z-i" :class="(discount_detail_status ? ' discount-detail-popup-z-index' : '')" :style="bottom_fixed_style">
<view :class="propCartNavBottomValue > 0 ? '' : 'bottom-line-exclude'">
<view>
<!-- 展示 -->
<view v-if="common_site_type == 4" class="cart-exhibition-mode">
<button class="item exhibition-btn bg-main br-main cr-white round wh-auto text-size-sm" type="default" @tap="exhibition_submit_event" hover-class="none">
@ -1417,17 +1417,29 @@
//
page_style_handle() {
var value = 0;
var value = 0;
var value_unit = 'px';
if(app.globalData.data.is_use_native_tabbar == 1) {
// #ifdef H5
value += (uni.getWindowInfo().windowBottom || 50)+40;
// #ifdef H5
if(this.propSourceType != 'page') {
value += uni.getWindowInfo().windowBottom || 50;
}
// #endif
} else {
value += ((this.propCartNavBottomValue-8)*2)+20;
value += this.propCartNavBottomValue;
// #ifdef H5
if(app.globalData.is_pc()) {
var system = app.globalData.get_system_info(null, null, true);
if(system.windowWidth <= 960) {
value *= 2;
value_unit = 'rpx';
}
}
// #endif
}
this.setData({
bottom_fixed_style: 'bottom:'+value+'rpx',
scroll_style: 'height: calc(100vh - ' + (value+(this.cart_type_value == 'realstore' ? 220 : 80)-(this.is_first == 1 ? 100 : 0))+'rpx)',
bottom_fixed_style: 'bottom:'+value+value_unit,
scroll_style: 'height: calc(100vh - ' + (value+(this.cart_type_value == 'realstore' ? 200 : 70)-(this.is_first == 1 ? 100 : 0))+'rpx)',
});
}
}
@ -1444,7 +1456,7 @@
padding-bottom: 60rpx;
}
.scroll-box.cart .content {
padding-bottom: calc(160rpx + env(safe-area-inset-bottom));
padding-bottom: calc(180rpx + env(safe-area-inset-bottom));
}
.cart-goods-title {
line-height: 44rpx;

View File

@ -131,6 +131,7 @@
}
let footer_height = nav_height + parseInt(new_style.common_style.margin_top) + parseInt(new_style.common_style.margin_bottom);
// #ifndef H5
// 20
var safe_areaInsets = uni.getSystemInfoSync().safeAreaInsets || {};
var bottom = parseInt(safe_areaInsets.bottom || 0);
@ -138,6 +139,7 @@
bottom -= 24;
}
footer_height += bottom;
// #endif
//
this.$emit('onFooterHeight', footer_height);

View File

@ -697,8 +697,20 @@
if(this.category_goods_is_show_cart_nav == 1 && this.common_site_type != 4) {
right_style = 'padding-bottom: calc(120rpx + '+bottom_style_value+'rpx);';
}
//
var footer_height = this.footer_height_value;
var footer_height_unit = 'px';
// #ifdef H5
if(app.globalData.is_pc()) {
var system = app.globalData.get_system_info(null, null, true);
if(system.windowWidth <= 960) {
footer_height *= 2;
footer_height_unit = 'rpx';
}
}
// #endif
this.setData({
category_content_style: 'height:calc(100vh - ' + (this.search_height + this.window_bottom_height + this.footer_height_value)+'px);',
category_content_style: 'height:calc(100vh - ' + (this.search_height + this.window_bottom_height)+'px - '+footer_height+footer_height_unit+');',
left_content_actual_style: left_style,
right_content_actual_style: right_style,
botton_nav_style: 'bottom: calc(20rpx);',