Commit 377f1fcb by 前端

删除文件

1 parent 7cbf2a87
...@@ -225,7 +225,7 @@ export default { ...@@ -225,7 +225,7 @@ export default {
console.log(i.bussinessType,sceneType) console.log(i.bussinessType,sceneType)
return i.merchantId == shopMerchantId && i.bussinessType == (sceneType == 0 ? 1 : 2) && i.loginPhone == phone return i.merchantId == shopMerchantId && i.bussinessType == (sceneType == 0 ? 1 : 2) && i.loginPhone == phone
}) })
this.recordFailList = recordFailList this.recordFailList = recordFailList.reverse();
}, },
getRecordFail() { getRecordFail() {
this.getRecordNum() this.getRecordNum()
......
...@@ -3,13 +3,42 @@ ...@@ -3,13 +3,42 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>file upload oss</title> <title></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.
</head> </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/uni.webview.1.5.5.js"></script>
<script src="js/aliyun-oss-sdk-6.18.1.min.js"></script> <script src="js/aliyun-oss-sdk-6.18.1.min.js"></script>
<script src="js/OSSUpLoader.js"></script> <script src="js/OSSUpLoader.js"></script>
......
import { getOssToken } from "@/utils/ossUploadFile/uploadFile.js"; import { getOssToken } from "@/utils/ossUploadFile/uploadFile.js";
import Queue from "@/utils/Queue.js"; import Queue from "@/utils/Queue.js";
const interval = 6 const interval = 60;
export default { export default {
onLoad() {}, onLoad() {},
data() { data() {
...@@ -107,7 +107,7 @@ export default { ...@@ -107,7 +107,7 @@ export default {
async getRecordsSnapshotFlatten() { async getRecordsSnapshotFlatten() {
const _records = await this.getRecordsSnapshot(); const _records = await this.getRecordsSnapshot();
console.log(_records, "_records"); console.log(_records, "_records");
const _snapshot = this.flattenData(_records); const _snapshot = this.flattenData(_records || []);
return _snapshot; return _snapshot;
}, },
/** /**
...@@ -159,8 +159,13 @@ export default { ...@@ -159,8 +159,13 @@ export default {
delete fileInfo.status; delete fileInfo.status;
} }
}); });
//删除客户端的文件
console.log(recordFileList, "recordFileList"); uni.removeSavedFile({
filePath: filePathOnClient,
complete: function (res) {
console.log(res);
},
});
if (recordFileList.every((i) => i.status == undefined)) { if (recordFileList.every((i) => i.status == undefined)) {
const pathArr = recordFileList.map((i) => i.file); const pathArr = recordFileList.map((i) => i.file);
const params = { ...record, recordUrlList: pathArr }; const params = { ...record, recordUrlList: pathArr };
...@@ -220,7 +225,9 @@ export default { ...@@ -220,7 +225,9 @@ export default {
polling() { polling() {
console.log(this.snapshot.size, "this.snapshot.size"); console.log(this.snapshot.size, "this.snapshot.size");
if (this.snapshot === null) return; if (this.snapshot === null) return;
uni.$isNetWork().then(() => { uni
.$isNetWork()
.then(() => {
if (this.snapshot.size == 0) { if (this.snapshot.size == 0) {
this.enQueue(); this.enQueue();
this.pollingLater(interval); this.pollingLater(interval);
...@@ -228,7 +235,8 @@ export default { ...@@ -228,7 +235,8 @@ export default {
const record = this.snapshot.dequeue(); const record = this.snapshot.dequeue();
this.uploadRecord(record); this.uploadRecord(record);
} }
}).catch(() => { })
.catch(() => {
this.pollingLater(interval); this.pollingLater(interval);
}); });
}, },
...@@ -245,5 +253,5 @@ export default { ...@@ -245,5 +253,5 @@ export default {
beforeDestroy() { beforeDestroy() {
console.log("stopPolling"); console.log("stopPolling");
this.stopPolling(); this.stopPolling();
} },
}; };
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!