Commit 6cde5207 authored by Damon's avatar Damon

离线图片使用临时文件

parent f2474220
...@@ -261,17 +261,17 @@ ...@@ -261,17 +261,17 @@
const self = this const self = this
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
const data = cache.getCache(self.systemId) const data = cache.getCache(self.systemId)
let path = [] // let path = []
data.result.forEach(v => { // data.result.forEach(v => {
v.list.forEach(item => { // v.list.forEach(item => {
if (item.imageList.length > 0) path = path.concat(item.imageList) // if (item.imageList.length > 0) path = path.concat(item.imageList)
}) // })
}) // })
for (let i of path) { // for (let i of path) {
uni.removeSavedFile({ // uni.removeSavedFile({
filePath: i // filePath: i
}) // })
} // }
cache.removeCache(self.systemId) cache.removeCache(self.systemId)
self.isPopShow = false self.isPopShow = false
self.getListData() self.getListData()
......
...@@ -109,11 +109,7 @@ ...@@ -109,11 +109,7 @@
saveToStroage(path) { saveToStroage(path) {
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
const currentItem = photo.currentItem const currentItem = photo.currentItem
uni.saveFile({ currentItem.imageList.unshift(path)
tempFilePath: path,
success(e) {
const { savedFilePath } = e
currentItem.imageList.unshift(savedFilePath)
// 从缓存数据中找到修改对象并替换 // 从缓存数据中找到修改对象并替换
const data = cache.getCache(currentItem.system_id) const data = cache.getCache(currentItem.system_id)
data.result.forEach(v => { data.result.forEach(v => {
...@@ -123,8 +119,6 @@ ...@@ -123,8 +119,6 @@
} }
}) })
cache.setCache(currentItem.system_id, data) cache.setCache(currentItem.system_id, data)
}
})
}, },
saveLocal(path){ saveLocal(path){
return new Promise((resolve,reject)=>{ return new Promise((resolve,reject)=>{
......
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