lyqu 4 年之前
父節點
當前提交
e8f2ef05f8
共有 1 個文件被更改,包括 16 次插入3 次删除
  1. 16 3
      components/works-poster/works-poster.vue

+ 16 - 3
components/works-poster/works-poster.vue

@@ -5,8 +5,8 @@
 			<!-- <view class="text-center text-white">长按保存图片</view> -->
 		</view>
 		<u-popup v-model="imgShow" mode="center" width="640" height="990" >
-			<image style="width: 640rpx;height: 940rpx;" :src="imgUrl"></image>
-			<view class="text-center text-lg text-white" style="line-height: 50upx;background-color: #666666;">长按图片保存</view>
+			<image class="calloutImg" :src="imgUrl" @click="preViewImg(imgUrl)"></image>
+			<view class="text-center text-lg text-white" style="line-height: 50upx;background-color: #666666;">点击海报,然后长按图片保存</view>
 		</u-popup>
 	</view>
 
@@ -194,9 +194,17 @@
 					canvasId: 'my-canvas',
 					quality: 1,
 					success: (res) => {
-						this.imgUrl = res.tempFilePath.replace(/[\r\n]/g, "");
+						base64ToPath(res.tempFilePath).then(res => {
+							this.imgUrl = res;
+						});
+						// this.imgUrl = res.tempFilePath.replace(/[\r\n]/g, "");
 					}
 				},this);
+			},
+			preViewImg(url) {
+				uni.previewImage({
+					urls: [url]
+				});
 			}
 		}
 	}
@@ -223,4 +231,9 @@
 		border-radius: 50rpx;
 	}
 }
+.calloutImg {
+	width: 640rpx;
+	height: 940rpx;
+	-webkit-touch-callout: default;
+}
 </style>