This commit is contained in:
2026-06-05 10:05:32 +08:00
parent 6e0fefd3c9
commit 1a518ce04f
2 changed files with 18 additions and 9 deletions

View File

@ -104,6 +104,8 @@ const getPlacementZone = async (sku) => {
const only10_12 = /(?=.*10)(?=.*12)/.test(pergolaSku) const only10_12 = /(?=.*10)(?=.*12)/.test(pergolaSku)
// 同时包含10和20 // 同时包含10和20
const only10_20 = /(?=.*10)(?=.*20)/.test(pergolaSku) const only10_20 = /(?=.*10)(?=.*20)/.test(pergolaSku)
// 只包含13 无13 无12 无20
const only13 = /(?=.*13)(?!.*10)(?!.*12)(?!.*20)/.test(pergolaSku)
// 1. 只要字符串里包含 10就返回 true // 1. 只要字符串里包含 10就返回 true
const has10 = /10/.test(sku); const has10 = /10/.test(sku);
@ -152,6 +154,13 @@ const getPlacementZone = async (sku) => {
division_include.push('前', '后') 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}`)); 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) { for (const event of result.data.events) {
if (event.event_type === 'change_color') { if (event.event_type === 'change_color') {
const materialName = event.material_name; const materialName = event.material_name;
console.log('替换模型颜色:', event); console.log('替换模型颜色:', event);
const { color, color_map_url, normal_map_url, metallic, roughness } = event.target_data; const { color, color_map_url, normal_map_url, metallic, roughness } = event.target_data;
kernel.material.apply({ kernel.material.apply({
target: materialName, target: materialName,
albedoColor: color, albedoColor: color,
albedoTexture: color_map_url, albedoTexture: color_map_url,
normalMap: normal_map_url, normalMap: normal_map_url,
}); });
console.log(`百叶模型颜色已替换为 ${color}`); console.log(`百叶模型颜色已替换为 ${color}`);

View File

@ -459,8 +459,8 @@
</div> </div>
<div class="category-content expanded"> <div class="category-content expanded">
<div class="option-group"> <div class="option-group">
<button class="option-btn" data-option="color-1">SPFPDS13FTW</button> <button class="option-btn" data-option="color-1">SPFFLOW13FTC</button>
<button class="option-btn" data-option="color-2">SPFSW13FTC</button> <button class="option-btn" data-option="color-2">SPFGLASS13FT</button>
</div> </div>
</div> </div>
</div> </div>
@ -473,8 +473,8 @@
</div> </div>
<div class="category-content expanded"> <div class="category-content expanded">
<div class="option-group"> <div class="option-group">
<button class="option-btn" data-option="color-3">SPFPCD10FTW</button> <button class="option-btn" data-option="color-3">SPF80CS10FTS</button>
<button class="option-btn" data-option="color-4">SPFDPH10FTA</button> <button class="option-btn" data-option="color-4">SPFGLASS10FT</button>
</div> </div>
</div> </div>
</div> </div>
@ -585,8 +585,8 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <script src="https://sdk.zguiy.com/zt/assets/index.global.js?v=1234"></script> --> <script src="https://sdk.zguiy.com/zt/assets/index.global.js?v=1234"></script>
<script src="./index.global.js?v=1234"></script> <!-- <script src="./index.global.js?v=1234"></script> -->
<script src="./app-global.js"></script> <script src="./app-global.js"></script>
<script> <script>
// 从全局对象获取 SDK kernel // 从全局对象获取 SDK kernel