Commit 7cbf2a87 by 前端

Merge branch 'v1.0.7' of http://192.168.3.233:8090/glsx/gl_tape into v1.0.7

2 parents 8f2c37ff 8bb2c25e
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
export default { export default {
onLoad() {}, onLoad() {},
data() { data() {
...@@ -219,25 +220,30 @@ export default { ...@@ -219,25 +220,30 @@ 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(() => {
if (this.snapshot.size == 0) { if (this.snapshot.size == 0) {
this.enQueue(); this.enQueue();
setTimeout(() => { this.pollingLater(interval);
this.polling();
}, 1000 * 60);
} else { } else {
console.log(this.snapshot, "this.snapshot");
const record = this.snapshot.dequeue(); const record = this.snapshot.dequeue();
console.log(record);
this.uploadRecord(record); this.uploadRecord(record);
} }
}).catch(() => {
this.pollingLater(interval);
});
}, },
stopPolling() { stopPolling() {
this.snapshot.clear(); this.snapshot.clear();
this.snapshot = null; this.snapshot = null;
}, },
pollingLater(interval = 60 * 10) {
setTimeout(() => {
this.polling();
}, interval * 1000);
},
}, },
beforeDestroy() { beforeDestroy() {
console.log("stopPolling"); console.log("stopPolling");
this.stopPolling(); this.stopPolling();
}, }
}; };
...@@ -66,7 +66,7 @@ export default { ...@@ -66,7 +66,7 @@ export default {
return { return {
historyList: [], historyList: [],
isEnd: false, isEnd: false,
currentPage: 1, pageNum: 1,
shopMerchantId: '', shopMerchantId: '',
goodsName: null goodsName: null
} }
...@@ -78,14 +78,34 @@ export default { ...@@ -78,14 +78,34 @@ export default {
watchStatus: { watchStatus: {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
this.$refs?.tabs?.tabClick(0) this.pageNum = 1
this.historyList = []
} }
}, },
watchCarModel: {
immediate: true,
handler(newval) {
console.log(newval)
if (this.madiaId == 4) {
this.historyList = uni.$storage.get("historyList")
let index = {
'问界M5': 'M5',
'问界M7': 'M7',
'问界M9': 'M9',
'奥迪RS 3': '测试'
}[newval]
return this.goodsName = index || null
}
}
}
}, },
computed: { computed: {
watchStatus () { watchStatus () {
return this.$store.state.user.historyStatus return this.$store.state.user.historyStatus
}, },
watchCarModel () {
return this.$store.state.user.customerInfo.carModel
}
}, },
mounted () { mounted () {
if (this.show) this.init() if (this.show) this.init()
...@@ -94,20 +114,22 @@ export default { ...@@ -94,20 +114,22 @@ export default {
init () { init () {
const { shopMerchantId } = uni.$storage.get("userInfo"); const { shopMerchantId } = uni.$storage.get("userInfo");
this.shopMerchantId = shopMerchantId this.shopMerchantId = shopMerchantId
this.getQuotationList(); this.getQuotationList(true);
}, },
async getQuotationList (isSwitch = false, next = false) { async getQuotationList (isSwitch = false, next = false) {
const { goodsName, shopMerchantId, currentPage } = this const { goodsName, shopMerchantId, pageNum } = this
if (next) this.currentPage++ if (next) ++this.pageNum
const data = await uni.$api.commonApi.getQuotationList({ const data = await uni.$api.commonApi.getQuotationList({
currentPage, pageNum,
pageSize: 18, pageSize: 18,
merchantId: shopMerchantId, merchantId: shopMerchantId,
orderStatus: 3, orderStatus: 3,
goodsName goodsName
}) })
console.log(data.list, '=====')
if (isSwitch) { if (isSwitch) {
this.historyList = data.list this.historyList = data.list
uni.$storage.set("historyList", data.list)
this.isEnd = false this.isEnd = false
} else { } else {
if (data.list.length > 0) { if (data.list.length > 0) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!