Commit 808eb958 authored by Damon's avatar Damon

修复删除本地文件问题

parent ced880c6
...@@ -244,21 +244,22 @@ ...@@ -244,21 +244,22 @@
// } // }
// }) // })
const self = this const self = this
uni.getSavedFileList({ const photo = getApp().globalData.photo
success(e) { const data = cache.getCache(self.systemId)
const {fileList} = e let path = []
// 清除本地照片 data.result.forEach(v => {
fileList.forEach(v => { v.list.forEach(item => {
uni.removeSavedFile({ if (item.imageList.length > 0) path = path.concat(item.imageList)
filePath: v.filePath })
})
})
//清除缓存,重新获取数据
cache.removeCache(self.systemId)
self.isPopShow = false
self.getListData()
}
}) })
for (let i of path) {
uni.removeSavedFile({
filePath: i
})
}
cache.removeCache(self.systemId)
self.isPopShow = false
self.getListData()
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment