Commit 7c9cc916 authored by Damon's avatar Damon

图片队列使用临时路径

parent cfe977aa
......@@ -77,7 +77,7 @@ export default {
// 系统自动登录::每次运行小程序重新获取用户信息
await this.autoLogin();
this.deleteTempImg()
//this.deleteTempImg()
},
onShow: async function () {
// 应用启动,或从后台进入前台显示
......
......@@ -87,7 +87,6 @@
if(photo.tempPath.mixWater){
// 保存水印处理图片到本地
path = photo.tempPath.mixWater
console.log("path", path)
let result1 = await this.saveLocal(path)
if(result1){
uni.showToast({
......
......@@ -47,13 +47,18 @@ export default {
*/
async saveToTask(files) {
// 生成key返回,然后把key放到异步上传的任务队列
let lists = []
for (let i = 0; i < files.length; i++) {
const path = files[i]
const row = await this.saveFiles(path)
lists.push(row)
let lists = files.map(v => {
return {
key: randomChar(10),
path: v,
src: ''
}
})
// for (let i = 0; i < files.length; i++) {
// const path = files[i]
// const row = await this.saveFiles(path)
// lists.push(row)
// }
const data = this.uploadTask
const saveLists = data.concat(lists)
this.$u.vuex('uploadTask', saveLists)
......
......@@ -32,7 +32,7 @@ export default {
}
})
uni.setStorageSync('delImg', delImg) // 已上传完的图片,会在启动系统的时候做一次清理
// uni.setStorageSync('delImg', delImg) // 已上传完的图片,会在启动系统的时候做一次清理
that.$u.vuex('uploadTask', newTask)
}
......
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