HomeDocs
跳到主要内容

dlt.saveImageToPhotosAlbum

简介

dlt.saveImageToPhotosAlbum 存储图片到相册

参数

Object object

属性类型默认值必填描述
filePathstring图片文件路径,可以是临时文件路径或永久文件路径 (本地路径) ,支持网络路径
successfunction接口调用成功的回调函数
failfunction接口调用失败的回调函数
completefunction接口调用结束的回调函数(调用成功、失败都会执行)

object.success 回调函数

参数

Object res

属性类型说明
successstringtrue-成功

object.fail 回调函数

参数

Object res

属性类型说明
successstringfalse-失败
errMsgstring错误码:
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",
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.