Bläddra i källkod

附加生成图放大功能

zjs_project 1 år sedan
förälder
incheckning
26667a8962

+ 7 - 1
src/components/newBottomCom/viewMask/viewMask.html

@@ -5,7 +5,13 @@
 	:autoplay="false" :loop="false" ref="carousel"
 	 @change="swiperChangeImg" :initial-index="currentIndex" :indicator-dots="false">
 		<el-carousel-item v-for="(item,index1) in aiImagesList" :key="index1">
-			<img @touchstart="mytouchstart" @touchmove="mytouchmove" @touchend="mytouchend" style="width:100%;height:100%;object-fit: cover;" mode="aspectFill" :src="item.image"></image>
+			<!-- <img @touchstart="mytouchstart" @touchmove="mytouchmove" @touchend="mytouchend" style="width:100%;height:100%;object-fit: cover;" mode="aspectFill" :src="item.image"></image> -->
+			<el-image 
+				@touchstart="mytouchstart" @touchmove="mytouchmove" @touchend="mytouchend"
+			    style="width:100%;height:100%;"
+			    :src="item.image"
+			    :preview-src-list="item.list">
+			  </el-image>
 		</el-carousel-item>
 	</el-carousel>
 	<div class="indicator-view rows" v-if="aiImagesList && aiImagesList.length>1 && showAIImage">

+ 6 - 1
src/components/newBottomCom/viewMask/viewMask.vue

@@ -640,6 +640,7 @@
 							let _data = {
 								image:newImage,
 								checked:false,
+								list:[newImage],
 							}
 							this.aiImagesList.push(_data);
 							this.showAIImage = true;//显示AI结果集合-因为生成了AI图片
@@ -675,7 +676,11 @@
 								this.$store.dispatch('setAiData', cpAiData)
 							}
 							this.clearInterval();
-							this.$refs.carousel.next();
+							if(this.aiImagesList.length>1){
+								setTimeout(()=>{
+									this.$refs.carousel.next();
+								}, 1000);
+							}
 						} else {
 							if (!res.success) {
 								this.showToast("渲染失败,请重试")