wx.getSavedFileList(OBJECT)
获取本地已保存的文件列表
OBJECT参数说明:
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
success | Function | 否 | 接口调用成功的回调函数,返回结果见success返回参数说明 |
fail | Function | 否 | 接口调用失败的回调函数 |
complete | Function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
success返回参数说明:
参数 | 类型 | 说明 |
---|---|---|
errMsg | String | 接口调用结果 |
fileList | Object Array | 文件列表 |
fileList中的项目说明:
键 | 类型 | 说明 |
---|---|---|
filePath | String | 文件的本地路径 |
createTime | Number | 文件的保存时的时间戳,从1970/01/01 08:00:00 到当前时间的秒数 |
size | Number | 文件大小,单位B |
示例代码:
onShow: function () { wx.getSavedFileList({ success: function (res) { console.log(res.fileList) } }) console.log("onShow"); }