Compare commits
2 Commits
6e0fefd3c9
...
09cd8072b8
| Author | SHA1 | Date | |
|---|---|---|---|
| 09cd8072b8 | |||
| 1a518ce04f |
@ -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}`);
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -79890,7 +79890,7 @@ discard;}}
|
|||||||
/** 初始化灯光并开启阴影 */
|
/** 初始化灯光并开启阴影 */
|
||||||
Awake() {
|
Awake() {
|
||||||
const light = new DirectionalLight("sun", new Vector3(-1, -2, -1), this.mainApp.appScene.object);
|
const light = new DirectionalLight("sun", new Vector3(-1, -2, -1), this.mainApp.appScene.object);
|
||||||
light.intensity = 1.2;
|
light.intensity = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356850,7 +356850,7 @@ clipPos=viewProjection*worldPos;previousClipPos=previousViewProjection*previousW
|
|||||||
if (originalZoneIndex !== -1) {
|
if (originalZoneIndex !== -1) {
|
||||||
const originalZone = wallZones[originalZoneIndex];
|
const originalZone = wallZones[originalZoneIndex];
|
||||||
if (originalZone) {
|
if (originalZone) {
|
||||||
const offsetDistance2 = -0.05;
|
const offsetDistance2 = 0;
|
||||||
const returnPosition = originalZone.center.add(originalZone.normal.scale(offsetDistance2));
|
const returnPosition = originalZone.center.add(originalZone.normal.scale(offsetDistance2));
|
||||||
rootMesh.position.copyFrom(returnPosition);
|
rootMesh.position.copyFrom(returnPosition);
|
||||||
const targetDirection2 = originalZone.normal.scale(-1);
|
const targetDirection2 = originalZone.normal.scale(-1);
|
||||||
@ -356877,7 +356877,7 @@ clipPos=viewProjection*worldPos;previousClipPos=previousViewProjection*previousW
|
|||||||
if (originalZoneIndex !== -1) {
|
if (originalZoneIndex !== -1) {
|
||||||
const originalZone = wallZones[originalZoneIndex];
|
const originalZone = wallZones[originalZoneIndex];
|
||||||
if (originalZone) {
|
if (originalZone) {
|
||||||
const offsetDistance2 = -0.05;
|
const offsetDistance2 = 0;
|
||||||
const returnPosition = originalZone.center.add(originalZone.normal.scale(offsetDistance2));
|
const returnPosition = originalZone.center.add(originalZone.normal.scale(offsetDistance2));
|
||||||
rootMesh.position.copyFrom(returnPosition);
|
rootMesh.position.copyFrom(returnPosition);
|
||||||
const targetDirection2 = originalZone.normal.scale(-1);
|
const targetDirection2 = originalZone.normal.scale(-1);
|
||||||
@ -356981,7 +356981,7 @@ clipPos=viewProjection*worldPos;previousClipPos=previousViewProjection*previousW
|
|||||||
const existingRootMesh = existingMeshes[0];
|
const existingRootMesh = existingMeshes[0];
|
||||||
const swapZone = wallZones[currentZoneIndex];
|
const swapZone = wallZones[currentZoneIndex];
|
||||||
if (swapZone) {
|
if (swapZone) {
|
||||||
const offsetDistance = -0.05;
|
const offsetDistance = 0;
|
||||||
const swapPosition = swapZone.center.add(swapZone.normal.scale(offsetDistance));
|
const swapPosition = swapZone.center.add(swapZone.normal.scale(offsetDistance));
|
||||||
existingRootMesh.position.copyFrom(swapPosition);
|
existingRootMesh.position.copyFrom(swapPosition);
|
||||||
const targetDirection = swapZone.normal.scale(-1);
|
const targetDirection = swapZone.normal.scale(-1);
|
||||||
|
|||||||
@ -79887,7 +79887,7 @@ class AppLight extends Monobehiver {
|
|||||||
/** 初始化灯光并开启阴影 */
|
/** 初始化灯光并开启阴影 */
|
||||||
Awake() {
|
Awake() {
|
||||||
const light = new DirectionalLight("sun", new Vector3(-1, -2, -1), this.mainApp.appScene.object);
|
const light = new DirectionalLight("sun", new Vector3(-1, -2, -1), this.mainApp.appScene.object);
|
||||||
light.intensity = 1.2;
|
light.intensity = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356847,7 +356847,7 @@ class AppModelDrag extends Monobehiver {
|
|||||||
if (originalZoneIndex !== -1) {
|
if (originalZoneIndex !== -1) {
|
||||||
const originalZone = wallZones[originalZoneIndex];
|
const originalZone = wallZones[originalZoneIndex];
|
||||||
if (originalZone) {
|
if (originalZone) {
|
||||||
const offsetDistance2 = -0.05;
|
const offsetDistance2 = 0;
|
||||||
const returnPosition = originalZone.center.add(originalZone.normal.scale(offsetDistance2));
|
const returnPosition = originalZone.center.add(originalZone.normal.scale(offsetDistance2));
|
||||||
rootMesh.position.copyFrom(returnPosition);
|
rootMesh.position.copyFrom(returnPosition);
|
||||||
const targetDirection2 = originalZone.normal.scale(-1);
|
const targetDirection2 = originalZone.normal.scale(-1);
|
||||||
@ -356874,7 +356874,7 @@ class AppModelDrag extends Monobehiver {
|
|||||||
if (originalZoneIndex !== -1) {
|
if (originalZoneIndex !== -1) {
|
||||||
const originalZone = wallZones[originalZoneIndex];
|
const originalZone = wallZones[originalZoneIndex];
|
||||||
if (originalZone) {
|
if (originalZone) {
|
||||||
const offsetDistance2 = -0.05;
|
const offsetDistance2 = 0;
|
||||||
const returnPosition = originalZone.center.add(originalZone.normal.scale(offsetDistance2));
|
const returnPosition = originalZone.center.add(originalZone.normal.scale(offsetDistance2));
|
||||||
rootMesh.position.copyFrom(returnPosition);
|
rootMesh.position.copyFrom(returnPosition);
|
||||||
const targetDirection2 = originalZone.normal.scale(-1);
|
const targetDirection2 = originalZone.normal.scale(-1);
|
||||||
@ -356978,7 +356978,7 @@ class AppModelDrag extends Monobehiver {
|
|||||||
const existingRootMesh = existingMeshes[0];
|
const existingRootMesh = existingMeshes[0];
|
||||||
const swapZone = wallZones[currentZoneIndex];
|
const swapZone = wallZones[currentZoneIndex];
|
||||||
if (swapZone) {
|
if (swapZone) {
|
||||||
const offsetDistance = -0.05;
|
const offsetDistance = 0;
|
||||||
const swapPosition = swapZone.center.add(swapZone.normal.scale(offsetDistance));
|
const swapPosition = swapZone.center.add(swapZone.normal.scale(offsetDistance));
|
||||||
existingRootMesh.position.copyFrom(swapPosition);
|
existingRootMesh.position.copyFrom(swapPosition);
|
||||||
const targetDirection = swapZone.normal.scale(-1);
|
const targetDirection = swapZone.normal.scale(-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user