diff --git a/components/diy/tabs.vue b/components/diy/tabs.vue index 1c16fcd3..926299a0 100644 --- a/components/diy/tabs.vue +++ b/components/diy/tabs.vue @@ -184,7 +184,7 @@ if (!Array.isArray(tabs_bg) || tabs_bg.length === 0 || !tabs_bg[0] || !tabs_bg[0].color) { new_tabs_background = 'background:#fff;'; } - const newPropTop = app.globalData.rpx_to_px(this.propTop); + const newPropTop = this.propIsCommon ? (app.globalData.rpx_to_px(this.propTop) + this.propStickyTop) : (app.globalData.rpx_to_px(this.propTop + this.propStickyTop)); this.setData({ tabs_data: new_tabs_data, tabs_sliding_fixed_bg: this.propIsCommon ? gradient_computer(new_style.common_style) : this.propTabsSlidingFixedBg, @@ -193,12 +193,11 @@ style_img_container: this.propIsCommon ? common_img_computer(new_style.common_style, this.propIndex) : new_content.tabs_top_up == '1' ? background_computer(new_style.common_style) + padding_computer(this.propSpacingCommonStyle, 1, false) + 'box-sizing: border-box;' : '', // 如果是选项卡轮播,不需要走默认样式 tabs_top_style: new_tabs_top_style, // 沉浸模式下并且开通了安全距离 会显示-的margin - style_margin_container: this.propIsImmersionModel && this.propNewIsTabsSafeDistance ? `margin-top: -${ newPropTop + this.propStickyTop }px;` : '', + style_margin_container: this.propIsImmersionModel && this.propNewIsTabsSafeDistance ? `margin-top: -${ newPropTop }px;` : '', // 判断是否置顶 top_up: new_top_up, tabs_z_index: 'z-index: 11;' }); - console.log(this.style_img_container); }, // 获取选项卡高度 get_tabs_height() { @@ -260,10 +259,10 @@ max-width: 100%; } } - @media only screen and (min-width: 800px) { - .tabs-contents { - max-width: 800px !important; - } + .tabs-contents { + max-width: 1600rpx !important; + } + @media only screen and (min-width: 1600rpx) { .tabs-container .tabs-top { left: calc(50% - 400px) !important; }