From 53cc53ad635a8bc911bcb61f3ea8b8b4e24e5e42 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Wed, 28 Sep 2022 16:35:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v1_5_0_C/myCoupon.html | 5 +++-- v1_5_0_C/myOrder.html | 18 ++++++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/v1_5_0_C/myCoupon.html b/v1_5_0_C/myCoupon.html index d1610b6..2247b76 100644 --- a/v1_5_0_C/myCoupon.html +++ b/v1_5_0_C/myCoupon.html @@ -41,7 +41,7 @@

-

满{{item.full}}元减{{item.reduce}}券

+

满{{item.full}}元减{{item.reduce}}元券

{{item.begin_time}} - {{item.end_time}}

@@ -128,6 +128,8 @@ if (code === 200) { const productArray = [] data.map(item => { + item.full = Number(item.full).toFixed(0) + item.reduce = Number(item.reduce).toFixed(0) item.product.legal.map(items => { productArray.push({ name: items.product_name, @@ -147,7 +149,6 @@ item.productArray = productArray }) this.couponList = data - console.log(data); } }) } diff --git a/v1_5_0_C/myOrder.html b/v1_5_0_C/myOrder.html index e382521..da80da5 100644 --- a/v1_5_0_C/myOrder.html +++ b/v1_5_0_C/myOrder.html @@ -25,7 +25,7 @@
-

{{item.create_time}}

+

{{item.update_time}}

{{statusColor(item.status).text}}

@@ -96,7 +96,7 @@ colorValue.color = '#F28542' colorValue.text = '待支付' break; - case 3: + case 4: colorValue.color = '#4193EE' colorValue.text = '已支付' break; @@ -119,15 +119,25 @@ /* 去兑换 */ goExchange (item) { window.location.replace('./couponCollection.html'); - console.log(item); }, /* 请求订单数据 */ getOrderList () { const key = sessionStorage.getItem('key') req.axiosGet(`/key/order/${key}`, { page: this.page, limit: this.limit }).then(({ data, code }) => { - if (code === 200) this.orderList = data + if (code === 200) { + const filterData1 = this.sortData(data.filter(item => ![4, 6].includes(item.status))) + const filterData2 = this.sortData(data.filter(item => item.status === 4)) + const filterData3 = this.sortData(data.filter(item => item.status === 6)) + const newData = [...filterData3, ...filterData2, ...filterData1] + this.orderList = newData + } }) + }, + + /* 排序 */ + sortData (data) { + return data.sort((a, b) => a.update_time - b.update_time) } } })