fix:修复订单状态不正确

This commit is contained in:
wangsongsole 2022-10-09 15:45:38 +08:00
parent c28b7d614f
commit 57bf4a9159
1 changed files with 13 additions and 23 deletions

View File

@ -28,7 +28,7 @@
<div class="content-item" v-for="item in orderList" :key="item.order_number">
<div class="top">
<p class="time">{{item.update_time}}</p>
<p class="status" :style="{color:statusColor(item.status)}">{{item.status_text}}
<p class="status" :style="{color:statusColor(item)}">{{item.status_text}}
</p>
</div>
<div class="middle">
@ -44,7 +44,10 @@
<div class="bottom">
<p class="money">实付金额:¥<span>{{item.pay_amount}}</span></p>
<p class="button" @click="immediatelyPay(item)" v-show="item.status===6">立即支付</p>
<p class="button" @click="goExchange(item)" v-show="item.status===0">去兑换</p>
<!-- 立减金待领取 -->
<p class="button" @click="goExchange(item)" v-show="item.status===1&&item.type===2">去兑换</p>
<!-- 立减金领取过期 -->
<p class="button filter" v-show="item.status===5&&item.type===2">去兑换</p>
</div>
</div>
<!-- 空状态 -->
@ -111,19 +114,13 @@
methods: {
/* 根据不同状态展示 订单样式和表现 */
statusColor (status) {
switch (status) {
/* 兑换码状态 */
case 3:
return '#FD553D'
case 2:
return '#44D27D'
case 6:
return '#F28542'
/* 立减金状态 */
case 4:
return '#4193EE'
statusColor ({ type, status }) {
if (type === 1) {
const colorArray = ['#FD553D', '#FD553D', '#44D27D', '#F28542', '#4193EE', '#F28542', '#4193EE']
return colorArray[status];
} else {
const colorArray = ['#FD553D', '#FD553D', '#44D27D', '#F28542', '#4193EE', '#F28542', '#4193EE']
return colorArray[status];
}
},
@ -232,14 +229,7 @@
}
return
}
if (code === 200) {
data.map(item => {
if (item.type === 2 && item.status === 2) item.status = 4
if (item.type === 2 && item.status === 1) item.status = 6
})
this.orderList = data
}
if (code === 200) this.orderList = data
})
},