用户订单

This commit is contained in:
sa_10_0 2024-11-06 20:43:16 +08:00
parent aa303ea9f6
commit f566e3016f
2 changed files with 11 additions and 12 deletions

View File

@ -95,9 +95,9 @@ const Getorder = async () => {
})
if (res.data.code === 1) {
Status.value.orders=res.data.data;
// for(let key in res.data.data){
// Status.value.orders[key]=res.data.data[key]
// }
for(let key in res.data.data){
Status.value.orders[key]=res.data.data[key]
}
console.log(Status.value.orders[0].orderStatus)//
console.log(res.data.data[0].orderStatus)//
}else{
@ -116,11 +116,11 @@ const Status =ref({
displayedOrders: []
})
const changeTab = (tab) => {
for(let key in Status.value.orders){
tab[key]={
Status.value.orders[key].orderStatus
}
}
// for(let key in Status.value.orders){
// tab[key]={
// Status.value.orders[key].orderStatus
// }
// }
// Status.value.orders.orderStatus = tab;
if (tab === '全部') {
Status.value.displayedOrders = Status.value.orders;

View File

@ -32,6 +32,9 @@ const _sfc_main = {
});
if (res.data.code === 1) {
Status.value.orders = res.data.data;
for (let key in res.data.data) {
Status.value.orders[key] = res.data.data[key];
}
console.log(Status.value.orders[0].orderStatus);
console.log(res.data.data[0].orderStatus);
} else {
@ -46,10 +49,6 @@ const _sfc_main = {
displayedOrders: []
});
const changeTab = (tab) => {
for (let key in Status.value.orders) {
tab[key] = {};
}
Status.value.orders.orderStatus = tab;
if (tab === "全部") {
Status.value.displayedOrders = Status.value.orders;
} else {