E企盈小程序营销工具技术服务商 热线:4006-838-530

微信小程序保存图片到本地

E企盈小程序直播系统

转载:打开链接 wx.getImageInfo({            src: ‘https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/logo_white_fe6da1ec.png’,            success: function (ret) {                var path = ret.path;                wx.saveImageToPhotosAlbum({                    filePath: path,                    success(result) {                        console.log(result)                    }                })            }        })  保存之前先download一下, 把返回的tempFilePath临时文件路径给wx.saveImageToPhotosAlbum的filePath参数wx.downloadFile({  url: ‘https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/logo_white_fe6da1ec.png’,  success: function (res) {    wx.saveImageToPhotosAlbum({      filePath: res.tempFilePath,      success(result) {        console.log(result)      }    })    wx.saveFile({      tempFilePath: res.tempFilePath,      success: function (res) {        console.log(res.savedFilePath)       }    })      }}) wx.getImageInfo({  src: ‘../images/shareimg.jpg’,  success: function (res) {    console.log(res.path)    wx.getSetting({      success(res) {        if (!res.authSetting[‘scope.writePhotosAlbum’]) {          wx.authorize({            scope: ‘scope.writePhotosAlbum’,            success() {              wx.saveImageToPhotosAlbum({                filePath: res.path,                success(result) {                  console.log(result)                }              })            }          })        }      }    })  }})

赞(0) 打赏
未经允许不得转载:E企盈小程序开发-热线:4006-838-530 » 微信小程序保存图片到本地
分享到: 更多 (0)
E企盈小程序直播营销卖货系统
E企盈直播平台营销卖货系统

评论 抢沙发

E企盈小程序开发

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏