浏览代码

适配黄山数据&修改空间时附加颜色变化

zjs_project 1 年之前
父节点
当前提交
2883efa130

+ 3 - 0
src/components/newBottomCom/viewlayout/viewlayout.vue

@@ -150,6 +150,9 @@
 				// 	this.selectSeedId = this.seedLayoutList[this.defaultIndex].spaceStructure;
 				// }
 				this.selectSeedId = this.seedLayoutList[this.defaultIndex].spaceStructure;
+				if(this.$route.query.structureName){//如果存在结构特征,则定位到该模型大类下
+					this.selectSeedId = this.seedLayoutList.find(it=>it.spaceName==this.$route.query.structureName).spaceStructure;
+				}
 				if(this.selectSeedId){
 					let item = this.seedLayoutList.find(it=>{
 						return it.spaceStructure == this.selectSeedId

+ 18 - 0
src/mixins/floorMethod.js

@@ -57,6 +57,8 @@ export default {
 							
 							instancedMesh.setMatrixAt(i, child.matrixWorld);
 							instancedMesh.instanceMatrix.needsUpdate = true;
+							instancedMesh.setColorAt(i, child.material.color);
+							instancedMesh.instanceColor.needsUpdate = true;//打开颜色修改开关,不开,颜色是不能修改额
 							let gltfSpace = that.gltfSpaces.find(gltfSpace=>gltfSpace.spaceId == obj.spaceId);//判断是否已经添加过
 							if(!gltfSpace){
 								let position = new THREE.Vector3();//当前几何体的位置参数
@@ -186,6 +188,7 @@ export default {
 				spaceInitMatrix.push({
 					index:_index,
 					matrix:startMatrix.clone(),
+					color:instancedMesh.material.color.clone(),
 				})
 			});
 			// console.warn("***cube***",cube.spaceId,Date.now(),JSON.stringify(spaceInitMatrix[0].matrix))
@@ -218,10 +221,25 @@ export default {
 					stratMatrix.multiply(scaleMatrix).premultiply(panMatrix);//通过矩阵计算获得最终的形变矩阵
 					instancedMesh.instanceMatrix.needsUpdate = true;//更新之前,必须开启开关
 					instancedMesh.setMatrixAt(instanced.instancedAtIndex,stratMatrix);//更新几何体的世界矩阵
+					if(this.curSpaceObj.spaceId==cube.spaceId){//当前选中的空间才变化颜色
+						instancedMesh.instanceColor.needsUpdate = true;//打开颜色修改开关,不开,颜色是不能修改额
+						let color = new THREE.Color(0xFF9F40); // 使用sRGB颜色值
+						// color.convertSRGBToLinear(); // 将颜色值转换为线性颜色值
+						instancedMesh.setColorAt(instanced.instancedAtIndex, color);//修改这个几何体的颜色
+					}
 				});
 			}).onComplete(()=>{//这个回调很可能会很慢
 				this.tweenCameraAnmaChange(false);
 				console.warn("***changeSpacesAnim-over***")
+				if(this.curSpaceObj.spaceId==cube.spaceId){//当前选中的空间才恢复颜色
+					cube.instancedMeshIndexList.forEach(instanced=>{
+						let _index = instanced.instancedMeshIndex;//第一个geometry实例 在 全局Instance
+						let instancedMesh = this.instancedSpaceMeshList[_index];//获取具体的网格实例
+						let tmp = spaceInitMatrix.find(it=>it.index==_index);
+						instancedMesh.instanceColor.needsUpdate = true;//打开颜色修改开关,不开,颜色是不能修改额
+						instancedMesh.setColorAt(instanced.instancedAtIndex, tmp.color);//修改这个几何体的颜色
+					});
+				}
 			});
 			// 开始动画
 			tween.start();

+ 1 - 1
src/mixins/wallMethod.js

@@ -650,7 +650,7 @@ export default {
 												newWallType = element;
 											}
 										}
-										console.log("寻找最大的窗户",index, wallWidth, newWallType.width,element.width)
+										// console.log("寻找最大的窗户",index, wallWidth, newWallType.width,element.width)
 									}
 	
 									item.wallModelData[1].wallWidth = newWallType.width;

+ 12 - 14
src/pages/webgl_rxdz/webgl_rxdz.vue

@@ -165,6 +165,7 @@
 			console.warn("***beforeDestroy-webgl_rxdz***");
 		},
         mounted() {
+			console.log("***onLoad-webgl_rxdz***", this.$route.query)
 			var that = this;
 			this.houseId = '100296';//
 			this.childLayout = '0'
@@ -590,13 +591,6 @@
 				}
             }
 			
-			// const eventChannel = this.getOpenerEventChannel();
-			// // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
-			// eventChannel && eventChannel.hasOwnProperty('on') && eventChannel.on('acceptDataFromOpenerPage', (dataList) => {
-			// 	console.log('监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据',dataList)
-			// 	this.setHouseDetail(dataList)
-			// })
-			
 		},
 		onShow(){
 			if(this.attendEvent){
@@ -621,13 +615,17 @@
 			//黄山数据处理
 			hushangHandle(param){
 				let expand = {};
-				expand.landImg = "https://dm.static.elab-plus.com/huangshan/zizaigu/share/A9.png";
-				expand.baseImg = "https://dm.static.elab-plus.com/huangshan/zizaigu/project/A9-180-1.5F-L形.jpg";
-				expand.bgPrototypeImg = "https://dm.static.elab-plus.com/huangshan/zizaigu/project/A9-180-1.5F-L形【图例】.jpg";
-				expand.landNo = "A9";
-				expand.buildingArea = "95";
-				expand.layer = "2层建筑&(带大露台)";
-				expand.structureDescription = "大开间面·尽览景致";
+				expand.landImg = this.$route.query.landImg || '';
+				expand.baseImg = this.$route.query.baseImg || '';
+				expand.bgPrototypeImg = this.$route.query.bgPrototypeImg || '';
+				expand.landNo = this.$route.query.landNo || '';//地块
+				expand.landArea = this.$route.query.landArea || '';//地块面积
+				expand.buildingAreaPreference = this.$route.query.buildingAreaPreference || '';//建筑面积
+				expand.layer = this.$route.query.layer || '';//层数
+				expand.structureName = this.$route.query.structureName || '';//结构-L形等
+				expand.landDescription = this.$route.query.landDescription || '';//地形地势
+				expand.scenery = this.$route.query.scenery || '';//景观
+				expand.structureDescription = this.$route.query.structureDescription || '';//空间特质-结构
 				param.expand = JSON.stringify(expand);
 				return param;
 			},

+ 27 - 7
src/pages/webgl_rxdz_customize/webgl_rxdz_customize.html

@@ -51,16 +51,32 @@
 				    <div class="info-item-label">地块</div>
 				    <div class="info-item-value">{{layoutStruct.expand.landNo || '-'}}</div>
 				</div>
-				<div class="info-item" v-if="layoutStruct.expand && layoutStruct.expand.buildingArea">
+				<div class="info-item" v-if="layoutStruct.expand && layoutStruct.expand.landArea">
+				    <div class="info-item-label">地块面积<span class="textAbout">约</span></div>
+				    <div class="info-item-value">{{layoutStruct.expand.landArea || '-'}}</div>
+				</div>
+				<div class="info-item" v-if="layoutStruct.expand && layoutStruct.expand.buildingAreaPreference">
 				    <div class="info-item-label">建筑面积<span class="textAbout">约</span></div>
-				    <div class="info-item-value">{{layoutStruct.expand.buildingArea+'m²' || '-'}}</div>
+				    <div class="info-item-value">{{layoutStruct.expand.buildingAreaPreference+'m²' || '-'}}</div>
 				</div>
 				<div class="info-item" v-if="layoutStruct.expand && layoutStruct.expand.layer">
 				    <div class="info-item-label">层数</div>
-				    <pre class="info-item-value">{{layoutStruct.expand.layer.replace(/&/g,'\n') || '-'}}</pre>
+				    <pre class="info-item-value">{{layoutStruct.expand.layer.replace(/&/g,'\n') || '-'}}</pre>
 				</div>
-				<div class="info-item" v-if="layoutStruct.expand && layoutStruct.expand.structureDescription">
+				<div class="info-item" v-if="layoutStruct.expand && layoutStruct.expand.structureName">
 				    <div class="info-item-label">结构</div>
+				    <pre class="info-item-value">{{layoutStruct.expand.structureName || '-'}}</pre>
+				</div>
+				<div class="info-item" v-if="layoutStruct.expand && layoutStruct.expand.scenery">
+				    <div class="info-item-label">地形地势</div>
+				    <pre class="info-item-value">{{layoutStruct.expand.scenery || '-'}}</pre>
+				</div>
+				<div class="info-item" v-if="layoutStruct.expand && layoutStruct.expand.landDescription">
+				    <div class="info-item-label">景观</div>
+				    <pre class="info-item-value">{{layoutStruct.expand.landDescription.replace(/&|·/g,'\n') || '-'}}</pre>
+				</div>
+				<div class="info-item" v-if="layoutStruct.expand && layoutStruct.expand.structureDescription">
+				    <div class="info-item-label">空间特质</div>
 				    <pre class="info-item-value">{{layoutStruct.expand.structureDescription.replace(/&|·/g,'\n') || '-'}}</pre>
 				</div>
                 <div class="info-item">
@@ -68,15 +84,19 @@
                     <div class="info-item-value eslipe">{{form.layoutName || '-'}}</div>
                 </div>
                 <div class="info-item">
-                    <div class="info-item-label">地块面积<span class="textAbout">约</span></div>
-                    <div class="info-item-value">{{form.layoutArea?(form.layoutArea+'m²'):'-'}}</div>
+                    <div class="info-item-label">定制空间面积<span class="textAbout">约</span></div>
+                    <div class="info-item-value">
+						<div v-for="(floor,index) in layoutStruct.layoutStruct" :key="index">
+							{{floor.layoutArea?(floor.floor +"F:" + floor.layoutArea+'m²'):'-'}}
+						</div>
+					</div>
                 </div>
                 <!-- <div class="info-item">
                     <div class="info-item-label">家庭结构</div>
                     <div class="info-item-value">{{layoutStruct.spaceName || '-'}}</div>
                 </div> -->
                 <div class="info-item" v-if="form.style">
-                    <div class="info-item-label">风格</div>
+                    <div class="info-item-label">风格偏好</div>
                     <div class="info-item-value">{{form.style || '-'}}</div>
                 </div>
             </div>

+ 1 - 1
src/pages/webgl_rxdz_customize/webgl_rxdz_customize.scss

@@ -150,7 +150,7 @@ page {
         position: relative;
         border: 2rem solid rgba(255, 255, 255, 0.5);
 		border-top:none;
-        padding: 90rem 60rem 20rem;
+        padding: 90rem 30rem 20rem;
 		box-sizing: border-box;
 		color: #fff;
 		z-index: 3;

+ 1 - 1
src/pages/webgl_rxdz_customize/webgl_rxdz_customize.vue

@@ -59,7 +59,7 @@ export default {
      * 生命周期函数--监听页面加载
      */
     mounted(options) {
-        console.log("***onLoad-webgl_rxdz_customize***", options)
+        console.log("***onLoad-webgl_rxdz_customize***", this.$route.query)
         const that = this;
         this.houseId = this.$route.query.houseId?this.$route.query.houseId:'';
         // this.spaceId = this.$route.query.spaceId?this.$route.query.spaceId:'';