Commit 377f1fcb by 前端

删除文件

1 parent 7cbf2a87
......@@ -225,7 +225,7 @@ export default {
console.log(i.bussinessType,sceneType)
return i.merchantId == shopMerchantId && i.bussinessType == (sceneType == 0 ? 1 : 2) && i.loginPhone == phone
})
this.recordFailList = recordFailList
this.recordFailList = recordFailList.reverse();
},
getRecordFail() {
this.getRecordNum()
......
......@@ -3,13 +3,42 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>file upload oss</title>
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Dolorum in saepe
quia, amet quis, at id aperiam nesciunt incidunt, rerum aut modi facilis
culpa expedita repellat cupiditate vero dicta ut.
<title></title>
</head>
<style>
body,
html {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
background: rgb(0, 0, 0, 0.5);
}
<body>
.loading {
width: 50px;
height: 50px;
border: 3px solid #666;
border-radius: 50%;
border-top-color: #fff;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="loading"></div>
<script src="js/uni.webview.1.5.5.js"></script>
<script src="js/aliyun-oss-sdk-6.18.1.min.js"></script>
<script src="js/OSSUpLoader.js"></script>
......
import { getOssToken } from "@/utils/ossUploadFile/uploadFile.js";
import Queue from "@/utils/Queue.js";
const interval = 6
const interval = 60;
export default {
onLoad() {},
data() {
......@@ -107,7 +107,7 @@ export default {
async getRecordsSnapshotFlatten() {
const _records = await this.getRecordsSnapshot();
console.log(_records, "_records");
const _snapshot = this.flattenData(_records);
const _snapshot = this.flattenData(_records || []);
return _snapshot;
},
/**
......@@ -159,8 +159,13 @@ export default {
delete fileInfo.status;
}
});
console.log(recordFileList, "recordFileList");
//删除客户端的文件
uni.removeSavedFile({
filePath: filePathOnClient,
complete: function (res) {
console.log(res);
},
});
if (recordFileList.every((i) => i.status == undefined)) {
const pathArr = recordFileList.map((i) => i.file);
const params = { ...record, recordUrlList: pathArr };
......@@ -220,7 +225,9 @@ export default {
polling() {
console.log(this.snapshot.size, "this.snapshot.size");
if (this.snapshot === null) return;
uni.$isNetWork().then(() => {
uni
.$isNetWork()
.then(() => {
if (this.snapshot.size == 0) {
this.enQueue();
this.pollingLater(interval);
......@@ -228,7 +235,8 @@ export default {
const record = this.snapshot.dequeue();
this.uploadRecord(record);
}
}).catch(() => {
})
.catch(() => {
this.pollingLater(interval);
});
},
......@@ -245,5 +253,5 @@ export default {
beforeDestroy() {
console.log("stopPolling");
this.stopPolling();
}
},
};
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!