Kaynağa Gözat

柔性定制修改

zjs_project 1 yıl önce
ebeveyn
işleme
68ac56859f

+ 14 - 0
src/components/newBottomCom/viewCareful/viewCareful.vue

@@ -44,6 +44,20 @@
 				},
 				deep:true,
 			},
+			curSpaceId: {
+				handler(newVal,oldVal) {
+					if (newVal) {
+						console.warn("***curSpaceId-CHANGE-viewCareful***", newVal)
+						let index = this.carefulList.findIndex(it=>it.spaceId==newVal);
+						this.selectIndex = index;
+					}
+				},
+			},
+		},
+		computed: {
+			curSpaceId() {
+				return this.$store.state.curSpaceId;
+			},
 		},
 		mixins: [],
 		async mounted() {//组件挂载时事件

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

@@ -1,6 +1,6 @@
 <!-- 布局切换操作视图 -->
 <div class="plot-view">
-	<div class="title rows justify-center">选择要更换成的功能空间</div>
+	<!-- <div class="title rows justify-center">选择要更换成的功能空间</div> -->
 	<div class="close rows justify-center" @click="closeHandle">
 		<div class="iconfont icon-close"></div>
 	</div>

+ 3 - 3
src/components/newBottomCom/viewPlot/viewPlot.scss

@@ -3,7 +3,7 @@
 	width: auto;
 	box-sizing: border-box;
 	z-index: 12;
-	padding-top: 30px;
+	padding-top: 0px;
 	.title{
 		font-family: "Verdana Bold";
 		font-weight: 700;
@@ -20,7 +20,7 @@
 		color: rgba(0, 0, 0, 0.22);
 		font-size: 30px;
 		padding: 60px;
-		z-index: 9;
+		z-index: 99;
 	}
 }
 .swiper-view{
@@ -145,7 +145,7 @@
 	position: fixed;
 	left: 140px;
 	bottom: 0px;
-	padding-bottom: 60px;
+	padding-bottom: 30px;
 	width: 470px;
 	z-index: 15;
 	background-color: rgba(255, 255, 255, 1);

+ 3 - 3
src/components/newBottomCom/viewShell/viewShell.scss

@@ -6,7 +6,7 @@
 	left: 0px;
 	bottom: 0px;
 	width: 100vw;
-	height: 200px;
+	height: 170px;
 	border-radius: 40px 40px 0 0;
 	background: #fff;
 	box-shadow: 0 -6px 12px #0000001f;
@@ -14,14 +14,14 @@
 	z-index: 315;
 	padding:0px 40px;
 	padding-top:30px;
-	padding-bottom:60px;
+	padding-bottom:30px;
 	transition: height 1s;
 }
 .shell-view2{
 	height: 600px;
 }
 .shell-view3{
-	height: 748px;
+	height: 600px;
 }
 .shell-signscoll{
 	position: absolute;

+ 2 - 2
src/components/newBottomCom/viewShell/viewShell.vue

@@ -94,8 +94,8 @@
 							this.shellHeight = '600px';
 							_endHeight = 600;
 						}else if(newVal==3){//变更为更改功能
-							this.shellHeight = '748';
-							_endHeight = 748;
+							this.shellHeight = '600';
+							_endHeight = 600;
 						}
 						// let currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length - 1].$vm : null;
 						if(this.$parent && this.$parent.hasOwnProperty('canvasHeight')){

+ 4 - 1
src/components/newBottomCom/viewlayout/viewlayout.html

@@ -19,7 +19,10 @@
 		</div>
 		<!-- 精细化 -->
 		<div class="btn-list rows rows-between" v-else-if="styleType==2">
-			<div class="btn houseType rows justify-center up2" @click="openLayout(3)">
+			<div class="btn houseType rows justify-center up2" @click="openLayout(3)" v-if="showX">
+				<div class="iconfont icon-huxingjianshang style1"></div>更改功能
+			</div>
+			<div class="btn houseType rows justify-center up3" @click="openLayout(3)" v-else>
 				<div class="iconfont icon-huxingjianshang style1"></div>更改功能
 			</div>
 			<div class="btn AiBtn rows justify-center up1" @click="goRoam">

+ 5 - 2
src/components/newBottomCom/viewlayout/viewlayout.scss

@@ -2,7 +2,7 @@
 	position: fixed;
 	left: 30px;
 	bottom: 0px;
-	padding-bottom: 60px;
+	padding-bottom: 30px;
 	width: 690px;
 	z-index: 15;
 	background-color: rgba(255, 255, 255, 1);
@@ -71,7 +71,10 @@
 	color: rgba(255, 255, 255, 1);
 	background-image:linear-gradient(124deg, rgba(245, 201, 82, 1) 0%, rgba(239, 149, 57, 1) 100%);
 }
-
+.up3{
+	color: rgba(255, 255, 255, 1);
+	background-image:linear-gradient(124deg, #ccc 0%, #ccc  100%);
+}
 .houseType{
 	width: 320px;
 	box-shadow: 0 6px 20px #f2980233;

+ 41 - 36
src/components/newBottomCom/viewlayout/viewlayout.vue

@@ -4,6 +4,9 @@
 <script>
 	// const util = require('@/static/utils/util.js');
 	const config = require('@/services/urlConfig.js');
+	import {
+		Toast
+	} from 'mint-ui';
 	// import Bus from '@/common/bus';
 	// import commonMethod from '@/common/commonMethod.js';
 	// import requestConfig from '@/static/lib/requestConfig';
@@ -38,6 +41,8 @@
 				smaillWord:"变小,缩放,小一点,变窄",
 				smaillWordPY:"bianxiao,suofang,xiaoyidian,bianzhai",
 				changeRate:0.05,	//每次变化的比例
+				spaceList:[],
+				showX:false,
 			}
 		},
 		props: {
@@ -78,9 +83,32 @@
 						// if((oldVal && oldVal.id != newVal.id) || !oldVal){
 						// 	this.initSpanceData();
 						// }
+						const spaceDetail = newVal;
+						this.spaceList = JSON.parse(spaceDetail.houseJson);
 					}
 				},
 			},
+			curSpaceId: {
+				handler(newVal,oldVal) {
+					if (newVal) {
+						console.warn("***curSpaceId-CHANGE-layout***", newVal)
+						// if((oldVal && oldVal.id != newVal.id) || !oldVal){
+						// 	this.initSpanceData();
+						// }
+						let space = this.spaceList.find(it=>it.spaceId==this.curSpaceId);
+						if(space && space.spaceType==15){//X空间
+							this.showX = true;
+						}else{
+							this.showX = false;
+						}
+					}
+				},
+			},
+		},
+		computed: {
+			curSpaceId() {
+				return this.$store.state.curSpaceId;
+			},
 		},
 		async mounted() {
 			// this.getRecordAuth();//获取录音权限
@@ -176,45 +204,22 @@
 				}
 				console.warn("***curHouseType-init***",this.seedLayoutList)
 			},
-			// seedItemCheck(item) {
-			// 	if (!item || !item.spaceStructure) {
-			// 		return false;
-			// 	}
-			// 	if (item.spaceStructure == this.selectSeedId) {
-			// 		return false;
-			// 	}
-			// 	this.selectSeedId = item.spaceStructure;
-			// 	this.$emit("seedChange", item);
-			// 	let param = {
-			// 		type: 'CLK', //埋点类型
-			// 		clkId: 'clk_2cmina_23080402', //点击ID
-			// 		clkName: 'seedroom_clk', //点击前往的页面名称
-			// 		clkParams: {
-			// 			type: item.spaceName,
-			// 			locusValue: item.spaceStructure,
-			// 			locusName: "切换种子户型",
-			// 		}
-			// 	};
-			// 	// util.trackRequest(param);
-			// },
-			//上划触发
-			// upCom() {
-			// 	console.warn("***upCom***")
-			// 	this.$emit("changeStyle",2);
-			// 	let param = {
-			// 		type: 'CLK', //埋点类型
-			// 		clkId: 'clk_2cmina_23080403', //点击ID
-			// 		clkName: 'adjust_clk', //点击前往的页面名称
-			// 		clkParams: {
-			// 			locusName: "精细调整",
-			// 		}
-			// 	};
-			// 	// util.trackRequest(param);
-			// },
 			//打开布局
 			openLayout(style) {
 				console.warn("***openLayout***",style)
-				this.$emit("changeStyle",style);
+				if(style==3){
+					let space = this.spaceList.find(it=>it.spaceId==this.curSpaceId);
+					if(this.showX){//X空间
+						this.$emit("changeStyle",style);
+					}else{
+						Toast({
+							message: '此空间无法更改功能',
+						});
+						return false
+					}
+				}else{
+					this.$emit("changeStyle",style);
+				}
 				// util.trackRequest(param);
 			},
 			goRoam(){

+ 14 - 0
src/components/newQCCom/viewCareful/viewCareful.vue

@@ -44,6 +44,20 @@
 				},
 				deep:true,
 			},
+			curSpaceId: {
+				handler(newVal,oldVal) {
+					if (newVal) {
+						console.warn("***curSpaceId-CHANGE-viewCareful***", newVal)
+						let index = this.carefulList.findIndex(it=>it.spaceId==newVal);
+						this.selectIndex = index;
+					}
+				},
+			},
+		},
+		computed: {
+			curSpaceId() {
+				return this.$store.state.curSpaceId;
+			},
 		},
 		mixins: [],
 		async mounted() {//组件挂载时事件

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

@@ -1,6 +1,6 @@
 <!-- 布局切换操作视图 -->
 <div class="plot-view">
-	<div class="title rows justify-center">选择要更换成的功能空间</div>
+	<!-- <div class="title rows justify-center">选择要更换成的功能空间</div> -->
 	<div class="close rows justify-center" @click="closeHandle">
 		<div class="iconfont icon-close"></div>
 	</div>

+ 3 - 3
src/components/newQCCom/viewPlot/viewPlot.scss

@@ -3,7 +3,7 @@
 	width: auto;
 	box-sizing: border-box;
 	z-index: 12;
-	padding-top: 30px;
+	padding-top: 0px;
 	.title{
 		font-family: "Verdana Bold";
 		font-weight: 700;
@@ -20,7 +20,7 @@
 		color: rgba(0, 0, 0, 0.22);
 		font-size: 30px;
 		padding: 60px;
-		z-index: 9;
+		z-index: 99;
 	}
 }
 .swiper-view{
@@ -145,7 +145,7 @@
 	position: fixed;
 	left: 140px;
 	bottom: 0px;
-	padding-bottom: 60px;
+	padding-bottom: 30px;
 	width: 470px;
 	z-index: 15;
 	background-color: rgba(255, 255, 255, 1);

+ 15 - 14
src/components/newQCCom/viewPlot/viewPlot.vue

@@ -26,6 +26,7 @@
 				lastTabIndex:0,
 				plotList:[],//布局数据
 				curHouseObj:null,
+				spaceList:[],
 			}
 		},
 		props:{
@@ -33,29 +34,28 @@
 				type: Boolean,
 				default: false,
 			},
-			selectSpace: {//当前展示的户型
-				type: Object,
-				default: () => {
-					return null
-				}
-			},
 		},
 		watch: {
-			selectSpace: {
+			curSpaceId: {
 				handler(newVal,oldVal) {
 					if (newVal) {
-						console.warn("***selectSpace-CHANGE-viewPlot***", newVal,oldVal)
-						if(!oldVal || (oldVal && oldVal.spaceId != newVal.spaceId)){
-							this.initData();
-						}
+						console.warn("***curSpaceId-CHANGE-viewPlot***", newVal,oldVal)
+						// this.initData();
 					}
 				},
-				deep:true,
+			},
+		},
+		computed: {
+			curSpaceId() {
+				return this.$store.state.curSpaceId;
 			},
 		},
 		mixins: [],
 		async mounted() {//组件挂载时事件
 			this.curHouseObj = JSON.parse(getStorage('curHouseObj'));
+			let spaceDetail = this.curHouseObj;
+			let spaceList = JSON.parse(spaceDetail.houseJson);
+			this.spaceList = spaceList;
 			// this.initData();
 			// var currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length - 1].$vm : null;
 			// this.$parent.$parent.updateCareFul = this.initData;//页面注册变更方法
@@ -70,8 +70,9 @@
 			//初始化数据
 			initData(){
 				// var currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length - 1].$vm : null;
-				this.plotList = [];
-				const spaceDetail = this.selectSpace;
+				console.warn("***initData***",this.spaceList)
+				const spaceDetail = this.spaceList.find(it=>it.spaceId == this.curSpaceId);
+				this.selectSpace = spaceDetail;
 				if(spaceDetail.layouts){
 					this.getOverallArrangementDetailsList(spaceDetail.layouts);
 				}

+ 4 - 3
src/components/newQCCom/viewShell/viewShell.html

@@ -29,10 +29,11 @@
 	:overChange="overChange" :curHouseObj="houseObj"></viewCareful>
 	<!-- 布局选择 -->
 	<viewPlot ref="viewPlot" v-show="styleType==3" @curSpaceChange="curSpaceChange"
-	:overChange="overChange" :selectSpace="selectSpace"></viewPlot>
+	:overChange="overChange" :curHouseObj="houseObj"></viewPlot>
 	<!-- 种子户型视图 -->
-	<viewlayout ref="viewlayout" @curSpaceChange="curSpaceChange" :styleType="styleType" :overChange="overChange" :curHouseObj="houseObj" 
-	@upCom="upCom" @streamRecord="streamRecord" @streamRecordEnd="streamRecordEnd"></viewlayout>
+	<viewlayout ref="viewlayout" @curSpaceChange="curSpaceChange" :styleType="styleType" 
+	:overChange="overChange" :curHouseObj="houseObj" @changeStyle="changeStyle"
+	@streamRecord="streamRecord" @streamRecordEnd="streamRecordEnd"></viewlayout>
 	<!-- nav视图 -->
 	<!-- <viewToolNav v-show="pageType==1 && (styleType==2 || styleType==3)" :seedItem="seedItem" @downCom="downScroll"></viewToolNav> -->
 	<!-- 风格选择视图 -->

+ 3 - 3
src/components/newQCCom/viewShell/viewShell.scss

@@ -6,7 +6,7 @@
 	left: 0px;
 	bottom: 0px;
 	width: 100vw;
-	height: 200px;
+	height: 170px;
 	border-radius: 40px 40px 0 0;
 	background: #fff;
 	box-shadow: 0 -6px 12px #0000001f;
@@ -14,11 +14,11 @@
 	z-index: 315;
 	padding:0px 40px;
 	padding-top:30px;
-	padding-bottom:60px;
+	padding-bottom:30px;
 	transition: height 1s;
 }
 .shell-view2{
-	height: 748px;
+	height: 600px;
 }
 .shell-signscoll{
 	position: absolute;

+ 20 - 20
src/components/newQCCom/viewShell/viewShell.vue

@@ -53,12 +53,6 @@
 			// 	type: [String, Number],
 			// 	default: '',
 			// },
-			// houseList: {//当前户型所有的户型详情,可以切换
-			// 	type: Array,
-			// 	default: () => {
-			// 		return []
-			// 	}
-			// },
 			houseObj: {//当前户型的具体详情
 				type: Object,
 				default: () => {
@@ -95,11 +89,11 @@
 							this.shellHeight = '200px';
 							_endHeight = 200;
 						}else if(newVal==2){//变更为展开状态
-							this.shellHeight = '800px';
-							_endHeight = 800;
+							this.shellHeight = '600px';
+							_endHeight = 600;
 						}else if(newVal==3){//变更为最小状态
-							this.shellHeight = '748';
-							_endHeight = 748;
+							this.shellHeight = '600px';
+							_endHeight = 600;
 						}
 						// let currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length - 1].$vm : null;
 						if(this.$parent && this.$parent.hasOwnProperty('canvasHeight')){
@@ -127,23 +121,29 @@
 		mixins: [touchHandle],
 		async mounted() {
 			// await this.getCityHouseList();		
-			console.warn("***viewShell***",this.houseList)
+			console.warn("***viewShell***")
 			let firstData = JSON.parse(getStorage('firstData'));
-			this.connectUsImg = firstData[0].selectOptionImageUrl;
+			if(firstData && firstData[0] && firstData[0].selectOptionImageUrl){
+				this.connectUsImg = firstData[0].selectOptionImageUrl;
+			}
 		},
 		methods:{
 			changeStyleType(type,selectSpace){
-				console.warn("***changeStyleType***",this.lastStyleType)
-				if(this.styleType != type){
-					this.lastStyleType = this.styleType;//记录下当前的状态,因为会返回到这个状态
+				// console.warn("***changeStyleType***",this.lastStyleType)
+				// if(this.styleType != type){
+				// 	this.lastStyleType = this.styleType;//记录下当前的状态,因为会返回到这个状态
+				// }
+				// this.styleType = type;
+				// this.selectSpace = selectSpace;
+			},
+			changeStyle(style){
+				this.styleType = style;//打开功能空间
+				if(this.styleType == 3){//功能变更
+					this.$refs.viewPlot.initData()
 				}
-				this.styleType = type;
-				this.selectSpace = selectSpace;
 			},
 			rebackLast(){
-				console.warn("***rebackLast***",this.lastStyleType)
-				this.styleType = this.lastStyleType;//返回记录下的状态
-				this.selectSpace = null;
+				this.styleType = 2;//返回记录下的状态
 			},
 			catchTouchMove: function() {
 				return false;

+ 26 - 13
src/components/newQCCom/viewlayout/viewlayout.html

@@ -3,27 +3,40 @@
 <div class="layout-view">
 	<!-- 种子区域 -->
 	<div>
-		<!-- <div class="btn-list rows rows-between" v-if="styleType==1 || styleType==3">
-			<div class="btn rows up justify-center" @click="upCom" :class="styleType==1?'up1':'up2'">开始定制户型 ></div>
-		</div> -->
-		<!-- <div class="btn-list rows rows-between" v-else-if="styleType==2">
-			<div class="btn houseType rows justify-center up2" >
-				<div class="iconfont icon-huxingjianshang style1"></div>户型空间
+		<div class="btn-list rows rows-between" v-if="styleType==1">
+			<!-- <div class="btn voice rows justify-center" :class="recording?'voice2':'voice3'" @touchstart="streamRecord" @touchmove="mytouchmove">
+				<img class="icon" :src="recording?'https://dm.static.elab-plus.com/miniProgram/iconfont/source.png':'https://dm.static.elab-plus.com/miniProgram/iconfont/source1.png'" mode="widthFix"/>
+			</div> -->
+			<!-- 版本2 -->
+			<!-- <div class="btn rows up justify-center" @click="upCom" :class="styleType==1?'up1':'up2'">开始定制户型 ></div> -->
+			
+			<div class="btn houseType rows justify-center up2" @click="openLayout(2)">
+				<div class="iconfont icon-huxingjianshang style1"></div>我来设计
 			</div>
 			<div class="btn AiBtn rows justify-center up1" @click="goRoam">
 				<div class="iconfont icon-a-lujing35039 style1"></div>AI精软装
 			</div>
-		</div> -->
-		<div class="btn-list rows rows-between" v-if="styleType==1 || styleType==2">
-			<div class="btn houseType rows justify-center up1" @click="goback">
-				<div class="iconfont icon-huxingjianshang style1"></div>重选空间
+		</div>
+		<!-- 精细化 -->
+		<div class="btn-list rows rows-between" v-else-if="styleType==2">
+			<div class="btn houseType rows justify-center up2" @click="openLayout(3)" v-if="showX">
+				<div class="iconfont icon-huxingjianshang style1"></div>更改功能
+			</div>
+			<div class="btn houseType rows justify-center up3" @click="openLayout(3)" v-else>
+				<div class="iconfont icon-huxingjianshang style1"></div>更改功能
 			</div>
-			<div class="btn AiBtn rows justify-center up2" @click="goRoam">
+			<div class="btn AiBtn rows justify-center up1" @click="goRoam">
 				<div class="iconfont icon-a-lujing35039 style1"></div>AI精软装
 			</div>
 		</div>
-		<!-- <div class="btn-list rows rows-between" v-if="styleType==3">
-			<div class="btn rows up justify-center" @click="upCom" :class="styleType==1?'up1':'up2'">确认</div>
+		<!-- 布局 -->
+		<!-- <div class="btn-list rows rows-between" v-else-if="styleType==3">
+			<div class="btn houseType rows justify-center up2" >
+				<div class="iconfont icon-huxingjianshang style1"></div>更改功能
+			</div>
+			<div class="btn AiBtn rows justify-center up1" @click="goRoam">
+				<div class="iconfont icon-a-lujing35039 style1"></div>AI精软装
+			</div>
 		</div> -->
 	</div>
 </div>

+ 5 - 2
src/components/newQCCom/viewlayout/viewlayout.scss

@@ -2,7 +2,7 @@
 	position: fixed;
 	left: 30px;
 	bottom: 0px;
-	padding-bottom: 60px;
+	padding-bottom: 30px;
 	width: 690px;
 	z-index: 15;
 	background-color: rgba(255, 255, 255, 1);
@@ -71,7 +71,10 @@
 	color: rgba(255, 255, 255, 1);
 	background-image:linear-gradient(124deg, rgba(245, 201, 82, 1) 0%, rgba(239, 149, 57, 1) 100%);
 }
-
+.up3{
+	color: rgba(255, 255, 255, 1);
+	background-image:linear-gradient(124deg, #ccc 0%, #ccc  100%);
+}
 .houseType{
 	width: 320px;
 	box-shadow: 0 6px 20px #f2980233;

+ 137 - 341
src/components/newQCCom/viewlayout/viewlayout.vue

@@ -4,6 +4,9 @@
 <script>
 	// const util = require('@/static/utils/util.js');
 	const config = require('@/services/urlConfig.js');
+	import {
+		Toast
+	} from 'mint-ui';
 	// import Bus from '@/common/bus';
 	// import commonMethod from '@/common/commonMethod.js';
 	// import requestConfig from '@/static/lib/requestConfig';
@@ -26,18 +29,20 @@
 					text: '等待说话',
 				},
 				recording: false, // 正在录音
-				startX: 0,
-				startY: 0,
-				clientX: 0,
-				clientY: 0,
-				defaultIndex: 0, //默认选中的户型大类
-				carefulList: [],
-				lastSpace: null, //上一个语音操作的空间对象
-				bigWord: "变大,放大,大一点,变宽",
-				bigWordPY: "bianda,fangda,dayidian,biankuan",
-				smaillWord: "变小,缩放,小一点,变窄",
-				smaillWordPY: "bianxiao,suofang,xiaoyidian,bianzhai",
-				changeRate: 0.05, //每次变化的比例
+				startX:0,
+				startY:0,
+				clientX:0,
+				clientY:0,
+				defaultIndex:0,//默认选中的户型大类
+				carefulList:[],
+				lastSpace:null,	//上一个语音操作的空间对象
+				bigWord:"变大,放大,大一点,变宽",
+				bigWordPY:"bianda,fangda,dayidian,biankuan",
+				smaillWord:"变小,缩放,小一点,变窄",
+				smaillWordPY:"bianxiao,suofang,xiaoyidian,bianzhai",
+				changeRate:0.05,	//每次变化的比例
+				spaceList:[],
+				showX:false,
 			}
 		},
 		props: {
@@ -47,17 +52,17 @@
 			// 		return []
 			// 	}
 			// },
-			// curHouseObj: {//当前展示的户型
-			// 	type: Object,
-			// 	default: () => {
-			// 		return null
-			// 	}
-			// },
-			overChange: { //当前选中的户型类型
+			curHouseObj: {//当前展示的户型
+				type: Object,
+				default: () => {
+					return null
+				}
+			},
+			overChange: {//当前选中的户型类型
 				type: Boolean,
 				default: false,
 			},
-			styleType: {
+			styleType:{
 				type: [String, Number],
 				default: '',
 			}
@@ -71,16 +76,36 @@
 			// 		}
 			// 	},
 			// },
-			// curHouseObj: {
-			// 	handler(newVal,oldVal) {
-			// 		if (newVal) {
-			// 			console.warn("***curHouseObj-CHANGE-layout***", newVal)
-			// 			if((oldVal && oldVal.id != newVal.id) || !oldVal){
-			// 				this.initSpanceData();
-			// 			}
-			// 		}
-			// 	},
-			// },
+			curHouseObj: {
+				handler(newVal,oldVal) {
+					if (newVal) {
+						console.warn("***curHouseObj-CHANGE-layout***", newVal)
+						// if((oldVal && oldVal.id != newVal.id) || !oldVal){
+						// 	this.initSpanceData();
+						// }
+						const spaceDetail = newVal;
+						this.spaceList = JSON.parse(spaceDetail.houseJson);
+					}
+				},
+			},
+			curSpaceId: {
+				handler(newVal,oldVal) {
+					if (newVal) {
+						console.warn("***curSpaceId-CHANGE-layout***", newVal)
+						let space = this.spaceList.find(it=>it.spaceId==this.curSpaceId);
+						if(space && space.spaceType==15){//X空间
+							this.showX = true;
+						}else{
+							this.showX = false;
+						}
+					}
+				},
+			},
+		},
+		computed: {
+			curSpaceId() {
+				return this.$store.state.curSpaceId;
+			},
 		},
 		async mounted() {
 			// this.getRecordAuth();//获取录音权限
@@ -90,343 +115,114 @@
 		},
 		// 页面被展示时执行
 		onPageShow: function() {
-
+			
 		},
 		//页面被隐藏时执行
 		onPageHide: function() {
 			console.warn("***detached-hide***")
 		},
 		methods: {
-			//返回上一页
-			goback(){
-				this.$router.go(-1);
-			},
-			//上划触发
-			upCom() {
-				console.warn("***upCom***")
-				this.$emit("upCom");
-				let param = {
-					type: 'CLK', //埋点类型
-					clkId: 'clk_2cmina_23080403', //点击ID
-					clkName: 'adjust_clk', //点击前往的页面名称
-					clkParams: {
-						locusName: "精细调整",
+			initSpanceData(){
+				this.carefulList = [];
+				// var currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length - 1].$vm : null;
+				const spaceDetail = this.curHouseObj;
+				const spaceList = JSON.parse(spaceDetail.houseJson);
+				spaceList && spaceList.forEach(async (item,index)=>{
+					let curSpaceArea = parseFloat(
+						(item.spaceWidth * item.spaceHeight) / 10000
+					).toFixed(1);
+					let minArea = 0;
+					let maxArea = 100;
+					if(item.hasOwnProperty('spaceWidthMin') && item.hasOwnProperty('spaceHeightMin')){
+						minArea = parseFloat((item.spaceWidthMin * item.spaceHeightMin) / 10000).toFixed(1);
 					}
-				};
-				// util.trackRequest(param);
-			},
-			goRoam() {
-				this.$parent.$refs.viewCareful.goRoam();
-			},
-			//获取录音权限
-			getRecordAuth: function() {
-				uni.getSetting({
-					success(res) {
-						console.log("succ")
-						console.log(res)
-						if (!res.authSetting['scope.record']) {
-							uni.authorize({
-								scope: 'scope.record',
-								success() {
-									// 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问
-									console.log("succ auth")
-								},
-								fail() {
-									console.log("fail auth")
-								}
-							})
-						} else {
-							console.log("record has been authed")
-						}
-					},
-					fail(res) {
-						console.log("fail")
-						console.log(res)
+					if(item.hasOwnProperty('spaceWidthMax') && item.hasOwnProperty('spaceHeightMax')){
+						maxArea = parseFloat((item.spaceWidthMax * item.spaceHeightMax) / 10000).toFixed(1);
 					}
-				})
-			},
-			//求最长公共子集
-			findSubStr(str1, str2) {
-				if (str1.length > str2.length) {
-					var temp = str1;
-					str1 = str2;
-					str2 = temp;
-				}
-				let len1 = str1.length;
-				let len2 = str2.length;
-				for (var j = len1; j > 0; j--) {
-					for (var i = 0; i < len1 - j; i++) {
-						var current = str1.substr(i, j);
-						if (str2.indexOf(current) >= 0) {
-							return current;
+					let text = item.spaceName;
+					if(text && !item.isSizeLock){
+						// let res = await requestConfig("chineseToPinyin", {chinese:text},true);
+						// let pinyin = res.single;
+						let data = {
+							spaceId:item.spaceId,
+							index:this.carefulList.length,
+							name:text,
+							namePY:'',
+							area:curSpaceArea,
+							percent:null,
+							minArea:minArea,	//最小面积
+							maxArea:maxArea,	//最大面积
 						}
+						this.carefulList.push(data)
 					}
-				}
-				return "";
-			},
-			//声音变化
-			async textChange(text) {
-				if (this.overChange) {
-					uni.showToast({
-						title: '请慢一点',
-						icon: 'none',
-						duration: 2000
-					})
-					return false;
-				}
-				let res = await requestConfig("chineseToPinyin", {
-					chinese: text
-				});
-				let pinyin = res.single;
-				console.warn("****pinyin***", pinyin)
-				text = pinyin;
-				//全匹配轮一遍
-				let curSpace = this.carefulList.find(space => {
-					return text.includes(space.namePY)
-				})
-				if (!curSpace) {
-					let list = this.carefulList.map((space, index) => {
-						let comStr = this.findSubStr(text, space.namePY + ' ');
-						return {
-							spaceId: space.spaceId,
-							namePY: space.namePY,
-							name: space.name,
-							comStr,
-							index,
-						}
-					})
-					//寻找5个字符串以上的
-					let tmpList = list.filter(it => {
-						return it.comStr.length > 5;
-					})
-					if (tmpList && tmpList.length > 0) {
-						tmpList.sort((a, b) => a.comStr.length - b.comStr.length);
-						let index = tmpList[tmpList.length - 1].index; //最大值在carefulList的序号
-						curSpace = this.carefulList[index]; //
-					} else {
-						curSpace = this.lastSpace;
-					}
-				}
-
-				//没有找到语音操作对象
-				if (!curSpace) {
-					uni.showToast({
-						title: '请再说一次',
-						icon: 'none',
-						duration: 2000
-					})
-					return false;
-				}
-				this.lastSpace = curSpace;
-
-				console.log("textChange:", curSpace, this.carefulList, text, this.bigWordPY, this.smaillWordPY);
-
-				let biglist = this.bigWordPY.split(',').map(word => {
-					return text.lastIndexOf(word)
 				})
-				let smalllist = this.smaillWordPY.split(',').map(word => {
-					return text.lastIndexOf(word)
+				console.warn("***viewlayout-init***", this.carefulList)
+			},
+			initData(houseList){
+				this.seedLayoutList = [];
+				houseList && houseList.forEach(item=>{
+					let data = {
+						spaceStructure: item.spaceStructure,
+						spaceName: item.spaceName,
+						set: false, //是否已经设置过
+					};
+					this.seedLayoutList.push(data);
 				})
-				let a = Math.max(...biglist);
-				let b = Math.max(...smalllist);
-				let big = false;
-				if (a == -1 && b == -1) { //都没命中
-					uni.showToast({
-						title: '请再说一次',
-						icon: 'none',
-						duration: 2000
-					})
-					return false;
-				} else if (a > -1 && b > -1) { //两个都命中了
-					if (a > b) { //放大靠后-命中靠后
-						big = true;
-					} else {
-						big = false;
+				// var currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length - 1].$vm : null;
+				// if(currPage.curHouseType){//获取当前页面选中的户型类型
+				// 	this.selectSeedId = currPage.curHouseType
+				// } else if(this.seedLayoutList && this.seedLayoutList[this.defaultIndex]){//默认选中第一个
+				// 	this.selectSeedId = this.seedLayoutList[this.defaultIndex].spaceStructure;
+				// }
+				this.selectSeedId = this.seedLayoutList[this.defaultIndex].spaceStructure;
+				let keyWord = this.$route.query.layer;
+				if(keyWord){//如果存在结构特征,则定位到该模型大类下
+					let item = this.seedLayoutList.find(it=>keyWord.includes(it.spaceName));
+					if(item){
+						this.selectSeedId = item.spaceStructure;
 					}
-				} else if (a > -1) {
-					big = true;
 				}
-				let _area = parseFloat(curSpace.area) * this.changeRate;
-				let data = {
-					spaceId: curSpace.spaceId,
-					area: _area,
-					isZoomIn: big, //true 放大 false 缩放
-				}
-				console.log("viewlayout-发送消息-空间变化: ", data, curSpace.area, big);
-				uni.showToast({
-					title: '正在变化,请稍后',
-					icon: 'none',
-					duration: 2000
-				})
-				// this.sendMessageAction(JSON.stringify(parmas));
-				this.$emit("curSpaceChange", data); //通知父组件-当前已经选中了户型大类
-			},
-			/**
-			 * 初始化语音识别回调
-			 * 绑定语音播放开始事件
-			 */
-			initRecord: function() {
-				// var currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length - 1].$vm : null;
-				//有新的识别内容返回,则会调用此事件
-				manager.onRecognize = (res) => {
-					let currentData = Object.assign({}, this.currentTranslate, {
-						text: res.result,
+				if(this.selectSeedId){
+					let item = this.seedLayoutList.find(it=>{
+						return it.spaceStructure == this.selectSeedId
 					})
-					this.currentTranslate = currentData;
-					console.warn("***manager-正在录音***", this.currentTranslate)
-				}
-				// 识别结束事件
-				manager.onStop = (res) => {
-					console.warn("***manager-识别结束0***", this.recording, res)
-					// this.textChange("客厅大一点");
-					if (this.recording == false) { //已经强制结束识别了
-						return false; //不识别
-					}
-					let text = res.result
-					if (text == '') { //识别内容为空时的反馈
-						this.showRecordEmptyTip()
-						return
-					}
-					console.warn("***manager-识别结束***", text);
+					this.$emit("seedChange", item);//通知父组件-当前已经选中了户型大类
 					let param = {
 						type: 'CLK', //埋点类型
-						clkId: 'clk_2cmina_23080407', //点击ID
-						clkName: 'voice_clk', //点击前往的页面名称
+						clkId: 'clk_2cmina_23080402', //点击ID
+						clkName: 'seedroom_clk', //点击前往的页面名称
 						clkParams: {
-							locusName: "语音调整",
-							text: text
+							type: item.spaceName,
+							locusValue: item.spaceStructure,
+							locusName: "切换种子户型",
 						}
 					};
 					// util.trackRequest(param);
-					text = text.replaceAll(/,|。/ig, "");
-					this.textChange(text);
-					this.stopRecordHandle();
-					//翻译
-					// this.translateText(currentData, this.dialogList.length)
-				}
-
-				// 识别错误事件
-				manager.onError = (res) => {
-					console.warn("***manager-识别错误***", this.recording, res)
-					if (this.recording == false) {
-						return false;
-					}
-					this.stopRecordHandle();
-					uni.showToast({
-						title: '请再说一次',
-						icon: 'none',
-						duration: 2000
-					})
 				}
-				// 语音播放开始事件
-				uni.onBackgroundAudioPlay(res => {
-					const backgroundAudioManager = uni.getBackgroundAudioManager()
-					let src = backgroundAudioManager.src
-
-					this.currentTranslateVoice = src;
-				})
-			},
-			//执行停止录音的方法
-			stopRecordHandle() {
-				// var currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length - 1].$vm : null;
-				this.recording = false;
-				this.$emit("streamRecordEnd"); //通知父组件
-				// currPage.voiceMaskChange(false);//关闭蒙层
-			},
-			//用户语音为空
-			showRecordEmptyTip() {
-				this.stopRecordHandle();
-				uni.showToast({
-					title: '告诉我您的想法',
-					icon: 'none',
-					duration: 2000
-				})
+				console.warn("***curHouseType-init***",this.seedLayoutList)
 			},
-			catchTapEvent: function() {
-				return false;
-			},
-			/**
-			 * 按住按钮开始语音识别
-			 */
-			streamRecord: function(e) {
-				// this.getRecordAuth();//获取录音权限
-				console.warn("streamrecord", e)
-				let currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages()
-					.length - 1].$vm : null;
-				// let buttonItem = detail.buttonItem || {}
-				manager.start({
-					lang: language[0].lang_content,
-				})
-				// this.recordStatus = 0;
-				this.clientX = 0;
-				this.clientY = 0;
-				this.startX = e.changedTouches[0].clientX;
-				this.startY = e.changedTouches[0].clientY;
-				this.recording = true; //录音中
-				currPage.voiceMaskChange(true); //显示蒙层
-				this.$emit("streamRecord");
-			},
-			mytouchmove(e) {
-				let startX = this.startX // 开始x坐标 
-				let startY = this.startY //开始y坐标
-				let touchMoveX = e.changedTouches[0].clientx //滑动变化坐标 
-				let touchMoveY = e.changedTouches[0].clientY //滑动变化坐标 
-				this.clientX = touchMoveX - startX;
-				this.clientY = touchMoveY - startY;
-			},
-			angle(start, end) {
-				let _X = end.X - start.X;
-				let _Y = end.Y - start.Y;
-				if (_X == 0) return 90;
-				return 360 * Math.atan((_Y / _X) / (2 * Math.PI))
-			},
-			/**
-			 * 松开按钮结束语音识别
-			 */
-			streamRecordEnd: function(e) {
-				console.warn("streamRecordEnd", this.recording, e)
-				// let detail = e.detail || {} // 自定义组件触发事件时提供的detail对象
-				// let buttonItem = detail.buttonItem || {}
-
-				// 防止重复触发stop函数
-				if (this.recording == false) {
-					console.warn("has finished!")
-					return
-				}
-				let startX = this.startX; // 开始x坐标
-				let startY = this.startY; //开始y坐标
-				let touchMoveX = e.changedTouches[0].clientX; //滑动变化坐标 
-				let touchMoveY = e.changedTouches[0].clientY; //滑动变化坐标 
-				let angle = this.angle({
-					X: startX,
-					Y: startY
-				}, {
-					X: touchMoveX,
-					Y: touchMoveY
-				})
-				//滑动角度超过45retrun
-				// console.log(Math.abs(angle), "Math.abs(angle)")
-				if (Math.abs(angle) > 45) { //上下滑动
-					if (startY > touchMoveY && (startY - touchMoveY) > 20) { //上滑
-						console.warn("***touchend-上滑***", startY - touchMoveY);
-						this.stopRecordHandle(); //停止录音了
-						manager.stop()
-						uni.showToast({
-							title: '识别已取消!',
-							icon: 'none',
-							duration: 2000
-						})
-					} else {
-						this.stopRecordHandle(); //停止录音了
-						manager.stop()
-						console.warn("streamRecordEnd-stop1", this.recording)
+			//打开布局
+			openLayout(style) {
+				console.warn("***openLayout***",style)
+				if(style==3){
+					let space = this.spaceList.find(it=>it.spaceId==this.curSpaceId);
+					if(this.showX){//X空间
+						this.$emit("changeStyle",style);
+					}else{
+						Toast({
+							message: '此空间无法更改功能',
+						});
+						return false
 					}
-				} else {
-					this.stopRecordHandle(); //停止录音了
-					manager.stop();
-					console.warn("streamRecordEnd-stop2", this.recording)
+				}else{
+					this.$emit("changeStyle",style);
 				}
+				// util.trackRequest(param);
+			},
+			goRoam(){
+				this.$parent.$refs.viewCareful.goRoam();
 			},
+			
 		}
 	}
 </script>

+ 1 - 1
src/pages/webgl_rxdz/webgl_rxdz.html

@@ -24,7 +24,7 @@
 	<viewShell ref="viewShell" pageType="1" :overChange="overChange" :houseList="houseList" :houseObj="curHouseObj" :curHouseType="curHouseType" @curSpaceChange="curSpaceChange" @curHouseTypeChange="curHouseTypeChange" @curHouseFloorChange="curHouseFloorChange"></viewShell>
 	
 	<div v-show="showLables && gltf.text.length>0 && gltf.transform" v-for="(gltf,index) in lableItem" :key="index" class="word-view"
-	:style="{'transform':gltf.transform}" @click="goRoam(gltf)">
+	:style="{'transform':gltf.transform}" @click="selectSpaceHandle(gltf)">
 		<div v-if="styleType==2" user-select="false" :class="['number-view ',(index+1)>9?'number-more':'',currentChangeSpaceId==gltf.spaceId?' active':'']">{{gltf.spaceIndex+1}}</div>
 		<div v-else user-select="false" class="word" :class="currentChangeSpaceId==gltf.spaceId?'active':''">{{gltf.text}}></div>
 	</div>

+ 1 - 0
src/pages/webgl_rxdz/webgl_rxdz.vue

@@ -1785,6 +1785,7 @@
 					this.changeSpaceColor(this.selectSpace.spaceId,2);//取消上一个空间的颜色
 				}
 				this.selectSpace = this.spaceList.find(it=>it.spaceId==gltf.spaceId);
+				this.$store.state.curSpaceId = this.selectSpace.spaceId;
 				this.changeSpaceColor(this.selectSpace.spaceId,1);//设置选中空间的颜色
 				console.warn("***selectSpaceHandle***",this.selectSpace)
 			},

+ 1 - 1
src/pages/webgl_rxdz_test/webgl_rxdz_test.html

@@ -29,7 +29,7 @@
 		<div @click="selectSpaceHandle(gltf)" v-if="styleType==2" user-select="false" :class="['number-view ',(index+1)>9?'number-more':'',currentChangeSpaceId==gltf.spaceId?' active':'']">{{gltf.spaceIndex+1}}</div>
 		<div @click="selectSpaceHandle(gltf)" v-else user-select="false" class="word" :class="currentChangeSpaceId==gltf.spaceId?'active':''">{{gltf.text}}></div>
 		<!-- 更改功能按钮 -->
-		<div class="change-view rows justify-center" @click="enterPlot(gltf)" v-if="selectSpace && selectSpace.spaceId==gltf.spaceId">更改功能</div>
+		<!-- <div class="change-view rows justify-center" @click="enterPlot(gltf)" v-if="selectSpace && selectSpace.spaceId==gltf.spaceId">更改功能</div> -->
 	</div>
 	<!-- <div id="labels"></div> -->
 	<!-- 左侧操作区域 -->

+ 21 - 11
src/pages/webgl_rxdz_test/webgl_rxdz_test.vue

@@ -544,15 +544,15 @@
 						camera.aspect = screenWidth / object.h1;
 						camera.updateProjectionMatrix();
 						renderer.setSize( screenWidth, object.h1 );
-						let step = 0.12;//每次缩放放大的尺度
-						let _juli = step * Math.tan(Math.PI / 8);//由于观测点和相机存在角度,所以要计算每次变化尺度产生的Z轴变化量
-						if(_height>0){
-							camera.position.y = camera.position.y + step;
-							camera.position.z = camera.position.z + _juli;
-						}else{
-							camera.position.y = camera.position.y - step;
-							camera.position.z = camera.position.z - _juli;
-						}
+						// let step = 0.12;//每次缩放放大的尺度
+						// let _juli = step * Math.tan(Math.PI / 8);//由于观测点和相机存在角度,所以要计算每次变化尺度产生的Z轴变化量
+						// if(_height>0){
+						// 	camera.position.y = camera.position.y + step;
+						// 	camera.position.z = camera.position.z + _juli;
+						// }else{
+						// 	camera.position.y = camera.position.y - step;
+						// 	camera.position.z = camera.position.z - _juli;
+						// }
 						// that.canvasHeight = object.h1;
 					}
 				}).onComplete(()=>{
@@ -802,7 +802,14 @@
 			
 			    }
 			},
-			
+			curSpaceSelect(data){
+				console.warn("***curSpaceSelect***",data);
+				let spaceId = data.spaceId;
+				let space = this.spaceList.find(it=>it.spaceId==spaceId);
+				this.currentChangeSpaceId = spaceId;
+				this.$store.state.curSpaceId = data.spaceId;
+				this.moveMeshCenter(space);
+			},
 			//具体空间面积变化-拖动产生的
 			//data = {
 			//		spaceId:245,
@@ -814,7 +821,8 @@
 				// this.changeArea = changArea;//当次变化的面积,有正负值
 				// this.sumArea = parseFloat((this.sumArea + changArea).toFixed(2));
 				this.overChange = true;//变形开始 防止在形变结束前,再次形变
-				this.currentChangeSpaceId = data.spaceId
+				this.currentChangeSpaceId = data.spaceId;
+				this.$store.state.curSpaceId = data.spaceId;
 				this.changCurSpaceArea(data);
 				let space = this.spaceList.find(it=>it.spaceId==this.currentChangeSpaceId);
 				this.moveMeshCenter(space);
@@ -1601,6 +1609,7 @@
 					this.changeSpaceColor(this.selectSpace.spaceId,2);//取消上一个空间的颜色
 				}
 				this.selectSpace = this.spaceList.find(it=>it.spaceId==gltf.spaceId);
+				this.$store.state.curSpaceId = this.selectSpace.spaceId;
 				this.changeSpaceColor(this.selectSpace.spaceId,1);//设置选中空间的颜色
 				console.warn("***selectSpaceHandle***",this.selectSpace)
 			},
@@ -1701,6 +1710,7 @@
                 console.log("该户型空间数据:", this.spaceList, this.layoutIds,type);
                 console.log("当前选中的空间:", this.curSpaceObj,this.curHouseObj);
 				this.spaceListBackup = JSON.parse(JSON.stringify(this.spaceList));
+				this.$store.state.curSpaceId = this.curSpaceObj.spaceId;
 				this.loaderSpaceArr(this.spaceList);
                 // 绘制墙体
                 this.getHouseTypeSpaceWalls();