diff --git a/App.vue b/App.vue index 4ff095d7..d3d2f178 100644 --- a/App.vue +++ b/App.vue @@ -7,10 +7,10 @@ data: { // 基础配置 // 数据接口请求地址 - request_url:'https://new.shopxo.vip/', + request_url:'http://shopxo.com/', // 静态资源地址(如系统根目录不在public目录下面请在静态地址后面加public目录、如:https://d1.shopxo.vip/public/) - static_url:'https://new.shopxo.vip/', + static_url:'http://shopxo.com/', // 系统类型(默认default、如额外独立小程序、可与程序分身插件实现不同主体小程序及支付独立) system_type: 'default', diff --git a/pages/diy/components/diy/diy.vue b/pages/diy/components/diy/diy.vue index 56ed83db..582c33e9 100644 --- a/pages/diy/components/diy/diy.vue +++ b/pages/diy/components/diy/diy.vue @@ -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);