zjs_project 1 rok pred
rodič
commit
c714edf24e

+ 2 - 1
src/components/newBottomCom/viewCareful/viewCareful.scss

@@ -27,7 +27,8 @@
 	font-size: 28rem;
 	color: #585858;
 	.index-view{
-		font-family: "DINCondensed-Bold";
+		// font-family: "DINCondensed-Bold";
+		font-family: "Verdana";
 		margin-right:10rem;
 	}
 	.name-view{

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

@@ -411,19 +411,16 @@
 				
 				// this.inputBase64Url = await this.shottingAction(2);//开始截图-返回的是base64的数据
 				// this.startServer();
-				this.$emit('hideOrShowActor','hide');//隐藏所有视角
 				// let base64 = await this.$parent.shottingAction(2);//开始截图-返回的是base64
 				let shottingImg = await this.$parent.shottingAction();//开始截图-返回的是图片地址
 				if(!shottingImg){
 					this.showToast("渲染失败,请重试");
-					this.$emit('hideOrShowActor','show');//显示选中的视角
 					return false;
 				}
 				// ?x-oss-process=image/auto-orient,1/quality,Q_46/format,jpg //阿里OSS
 				// "?imageMogr2/auto-orient/format/webp/blur/1x0/quality/75";//七牛云压缩图片
 				shottingImg += "?x-oss-process=image/auto-orient,1/quality,Q_46/format,jpg";//压缩图片
 				this.shottingImg = shottingImg;
-				this.$emit('hideOrShowActor','show');//显示选中的视角
 				this.changeImg2Base64(this.shottingImg, false);
 				console.warn("***shottingImg***",this.shottingImg)
 				if(type==1){

+ 2 - 2
src/pages/webgl_rxdz_roam/webgl_rxdz_roam.html

@@ -7,7 +7,7 @@
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 -->
 <div class="main-view">
-	<mynavbar :barData='navbar'/>
+	<mynavbar :barData='navbar' @navbarBackCallback="navbarBackClk" />
 	<!-- 主要操作视图 -->
 	<!-- <viewShell pageType="2" :spaceObj="curSpaceObj" @hideOrShowActor="hideOrShowActor"></viewShell> -->
 	<!-- <my-loading ref="myLoading" :myLoadingStatus="myLoadingStatus"></my-loading>
@@ -22,7 +22,7 @@
 	</canvas>
 	<!-- AI结果覆盖层 -->
 	<viewMask ref="viewMask" @switchActor="switchActor" style="z-index: 13;"
-	  :spaceObj="curSpaceObj" @hideOrShowActor="hideOrShowActor" ></viewMask>
+	  :spaceObj="curSpaceObj" ></viewMask>
 	<!-- 生成截屏的画布对象 -->
 	<canvas id="canvas" type="2d" :style="{'height':canvasHeight+'px','top':'100vh'}"></canvas>
 </div>

+ 28 - 26
src/pages/webgl_rxdz_roam/webgl_rxdz_roam.vue

@@ -46,7 +46,7 @@
 				    navPaddingBg:'transparent',
 				    navBarColor: 'transparent',
 				    navBackColor: 'transparent',
-				    haveCallback: false, // 如果是 true 会接手 navbarBackClk
+				    haveCallback: true, // 如果是 true 会接手 navbarBackClk
 				    fromShare: false,
 				    fromProject: 0,
 				    shareToken: "",
@@ -71,7 +71,6 @@
 				controlLastPosition: null,		//观察点上一次移动到的位置
 				canvasHeight:408,	//canvas视图的高度-计算得出
 				chooseMesh:null,//标记鼠标拾取到的mesh
-				isManyou: false,	//当前是否处在漫游状态
 				shottingImg: [],
 				progress:1,	//进度条
 				myLoadingStatus:false,
@@ -83,8 +82,9 @@
 				actors:[],
 				showDownView:true,//默认显示下载按钮
 				currentActor:null,
-				circleGroup:null,
+				circleGroup:null,//圆形地标
 				isIOS:false,
+				defaulIndex:null,	//默认视角的序号
 				// aiImagesList:[
 				// 	// "https://dm.static.elab-plus.com/miniProgram/plus_IM01.png",
 				// 	// "https://dm.static.elab-plus.com/miniProgram/plus_IM02.png",
@@ -146,7 +146,6 @@
 			// this.meshRoam = meshRoam;
 			this.tweenCameraAnmaChange = tweenCameraAnmaChange;
 			this.switchActor = switchActor;
-			this.hideOrShowActor = hideOrShowActor;
 			this.starRender = starRender;//对外暴露启动渲染的方法
 			this.positionCamer = positionCamer;
 			if(this.curHouseObj && this.curHouseObj.id){
@@ -345,16 +344,8 @@
 					}
 			    }
 			}
-			//显示当前选中的视角或者隐藏所有视角-因为截图时不能保留视角
-			function hideOrShowActor (type) {
-				console.warn("***hideOrShowActor***",type)
-				if(!that.currentActor){
-					this.$message.warning("没有视角!");
-					return false;
-				}
-			}
 			//自动切换视角
-			function switchActor () {
+			function switchActor (toIndex=null) {
 				if(!that.currentActor){
 					this.$message.warning("没有当前视角!");
 					return false;
@@ -363,10 +354,14 @@
 					this.$message.warning("没有视角!");
 					return false;
 				}
-				let index = that.currentActor.userIndex;//当前视角的序号
-				let nextIndex = (index + 1) % that.actors.length;
-				//移动到对应的视角去
-				moveActor(that.actors[nextIndex]);
+				if(toIndex!=null){//存在要去往的视角
+					moveActor(that.actors[toIndex]);
+				}else{
+					let index = that.currentActor.userIndex;//当前视角的序号
+					let nextIndex = (index + 1) % that.actors.length;
+					//移动到对应的视角去
+					moveActor(that.actors[nextIndex]);
+				}
 			}
 			//移动到选中的位置-地板
 			function moveCarmer (point) {
@@ -455,6 +450,7 @@
 				if(defaulIndex == -1){
 					defaulIndex = 0;
 				}
+				that.defaulIndex = defaulIndex;//记录下默认视角
 				that.actors = [];
 				spaceObj.actors.forEach((actor,index)=>{
 					// let model = gltf.scene; // 获取模型
@@ -500,7 +496,7 @@
 					cube.actorEum = index;
 					cube.targetNewPosition = targetNewPosition;
 					// cube.visible = false;
-					console.warn("*actors*",cube)
+					console.warn("*actors*",cube,defaulIndex)
 					that.actors.push(cube);//添加视角
 					if(index == defaulIndex){//隐藏当前视角
 						// cube.visible = false;
@@ -751,19 +747,25 @@
 			}
 		},
 		methods: {
-			hideOrShowActor(){
-				
-			},
-			switchActor(){
-				
+			navbarBackClk() {
+				if(!this.$refs.viewMask){
+					this.$router.go(-1);
+					return false
+				}
+				if (this.$refs.viewMask.showAIImage) {
+					this.$refs.viewMask.showOrHideWebGl();//隐藏显示的AI生图
+					if(this.currentActor.userIndex!=this.defaulIndex){//当前不是默认视角了
+						this.switchActor(this.defaulIndex);//切换到默认视角
+					}
+				} else {
+					this.$router.go(-1);
+				}
 			},
+			switchActor(){},
 			positionCamer(){},
 			clearHandle(){
 				this.clearEvent();
 			},
-			showOrHideWebGl(){
-				this.$refs.viewMask.showOrHideWebGl();//显示或者隐藏AI
-			},
 			save(){
 				this.$refs.viewMask.save();//下载
 			},