Procházet zdrojové kódy

增加数字人旋转功能

zjs_project před 1 rokem
rodič
revize
b21ac4056b

+ 3 - 0
src/components/krpanoVideo/index.vue

@@ -205,6 +205,9 @@
 					this.playBgMusic(item.url)
 				}
 			},
+			rotateVideo(deg){
+				this.panoramicKrpano.call(`rotateVideo(${deg})`);
+			},
 			updataVideoSize(item){
 				//如果存在视频尺寸
 				if(!item.width || !item.height){

+ 3 - 0
src/components/krpanoVideo/panoramic.xml

@@ -201,6 +201,9 @@
 		<action name="mobilescale" autorun="preinit" devices="mobile">
 		    mul(stagescale,0.5);
 		</action>
+		<action name="rotateVideo">
+			set(hotspot[video].rotate, %1);
+		</action>
 		<action name="playSceneName">
 			def(scale, string, get(hotspot[video].scale));
 		    <!-- 打印日志 -->

+ 3 - 0
src/components/krpanoVideo/panoramic_no_drag.xml

@@ -144,6 +144,9 @@
 		<action name="mobilescale" autorun="preinit" devices="mobile">
 		    mul(stagescale,0.5);
 		</action>
+		<action name="rotateVideo">
+			set(hotspot[video].rotate, %1);
+		</action>
 		<action name="playSceneName">
 			def(scale, string, get(hotspot[video].scale));
 		    <!-- 打印日志 -->

+ 3 - 0
src/pages/webgl_rxdz_krpanovr/webgl_rxdz_krpanovr.html

@@ -9,6 +9,9 @@
 		<img class="icon-yinle" src="https://dm.static.elab-plus.com/miniProgram/music_icon.png" alt=""></img>
 		{{music.title}}
 	</div>
+	<div class="to rows justify-center" @click="rotateVideo" v-if="tabIndex==0">
+		<img class="convert" src="https://dm.static.elab-plus.com/miniProgram/convert1.png" alt=""></img>
+	</div>
 	<krpanoVideo ref="krpanoVideo" :bgUrl="bgUrl" :muted="muted"></krpanoVideo>
 	<div class="voice-btn rows justify-center" @click="updateMuted">
 		<span :class="[muted?'iconfont icon-jingyin':'iconfont icon-yinliang']" style="color: #ffffff;"></span>

+ 14 - 0
src/pages/webgl_rxdz_krpanovr/webgl_rxdz_krpanovr.scss

@@ -148,4 +148,18 @@ page {
 		color: #fff;
 		margin-right: 20px;
 	}
+}
+.to{
+	position: absolute;
+	width: 72px;
+	height: 72px;
+	background: rgba(0, 0, 0, 0.5);
+	left: 120px;
+	top: 650px;
+	border-radius: 50%;
+	z-index: 99;
+	.convert{
+		width: 42px;
+		height: 42px;
+	}
 }

+ 7 - 0
src/pages/webgl_rxdz_krpanovr/webgl_rxdz_krpanovr.vue

@@ -62,6 +62,7 @@
 				},
 				relationId:'',	//场景id
 				amount:'',	//场景总金额,如果有的话
+				deg:0,
 			}
 		},
 		beforeDestroy() {
@@ -107,6 +108,12 @@
 			updateMuted(){
 				this.muted = !this.muted;
 			},
+			rotateVideo(){
+				this.deg = this.deg + 45;
+				this.deg = this.deg % 360;
+				console.warn("******",this.deg)
+				this.$refs.krpanoVideo.rotateVideo(this.deg);
+			},
 			getPosition(){
 				let position = this.$refs.krpanoVideo.getPosition();
 				return position;