Commit 7c9cc916 authored by Damon's avatar Damon

图片队列使用临时路径

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