zjs_project 1 年之前
父节点
当前提交
8225bf6fd6

+ 2 - 0
src/components/krpanoVideo/index.scss

@@ -26,6 +26,8 @@
         pointer-events: none;
         > img {
             width: 100%;
+			height: 100%;
+			object-fit: cover;
         }
     }
     .hide {

+ 28 - 1
src/components/krpanoVideo/index.vue

@@ -62,6 +62,10 @@
 				type: [Number,String],
 				default: 1,
 			},
+			coordinate: {
+				type: String,
+				default: '',
+			},
 		},
 		watch: {
 			videoUrl: {
@@ -97,11 +101,22 @@
 				handler(newVal,oldVal) {
 					console.warn("***scale-webgl_rxdz_krpanoVideo***", newVal,'---',oldVal)
 					if(this.panoramicKrpano){
-						this.panoramicKrpano.call(`scaleChange(${newVal})`);
+						let sc = newVal;
+						if(newVal.includes('{')){
+							let scale = JSON.parse(newVal);
+							sc = scale.x;
+						}
+						this.panoramicKrpano.call(`scaleChange(${sc})`);
 					}
 				},
 				immediate: true,
 			},
+			coordinate: {
+				handler(newVal,oldVal) {
+					console.warn("***coordinate-webgl_rxdz_krpanoVideo***", newVal,oldVal)
+				},
+				immediate: true,
+			},
 		},
         methods: {
 			playVideo(){
@@ -133,6 +148,12 @@
 					this.videoBefore = false;
 					this.sceneLoaded = true;
 					this.playVideo();//播放绿幕视频
+					if(this.coordinate){
+						let position = JSON.parse(this.coordinate);
+						if(position.ath && position.atv){
+							this.setPosition(position);
+						}
+					}
 				}
                 // 视频加载完
                 window.videoready = () => {
@@ -211,6 +232,12 @@
 				console.warn("***getPosition***",posi);
 				return posi
 			},
+			setPosition(position){
+				let video = this.panoramicKrpano.get("hotspot[video]");
+				video.ath = position.ath;
+				video.atv = position.atv;
+				console.warn("***setPosition***",position);
+			},
 			//设置全景图图片地址
 			setSphereUrl(url){
 				if(!url){

+ 1 - 2
src/components/krpanoVideo/panoramic_no_drag.xml

@@ -41,6 +41,7 @@
 			width="90" height="160" chromakey="0x238E54|0.294|0.133" preload="true" pausedonstart="false" loop="true"
 			distorted="true" muted="true" zoom="true" autopause="true" autoresume="true" scale="1"
 			onvideoready="videoreadyFunc" onvideoplay="videoplayHandle" cursor="grab"
+			onclick="togglepause();" enabled="false"
 			ondown.addevent="set(cursor,grabbing);" onup.addevent="set(cursor,grab);" />
 		<action name="mobilescale" autorun="preinit" devices="mobile">
 			mul(stagescale,0.5);
@@ -349,6 +350,4 @@
 			]]>
 		</action>
 	</scene>
-
-
 </krpano>

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

@@ -117,7 +117,7 @@
 						}
 					};
 					util.trackRequest(param);
-					let _ps = this.$parent.getPosition();
+					let _ps = JSON.stringify(this.$parent.getPosition());
 					let _scale = this.$parent.scale;
 					console.warn("_ps",_ps,_scale)
 					if(window.__wxjs_environment === 'miniprogram'){

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

@@ -7,7 +7,7 @@
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 -->
 <div class="main-view">
-	<krpanoVideo ref="krpanoVideo" :videoUrl="videoUrl" :bgUrl="bgUrl" :muted="muted" :scale="scale"></krpanoVideo>
+	<krpanoVideo ref="krpanoVideo" :coordinate="coordinate" :videoUrl="videoUrl" :bgUrl="bgUrl" :muted="muted" :scale="scale"></krpanoVideo>
 	<div v-if="videoUrl" class="voice-btn rows justify-center" @click="updateMuted">
 		<span :class="[muted?'iconfont icon-jingyin':'iconfont icon-yinliang']" style="color: #ffffff;"></span>
 	</div>

+ 2 - 2
src/pages/webgl_rxdz_krpano720/webgl_rxdz_krpano720.vue

@@ -51,8 +51,8 @@
 			var that = this;
 			console.warn("***webgl_rxdz_krpano720-options***", this.$route.query)
 			this.isIOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
-			// this.videoUrl = this.$route.query.videoUrl || '';
-			this.videoUrl = this.$route.query.videoUrl || 'https://dm.static.elab-plus.com/miniProgram/002.mp4';
+			this.videoUrl = this.$route.query.videoUrl || '';
+			// this.videoUrl = this.$route.query.videoUrl || 'https://dm.static.elab-plus.com/miniProgram/002.mp4';
 			this.bgUrl = this.$route.query.bgUrl || 'https://elab-marketing-web.oss-accelerate.aliyuncs.com/replicate_images/1702457671501.png';
 			this.coordinate = this.$route.query.coordinate || '';
 			this.scale = this.$route.query.scale || '1';

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

@@ -1,6 +1,6 @@
 <div class="main-view">
 	<!-- <mynavbar :barData='navbar' @navbarBackCallback="navbarBackClk" /> -->
-	<krpanoVideo ref="krpanoVideo" :videoUrl="videoUrl" :bgUrl="bgUrl" :muted="muted" :scale="scale"></krpanoVideo>
+	<krpanoVideo ref="krpanoVideo" :coordinate="coordinate" :videoUrl="videoUrl" :bgUrl="bgUrl" :muted="muted" :scale="scale"></krpanoVideo>
 	<!-- <div class="guide-mask" id="guide-mask">
 		<img src="https://dm.static.elab-plus.com/coverTips.png">
 	</div> -->