dlt.saveImageToPhotosAlbum
简介
dlt.saveImageToPhotosAlbum 存储图片到相册
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 描述 |
|---|---|---|---|---|
| filePath | string | 是 | 图片文件路径,可以是临时文件路径或永久文件路径 (本地路径) ,支持网络路径 | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
object.success 回调函数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| success | string | true-成功 |
object.fail 回调函数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| success | string | false-失败 |
| errMsg | string | 错误码: 1. Failed saved image to album, unknown Error: SA001 2. Failed saved image to album, save failed: SA002 3.Failed saved image to album, download failed: SA003 4. Failed saved image to album, error path: SA004 5.Failed saved image to album, download result is empty: SA005 |
示例代码
// pages/index/index.js
Page({
saveImageToPhotosAlbum() {
dlt.saveImageToPhotosAlbum({
filePath: "xxx",
});
},
});