Merge branch 'dev-yxl' of gitee.com:zongzhige/shopxo-uniapp into dev

master
gongfuxiang 2025-06-03 13:47:07 +08:00
commit 03781ffa69
1 changed files with 34 additions and 26 deletions

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;
@ -495,7 +471,7 @@
this.setData({
header_data: header,
footer_data: this.propValue.footer,
diy_data: new_diy_data,
diy_data: this.set_diy_data_floating_up(new_diy_data),
tabs_data: new_tabs_data,
page_style: common_styles_computer(header_style.common_style),
page_img_style: background_computer(header_style.common_style),
@ -534,6 +510,38 @@
}
return item;
},
set_diy_data_floating_up(diy_data_list) {
//
const newMarginTopList = diy_data_list.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_list.forEach((item, index) => {
//
const style = item.com_data?.style?.common_style;
if (style && newMarginTopMap.has(item.id) && scaleComponents.has(diy_data_list[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;';
}
});
return diy_data_list;
},
//
tabs_click_event(tabs_id, bool, params = {}) {
let new_data = [];