1.代码优化
parent
555c88236b
commit
cc8a1d6ce9
|
|
@ -65,7 +65,7 @@
|
|||
},
|
||||
watch: {
|
||||
propScrollTop(newVal) {
|
||||
if (newVal + this.propTop + this.custom_nav_height >= this.tabs_top) {
|
||||
if (newVal + this.propTop + this.custom_nav_height >= this.tabs_top && this.top_up == '1') {
|
||||
let new_style = this.propValue.style || {};
|
||||
let tabs_bg = new_style.common_style.color_list;
|
||||
let new_tabs_background = '';
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
},
|
||||
watch: {
|
||||
propScrollTop(newVal) {
|
||||
if (newVal + this.propTop + this.custom_nav_height >= this.tabs_top) {
|
||||
if (newVal + this.propTop + this.custom_nav_height >= this.tabs_top && this.top_up == '1') {
|
||||
let new_style = this.propValue.style || {};
|
||||
let tabs_bg = new_style.common_style.color_list;
|
||||
let new_tabs_background = '';
|
||||
|
|
|
|||
|
|
@ -173,17 +173,18 @@
|
|||
}
|
||||
// 小程序下,获取小程序胶囊的宽度
|
||||
let menuButtonInfo = 'max-width:100%';
|
||||
|
||||
let new_text_style = `font-weight:${new_style.header_background_title_typeface}; font-size: ${new_style.header_background_title_size * 2}rpx; color: ${new_style.header_background_title_color};`;
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU
|
||||
const custom = uni.getMenuButtonBoundingClientRect();
|
||||
menuButtonInfo = `max-width:calc(100% - ${custom.width + 10}px);`;
|
||||
new_text_style += `right:-${custom.width + 10}px;`;
|
||||
// #endif
|
||||
this.setData({
|
||||
form: this.propValue,
|
||||
position: new_style.up_slide_display == '1' ? 'position:fixed;' : 'position:relative;',
|
||||
is_positon_realative: new_style.up_slide_display == '1' ? false : true,
|
||||
roll_style: new_roll_style,
|
||||
text_style: `font-weight:${new_style.header_background_title_typeface}; font-size: ${new_style.header_background_title_size * 2}rpx; color: ${new_style.header_background_title_color};right:-${custom.width + 10}px;`,
|
||||
text_style: new_text_style,
|
||||
position_class: new_content.indicator_location == 'center' ? `indicator-center` : '',
|
||||
header_style: menuButtonInfo,
|
||||
header_background_type: header_background_type,
|
||||
|
|
|
|||
|
|
@ -116,13 +116,13 @@
|
|||
propIsBar: false,
|
||||
// 5,7,0 是误差,, 12 是下边距,60是高度,bar_height是不同小程序下的导航栏距离顶部的高度
|
||||
// #ifdef MP
|
||||
tabs_top: 'calc(' + bar_height + 5 + 12 + 'px + 66rpx);',
|
||||
tabs_top: 'calc(' + (bar_height + 5 + 12) + 'px + 66rpx);',
|
||||
// #endif
|
||||
// #ifdef H5 || MP-TOUTIAO
|
||||
tabs_top: 'calc(' + bar_height + 7 + 12 + 'px+ 66rpx);',
|
||||
tabs_top: 'calc(' + (bar_height + 7 + 12) + 'px+ 66rpx);',
|
||||
// #endif
|
||||
// #ifdef APP
|
||||
tabs_top: 'calc(' + bar_height + 0 + 12 + 'px+ 66rpx);',
|
||||
tabs_top: 'calc(' + (bar_height + 0 + 12) + 'px+ 66rpx);',
|
||||
// #endif
|
||||
custom_nav_height: '66rpx',
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,14 +6,13 @@
|
|||
<componentDiyModulesTabsView :propValue="tabs_data" propIsTabsIcon :propStyle="propStyle" @tabs-click="tabs_click_event"></componentDiyModulesTabsView>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view v-if="top_up == '1'" class="tabs-seat" :style="'height:' + tabs_seat_height + 'px;padding-top:' + tabs_padding_top"></view> -->
|
||||
<view v-if="top_up == '1'" class="tabs-seat" :style="'height:' + tabs_seat_height + 'px;'"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const app = getApp();
|
||||
import { common_styles_computer, gradient_computer } from '@/common/js/common/common.js';
|
||||
import { common_styles_computer } from '@/common/js/common/common.js';
|
||||
import componentDiyModulesTabsView from '@/components/diy/modules/tabs-view';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0));
|
||||
|
|
|
|||
Loading…
Reference in New Issue