|
@@ -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()
|
|
|
}
|
|
|
});
|
|
|
}
|