wangguoyu 2 months ago
parent
commit
ae4cc949fc
1 changed files with 7 additions and 33 deletions
  1. 7 33
      pages/admin/Jiazheng/common/share.vue

+ 7 - 33
pages/admin/Jiazheng/common/share.vue

@@ -37,14 +37,6 @@
 
 			showShareMenu() {
 				this.$refs.downPopupRef.open('bottom')
-				/*  uni.showActionSheet({
-				    itemList: ['下载图片'],
-				    success: (res) => {
-				      if (res.tapIndex === 0) {
-				        this.downloadImage();
-				      }
-				    }
-				  }); */
 			},
 
 			getImage() {
@@ -52,11 +44,11 @@
 				jiazhengSharePic({
 					id: this.id
 				}).then(res => {
-					console.log('res',res);
-					if(res.code ==0 &&res.data){
-						this.imageUrl  = res.data
+					console.log('res', res);
+					if (res.code == 0 && res.data) {
+						this.imageUrl = res.data
 						this.downloadImage()
-					}else{
+					} else {
 						uni.showToast({
 							title: '获取图片失败',
 							icon: 'none'
@@ -127,27 +119,7 @@
 
 			saveImageToAlbum(tempFilePath) {
 				// #ifdef APP-PLUS
-				if (uni.getSystemInfoSync().platform === 'android') {
-					uni.authorize({
-						scope: 'scope.writePhotosAlbum',
-						success: () => {
-							this.saveImage(tempFilePath);
-						},
-						fail: () => {
-							uni.showModal({
-								title: '提示',
-								content: '需要相册权限才能保存图片,是否去设置?',
-								success: (res) => {
-									if (res.confirm) {
-										uni.openSetting(); // 打开设置页面
-									}
-								}
-							});
-						}
-					});
-				} else {
-					this.saveImage(tempFilePath);
-				}
+				this.saveImage(tempFilePath);
 				// #endif
 			},
 			saveImage(tempFilePath) {
@@ -158,6 +130,7 @@
 							title: '保存成功',
 							icon: 'success'
 						});
+							this.$refs.downPopupRef.close()
 					},
 					fail: (err) => {
 						console.error('保存失败:', err);
@@ -165,6 +138,7 @@
 							title: '保存失败',
 							icon: 'none'
 						});
+							this.$refs.downPopupRef.close()
 					}
 				});
 			}