# saveImageToPhotosAlbum ^6.8

保存图片到相册

# 请求参数

Prop Type Comment
src String 图片文件路径(相对路径) 如果是http或者https开头的图片路径则为网络图片,需要下载,其他则是本地图片文件相对路径。优先级最高
base64 String 图片的base64字符串 优先级次之(v7.10加上的)

# 参数代码示例

    let params = {
        src: 'localImages/weex_1598499691_0.jpg',
        base64:'xxxx', // 只需要传实体部分
    }
1
2
3
4

# 接口调用示例

      let params = { src: this.src}  
      this.$bridge
        .saveImageToPhotosAlbum(params)
        .then(res => {    
          this.$alert(res)
        })
        .catch(err => {
          this.$toast(err)
        })

1
2
3
4
5
6
7
8
9
10

# 返回参数

  • 成功时返回
Prop Type Value
msg String -
code Number 0
  • 失败时返回
Prop Type Value Comment
code Number -7 文件不存在
msg String -

# 返回示例


{
    "msg": "success",
    "code": 0
}

1
2
3
4
5
6
更新时间: 7/27/2021, 11:23:45 AM