1.代码优化

master
sws 2024-10-08 18:18:45 +08:00
parent 555c88236b
commit cc8a1d6ce9
5 changed files with 9 additions and 9 deletions

View File

@ -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 = '';

View File

@ -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 = '';

View File

@ -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,

View File

@ -116,13 +116,13 @@
propIsBar: false,
// 5,7,0 12 60bar_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',
};

View File

@ -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));