support gift
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
<div class="title">
|
||||
<div class="heading">
|
||||
<strong v-text="item.productNameSnapshot || '未命名产品'" />
|
||||
<t-tag v-if="item.gifted" size="small" theme="success" content="赠送" />
|
||||
<span v-text="getItemDescription(item)" />
|
||||
</div>
|
||||
<div
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
>
|
||||
<template #description>
|
||||
<div class="item-description">
|
||||
<t-tag v-if="isGiftedFulfillmentItem(item)" size="small" theme="success" content="赠送" />
|
||||
<product-sku-snapshot-tags
|
||||
:product-name="item.productNameSnapshot"
|
||||
:snapshot="item.skuSpecSnapshot"
|
||||
@@ -200,6 +201,10 @@ function getFulfillmentQuantityText(item: OrderFulfillmentItem): string {
|
||||
return `履约数量 ${getPackageQuantityText(item.quantity)} ${item.unitSnapshot || "单位"}`;
|
||||
}
|
||||
|
||||
function isGiftedFulfillmentItem(item: OrderFulfillmentItem): boolean {
|
||||
return Boolean(order.value?.itemList?.find(orderItem => orderItem.id === item.sourceOrderItemId)?.gifted);
|
||||
}
|
||||
|
||||
async function loadData(): Promise<void> {
|
||||
const id = String(route.params.id || "");
|
||||
if (!id) return;
|
||||
|
||||
Reference in New Issue
Block a user