Просмотр исходного кода

更改空间显示名称 X空间 类型 根据布局所属类型来显示

zjs_project 1 год назад
Родитель
Сommit
200aeb9991

+ 3 - 2
src/components/newBottomCom/viewMask/viewMask.vue

@@ -278,13 +278,14 @@
 						let layout = list.find(it=>it.id == layoutId);
 						if(layout){
 							let name = spaceTypes[layout.type - 1];
-							lable.text = name
+							lable.text = name;
 						}
 					}else{
 						let name = spaceTypes[lable.spaceType - 1];
 						lable.text = name;
 					}
 				})
+				this.$forceUpdate()
 				console.warn("***updataLable***",this.datalist)
 			},
 			swiperChangeImg(e){
@@ -511,7 +512,7 @@
 				// const spaceName = this.spaceTypes[this.spaceObj.spaceType - 1].title;
 				let res = await requestConfig("getHardboundEffects", {
 					"houseId": this.$route.query.houseId || this.$store.state.houseId,
-					"spaceType": this.spaceObj.spaceType,
+					"spaceType": this.spaceObj.layoutSpaceType || this.spaceObj.spaceType,
 					"spaceName": this.spaceObj.spaceName,
 				});
 				this.styleList = [];

+ 1 - 1
src/components/newBottomCom/viewPlot/viewPlot.html

@@ -7,7 +7,7 @@
 	<!-- 布局空间列表数据 -->
 	<div class="swiper-view">
 		<div class="tab-content rows flex-start">
-			<div @click="tabIndex=index" class="tab-item columns"
+			<div @click="tabIndex=index;selectIndex=0;" class="tab-item columns"
 				:class="{'tabActive': tabIndex == index}" 
 				v-for="(tab,index) in plotList" :key="index" >
 				<!-- <img class="tab-img" :src="tab.imageUrl" mode="aspectFill" /> -->

+ 8 - 2
src/components/newBottomCom/viewPlot/viewPlot.vue

@@ -2,7 +2,7 @@
 
 </template>
 <script>
-	// const util = require('@/static/utils/util.js');
+	const util = require('@/utils/util.js').default;
 	const config = require('@/services/urlConfig.js');
 	import spaceTypes from '@/static/spaceTypesIE.js';
 	import {
@@ -122,7 +122,7 @@
 					clkId: 'clk_2cmina_24012302', //点击ID
 					clkName: 'option_clk', //点击前往的页面名称
 					clkParams: {
-						type: this.options[this.optionIndex].content,
+						type: this.plotList[this.tabIndex].dataList[this.selectIndex].name,
 						locusName: "选项选择",
 					}
 				};
@@ -145,6 +145,12 @@
 					return false
 				}
 				let plot = this.plotList[this.tabIndex].dataList[this.selectIndex];
+				if(!plot){
+					Toast({
+						message: '请选择具体的布局',
+					});
+					return false
+				}
 				this.$parent.$parent.userSelectPlot(plot);//告知页面,用户选择的布局id
 			},
 			//去往详情页面

+ 5 - 1
src/components/newBottomCom/viewShell/viewShell.vue

@@ -133,11 +133,15 @@
 		},
 		methods:{
 			changeStyleType(type,selectSpace){
-				this.lastStyleType = this.styleType;//记录下当前的状态,因为会返回到这个状态
+				console.warn("***changeStyleType***",this.lastStyleType)
+				if(this.styleType != type){
+					this.lastStyleType = this.styleType;//记录下当前的状态,因为会返回到这个状态
+				}
 				this.styleType = type;
 				this.selectSpace = selectSpace;
 			},
 			rebackLast(){
+				console.warn("***rebackLast***",this.lastStyleType)
 				this.styleType = this.lastStyleType;//返回记录下的状态
 				this.selectSpace = null;
 			},

+ 5 - 0
src/mixins/loadModel.js

@@ -1159,10 +1159,15 @@ export default {
 		},
 		//切换单个空间的布局到指定的布局上
 		changeSingleLayout(spaceId,layoutObj){
+			if(!layoutObj){
+				console.warn("***changeSingleLayout***数据错误")
+				return false
+			}
 			// 更新空间的布局id
 			const element = this.spaceList.find(it=>it.spaceId == spaceId);
 			this.deleteLayoutModel(element, layoutObj);//删除当前空间的布局
 			element.layoutId = layoutObj.id;//更新布局信息到空间对象里面
+			element.layoutSpaceType = layoutObj.type;//更新布局信息到空间对象里面
 			this.changeLayouts = [];
 			this.changeLayouts.push(layoutObj)
 			let changeSpaces = [];

+ 20 - 13
src/pages/webgl_rxdz_test/webgl_rxdz_test.vue

@@ -1663,10 +1663,14 @@
 			},
 			//用户选择的布局id-需要切换到这个布局去
 			userSelectPlot(layoutObj){
+				if(!layoutObj){
+					console.warn("***userSelectPlot***数据错误")
+					return false
+				}
 				let spaceId = this.selectSpace.spaceId;
 				console.warn("***userSelectPlot***",spaceId,layoutObj)
 				this.changeSingleLayout(spaceId,layoutObj);
-				this.updataLable();
+				this.updataLable(spaceId,layoutObj);
 			},
 			async goRoam1(spaceId){
 				if(this.overChange){
@@ -1759,19 +1763,22 @@
                 this.getHouseTypeSpaceWalls();
             },
 			//更改空间显示名称 X空间 类型 根据布局所属类型来显示
-			updataLable(){
+			updataLable(spaceId,layoutObj){
 				let list = this.arrFrunList;
-				this.lableItem.forEach(lable=>{
-					if(lable.spaceType==15){
-						let layoutId = this.spaceList.find(it => it.spaceId == lable.spaceId).layoutId;
-						let layout = list.find(it=>it.id == layoutId);
-						if(layout){
-							let name = spaceTypes[layout.type - 1];
-							lable.text = name
-						}
-					}
-				})
-				console.warn("***updataLable***",this.lableItem)
+				let lable = this.lableItem.find(it=>it.spaceId == spaceId);
+				let name = spaceTypes[layoutObj.type - 1];
+				lable.text = name;
+				// this.lableItem.forEach(lable=>{
+				// 	if(lable.spaceType==15){
+				// 		let layoutId = this.spaceList.find(it => it.spaceId == lable.spaceId).layoutId;
+				// 		let layout = list.find(it=>it.id == layoutId);
+				// 		if(layout){
+				// 			let name = spaceTypes[layout.type - 1];
+				// 			lable.text = name
+				// 		}
+				// 	}
+				// })
+				console.warn("***updataLable***",lable)
 			},
 			// 添加文字标签
 			addWordLabel(){