-
@@ -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)
}
}
})
{{item.create_time}}
+{{item.update_time}}
{{statusColor(item.status).text}}