support gift

This commit is contained in:
Timi
2026-09-10 01:33:58 +08:00
parent 8a88df99fc
commit 33b1c0a432
9 changed files with 279 additions and 154 deletions
@@ -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;