【砍价详细】

1. 移除后端的 action,而是前端计算,和后端解耦
pull/1/MERGE
YunaiV 2023-06-23 00:26:28 +08:00
parent e67fdf510c
commit 8718927bb1
1 changed files with 25 additions and 1 deletions

View File

@ -476,7 +476,7 @@
BargainApi.getBargainRecordDetail(this.bargainId, this.id).then(res => {
const bargainUserInfo = res.data;
this.bargainUserInfo = bargainUserInfo;
this.action = bargainUserInfo.action;
this.action = this.calculateAction(bargainUserInfo);
this.helpAction = bargainUserInfo.helpAction;
this.storeBargainId = bargainUserInfo.id || this.storeBargainId;
this.buyPrice = this.bargainUserInfo.payPrice || this.buyPrice;
@ -508,6 +508,30 @@
});
});
},
/**
* 计算 action
*/
calculateAction: function (item) {
if (!item || !item.status) {
return 1; // -
}
if (item.status === 1) {
return 2; // -
}
if (item.status === 3) {
return 6; // - TODO
}
if (!item.orderId) {
return 3; // -
}
if (!item.payStatus) {
return 4; // -
}
if (!item.payStatus) {
return 5; // -
}
return 1; //
},
/**
* 参与砍价
*/