feat(customer-vue, order): 주문 내역 페이지 재주문하기 버튼 로직 추가

- 재주문하기 버튼 클릭시 해당 매장으로 이동
- 합계 3자리수 콤마 추가
- 자세히보기 버튼 클릭 시 준비중입니다 알림창 표시
This commit is contained in:
bum12ark
2022-03-17 16:51:10 +09:00
parent 66a15b2beb
commit 9d43a18d82
5 changed files with 30 additions and 9 deletions

View File

@@ -2,7 +2,6 @@
<v-card
class="mx-auto mb-5"
outlined
>
<v-list-item three-line>
<v-list-item-content>
@@ -19,7 +18,7 @@
{{ card.orderItemNames }}
</div>
<div class="text--primary">
합계 : <b>{{ card.orderPrice }}</b>
합계 : <b>{{ card.orderPrice | currency }}</b>
</div>
</v-list-item-content>
@@ -33,11 +32,15 @@
</v-list-item>
<v-card-actions class="pb-1">
<v-btn block color="primary">재주문하기</v-btn>
<v-btn block color="primary" @click="clickReOrder">
재주문하기
</v-btn>
</v-card-actions>
<v-card-actions class="pt-1">
<v-btn block outlined color="primary">자세히보기</v-btn>
<v-btn block outlined color="primary" @click="clickDetail">
자세히보기
</v-btn>
</v-card-actions>
</v-card>
</template>
@@ -47,12 +50,24 @@ export default {
name: "OrderHistoryCard",
props: {
card: {
storeId: Number,
storeName: String,
orderTime: String,
orderStatus: String,
orderItemNames: String,
orderPrice: String
}
},
methods: {
clickReOrder: function() {
this.$router.push({
name: "store",
params: {storeId: this.card.storeId}
})
},
clickDetail: function() {
alert("준비 중입니다.");
}
}
}
</script>

View File

@@ -82,6 +82,7 @@ export default {
this.cards.push({
orderId: order.orderId,
orderTime: order.orderTime,
storeId: order.storeId,
storeName: order.storeName,
orderPrice: order.orderPrice,
orderStatus: this.getOrderStatusName(order.orderStatus),
@@ -90,9 +91,11 @@ export default {
});
},
getOrderStatusName(orderStatus) {
if (orderStatus === "REJECT") return "주문 거절";
if (orderStatus === "ORDER") return "주문";
if (orderStatus === "PLACED") return "주문 수락";
if (orderStatus === "PLACED") return "주문신청";
if (orderStatus === "REJECTED") return "주문거절";
if (orderStatus === "ACCEPTED") return "주문수락";
if (orderStatus === "WAITING") return "픽업대기";
if (orderStatus === "FINISHED") return "픽업완료";
return orderStatus;
},
getOrderItemName(orderItems) {
@@ -100,7 +103,7 @@ export default {
if (itemSize == 1) return orderItems[0].orderItemName;
else if (itemSize > 1) return orderItems[0].orderItemName + " 외 " + (itemSize - 1) + "건";
else return "없음";
}
},
}
}
</script>