Browse Source

修复app 图片预览

wly 2 weeks ago
parent
commit
192dde5c85

+ 1 - 0
components/kxj-previewImage/kxj-previewImage.vue

@@ -211,6 +211,7 @@
 			},
 			//打开
 			open(e) {
+				console.log('open');
 				if (e === null || e === '') {
 					console.log('kxj-previewImage:打开参数无效');
 					return;

+ 1 - 3
pages/article/article.vue

@@ -120,9 +120,7 @@
 			//打开预览e
 			previewOpen(imgs1, index) {
 				this.imgs = imgs1.split("|");
-				this.$nextTick(()=>{
-					this.$refs.previewImage.open(index)
-				})
+				setTimeout(()=>this.$refs.previewImage.open(index),0)
 				return; //如需测试和uni原生预览差别可注释这两行
 			},
 			loadData() {

+ 3 - 5
pages/index/peopleHome.vue

@@ -157,8 +157,7 @@
 		<view class="thread2"></view>
 		<view class="thread2"></view>
 
-		<previewImage ref="previewImage" :opacity="0.8" :circular="true" :imgs="imgs" :descs="descs"
-			@longPress="longPress"></previewImage>
+		<previewImage ref="previewImage" :opacity="0.8" :circular="true" :imgs="imgs" :descs="descs"></previewImage>
 	</view>
 </template>
 
@@ -224,9 +223,8 @@
 			},
 			previewOpen(imgs1, index) {
 				this.imgs = imgs1.split("|");
-				this.$nextTick(()=>{
-					this.$refs.previewImage.open(index)
-				}) // 传入当前选中的图片地址或序号
+				setTimeout(()=>this.$refs.previewImage.open(index),0)
+				// 传入当前选中的图片地址或序号
 				return; //如需测试和uni原生预览差别可注释这两行
 			},
 			loadWishData() {

+ 1 - 3
pages/my/myArticle.vue

@@ -195,9 +195,7 @@
 				// var param = e.currentTarget.dataset.src;
 				// console.log(param);
 				// this.imgs = ['../../static/home/avator.png', '../../static/me/sex_2.png', '../../static/home/avator.png'];
-				this.$nextTick(() => {
-					this.$refs.previewImage.open(index)
-				}) // 传入当前选中的图片地址或序号
+				setTimeout(()=>this.$refs.previewImage.open(index),0)// 传入当前选中的图片地址或序号
 				return; //如需测试和uni原生预览差别可注释这两行
 			},
 			//长按事件