OrderList暂存
This commit is contained in:
parent
10d80f09b9
commit
87f925a9c7
|
@ -154,23 +154,26 @@
|
|||
const getOrderList = async () => {
|
||||
try {
|
||||
const res = await myAxios.post('/order/list/page', { ...searchParams.value});
|
||||
console.log('订单信息--->',res.data);
|
||||
console.log('订单信息--->',res.data.data);
|
||||
|
||||
if (res.data.code === 1) {
|
||||
tableData.value = res.data.data.records;
|
||||
total.value = parseInt(res.data.data.total)
|
||||
console.log('tableData-->',tableData.value);
|
||||
//获取订单记录成功后,获取订单详情记录
|
||||
console.log('数组长度--->',tableData.value.length);
|
||||
for(let key in tableData.value) {
|
||||
num.value = parseInt(key)
|
||||
const resOrderDetail = await myAxios.post('/order/list/item',{id:tableData.value[key].id}) //获取订单中详情记录
|
||||
if( resOrderDetail.data.code === 1 ) {
|
||||
orderDetail.value[num.value] = resOrderDetail.data.data //订单中的商品明细,多个商品
|
||||
}
|
||||
console.log('请求返回的resOrderDetail--->',resOrderDetail.data);
|
||||
console.log('第',key,'次返回的orderDetail-->',orderDetail.value[num.value]);
|
||||
console.log('总的orderDetail-->',orderDetail.value);
|
||||
}
|
||||
tableData.value = res.data.data;
|
||||
total.value = res.data.data.length
|
||||
|
||||
|
||||
// console.log('tableData-->',tableData.value);
|
||||
//获取订单记录成功后,获取订单详情的商品记录
|
||||
// console.log('数组长度--->',tableData.value.length);
|
||||
// for(let key in tableData.value) {
|
||||
// num.value = parseInt(key)
|
||||
// const resOrderDetail = await myAxios.post('/order/list/item',{id:tableData.value[key].id}) //获取订单中详情记录
|
||||
// if( resOrderDetail.data.code === 1 ) {
|
||||
// orderDetail.value[num.value] = resOrderDetail.data.data //订单中的商品明细,多个商品
|
||||
// }
|
||||
// console.log('请求返回的resOrderDetail--->',resOrderDetail.data);
|
||||
// console.log('第',key,'次返回的orderDetail-->',orderDetail.value[num.value]);
|
||||
// console.log('总的orderDetail-->',orderDetail.value);
|
||||
// }
|
||||
// console.log(orderDetail.value);
|
||||
} else {
|
||||
ElMessage({
|
||||
|
|
Loading…
Reference in New Issue
Block a user