From 8718927bb18774803b167200d478a1861cf78be6 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 23 Jun 2023 00:26:28 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=A0=8D=E4=BB=B7=E8=AF=A6=E7=BB=86?= =?UTF-8?q?=E3=80=91=201.=20=E7=A7=BB=E9=99=A4=E5=90=8E=E7=AB=AF=E7=9A=84?= =?UTF-8?q?=20action=EF=BC=8C=E8=80=8C=E6=98=AF=E5=89=8D=E7=AB=AF=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=EF=BC=8C=E5=92=8C=E5=90=8E=E7=AB=AF=E8=A7=A3=E8=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity/goods_bargain_details/index.vue | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/pages/activity/goods_bargain_details/index.vue b/pages/activity/goods_bargain_details/index.vue index 312e15e5..acbc2128 100644 --- a/pages/activity/goods_bargain_details/index.vue +++ b/pages/activity/goods_bargain_details/index.vue @@ -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; // 兜底逻辑 + }, /** * 参与砍价 */