|
|
@@ -5,35 +5,16 @@ import { redirect, RedirectType } from 'next/navigation';
|
|
|
import Link from "next/link";
|
|
|
import Image from "next/image";
|
|
|
import type {FetchGraphqlResult} from "@/types/graphqlFetch/type";
|
|
|
-import type { OrderDetailsData,ProductItemAdditional } from "@/types/customer/type";
|
|
|
+import type { OrderDetailsData } from "@/types/customer/type";
|
|
|
import {deleteGuestCookieAction} from "@/actions";
|
|
|
import { useConfig } from "@utils/hooks/useConfig";
|
|
|
-import {getAddressFromOrderDetailAddressList} from "@/utils/orderDetailTools";
|
|
|
+import {getAddressFromOrderDetailAddressList,getProductAdditionalInfo} from "@/utils/orderDetailTools";
|
|
|
import Faqs from "./Faqs";
|
|
|
|
|
|
/**
|
|
|
* 订单详情里的金额的货币符号不会根据用户选择的货币改变 ,而是固定为下单时使用的货币
|
|
|
*/
|
|
|
|
|
|
-function getProductAdditionalInfo(productItem: ProductItemAdditional) {
|
|
|
- const attributeKeys = Object.keys(productItem.attributes);
|
|
|
- let res = '';
|
|
|
- attributeKeys.forEach(key => {
|
|
|
- const attribute = productItem.attributes[key];
|
|
|
- if (attribute) {
|
|
|
- // option_label value_label
|
|
|
-
|
|
|
- if(res) {
|
|
|
- res = res + ', ' + attribute.option_label + ': ' + attribute.value_label;
|
|
|
- } else {
|
|
|
- res = attribute.option_label + ': ' + attribute.value_label;
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- return res;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
export default function OrderDetailWrapper({
|
|
|
orderDetailPromise,
|
|
|
isGuest
|