zjs_project 1 éve
szülő
commit
72640d0dd5

+ 1 - 0
src/App.vue

@@ -59,6 +59,7 @@
 			let isIOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
 			this.isIOS = isIOS;
 			window.addEventListener('error', (error) => {
+				console.warn("***error***",error)
 				// 区分是否是js错误
 				if (error.message) {
 					alert("error" + error.message)

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

@@ -89,7 +89,7 @@
 			aiPeopleChange(item){
 				this.$emit("aiPeopleChange", item);//通知页面,户型大类发生了变更
 			},
-			
+			//发布全景
 			mynavigateFuc(e) {
 				if (e) {
 					let param = {
@@ -104,7 +104,7 @@
 					let _ps = this.$parent.getVideoPosition();
 					console.warn("_ps",_ps)
 					if(window.__wxjs_environment === 'miniprogram'){
-						wx.miniProgram.navigateTo({url: '/extraPackage/pages/aiPublishPage/aiPublishPage?event=openCustomerServiceChat&houseId='+this.$store.state.houseId+'&coordinate=' + encodeURIComponent(_ps) + '&bgUrl='+this.$route.query.bgUrl+'&videoUrl='+encodeURIComponent(this.dataList[this.selectIndex].url)})
+						wx.miniProgram.navigateTo({url: '/extraPackage/pages/aiPublishPage/aiPublishPage?houseId='+this.$store.state.houseId+'&coordinate=' + encodeURIComponent(_ps) + '&bgUrl='+this.$route.query.bgUrl+'&videoUrl='+encodeURIComponent(this.dataList[this.selectIndex].url)})
 					}else{
 						Toast({
 							message: '敬请期待',

+ 35 - 5
src/pages/webgl_rxdz_720/webgl_rxdz_720.vue

@@ -59,6 +59,7 @@
 				isIOS: false,
 				videoUrl:'',	//绿幕视频地址
 				bgUrl:'',
+				coordinate:'',
 			}
 		},
 		beforeDestroy() {
@@ -100,8 +101,9 @@
 			var that = this;
 			console.warn("***webgl_rxdz_roam-options***", this.$route.query)
 			this.isIOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
-			this.videoUrl = this.$route.query.videoUrl || 'https://dm.static.elab-plus.com/miniProgram/005.mp4';
+			this.videoUrl = this.$route.query.videoUrl || '';
 			this.bgUrl = this.$route.query.bgUrl || 'https://dm.static.elab-plus.com/miniProgram/tears_of_steel_bridge_2k.jpg';
+			this.coordinate = this.$route.query.coordinate || '';
 			let screenWidth = window.screen.width;
 			let screenHeight = window.screen.height;
 			if (window.innerWidth && window.screen.width) {
@@ -134,7 +136,7 @@
 
 			function init() {
 				// 创建相机位置
-				camera = new THREE.PerspectiveCamera(120, screenWidth / that.canvasHeight, 0.1, 10000);
+				camera = new THREE.PerspectiveCamera(90, screenWidth / that.canvasHeight, 0.1, 10000);
 				// camera.up.set(0, 1, 0);//俯视状态,将相机的up向量设置为z轴负方向 {x:0,y:1,z:0}
 				camera.position.set(that.cameraStarPosition.x, that.cameraStarPosition.y, that.cameraStarPosition.z);
 				scene.add(camera);
@@ -187,22 +189,44 @@
 				// 		}
 				// 	}
 				// });
-				camera.lookAt(that.controlStarPosition.x, that.controlStarPosition.y, that.controlStarPosition.z);
+				// camera.lookAt(that.controlStarPosition.x, that.controlStarPosition.y, that.controlStarPosition.z);
+				if(that.coordinate){
+					let position = JSON.parse(that.coordinate);
+					// camera.lookAt(position.x, position.y, position.z);
+				}
 				starRender(); //启动渲染
-				videoHandle();
+				if(that.isIOS){
+					document.addEventListener("WeixinJSBridgeReady", function (){
+						videoHandle();
+					}, false)
+				}
 				var guideMask = document.querySelector('#guide-mask');
 				document.addEventListener("touchstart", function () {
 					guideMask.classList.add('guide-mask-hide');
+					if(!that.isIOS){
+						setTimeout(()=>{
+							videoHandle();
+						},500)
+					}
 				}, false);
 			}
 
 			function videoHandle() {
+				if(!that.videoUrl){
+					return false;
+				}
+				if(videoMesh){
+					return false
+				}
 				// 创建视频元素
 				var video = document.createElement('video');
 				video.src = that.videoUrl; // 视频文件的路径
 				video.setAttribute("crossOrigin", "Anonymous");
 				video.loop = true;
 				video.muted = true;
+				video.controls = false;
+				video.setAttribute('webkit-playsinline', true);
+				video.setAttribute('playsinline', true);
 				video.play();
 				
 				console.warn("***video***",video,video.width);
@@ -380,7 +404,12 @@
 				let geometry = new THREE.PlaneGeometry(9, 16);
 				// 应用绿幕材质到对象上
 				let mesh = new THREE.Mesh(geometry, greenScreenMaterial);
-				mesh.position.set(0, 0, -10);//设置视频位置
+				if(that.coordinate){
+					let position = JSON.parse(that.coordinate);
+					mesh.position.set(position.x, position.y, position.z);//设置视频位置
+				}else{
+					mesh.position.set(0, 0, -10);//设置视频位置
+				}
 				// mesh.lookAt(camera.position);
 				scene.add(mesh);
 				videoMesh = mesh;
@@ -403,6 +432,7 @@
 					return false;
 				}
 				// stats.update();
+				controls.update();
 				if(videoMesh){
 					videoMesh.lookAt(camera.position);
 				}

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

@@ -26,5 +26,5 @@
 	  :spaceObj="curSpaceObj" ></viewMask> -->
 	<!-- 生成截屏的画布对象 -->
 	<canvas id="canvas" type="2d" :style="{'height':'200px','top':'200px'}"></canvas>
-	<video id="myvideo" style="display: none;" loop muted autoplay controls="false" :src="videoUrl"></video>
+	<video id="myvideo" v-if="videoUrl" style="display: none;" loop muted autoplay controls="false" :src="videoUrl"></video>
 </div>

+ 52 - 28
src/pages/webgl_rxdz_clipImg/webgl_rxdz_clipImg.vue

@@ -44,7 +44,7 @@
 				camera: null,
 				controlStarPosition: {
 					x: 0,
-					y: 0,
+					y: -5,
 					z: 0
 				}, //控制器初始位置
 				cameraStarPosition: {
@@ -74,6 +74,7 @@
 				type:1,
 				bottomLeftX:0,
 				bottomLeftY:0,
+				coordinate:'',
 			}
 		},
 		beforeDestroy() {
@@ -115,8 +116,9 @@
 			var that = this;
 			console.warn("***webgl_rxdz_roam-options***", this.$route.query)
 			this.isIOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
-			this.videoUrl = this.$route.query.videoUrl || 'https://dm.static.elab-plus.com/miniProgram/007.mp4';
+			this.videoUrl = this.$route.query.videoUrl || '';
 			this.bgUrl = this.$route.query.bgUrl || 'https://dm.static.elab-plus.com/miniProgram/tears_of_steel_bridge_2k.jpg';
+			this.coordinate = this.$route.query.coordinate || '';
 			let screenWidth = window.screen.width;
 			let screenHeight = window.screen.height;
 			if (window.innerWidth && window.screen.width) {
@@ -133,7 +135,6 @@
 			this.top = this.top * unit;
 			this.canvasHeight = screenHeight;
 			this.houseId = this.$route.query.houseId ? this.$route.query.houseId : '';
-			this.spaceId = this.$route.query.spaceId ? this.$route.query.spaceId : '';
 			let container = this.$refs.webgl;
 			let canvas3d = this.canvas = this.$refs.glcanvas;
 			//uniapp 兼容写法,因为uni的页面对象的Vue 实例是$vm
@@ -146,29 +147,24 @@
 				boundary = null;
 			let videoMesh = null;
 			init();
-			// this.clearEvent = clearEvent;
-			// this.attendEvent = attendEvent;
 			this.starRender = starRender; //对外暴露启动渲染的方法
 			this.stopRender = stopRender; //对外暴露停止渲染的方法
 
 			function init() {
 				// 创建相机位置
-				camera = new THREE.PerspectiveCamera(120, screenWidth / that.canvasHeight, 0.1, 10000);
+				camera = new THREE.PerspectiveCamera(90, screenWidth / that.canvasHeight, 0.1, 10000);
 				// camera.up.set(0, 1, 0);//俯视状态,将相机的up向量设置为z轴负方向 {x:0,y:1,z:0}
 				camera.position.set(that.cameraStarPosition.x, that.cameraStarPosition.y, that.cameraStarPosition.z);
 				scene.add(camera);
 				that.camera = camera;
-
-				// 环境光会均匀的照亮场景中的所有物体
-				// const ambientLight = new THREE.AmbientLight(0xFFEFE0, 3.5);
-				// scene.add(ambientLight);
+				
 				// 辅助方格
-				// const axesHelper = new THREE.AxesHelper( 50 );
-				// scene.add( axesHelper );
-				// const gridHelper = new THREE.GridHelper(50, 10, 0xcccccc, 0xcccccc);
-				// gridHelper.position.y = 0;
-				// gridHelper.position.x = 0;
-				// scene.add(gridHelper);
+				const axesHelper = new THREE.AxesHelper( 50 );
+				scene.add( axesHelper );
+				const gridHelper = new THREE.GridHelper(50, 10, 0xcccccc, 0xcccccc);
+				gridHelper.position.y = 0;
+				gridHelper.position.x = 0;
+				scene.add(gridHelper);
 				//加载环境720贴图
 				const loader = new THREE.TextureLoader();
 				const texture = loader.load(that.bgUrl, () => {
@@ -191,7 +187,7 @@
 				controls = new OrbitControls(camera, renderer.domElement);
 				controls.enableDamping = true; //启动缓动
 				controls.minDistance = 0.0001;
-				controls.maxDistance = 30;
+				controls.maxDistance = 300;
 				// controls.minPolarAngle = 0; // 默认0
 				// controls.maxPolarAngle = Math.PI / 2; // 默认Math.PI,即可以向下旋转到的视角。
 				controls.enableZoom = true; //启用摄像机的缩放
@@ -209,10 +205,14 @@
 				// 		}
 				// 	}
 				// });
-				camera.lookAt(that.controlStarPosition.x, that.controlStarPosition.y, that.controlStarPosition.z);
+				if(that.coordinate){
+					let position = JSON.parse(that.coordinate);
+					// mesh.position.set();//设置视频位置
+					camera.lookAt(position.x, position.y, position.z);
+				}
+				// camera.lookAt(that.controlStarPosition.x, that.controlStarPosition.y, that.controlStarPosition.z);
 				starRender(); //启动渲染
 				// var guideMask = document.querySelector('#guide-mask');
-				
 				if(that.isIOS){
 					document.addEventListener("WeixinJSBridgeReady", function (){
 					    videoHandle();
@@ -220,15 +220,16 @@
 				}else{
 					document.addEventListener("touchstart",  ()=> {
 						// guideMask.classList.add('guide-mask-hide');
-						setTimeout(()=>{
-							videoHandle();
-						},200)
+						videoHandle();
 					}, false);
 				}
 				
 			}
 
 			function videoHandle() {
+				if(!that.videoUrl){
+					return false;
+				}
 				if(videoMesh){
 					return false
 				}
@@ -426,8 +427,12 @@
 				let geometry = new THREE.PlaneGeometry(9, 16);
 				// 应用绿幕材质到对象上
 				let mesh = new THREE.Mesh(geometry, greenScreenMaterial);
-				mesh.position.set(0, 0, -10);//设置视频位置
-				// mesh.lookAt(camera.position);
+				if(that.coordinate){
+					let position = JSON.parse(that.coordinate);
+					mesh.position.set(position.x, position.y, position.z);//设置视频位置
+				}else{
+					mesh.position.set(0, 0, -10);//设置视频位置
+				}
 				scene.add(mesh);
 				videoMesh = mesh;
 			}
@@ -448,6 +453,7 @@
 				if (needRender == false) {
 					return false;
 				}
+				controls.update();
 				if(videoMesh){
 					videoMesh.lookAt(camera.position);
 				}
@@ -471,13 +477,31 @@
 				// 	showCancelButton: true
 				// });
 				// window.open(shottingImg, "_blank");
-				window.location.href = shottingImg
+				// window.location.href = shottingImg
+				let param = {
+					type: 'CLK', //埋点类型
+					clkId: 'clk_2cmina_23121401', //点击ID
+					clkName: 'webgl_cover_clk', //点击前往的页面名称
+					clkParams: {
+						locusName: "封面确认",
+						locusValue: shottingImg
+					}
+				};
+				util.trackRequest(param);
+				if(window.__wxjs_environment === 'miniprogram'){
+					wx.miniProgram.postMessage({data: {bgUrl:shottingImg}})
+					wx.miniProgram.navigateBack();
+					// wx.miniProgram.navigateTo({
+					// 	url: '/extraPackage/pages/aiPublishPage/aiPublishPage?houseId='+this.$store.state.houseId
+					// 	+ '&coordinate=' + encodeURIComponent(this.$route.query.coordinate) 
+					// 	+ '&bgUrl=' + shottingImg
+					// 	+ '&videoUrl=' + encodeURIComponent(this.$route.query.videoUrl)})
+				}else{
+					window.location.href = shottingImg
+				}
 			},
 			navbarBackClk() {
 
-			},
-			clearHandle() {
-				this.clearEvent();
 			},
 			mytouchstart(e,type) {
 				console.warn("***mytouchstart***",type)

+ 10 - 9
src/pages/webgl_rxdz_vr/webgl_rxdz_vr.vue

@@ -47,11 +47,11 @@
 				loader: null,
 				scene: null,
 				camera: null,
-				controlStarPosition: {
-					x: 0,
-					y: 0,
-					z: 0
-				}, //控制器初始位置
+				// controlStarPosition: {
+				// 	x: 0,
+				// 	y: -5,
+				// 	z: 0
+				// }, //控制器初始位置
 				cameraStarPosition: {
 					x: 0,
 					y: 0,
@@ -106,7 +106,7 @@
 			console.warn("***webgl_rxdz_roam-options***", this.$route.query)
 			this.isIOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
 			this.videoUrl = this.$route.query.videoUrl || '';
-			this.bgUrl = this.$route.query.bgUrl || 'https://dm.static.elab-plus.com/miniProgram/tears_of_steel_bridge_2k.jpg';
+			this.bgUrl = this.$route.query.bgUrl || 'https://elab-marketing-web.oss-accelerate.aliyuncs.com/replicate_images/1702457671501.png';
 			
 			// alert("***mounted-webgl_rxdz_roam***"+this.isIOS + this.curHouseObj)
 			let screenWidth = window.screen.width;
@@ -145,7 +145,7 @@
 			
 			function init() {
 				// 创建相机位置
-				camera = new THREE.PerspectiveCamera(120, screenWidth / that.canvasHeight, 0.1, 10000);
+				camera = new THREE.PerspectiveCamera(90, screenWidth / that.canvasHeight, 0.1, 10000);
 				// camera.up.set(0, 1, 0);//俯视状态,将相机的up向量设置为z轴负方向 {x:0,y:1,z:0}
 				camera.position.set(that.cameraStarPosition.x, that.cameraStarPosition.y, that.cameraStarPosition.z);
 				scene.add(camera);
@@ -199,7 +199,7 @@
 				// 		}
 				// 	}
 				// });
-				camera.lookAt(that.controlStarPosition.x, that.controlStarPosition.y, that.controlStarPosition.z);
+				// camera.lookAt(that.controlStarPosition.x, that.controlStarPosition.y, that.controlStarPosition.z);
 				starRender(); //启动渲染
 				if(that.isIOS){
 					document.addEventListener("WeixinJSBridgeReady", function (){
@@ -403,7 +403,7 @@
 				let geometry = new THREE.PlaneGeometry(9, 16);
 				// 应用绿幕材质到对象上
 				let mesh = new THREE.Mesh(geometry, greenScreenMaterial);
-				mesh.position.set(0, 0, -10);//设置视频位置
+				mesh.position.set(0, -10, -10);//设置视频位置
 				// mesh.lookAt(camera.position);
 				scene.add(mesh);
 				videoMesh = mesh;
@@ -440,6 +440,7 @@
 					return false;
 				}
 				// stats.update();
+				controls.update();
 				if(videoMesh){
 					videoMesh.lookAt(camera.position);
 				}