收藏
回答

为何在7.018下scope.writePhotosAlbum不存在?

小程序在7.0.18下,无法获取"writePhotosAlbum"的授权,降级至7.0.17后正常。

Appid:wx1b712a36c88933a4

代码片段:

wx.getSetting({
      success(res) {
        let wpa = res.authSetting["scope.writePhotosAlbum"];
        console.log(res.authSetting)//7.0.18下无该权限
        if (wpa == false || wpa == undefined) {
          wx.showModal({
            title"提示",
            content"保存照片功能,需要您的相册访问授权,请先授权再使用该功能。",
            confirmText"授权",
            cancelText"取消",
            success(res) {
              if (res.confirm) {
                wx.openSetting({})
              } else {
                return;
              }
            }
          })
        } else {
          wx.showLoading({
            title'正在保存...',
            masktrue
          })
          setTimeout(() => {
            wx.saveImageToPhotosAlbum({
              filePath: that.data.shareImagePath,
              success(res) {
                wx.showToast({
                  title'保存成功',
                  icon'none'
                })
                setTimeout(() => {
                  wx.hideLoading()
                  that.setData({
                    isPhotoModelfalse,
                    isCanvasfalse
                  })
                }, 1000)
              },
              fail() {
                wx.showToast({
                  title'保存失败,请刷新页面重试',
                  icon'none'
                })
                setTimeout(() => {
                  wx.hideLoading()
                  that.setData({
                    isPhotoModelfalse,
                    isCanvasfalse
                  })
                }, 1000)
              }
            })
          }, 2500)
        }
      }
    })
回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签