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

master
gongfuxiang 2025-05-14 15:01:51 +08:00
commit 35f4beac31
1 changed files with 23 additions and 2 deletions

View File

@ -16,7 +16,7 @@
</view>
<template v-if="is_tabs_type">
<template v-if="diy_data.length > 0">
<view v-for="(item, index) in diy_data" :key="index" :style="'margin-top:' + (['float-window'].includes(item.key) ? '0rpx;z-index:1' : -(item.com_data.style.common_style.floating_up * 2 || 0) + 'rpx;z-index:' + (!isEmpty(item.com_data.style.common_style.module_z_index) ? item.com_data.style.common_style.module_z_index : 0))">
<view v-for="(item, index) in diy_data" :key="index" :style="'margin-top:' + (['float-window'].includes(item.key) ? '0rpx;' : item.floating_up + 'z-index:' + (!isEmpty(item.com_data.style.common_style.module_z_index) ? item.com_data.style.common_style.module_z_index : 0))">
<!-- 基础组件 -->
<template v-if="item.is_enable == '1'">
<component-diy-search v-if="item.key == 'search'" :propIndex="get_prop_index(item)" :propKey="item.id + index" :propValue="item.com_data"></component-diy-search>
@ -224,6 +224,7 @@
},
data() {
return {
scale_component_list: [ 'carousel', 'custom', 'data-magic', 'img-magic', 'video' ],
//
currency_symbol: app.globalData.currency_symbol(),
//
@ -448,8 +449,28 @@
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);
//
let scale = sys_width / 390;
// 2
scale = scale > 2 ? 2 : scale;
//
diy_data.forEach((item) => {
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)) {
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;