zjs_project 1 year ago
parent
commit
f3a3faf33f

+ 26 - 15
src/components/krpanoVideo/index.vue

@@ -331,19 +331,23 @@
 					this.videoBefore = false;
 					this.sceneLoaded = true;
 					// this.playVideo();//播放绿幕视频
-					if(this.peopleData && this.peopleData.ath){
-						this.initPeople(this.peopleData)
-						this.updataVideoSize(this.peopleData);
-					}
-					if(this.petData && this.petData.ath){
-						this.initPet(this.petData)
-					}
-					if(this.redBoxData && this.redBoxData.ath){
-						this.initRedBox(this.redBoxData)
-					}
-					if(this.bgMusicData && this.bgMusicData.url){
-						this.initbgMusic(this.bgMusicData)
-					}
+					setTimeout(()=>{
+						if(this.peopleData && this.peopleData.ath){
+							this.initPeople(this.peopleData)
+							this.updataVideoSize(this.peopleData);
+						}
+						if(this.petData && this.petData.ath){
+							this.initPet(this.petData)
+						}
+						if(this.redBoxData && this.redBoxData.ath){
+							this.initRedBox(this.redBoxData)
+						}
+						if(this.bgMusicData && this.bgMusicData.url){
+							this.initbgMusic(this.bgMusicData)
+						}
+						console.warn("***sceneLoad1***",this.peopleData,this.petData,this.redBoxData,this.bgMusicData)
+					},200)
+					
 				}
                 // 视频加载完
                 window.videoready = () => {
@@ -418,12 +422,14 @@
 				let y = parseInt(this.$parent.top*pix);
 				let width = parseInt(this.$parent.width*pix);
 				let height = parseInt(this.$parent.height*pix);
-				console.warn("***screenshotcanvas***",x,y,width,height)
+				let hasRedBox = this.redBoxData && this.redBoxData.ath?true:false;
+				console.warn("***screenshotcanvas***",x,y,width,height,hasRedBox)
 				this.panoramicKrpano.call("makescreenshot("
 				+ x+','
 				+ y+','
 				+ width+','
-				+ height+")");
+				+ height+','
+				+ hasRedBox+")");
 			},
 			// getScale(){
 			// 	let video = this.panoramicKrpano.get("hotspot[video]");
@@ -497,6 +503,11 @@
                 onready: this.panoramic,
             });
 			this.scale = this.$parent.peopleScale;
+			// console.warn("***mounted***",this.$route.query.AIPeople,this.$route.query.bgMusic);
+			// this.peopleData = this.$route.query.AIPeople ? JSON.parse(this.$route.query.AIPeople) : {};
+			// this.petData = this.$route.query.AIPet ? JSON.parse(this.$route.query.AIPet) : {};
+			// this.redBoxData = this.$route.query.bgMusic ? JSON.parse(this.$route.query.bgMusic) : {};
+			// this.bgMusicData = this.$route.query.redBox ? JSON.parse(this.$route.query.redBox) : {};
         },
         created() {
 			console.warn("***this.type***")

+ 24 - 17
src/components/krpanoVideo/panoramic_no_drag.xml

@@ -225,7 +225,7 @@
 			// create an empty Object as makeScreenshot cache
 			var makeScreenshotCache = {};
 			// add a 'makescreenshot' action to krpano
-			krpano.makescreenshot = function(leftX,leftY,screenshotwidth,screenshotheight)
+			krpano.makescreenshot = function(leftX,leftY,screenshotwidth,screenshotheight,hasRedBox=false)
 			{
 				// if there is already a screenshot layer, remove it now
 				console.warn("***makescreenshot***",krpano.webGL,leftX,leftY,screenshotwidth,screenshotheight)
@@ -262,23 +262,26 @@
 					//var imgBase64 = screenshotcanvas.toDataURL();
 					// var shotImgBase64 = screenshotcanvas;
 					var imgBase64 = screenshotcanvas;
-					console.warn("***makescreenshot1***",vfw,vfh,scaledCanvas.width,scaledCanvas.height)
-					var image = new Image();;
-					image.src = imgBase64;
-					image.onload = function() {
-						scaledContext.save();
-						scaledContext.drawImage(image,0,0,vfw,vfh,0,0,scaledCanvas.width,scaledCanvas.height);
-						scaledContext.restore();
-						var imageObj = new Image();;
-						imageObj.src = 'https://dm.static.elab-plus.com/miniProgram/shareBg.png';
-						imageObj.setAttribute("crossOrigin", "anonymous");
-						imageObj.onload = function() {
-							scaledContext.drawImage(imageObj,0,0,scaledCanvas.width,scaledCanvas.height,0,0,scaledCanvas.width,scaledCanvas.height);
-							var img_src = scaledCanvas.toDataURL();
-							screenshot(img_src,2);//生成分享的图
+					console.warn("***makescreenshot1***",vfw,vfh,scaledCanvas.width,scaledCanvas.height,hasRedBox)
+					if(hasRedBox==true){//有前置背景
+						var image = new Image();;
+						image.src = imgBase64;
+						image.onload = function() {
+							scaledContext.save();
+							scaledContext.drawImage(image,0,0,vfw,vfh,0,0,scaledCanvas.width,scaledCanvas.height);
+							scaledContext.restore();
+							var imageObj = new Image();;
+							imageObj.src = 'https://dm.static.elab-plus.com/miniProgram/shareBg.png';
+							imageObj.setAttribute("crossOrigin", "anonymous");
+							imageObj.onload = function() {
+								scaledContext.drawImage(imageObj,0,0,scaledCanvas.width,scaledCanvas.height,0,0,scaledCanvas.width,scaledCanvas.height);
+								var img_src = scaledCanvas.toDataURL();
+								screenshot(img_src,2);//生成分享的图
+							}
 						}
 					}
 					
+					
 					screenshot(imgBase64,1);
 					function screenshot(imgBase64,type){
 						var reqUrl = window.$config.api_url + 'elab-marketing-file/upload/uploadBase64';
@@ -292,7 +295,7 @@
 							data: data
 						});
 						request.done(function(result) {
-							console.warn("***krpano-request-result****",result)
+							console.warn("***krpano-request-result****",hasRedBox,result)
 							if (result && result.success) {
 								let shottingImg = result.single.filePath;
 								if(type==1){
@@ -300,7 +303,11 @@
 								}else if(type==2){
 									shareImg = shottingImg;
 								}
-								if(shotImg && shareImg){
+								if(hasRedBox=='true'){
+									if(shotImg && shareImg){
+										window.show_img(shotImg,shareImg);
+									}
+								}else{
 									window.show_img(shotImg,shareImg);
 								}
 							}

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

@@ -2,7 +2,7 @@
 	<div class="ai-title rows">
 		<!-- v-if="relationId" -->
 		<div v-if="relationId" class="title-btn rows justify-center" :class="{active:tabIndex==2}" @click.stop="tabChange(2)">
-			<img class="redbox_icon" src="https://dm.static.elab-plus.com/miniProgram/redbox_icon.png" alt=""></img>
+			<img class="redbox_icon" src="https://dm.static.elab-plus.com/miniProgram/redbox.gif" alt=""></img>
 			活动
 		</div>
 		<div class="title-btn rows justify-center" :class="{active:tabIndex==0}" @click.stop="tabChange(0)">数字人</div>

+ 18 - 12
src/components/newBottomCom/viewAI/viewAI.scss

@@ -3,7 +3,7 @@
 	width: 100%;
 	height: calc(100% - 750px);
 	background: #fff;
-	padding-top: 36px;
+	padding-top: 20px;
 	.ai-title{
 		position: relative;
 		width: 100%;
@@ -18,12 +18,12 @@
 			font-size: 30px;
 			background: #fff;
 			color: #4e4e4e;
-			padding: 7px 17px;
+			padding: 0px 17px;
 			box-sizing: border-box;
 			.redbox_icon{
-				width: 30px;
-				height: 35px;
-				margin-right: 15px;
+				width: 56px;
+				height: 56px;
+				// margin-right: 15px;
 			}
 		}
 		.title-btn.active{
@@ -36,6 +36,7 @@
 		position: absolute;
 		bottom: 160px;
 		width: 100%;
+		height: 34px;
 		// padding-left: 40px;
 		font-family: "Verdana";
 		font-weight: 400;
@@ -57,9 +58,10 @@
 		width: 100%;
 		padding-left: 40px;
 		padding-right: 40px;
-		
+		height: calc(100% - 76px - 28px - 194px);
 		.main{
-			max-height: 400px;
+			// max-height: 400px;
+			max-height: 100%;
 			overflow-y: auto;
 			.item{
 				// margin-right: 20px;
@@ -68,9 +70,9 @@
 					position:relative;
 					font-family: "Verdana";
 					font-weight: 400;
-					font-size: 28px;
+					font-size: 24px;
 					color: #4e4e4e;
-					height: 30px;
+					height: 34px;
 					.icon-ic-huanyihuan{
 						font-size: 24px;
 						color: #000;
@@ -133,7 +135,7 @@
 					border-radius: 20px;
 					border: solid 4px transparent;
 					font-size: 0px;
-					margin-bottom: 10px;
+					margin-bottom: 4px;
 					box-sizing: border-box;
 					object-fit: contain;
 				}
@@ -170,7 +172,7 @@
 .redbox{
 	position: relative;
 	box-sizing: border-box;
-	padding: 0px 30px;
+	padding: 0px 20px;
 	margin-top: 50px;
 	.main-box{
 		margin-bottom: 44px;
@@ -188,6 +190,7 @@
 				width: 217px;
 			}
 			.left-main{
+				position: relative;
 				.main-red{
 					.red-img{
 						width: 217px;
@@ -221,6 +224,7 @@
 							font-size: 40px;
 							font-family: DINCondensed-Bold;
 							font-weight: 700;
+							text-align: center;
 							.tips{
 								font-size: 26px;
 							}
@@ -235,8 +239,10 @@
 					}
 				}
 				.plus{
+					position: absolute;
+					left: 217px;
 					font-size: 30px;
-					margin-top: -50px;
+					top: 136px;
 				}
 				.special-img{
 					width: 286px;

+ 13 - 5
src/components/newBottomCom/viewAI/viewAI.vue

@@ -63,6 +63,7 @@
 				widthHeight:'',	//用户上传视频尺寸
 				stopFlag:false,	//停止上传动作
 				cancelTokenSource:null,	//取消上传的操作对象
+				repeartFlag:false,	//防止重复点击
 			}
 		},
 		props: {
@@ -657,6 +658,10 @@
 						});
 						return false;
 					}
+					if(this.repeartFlag){
+						return false;
+					}
+					this.repeartFlag = true;
 					let param = {
 						type: 'CLK', //埋点类型
 						clkId: 'clk_2cmina_23121301', //点击ID
@@ -705,15 +710,18 @@
 								atv:_ps.redBoxAtv,
 								scale:1,
 								lottieIndex:this.specialIndex,
-								count:this.$parent.redBoxData.count,
-								money:this.$parent.redBoxData.money,
-								message:this.$parent.redBoxData.message,
+								// count:this.$parent.redBoxData.count,
+								// money:this.$parent.redBoxData.money,
+								// message:this.$parent.redBoxData.message,
 							}
 							url += '&redBox=' + encodeURIComponent(JSON.stringify(redBox))
 						}
-						console.warn("data:", _ps, url)
+						console.warn("data:", _ps, url);
 						wx.miniProgram.navigateTo({
-							url: url	
+							url: url,
+							complete:(e)=>{
+								this.repeartFlag = false;
+							}
 						})
 					} else {
 						console.warn("data:", _ps)

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

@@ -75,6 +75,11 @@
 			this.bgUrl = this.$route.query.bgUrl || 'https://elab-marketing-web.oss-accelerate.aliyuncs.com/replicate_images/1702457671501.png';
 			this.relationId = this.$route.query.relationId || '';//场景id
 			this.amount = this.$route.query.amount || '';//场景总金额
+			if(this.relationId){
+				this.tabIndex = 2;
+			}else{
+				this.tabIndex = 0;
+			}
 			// this.AIPeople = this.$route.query.AIPeople ? JSON.parse(this.$route.query.AIPeople) : '';
 			// this.AIPet = this.$route.query.AIPet ? JSON.parse(this.$route.query.AIPet) : '';
 			// this.bgMusic = this.$route.query.bgMusic ? JSON.parse(this.$route.query.bgMusic) : '';