Commit bb5c7fc0 authored by Damon's avatar Damon

缓存图片处理调整

parent 6ebba4ea
...@@ -83,10 +83,14 @@ export default { ...@@ -83,10 +83,14 @@ export default {
// 系统自动登录 // 系统自动登录
await this.autoLogin(); await this.autoLogin();
this.deleteTempImg()
}, },
onShow: async function () { onShow: async function () {
// 应用启动,或从后台进入前台显示 // 应用启动,或从后台进入前台显示
this.handleImageTask() if (this.uploadTask.length > 0) {
upload.uploadImageTask(this)
}
}, },
onHide: function () { onHide: function () {
// 应用从前台进入后台 // 应用从前台进入后台
...@@ -97,11 +101,8 @@ export default { ...@@ -97,11 +101,8 @@ export default {
} }
}, },
methods: { methods: {
// 处理上传图片队列数据 // 处理已上传完成的图片
handleImageTask() { deleteTempImg() {
if (this.uploadTask.length > 0) {
upload.uploadImageTask(this)
} else { // 定时清理缓存在本地的文件
const result = uni.getStorageSync('delImg') const result = uni.getStorageSync('delImg')
if (result.length > 0) { if (result.length > 0) {
for (let i of result) { for (let i of result) {
...@@ -111,7 +112,6 @@ export default { ...@@ -111,7 +112,6 @@ export default {
} }
uni.setStorageSync('delImg', []) uni.setStorageSync('delImg', [])
} }
}
}, },
getSystemInfo() { getSystemInfo() {
try { try {
......
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