소스 검색

优化修改

zjs_project 11 달 전
부모
커밋
21b50c525d

+ 4 - 0
src/App.vue

@@ -47,11 +47,15 @@
 			let userInfo = getStorage('userInfo') ? JSON.parse(getStorage('userInfo')) : null;
 			let userId = this.$route.query.leavePhoneCustomerId ? this.$route.query.leavePhoneCustomerId : (userInfo?userInfo.userId:'');
 			let xcxHouseId = this.$route.query.xcxHouseId ? this.$route.query.xcxHouseId : (this.$route.query.houseId || '');
+			let landDataId = this.$route.query.landDataId ? this.$route.query.landDataId : '';//土地id
 			let query = this.$route.query;
 			let brandId = this.$route.query.brandId || this.$route.query.special_ID;
 			if (brandId) { //如果存在集团id
 				$config.brandId = brandId;
 			}
+            if (landDataId) { //如果存在土地id
+                this.$store.state.landDataId = landDataId;
+            }
 			if (xcxHouseId) { //如果存在houseid
 				this.$store.dispatch('setHouseId', xcxHouseId);
 			}

+ 5 - 2
src/components/newQCCom/viewMask/viewMask.html

@@ -100,9 +100,12 @@
 				<div class="btn AiBtn rows justify-center up1" @click.stop="aiSubmit(1)">
 					<div class="iconfont icon-a-lujing35039 style1"></div>{{aiImagesList && aiImagesList.length>0?'继续生成':'开始设计'}}
 				</div>
-				<div class="btn houseType rows justify-center up2" @click.stop="gonext">
+				<!-- <div class="btn houseType rows justify-center up2" @click.stop="gonext">
 					下一步
-				</div>
+				</div> -->
+                <div class="btn houseType rows justify-center up2" @click.stop="submit">
+                	提交
+                </div>
 			</div>
 		</div>
 	</div>

+ 124 - 0
src/components/newQCCom/viewMask/viewMask.vue

@@ -167,6 +167,7 @@
 				datalist:[],
 				connectUsImg:'',
 				curSpaceId:'',
+                queryObj:null,
 			}
 		},
 		props:{
@@ -253,6 +254,8 @@
 			if(firstData && firstData[0]){
 				this.connectUsImg = firstData[0].selectOptionImageUrl;
 			}
+            let queryObj = getStorage('queryObj') ? JSON.parse(getStorage('queryObj')) : null;
+            this.queryObj = queryObj;
 		},
 		beforeDestroy:function(){
 			console.warn("***beforeDestroy***");//更新到页面上的数据
@@ -262,9 +265,15 @@
 			aiData() {
 				return this.$store.state.aiData;
 			},
+            landDataId() {
+            	return this.$store.state.landDataId;
+            },
 			curHouseObj() {
 				return this.$store.state.curHouseObj;
 			},
+            userId() {
+            	return this.$store.state.userId;
+            },
 		},
 		methods:{
 			//更改空间显示名称 X空间 类型 根据布局所属类型来显示
@@ -1058,6 +1067,121 @@
 					}
 				});
 			},
+            submit() {
+                this.spaceAIHandle();
+            	//三个题都存在,则是完整的前测
+            	if(this.queryObj && this.queryObj.id2 && this.queryObj.id3){
+                    setTimeout(()=>{
+                        this.resultDataHandle();
+                    },200)
+            	}else{
+            		MessageBox.confirm('',{
+            			title: '提示',
+            			message: '感谢您的参与',
+            			showCancelButton: true,
+            			confirmButtonText:'返回首页',
+            			cancelButtonText:'确认',
+            		}).then(action => {
+            			console.warn("***MessageBox-action***",action)
+            			if(action == 'confirm'){
+            				if(window.__wxjs_environment === 'miniprogram'){
+            					this.pvCloseHandle();//小程序跳转会主动杀死关闭当前页面-不经过vue跳转关闭逻辑-所以需要主动触发关闭埋点
+            					wx.miniProgram.redirectTo({url: '/pages/index/index?houseId='+this.houseId})
+            				}else{
+            					// this.$message.warning("敬请期待");
+            					// this.showPop();
+            				}
+            			}
+            		}).catch(err=>{
+            			console.warn("***MessageBox-err***",err)
+            			if(err == 'cancel'){
+            				// self.cancelHandle();
+            			}
+            		});
+            	}
+            },
+            //提交结果数据处理
+            async resultDataHandle(){
+                
+            	// let firstData = JSON.parse(getStorage('firstData'));
+            	let secondData = JSON.parse(getStorage('secondData'));
+            	let thirdData = JSON.parse(getStorage('thirdData'));
+            	let curHouseObj = JSON.parse(getStorage('curHouseObj'));
+            	let spaceList = JSON.parse(getStorage('spaceList'));
+            	let shottingImg = getStorage('shottingImg');
+            	let expand = [];//扩展数据
+            	let checkIndexList = [];
+                let otherlist = [];
+            	let userId = this.userId ? this.userId : '';
+            	let houseData = {
+            		"layoutId": curHouseObj.id,
+            		"layoutName": curHouseObj.name,
+            		"layoutArea": curHouseObj.houseArea,
+            		"floor": 1,
+            		"layoutImgCustomized": shottingImg,
+            		"style": "",
+            		"houseJson": []
+            	}
+            	// firstData.forEach(it=>{
+            	// 	let _dt = {
+            	// 		name:it.name,
+            	// 		value:it.selectOptionImageUrl,
+            	// 	}
+            	// 	expand.push(_dt);
+            	// })
+            	secondData.forEach(it=>{
+            		let _dt = {
+            			name:it.name,
+            			value:it.selectOptionName,
+            		}
+            		expand.push(_dt);
+            	})
+                thirdData.forEach(it=>{
+                	let _dt = {
+                		name:it.spaceName,
+                		value:it.selectOptionName,
+                	}
+                	expand.push(_dt);
+                })
+            	houseData.houseJson = spaceList.concat(thirdData);
+            	// houseData.expand = expand;
+            	let param = {
+            		"brandId": $config.brandId,
+            		"houseId": this.houseId || curHouseObj.houseId,
+            		"userId": userId,
+            		"floot": 1,
+            		"spaceName": curHouseObj.name,
+            		"spaceStructure": '',
+            		"curFloor":1,
+            		layoutStruct:[houseData],
+            		type:'QIANCE',
+            		expand:JSON.stringify(expand),
+            	}
+                if(this.landDataId){
+                    param.landDataId = this.landDataId;
+                }
+            	console.warn("submitHouse-param: ", param);
+            	// setStorage('envData',checkIndexList);
+            	const loading = this.$loading({
+            		lock: true,
+            		text: '提交中...',
+            		spinner: 'el-icon-loading',
+            		background: 'rgba(0, 0, 0, 0.7)'
+            	});
+            	let res = await requestConfig("saveCustomizedRecord", param);
+            	loading.close();
+            	if(res && res.success && res.single){//提交成功
+            		let data = {
+            			houseId:this.houseId || curHouseObj.houseId,
+            			id:res.single,
+            		}
+            		router.push({
+            			name: "webgl_rxdz_text_customize",
+            			query:data
+            		});
+            	}
+            },
+            
 			showToast(title,time=3000){
 				this.myloading = false;
 				this.$store.state.loading = true;

+ 90 - 0
src/pages/webgl_rxdz_test1_env/webgl_rxdz_test1_env.html

@@ -0,0 +1,90 @@
+<div class="bookingSheet">
+    <!-- <shareOption @afterUserHandle="afterShareOptionHandle" @optionChange="optionChange" :showShareOptions="showShareOptions"></shareOption> -->
+    <mynavbar :barData='navbar'/>
+	<!-- <authview id="authView" :showPhoneModel="showPhoneModel"></authview> -->
+    <div class="contentBox">
+        <!-- 角色图片轮播区域 -->
+        <div class="master-pic" v-if="aiImagesList && aiImagesList.length>0">
+        	<el-carousel :autoplay="false" :loop="false" :indicator-dots="false"
+				:initial-index="currentIndex"
+        		@change="swiperChangeImg" class="master-pic-swiper" arrow="always"
+        		ref="carousel" indicator-position="none">
+				<!-- <el-carousel-item class="master-pic-item rows justify-center">
+				    <img @touchstart="mytouchstart" @touchmove="mytouchmove" @touchend="mytouchend" 
+					class="master-pic-img" :src="firstImg" mode="aspectFill" />
+				</el-carousel-item> -->
+                <el-carousel-item v-for="(item,s) in aiImagesList" :key="item.id" 
+        			:item-id="item.id" class="master-pic-item rows justify-center">
+                    <img @touchstart="mytouchstart" @touchmove="mytouchmove" @touchend="mytouchend" 
+        			class="master-pic-img" :src="item.imageUrl" mode="aspectFill" />
+                </el-carousel-item>
+            </el-carousel>
+			<div class="indicator-view rows" v-if="aiImagesList && aiImagesList.length>1">
+				<div class="indicator-item" :class="{'active': currentIndex == idx}" v-for="(item, idx) in aiImagesList" :key="idx"></div>
+			</div>
+			<!-- v-if="aiFlag && aiImagesList.length>0 && showAIImage" -->
+			<div class="load-mask"></div>
+			<!-- <div class="loading_more">
+				<template v-if="!startCreate">
+					<img class="leftSwiperImg"
+						src="https://dm.static2.elab-plus.com/miniProgram/leftSwiperImg.png"
+						mode="aspectFit"></image>
+				</template>
+				<template v-else>
+					<img class="loading_img"
+						src="https://dm.static2.elab-plus.com/aiBeauty/aiBeauty3/icon_loading_Img.png"
+						mode="aspectFit" />
+					<span class="loading_text" v-if="loadingMsg">{{loadingMsg}}</span>
+				</template>
+			</div> -->
+        </div>
+		
+		<!-- 底部视图 -->
+		<div class="bottom-view">
+			<!-- 左侧按钮  -->
+			<div class="btn-view columns" v-if="aiImagesList[currentIndex]">
+				<!-- 下载 -->
+				<!-- <div class="compareBtn btn1" @click.stop="save" v-if="showAIImage">
+					<img class="down" src="https://dm.static.elab-plus.com/miniProgram/iconfont/down.png" mode="widthFix"/>
+				</div> -->
+				<!-- 点赞喜欢 -->
+				<div class="likeBtn columns" @click.stop="changeAIImg" :class="{like:checked}">
+					<div class="iconfont icon-qeuren"></div>
+					喜欢
+				</div>
+			</div>
+			<!-- 大类 -->
+			<div class="tabList">
+				<div class="tab-content rows flex-start">
+					<div @click="changeTab(index)" class="tab-item columns"
+						:class="{'tabActive': tabIndex == index}" 
+						v-for="(tab,index) in tabData" :key="index" >
+						<div class="tab-text">{{tab.fatherContent}}</div>
+						<div class="tab-info rows justify-center" :class="{'select': tab.checkedIndex > -1}">
+							<i class="iconfont icon-Hook-1"></i>
+						</div>
+					</div>
+					<div class="tab-line"></div>
+				</div>
+			</div>
+			<!-- 选项 -->
+			<div class="swiper-view">
+				<div class="tab-content rows flex-start">
+					<div @click="changeOption(index)" class="tab-item columns"
+						:class="{'tabActive': optionIndex == index}" 
+						v-for="(tab,index) in options" :key="index" >
+						<img class="tab-img" :src="tab.imageUrl" mode="aspectFill" />
+						<div class="tab-text">{{tab.content}}</div>
+					</div>
+				</div>
+			</div>
+			<div class="question rows justify-center" v-if="tabData && tabData[tabIndex]">
+				{{tabData[tabIndex].subName}}
+			</div>
+			<!-- 底部按钮 -->
+			<div class="bottom-btn rows justify-center" @click="enterAction" :class="{'active': allSelect}">
+				下一步
+			</div>
+		</div>
+    </div>
+</div>

+ 344 - 0
src/pages/webgl_rxdz_test1_env/webgl_rxdz_test1_env.scss

@@ -0,0 +1,344 @@
+/**newIndex.wxss**/
+
+page {
+}
+
+.pointerEvents{
+    pointer-events: none;
+}
+/deep/.el-carousel__container{
+	height: 100%!important;
+}
+.contentBox{
+	position: relative;
+    width: 100vw;
+	height: 100vh;
+    overflow: hidden;
+    box-sizing: border-box;
+	background-color: white;
+	z-index: 2;
+	.master-pic{
+	    position: relative;
+	    width: 100%;
+	    height:880px;
+	    // padding: 10px;
+	    box-sizing: border-box;
+	    // background-color: #171717;
+		.master-pic-swiper{
+			width: 100%;
+			height: 100%;
+		}
+		.master-pic-item{
+			width: 100%;
+			height: 100%;
+			.master-pic-img{
+			    width: 100%;
+			    height: 880px;
+			    display: block;
+				object-fit: cover;
+			}
+		}
+	}
+	.bottom-view{
+		position: fixed;
+		bottom: 0px;
+		left: 0px;
+		width: 100vw;
+		height: calc(100vh - 820px);
+		border-radius: 40px 40px 0 0;
+		background: #fff;
+		padding: 30px 0px;
+		box-sizing: border-box;
+		z-index: 3;
+	}
+    .tabList{
+		position: relative;
+		width: 100%;
+		height: 90px;
+		// top:926px;
+		overflow-x: auto;
+		overflow-y: hidden;
+		margin-bottom: 40px;
+		z-index: 9;
+		.tab-content{
+			position: absolute;
+			min-width: 100vw;
+			.tab-line{
+				position: absolute;
+				left: 0px;
+				bottom: 21px;
+				width: 100%;
+				height: 1px;
+				background: rgba(112, 112, 112, 0.46);
+				opacity: 1;
+				z-index: 1;
+			}
+		}
+        .tab-item{
+			width:max-content;
+            margin-right: 20px;
+            font-family: "Verdana";
+            font-weight: 400;
+            font-size: 24px;
+            color: #1d1d1d;
+			text-align:center;
+			padding:2px;
+			box-sizing: border-box;
+			margin-right: 60px;
+			z-index: 2;
+			&:first-child{
+				margin-left: 112px;
+			}
+			&:last-child{
+				margin-right: 0px;
+			}
+            
+			.tab-text{
+				font-family: "Verdana";
+				font-weight: 400;
+				font-size: 32px;
+				color: rgba(39, 39, 39, 0.5);
+			}
+			&.tabActive .tab-text{
+				font-family: "Verdana Bold";
+				font-weight: 700;
+				color: #272727;
+			}
+			.tab-info{
+				position: relative;
+				width: 40px;
+				height: 40px;
+				font-size: 20px;
+				background: #d2c9ba;
+				border: 2px solid #fff;
+				border-radius: 50%;
+				box-sizing: border-box;
+				color: #fff;
+				&.select {
+					background: #ff870f;
+				}
+				i{
+					font-size: 14px;
+				}
+			}
+        }
+    }
+	.swiper-view{
+		position: relative;
+		width: 100%;
+		height: 190px;
+		// top:926px;
+		overflow-x: auto;
+		overflow-y: hidden;
+		margin-bottom: 40px;
+		z-index: 10;
+		background-color: #fff;
+		.tab-content{
+			position: absolute;
+		}
+		.tab-item{
+			// width:190px;
+			width:max-content;
+		    font-family: "Verdana";
+		    font-weight: 400;
+		    font-size: 0px;
+		    color: rgba(69, 69, 69, 0.6);
+			text-align:center;
+			box-sizing: border-box;
+			margin-right: 20px;
+			&:first-child{
+				margin-left: 30px;
+			}
+			&:last-child{
+				margin-right: 0px;
+			}
+		    .tab-img{
+		    	width: 140px;
+		    	height: 140px;
+		    	object-fit: cover;
+				margin-bottom: 8px;
+				border-radius: 12px;
+				border: transparent 2px solid;
+				box-sizing: border-box;
+		    }
+			.tab-text{
+				height: 40px;
+				font-family: "Verdana";
+				font-weight: 400;
+				font-size: 28px;
+				color: #4e4e4e;
+			}
+			&.tabActive .tab-text{
+				font-family: "Verdana Bold";
+				font-weight: 700;
+				color: #f9870f;
+			}
+			&.tabActive .tab-img{
+				border-color: rgba(249, 135, 15, 1);
+			}
+		}
+	}
+    .question{
+		position: fixed;
+		width: 100%;
+		bottom: 178px;
+		font-family: "Verdana";
+		font-weight: 400;
+		height: 34px;
+		font-size: 24px;
+		color: rgba(78, 78, 78, 0.47);
+		z-index: 9;
+	}
+}
+.bottom-btn{
+    position: fixed;
+    width: 652px;
+    height: 88px;
+    border-radius: 44px;
+	left: 50px;
+	bottom: 60px;
+    // background-image:linear-gradient(124deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 1) 100%);
+	background-color: #D6D6D6;
+    box-sizing: border-box;
+	z-index: 11;
+	font-family: "Verdana Bold";
+	font-weight: 700;
+	font-size: 30px;
+	color: rgba(255, 255, 255, 0.7);
+	&.active{
+		background-image:linear-gradient(124deg, rgba(245, 201, 82, 01) 0%, rgba(253, 148, 41, 1) 100%);
+		color: #fff;
+	}
+}
+.indicator-view{
+	position: absolute;
+	z-index: 12;
+	bottom: 70px;
+	left:50%;
+	transform: translateX(-50%);
+	.indicator-item{
+		width: 12px;
+		height: 12px;
+		background: #fff;
+		opacity: 0.52;
+		margin-right:6px;
+		border-radius: 50%;
+		&.active{
+			opacity:1;
+		}
+		&:last-child{
+			margin-right:0px;
+		}
+	}
+}
+.load-mask{
+	position: absolute;
+	width: 100%;
+	height: 158px;
+	z-index: 2;
+	background: linear-gradient(180.00deg, #00000000 0%, #00000066 100%);
+	bottom: 20px;
+}
+.loading_more {
+	position: absolute;
+	width: 100%;
+	z-index: 12;
+	bottom: 86px;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	z-index: 25;
+	color:#fff;
+	font-size:28px;
+	.leftSwiperImg{
+		width: 234.32px;
+		height: 40px;
+	}
+	.loading_img {
+		width: 40px;
+		height: 40px;
+		-webkit-animation: rotation 1s linear infinite;
+		animation: rotation 1s linear infinite;
+	}
+	.loading_text {
+		height: 40px;
+		margin-left: 10px;
+	}
+}
+@keyframes rotation {
+	0% {
+		transform: rotate(0deg);
+	}
+
+	100% {
+		transform: rotate(360deg);
+	}
+}
+.btn-view{
+	position: absolute;
+	top: calc(-132px - 30px);
+	left: 30px;
+	width: 72px;
+	z-index: 13;
+	pointer-events: auto;
+	.compareBtn {
+		position: relative;
+		background: rgba(0,0,0,0.2);
+		border-radius: 50%;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		pointer-events: auto;
+		z-index:11;
+		width: 72px;
+		height: 72px;
+	}
+	.likeBtn{
+		width: 72px;
+		height: 132px;
+		border-radius: 36px;
+		padding:30px 10px;
+		background: rgba(0, 0, 0, 0.5);
+		box-sizing: border-box;
+		font-family: "Verdana Bold";
+		font-weight: 700;
+		font-size: 24px;
+		color: #fff;
+		text-align: center;
+		justify-content:unset;
+		z-index: 13;
+		pointer-events: auto;
+		.icon-qeuren{
+			margin-bottom:10px;
+			font-size:30px;
+		}
+	}
+	.like{
+		background: rgba(249, 193, 102, 0.5);
+	}
+	.btn1{
+		margin-bottom:20px;
+	}
+	.compareIcon {
+		width: 42px;
+		height: 44px;
+	}
+	.down{
+		width: 40px;
+		height: 39px;
+	}
+}
+@media screen and (max-height: 750px){
+	.master-pic{
+		height:850px!important;
+	}
+	.bottom-view{
+		height: calc(100vh - 790px)!important;
+	}
+	.question{
+		bottom: 140px!important;
+	}
+	.bottom-btn{
+		bottom: 30px!important;
+	}
+}

+ 425 - 0
src/pages/webgl_rxdz_test1_env/webgl_rxdz_test1_env.vue

@@ -0,0 +1,425 @@
+<template src="./webgl_rxdz_test1_env.html">
+</template>
+
+<script>
+	const util = require('@/utils/util.js').default;
+	const config = require('@/services/urlConfig.js');
+	import router from "@/router";
+	import {
+		setStorage,
+		getStorage,
+		removeItem,
+	} from '@/utils/localStorage';
+	import {
+		Toast
+	} from 'mint-ui';
+	import { MessageBox } from 'mint-ui';
+	import touchHandle from '@/mixins/touchHandle.js';
+	// import createImgHandle from '@/mixins/createImgHandle.js';
+	import commonPageMethod from '@/mixins/commonPageMethod.js';
+	export default {
+		mixins: [touchHandle, commonPageMethod],
+		/**
+		 * 页面的初始数据
+		 */
+		data() {
+			return {
+				pvId: 'p_2cmina_21012501',
+				locusBehaviorName: "环境偏好",
+				locusValue: "",
+				locusName: "",
+				pvCurPageName: "role_set",
+				pvCurPageParams: null,
+				navbar: {
+					showCapsule: 1,
+					title: '环境偏好',
+					titleColor: '#fff',
+					navPadding: 0,
+					navPaddingBg: 'transparent',
+					navBarColor: 'transparent',
+					navBackColor: 'transparent',
+					haveCallback: false, // 如果是 true 会接手 navbarBackClk
+					fromShare: false,
+					fromProject: 0,
+					shareToken: "",
+					pageName: this.pvCurPageName,
+				},
+				houseId: $config.houseIdHs,
+
+				id: '', //题目
+				allSelect:false,//是否所有大类都选择了
+				currentIndex: 0,
+				// featureImgList: [],
+				showPhoneModel: false,
+				tabIndex: 0, //当前在第几个tab
+				optionIndex: -1, //选项选中的序号
+				options: [], //选项数据
+				aiImagesList: [], //角色数据,单独
+				AIImg:'',	//AI生成所需要的垫图
+				tabData: [],
+				checked:false,	//是否喜欢
+				subDataList:[],	//提交的数据对象
+				queryObj:null,
+			}
+		},
+		/**
+		 * 生命周期函数--监听页面加载
+		 */
+		mounted(options) {
+			console.log("***onLoad-webgl_rxdz_customize***", this.$route.query)
+			const that = this;
+			this.houseId = this.$route.query.houseId ? this.$route.query.houseId : (this.$store.state.houseId || '');
+			let queryObj = getStorage('queryObj') ? JSON.parse(getStorage('queryObj')) : null;
+			this.id = this.$route.query.id3 ? this.$route.query.id3 : (queryObj && queryObj.id3?queryObj.id3:'111');
+			this.queryObj = queryObj;
+			this.queryTestcaseSingle();
+		},
+		computed: {
+			userId() {
+				return this.$store.state.userId;
+			},
+		},
+
+		methods: {
+			swiperChangeImg(e) {
+				console.log("***swiperChangeImg***", e);
+				this.currentIndex = e.detail ? e.detail.current : e;
+				this.checked = this.aiImagesList[this.currentIndex].checked;
+				// this.optionIndex = this.currentIndex;
+				// this.tabData[0].checkedIndex = this.currentIndex;
+			},
+			rightScroll() { //右滑
+				if (this.currentIndex <= (this.aiImagesList.length - 1) && this.currentIndex > 0) {
+					this.$refs.carousel.prev();
+					this.$forceUpdate()
+				}
+			},
+			leftScroll() { //继续生成
+				console.log("***leftScroll***", this.currentIndex,this.aiImagesList.length);
+				if (this.currentIndex != this.aiImagesList.length - 1) {
+					if (this.currentIndex < this.aiImagesList.length - 1) {
+						this.$refs.carousel.next();
+					}
+					return false;
+				}
+				// console.log("***leftScroll***",this.currentIndex,this.aiImagesList.length)
+				// let obj = {
+				// 	imgUrl:this.AIImg,
+				// 	prompt:this.options[this.optionIndex].remark,
+				// 	negativePrompt:this.options[this.optionIndex].tips,
+				// 	tabIndex:this.tabIndex,
+				// 	optionIndex:this.optionIndex,
+				// }
+				// this.startServer(obj);//继续生成下一张
+			},
+			//点赞喜欢
+			changeAIImg() {
+				// let lastPage = getCurrentPages()[getCurrentPages().length - 2] ? getCurrentPages()[getCurrentPages().length - 2].$vm : null;
+				this.checked = !this.checked;//变更选项
+				this.aiImagesList[this.currentIndex].checked = this.checked;
+				console.warn("***changeAIImg***",this.checked)
+				let img = this.aiImagesList[this.currentIndex].imageUrl;
+				let obj = this.options[this.optionIndex].hardboundEffect.find(it=>it.imageUrl==img);
+				if(obj){
+					obj.checked = this.checked;
+				}
+			},
+			//查询题目数据
+			async queryTestcaseSingle() {
+				let userId = this.userId || '';
+				let params = {
+					id: this.id,
+					brandId: $config.brandId,
+					houseId: this.houseId,
+					userId,
+				};
+				// params.userId = this.userId;
+				const res = await requestConfig('queryTestcaseSingle', params);
+				if (res.success) {
+					let list = res.list;
+					list.forEach(it => {
+						it.checkedIndex = -1;////增加当前题目用户选择的需要,默认不选中
+						it.options.forEach(option=>{
+							if(option.imageUrls){
+								option.hardboundEffect = option.imageUrls.map(it=>{
+									return {
+										imageUrl: it,
+										checked: false,
+										type:'system',//表示系统生成的
+									}
+								})
+							}
+							// option.hardboundEffect = [
+							// 	{
+							// 		imageUrl :option.imageUrl,
+							// 		type:'system',//人为添加的
+							// 	}
+							// ];//AI生成图存放对象
+						})
+					});
+					let envData = getStorage('envData') ? JSON.parse(getStorage('envData')) : null;
+					this.tabData = list;
+					this.tabData[0].checkedIndex = 0;
+					this.optionIndex = 0;
+					this.options = this.tabData[0].options; //选项数据
+					this.AIImg = this.tabData[0].options[0].imageUrl;//AI生成所需的垫图
+					this.aiImagesList = this.tabData[0].options[0].hardboundEffect;
+					if(envData && envData.length>0){
+						removeItem('envData');//用完后删除
+					}else{
+						this.submitAnswer()
+					}
+					
+					//初始化待提交的数据对象
+					// list.forEach(it=>{
+					// 	let obj = {
+					// 		fatherContent:it.fatherContent,
+					// 		name:it.fatherContent,
+					// 		houseId:it.houseId,
+					// 		houseName:it.houseName,
+					// 		id:it.id,
+					// 		hardboundEffect:[]
+					// 	}
+					// 	this.subDataList.push(obj);
+					// });
+				}
+			},
+			//切换大类
+			changeTab(id) {
+				if (id == this.tabIndex) {
+					return
+				}
+				this.tabIndex = id;
+				this.options = this.tabData[this.tabIndex].options; //选项数据
+				this.optionIndex = this.tabData[this.tabIndex].checkedIndex; //获取用户已经选中的选项
+				if(this.optionIndex>-1){
+					this.aiImagesList = this.options[this.optionIndex].hardboundEffect;
+					this.checked = this.aiImagesList[this.currentIndex].checked;
+				}
+				// let param = {
+				// 	type: 'CLK', //埋点类型
+				// 	clkId: 'clk_2cmina_24012601', //点击ID
+				// 	clkName: 'tab_clk', //点击前往的页面名称
+				// 	clkParams: {
+				// 		type: this.tabData[this.tabIndex].fatherContent,
+				// 		locusName: "大类选择",
+				// 	}
+				// };
+				// util.trackRequest(param);
+			},
+			//切换选项
+			changeOption(id) {
+				if (id == this.optionIndex) {
+					return false;
+				}
+				this.optionIndex = id;
+				this.tabData[this.tabIndex].checkedIndex = this.optionIndex;
+				this.allSelect = !this.tabData.some(it=>it.checkedIndex==-1);
+				this.AIImg = this.options[this.optionIndex].imageUrl;//AI生成图的垫图
+				//替换对应的队列为选中的选项的数组对象
+				this.aiImagesList = this.options[this.optionIndex].hardboundEffect;
+				this.currentIndex = 0;
+				this.$refs.carousel.setActiveItem(0); //切换到第一张
+				this.checked = this.aiImagesList[this.currentIndex].checked;
+				console.warn("***changeOption***", this.tabData,this.AIImg,this.subDataList)
+				// let param = {
+				// 	type: 'CLK', //埋点类型
+				// 	clkId: 'clk_2cmina_24012602', //点击ID
+				// 	clkName: 'option_clk', //点击前往的页面名称
+				// 	clkParams: {
+				// 		type: this.options[this.optionIndex].content,
+				// 		locusName: "选项选择",
+				// 	}
+				// };
+				// util.trackRequest(param);
+				this.submitAnswer()
+			},
+			submitAnswer(){
+				let userId = this.userId || '';
+				let params = {
+					"answerContent": [
+						{
+							"optionTitle": this.options[this.optionIndex].content,
+							"questionTitle": this.tabData[this.tabIndex].subContent,//问题标题
+							"subOptionId": this.options[this.optionIndex].id,
+							"subQuestionId": this.tabData[this.tabIndex].id,
+						}
+					],
+					brandId: $config.brandId,
+					houseId: this.houseId,
+					channel:this.queryObj ? this.queryObj.channel : '',
+					city:this.queryObj ? this.queryObj.city : '',
+					district:this.queryObj ? this.queryObj.district : '',
+					province:this.queryObj ? this.queryObj.province : '',
+					paperTitle:'',//试卷id
+					testThemeId:'',
+					testcaseId:this.id,
+					uuid:userId,
+					xcxCustomerId:userId,
+				};
+				requestConfig('submitAnswer', params,true);
+				let param = {
+					type: 'CLK', //埋点类型
+					clkId: 'clk_2cmina_24022003', //点击ID
+					clkName: 'option_clk', //点击前往的页面名称
+					clkParams: {
+						locusValue: this.options[this.optionIndex].content,
+						locusName: "选项选择",
+					}
+				};
+				util.trackRequest(param);
+			},
+			catchTouchMove: function() {
+				return false;
+			},
+			//提交结果数据处理
+			async resultDataHandle(){
+                let otherlist = [];
+                this.tabData.forEach(tab=>{
+                	let list = tab.options[tab.checkedIndex].hardboundEffect.filter(it=>it.checked==true);//过滤选中的
+                	list = list.map(it=>{
+                		return it.imageUrl
+                	})
+                	let obj = tab.options[tab.checkedIndex];
+                	let data = {
+                		spaceName:tab.fatherName,
+                		spaceId:'',
+                		hardboundEffect:(list && list.length>0)?list:[obj.imageUrl],
+                	}
+                	otherlist.push(data);
+                })
+                setStorage('thirdData', otherlist);//把环境选择的数据存入本地缓存里面,方便后续使用
+				let firstData = JSON.parse(getStorage('firstData'));
+				let secondData = JSON.parse(getStorage('secondData'));
+				let thirdData = JSON.parse(getStorage('thirdData'));
+				let curHouseObj = JSON.parse(getStorage('curHouseObj'));
+				let spaceList = JSON.parse(getStorage('spaceList'));
+				let shottingImg = getStorage('shottingImg');
+				let expand = [];//扩展数据
+				let checkIndexList = [];
+				let userId = this.userId ? this.userId : '';
+				let houseData = {
+					"layoutId": curHouseObj.id,
+					"layoutName": curHouseObj.name,
+					"layoutArea": curHouseObj.houseArea,
+					"floor": 1,
+					"layoutImgCustomized": shottingImg,
+					"style": "",
+					"houseJson": []
+				}
+				firstData.forEach(it=>{
+					let _dt = {
+						name:it.name,
+						value:it.selectOptionImageUrl,
+					}
+					expand.push(_dt);
+				})
+				secondData.forEach(it=>{
+					let _dt = {
+						name:it.name,
+						value:it.selectOptionName,
+					}
+					expand.push(_dt);
+				})
+                thirdData.forEach(it=>{
+                	let _dt = {
+                		name:it.fatherName,
+                		value:it.options[it.checkedIndex].content,
+                	}
+                	expand.push(_dt);
+                    checkIndexList.push(it.checkedIndex);
+                })
+				// this.tabData.forEach(tab=>{
+				// 	let list = tab.options[tab.checkedIndex].hardboundEffect.filter(it=>it.checked==true);//过滤选中的
+				// 	list = list.map(it=>{
+				// 		return it.imageUrl
+				// 	})
+				// 	let obj = tab.options[tab.checkedIndex];
+				// 	let data = {
+				// 		spaceName:tab.fatherName,
+				// 		spaceId:'',
+				// 		hardboundEffect:(list && list.length>0)?list:[obj.imageUrl],
+				// 	}
+				// 	otherlist.push(data);
+				// 	expand.push({
+				// 		name:tab.fatherName,
+				// 		value:obj.content,
+				// 	});
+				// 	checkIndexList.push(tab.checkedIndex);
+				// })
+				houseData.houseJson = spaceList.concat(otherlist);
+				// houseData.expand = expand;
+				let param = {
+					"brandId": $config.brandId,
+					"houseId": this.houseId || curHouseObj.houseId,
+					"userId": userId,
+					"floot": 1,
+					"spaceName": curHouseObj.name,
+					"spaceStructure": '',
+					"curFloor":1,
+					layoutStruct:[houseData],
+					type:'QIANCE',
+					expand:JSON.stringify(expand),
+				}
+				console.warn("submitHouse-param: ", param);
+				setStorage('envData',checkIndexList);
+				const loading = this.$loading({
+					lock: true,
+					text: '提交中...',
+					spinner: 'el-icon-loading',
+					background: 'rgba(0, 0, 0, 0.7)'
+				});
+				let res = await requestConfig("saveCustomizedRecord", param);
+				loading.close();
+				if(res && res.success && res.single){//提交成功
+					let data = {
+						houseId:this.houseId || curHouseObj.houseId,
+						id:res.single,
+					}
+					router.push({
+						name: "webgl_rxdz_text_customize",
+						query:data
+					});
+				}
+			},
+			
+            //进入下一步
+            enterAction() {
+            	let index = this.tabData.findIndex(it=>it.checkedIndex==-1);
+            	if(index>-1){
+            		Toast({
+            			message: this.tabData[index].fatherContent + '选项不能为空',
+            		});
+            		return false;
+            	}
+                let otherlist = [];
+            	this.tabData.forEach(tab=>{
+            		let list = tab.options[tab.checkedIndex].hardboundEffect.filter(it=>it.checked==true);//过滤选中的
+            		list = list.map(it=>{
+            			return it.imageUrl
+            		})
+            		let obj = tab.options[tab.checkedIndex];
+            		let data = {
+            			spaceName:tab.fatherName,
+            			spaceId:'',
+            			selectOptionName:obj.content,
+            			hardboundEffect:(list && list.length>0)?list:[obj.imageUrl],
+            		}
+            		otherlist.push(data);
+            	})
+            	setStorage('thirdData', otherlist);//把环境选择的数据存入本地缓存里面,方便后续使用
+            	let data = {
+            		houseId:this.houseId || 100297,
+            	}
+            	router.push({
+            		name: "webgl_rxdz_test_houseList",
+            		query:data
+            	});
+            },
+		}
+
+	}
+</script>
+<style lang="scss" scoped>
+	@import "./webgl_rxdz_test1_env.scss";
+</style>

+ 6 - 0
src/pages/webgl_rxdz_text_customize/webgl_rxdz_text_customize.vue

@@ -103,6 +103,9 @@ export default {
 		userId() {
 			return this.$store.state.userId;
 		},
+        landDataId() {
+        	return this.$store.state.landDataId;
+        },
 	},
 
     methods: {
@@ -369,6 +372,9 @@ export default {
 			if(this.shareUserId){//分享时 不带用户id
 				delete params.userId
 			}
+            if(this.landDataId){
+                params.landDataId = this.landDataId;
+            }
 			// params.userId = this.userId;
 			const res = await requestConfig('getCustomizedRecord', params);
             if (res.success && res.list && res.list[0]) {

+ 10 - 0
src/router/index.js

@@ -25,6 +25,8 @@ import webgl_rxdz_test_roam from '@/pages/webgl_rxdz_test_roam/webgl_rxdz_test_r
 import webgl_rxdz_text_customize from '@/pages/webgl_rxdz_text_customize/webgl_rxdz_text_customize';//前测-结果查看
 import webgl_rxdz_test_look from '@/pages/webgl_rxdz_test_look/webgl_rxdz_test_look.vue';//前测查看具体户型
 
+import webgl_rxdz_test1_env from '@/pages/webgl_rxdz_test1_env/webgl_rxdz_test1_env';//前测-环境偏好
+
 Vue.use(Router)
 const router = new Router({
     mode: 'hash',
@@ -195,6 +197,14 @@ const router = new Router({
 				keepAlive:false
 			}
 		},
+        {
+        	path: '/pages/webgl_rxdz_test1_env',
+        	name: 'webgl_rxdz_test1_env',
+        	component: webgl_rxdz_test1_env,
+        	meta:{
+        		keepAlive:false
+        	}
+        },
     ],
 })
 // router.beforeRouteLeave = (to, from, next)=> {

+ 1 - 0
src/store/state.js

@@ -9,5 +9,6 @@ const state = {
 	wallList:null,	//墙体数据
 	aiData:null,	//AI生成的数据
 	curSpaceId:null,	//当前选中的空间id
+	landDataId:null,	//土地id
 }
 export default state