|
|
@@ -33,20 +33,42 @@ |
|
|
|
var userInfos = uni.getStorageSync('weapp_session_userInfo_data'); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
baocun(){ |
|
|
|
uni.chooseImage({ |
|
|
|
count: 1, |
|
|
|
sourceType: ['camera'], |
|
|
|
success: function (res) { |
|
|
|
uni.saveImageToPhotosAlbum({ |
|
|
|
filePath: "../../static/images/supimg.png", |
|
|
|
success: function () { |
|
|
|
console.log('save success'); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
baocun () { |
|
|
|
const _this = this; |
|
|
|
wx.getImageInfo({ |
|
|
|
src: '/static/images/supimg.png', |
|
|
|
success: function (res) { |
|
|
|
wx.saveImageToPhotosAlbum({ |
|
|
|
filePath: res.path, |
|
|
|
success (result) { |
|
|
|
_this.setData({ show: false }); |
|
|
|
wx.showToast({ |
|
|
|
title: '保存成功', |
|
|
|
icon: 'success', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
}, |
|
|
|
fail (err) { |
|
|
|
if (err.errMsg === "saveImageToPhotosAlbum:fail auth deny") { |
|
|
|
wx.openSetting({ |
|
|
|
success (settingdata) { |
|
|
|
if (settingdata.authSetting['scope.writePhotosAlbum']) { |
|
|
|
_this.savePhoto() |
|
|
|
} else { |
|
|
|
wx.showToast({ |
|
|
|
title: '获取权限失败,无法保存图片', |
|
|
|
icon: 'success', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|