修改上浮逻辑处理

master
于肖磊 2025-06-03 13:38:34 +08:00
parent 7747c38724
commit b31f1f60b5
2 changed files with 32 additions and 27 deletions

View File

@ -7,10 +7,10 @@
data: {
//
//
request_url:'https://new.shopxo.vip/',
request_url:'http://shopxo.com/',
// publicpublichttps://d1.shopxo.vip/public/
static_url:'https://new.shopxo.vip/',
static_url:'http://shopxo.com/',
// default
system_type: 'default',

View File

@ -440,6 +440,7 @@
let new_diy_index = 0;
let new_tabs_data = [];
let new_diy_data = [];
//
if (tabs_data.length > 0) {
tabs_data.forEach((item) => {
// item
@ -450,33 +451,8 @@
new_diy_data = diy_data;
} else {
new_tabs_data = tabs_data;
const newMarginTopList = diy_data.filter((item) => {
const style = item.com_data?.style?.common_style;
return style && style.floating_up > 0;
});
const newMarginTopMap = new Set(newMarginTopList.map(item => item.id));
//
const scaleComponents = new Set(this.scale_component_list);
const subset_scale_component_list = new Set(this.subset_scale_component_list);
//
let scale = sys_width / 390;
// 2
// if (sys_width <= 800) {
// scale = scale > 2 ? 2 : scale;
// } else {
// scale = scale;
// }
//
diy_data.forEach((item, index) => {
//
const style = item.com_data?.style?.common_style;
if (style && newMarginTopMap.has(item.id) && scaleComponents.has(diy_data[index - 1].key) && !subset_scale_component_list.has(item.key)) {
item.floating_up = '-' + (style?.floating_up || 0) * scale + 'px;';
} else {
item.floating_up = '-' + (style?.floating_up || 0) * 2 + 'rpx;';
}
//
if (item.com_name == 'float-window') {
item.index = -1;
@ -488,6 +464,35 @@
}
});
}
//
const newMarginTopList = new_diy_data.filter((item) => {
const style = item.com_data?.style?.common_style;
return style && style.floating_up > 0;
});
const newMarginTopMap = new Set(newMarginTopList.map(item => item.id));
//
const scaleComponents = new Set(this.scale_component_list);
const subset_scale_component_list = new Set(this.subset_scale_component_list);
//
let scale = sys_width / 390;
// 2
// if (sys_width <= 800) {
// scale = scale > 2 ? 2 : scale;
// } else {
// scale = scale;
// }
//
new_diy_data.forEach((item, index) => {
//
const style = item.com_data?.style?.common_style;
if (style && newMarginTopMap.has(item.id) && scaleComponents.has(diy_data[index - 1].key) && !subset_scale_component_list.has(item.key)) {
item.floating_up = '-' + (style?.floating_up || 0) * scale + 'px;';
} else {
item.floating_up = '-' + (style?.floating_up || 0) * 2 + 'rpx;';
}
});
const { padding_right = 0, padding_left = 0 } = header_style.common_style;
const new_is_search_alone_row = header.com_data.content.data_alone_row_value.length > 0 ? true : false;
const new_data_alone_row_space = parseInt(header_style.data_alone_row_space || 0);