zjs_project 3 weeks ago
parent
commit
c33ebf76dc
2 changed files with 20 additions and 1 deletions
  1. 3 0
      src/mixins/commonPageMethod.js
  2. 17 1
      src/pages/webgl_rxdz_test/webgl_rxdz_test.vue

+ 3 - 0
src/mixins/commonPageMethod.js

@@ -72,6 +72,9 @@ export default {
 			if(this.starRender && typeof(this.starRender)==='function'){
 				this.starRender()
 			}
+            if(this.backAysncData && typeof(this.backAysncData)==='function'){
+            	this.backAysncData()
+            }
 			let param = {
 				type: 'PV',
 				pvId: this.pvId,

+ 17 - 1
src/pages/webgl_rxdz_test/webgl_rxdz_test.vue

@@ -797,6 +797,22 @@
                     console.warn("***没有数据***",res.list)
                 }
             },
+            //页面返回后同步数据
+            backAysncData(){
+                console.warn("---backAysncData---",this.pvId)
+                let curLayoutStruct = JSON.parse(getStorage('curLayoutStruct')) ;//获取楼层的数据-户型数组
+                if(curLayoutStruct && curLayoutStruct.length>0){
+                    curLayoutStruct.forEach((layoutStruct,index)=>{
+                        let spaceList =  JSON.parse(layoutStruct.houseJson);//houseJson是字符串需要序列号处理
+                        spaceList.forEach(obj => delete obj.wallList);//去除墙体数据,减少数据量
+                        if(this.curHouseObj && this.curHouseObj.id==layoutStruct.id){
+                            this.curHouseObj.houseJson = JSON.stringify(spaceList);
+                            console.warn("***backAysncData-curHouseObj***",this.curHouseObj)
+                        }
+                        this.curLayoutStruct[index].houseJson = JSON.stringify(spaceList);//数据会同步到组件中
+                    })
+                }
+            },
             //当前户型初始化
             houseInit(item){
             	this.gltfWalls = [];
@@ -1843,7 +1859,7 @@
                 this.locationHandle();
                 setTimeout( async ()=>{
                     let shottingImg = await this.shottingAction() + "?x-oss-process=image/auto-orient,1/quality,Q_46/format,jpg";//开始截图
-                    console.warn("***shottingImg***",shottingImg,this.selectSpace);
+                    console.warn("***shottingImg***",shottingImg,this.selectSpace,this.curLayoutStruct);
                     setStorage('shottingImg', shottingImg);//把空间选择的数据存入本地缓存里面,方便后续使用
                     if(!this.curLayoutStruct){
                         this.curLayoutStruct = [this.curHouseObj]