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 Queue from "@/utils/Queue.js";
const interval = 6
export default {
onLoad() {},
data() {
......@@ -219,25 +220,30 @@ export default {
polling() {
console.log(this.snapshot.size, "this.snapshot.size");
if (this.snapshot === null) return;
if (this.snapshot.size == 0) {
this.enQueue();
setTimeout(() => {
this.polling();
}, 1000 * 60);
} else {
console.log(this.snapshot, "this.snapshot");
const record = this.snapshot.dequeue();
console.log(record);
this.uploadRecord(record);
}
uni.$isNetWork().then(() => {
if (this.snapshot.size == 0) {
this.enQueue();
this.pollingLater(interval);
} else {
const record = this.snapshot.dequeue();
this.uploadRecord(record);
}
}).catch(() => {
this.pollingLater(interval);
});
},
stopPolling() {
this.snapshot.clear();
this.snapshot = null;
},
pollingLater(interval = 60 * 10) {
setTimeout(() => {
this.polling();
}, interval * 1000);
},
},
beforeDestroy() {
console.log("stopPolling");
this.stopPolling();
},
}
};
......@@ -66,7 +66,7 @@ export default {
return {
historyList: [],
isEnd: false,
currentPage: 1,
pageNum: 1,
shopMerchantId: '',
goodsName: null
}
......@@ -78,14 +78,34 @@ export default {
watchStatus: {
immediate: true,
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: {
watchStatus () {
return this.$store.state.user.historyStatus
},
watchCarModel () {
return this.$store.state.user.customerInfo.carModel
}
},
mounted () {
if (this.show) this.init()
......@@ -94,20 +114,22 @@ export default {
init () {
const { shopMerchantId } = uni.$storage.get("userInfo");
this.shopMerchantId = shopMerchantId
this.getQuotationList();
this.getQuotationList(true);
},
async getQuotationList (isSwitch = false, next = false) {
const { goodsName, shopMerchantId, currentPage } = this
if (next) this.currentPage++
const { goodsName, shopMerchantId, pageNum } = this
if (next) ++this.pageNum
const data = await uni.$api.commonApi.getQuotationList({
currentPage,
pageNum,
pageSize: 18,
merchantId: shopMerchantId,
orderStatus: 3,
goodsName
})
console.log(data.list, '=====')
if (isSwitch) {
this.historyList = data.list
uni.$storage.set("historyList", data.list)
this.isEnd = false
} else {
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!