diff --git a/examples/app-global.js b/examples/app-global.js index e3ff771..dabd128 100644 --- a/examples/app-global.js +++ b/examples/app-global.js @@ -104,6 +104,8 @@ const getPlacementZone = async (sku) => { const only10_12 = /(?=.*10)(?=.*12)/.test(pergolaSku) // 同时包含10和20 const only10_20 = /(?=.*10)(?=.*20)/.test(pergolaSku) + // 只包含13 无13 无12 无20 + const only13 = /(?=.*13)(?!.*10)(?!.*12)(?!.*20)/.test(pergolaSku) // 1. 只要字符串里包含 10,就返回 true const has10 = /10/.test(sku); @@ -152,6 +154,13 @@ const getPlacementZone = async (sku) => { division_include.push('前', '后') } } + //棚子只包13的并且含配件是13 + if (pergolaSku === "SPF111SEM13" && has13) { + division_include.push('前', '后') + } + if (pergolaSku === "SPF111SEM13" && has10) { + division_include.push('左', '右') + } const response = await fetch(getApiUrl(`/api/product-configs/by-sku/${sku}`)); @@ -362,16 +371,16 @@ const executeEvent2 = async (result, sku) => { for (const event of result.data.events) { if (event.event_type === 'change_color') { const materialName = event.material_name; - console.log('替换模型颜色:', event); + console.log('替换模型颜色:', event); const { color, color_map_url, normal_map_url, metallic, roughness } = event.target_data; - + kernel.material.apply({ target: materialName, albedoColor: color, albedoTexture: color_map_url, normalMap: normal_map_url, - + }); console.log(`百叶模型颜色已替换为 ${color}`); diff --git a/examples/demo-global.html b/examples/demo-global.html index cd06a07..984c162 100644 --- a/examples/demo-global.html +++ b/examples/demo-global.html @@ -459,8 +459,8 @@
- - + +
@@ -473,8 +473,8 @@
- - + +
@@ -585,8 +585,8 @@ - - + +