Ver código fonte

wholesale专题页调整

zhangzf 2 dias atrás
pai
commit
3805d5c9c2

+ 635 - 0
src/app/(public)/(cms)/wholesale/page.tsx

@@ -0,0 +1,635 @@
+"use client";
+import { useState, useEffect, useMemo } from "react";
+import { useForm, Controller, FormProvider } from "react-hook-form";
+import { Swiper, SwiperSlide } from "swiper/react";
+import { Autoplay } from "swiper/modules";
+import Select from "@/components/theme/ui/Select";
+import Image from "next/image";
+import Link from "next/link";
+import { useCustomToast } from "@/utils/hooks/useToast";
+import { clientFetch } from "@/lib/restApiClient";
+
+type InquiryFormValues = {
+  name: string;
+  email: string;
+  business_name: string;
+  number: string;
+  country: string;
+  business_role: string;
+  message: string;
+};
+
+type FaqItem = {
+  title: string;
+  content: string;
+};
+
+const WholesalePage = () => {
+  // FAQ 状态:哪个展开
+  const [openFaqIndex, setOpenFaqIndex] = useState<number | null>(null);
+
+  // 底部弹窗
+  const [modalContent, setModalContent] = useState<{
+    type: "call" | "whatsapp" | "email";
+  } | null>(null);
+  const showModal = !!modalContent;
+  const { showToast } = useCustomToast();
+  // react hook form
+  const {
+    register,
+    handleSubmit,
+    formState: { errors, isSubmitting },
+    reset,
+  } = useForm<InquiryFormValues>();
+  const addressForm = useForm<InquiryFormValues>();
+  const COUNTRIES = [
+    { id: 1, code: "AF", name: "Afghanistan" },
+    { id: 2, code: "AX", name: "Åland Islands" },
+    { id: 3, code: "AL", name: "Albania" },
+    { id: 4, code: "DZ", name: "Algeria" },
+    { id: 49, code: "CN", name: "China" },
+    { id: 244, code: "US", name: "United States" },
+  ];
+  const countriesOptions = useMemo(() => {
+    return COUNTRIES.map((country) => ({
+      value: country.code,
+      label: country.name,
+      id: String(country.id),
+    }));
+  }, [COUNTRIES]);
+  // 提交表单
+  const onSubmit = async (data: InquiryFormValues) => {
+    try {
+      const res = await clientFetch(`/api/wholesale`, {
+        method: "POST",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        body: JSON.stringify(data),
+      });
+      console.log("提交成功,返回结果:", res);
+      if(res.success){
+         reset();
+         showToast(res.message, "success");
+      }else{
+        showToast(res.message, "danger");
+      }
+    } catch (err) {
+      alert("Network error");
+    }
+    console.log("data-------------------------", JSON.stringify(data));
+  };
+
+  // 关闭弹窗
+  const closeModal = () => setModalContent(null);
+
+  // 切换FAQ
+  const toggleFaq = (idx: number) => {
+    setOpenFaqIndex(openFaqIndex === idx ? null : idx);
+  };
+
+  const faqList: FaqItem[] = [
+    {
+      title: "PREMIUM HUMAN HAIR",
+      content:
+        "Each Wig Must Go Through 20 Process Quality Control Inspections, We Can Ensure A Consistent Supply With The Highest Quality Our Hair Is Fuller, And Longer, And Undergoes The Most Advanced Techniques To Achieve The Most Natural Look And Feel Possible. You Can Expect Our Units, Bundles, And Closures To Last For Months And Even Years.",
+    },
+    {
+      title: "FACTORY PRICES",
+      content:
+        "We Have Our Own Factory And We’Ve Taken Care To Keep Our Prices Fair So That Every Wholesalers Can Benefit From Our Cooperation, So The Factory-Direct Price Is Very Competitive With The Same Quality Hair In The Hair Market. Besides, The More You Buy, The Bigger Discount You Will Enjoy.",
+    },
+    {
+      title: "SAFE PAYMENT",
+      content:
+        "To Make It Easy To Pay For Your Bulk Orders, We Accept Paypal, Klarna, Cashapp, Zelle, Credit Card, Bank Transfers, Western Union, Money Gram And So On.",
+    },
+    {
+      title: "FAST DELIVERY",
+      content:
+        "We Keep Sufficient Stock On Hand For Your Orders. For In-Stock Orders, 2-5 Days Delivery To Us, 4-7 Days Delivery To European Countries/Canada; And For Custom Orders And Out-Of-Stock Orders, Please Allow 3-5 Business Days Before Shipping. 2 Warehouses In The Us. Bulk Order Enjoy Express Shipping With Signature And Insurance Service Cooperating Couriers: Usps /Ups /Fedex /Dhl.",
+    },
+    {
+      title: "CUSTOM PACKAGING",
+      content: "Custom Boxes & Labels Allow You To Differentiate Your Brand.",
+    },
+    {
+      title: "POST-SALE GUARANTEE",
+      content:
+        "30 Days No Reason Return, No Worry About The Backlog Of Stock. For Not Hot Selling Products You Can Return It Back To Us To Exchange It To Hot-Selling One.",
+    },
+  ];
+
+  const swiperImgList = [
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1620180010.jpg",
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1620180011.jpg",
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1620180012.jpg",
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1620180013.jpg",
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1620180014.jpg",
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1609817234.jpg",
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1609817236.jpg",
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1609817240.jpg",
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1609817241.jpg",
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1609817243.jpg",
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1609817245.jpg",
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1609817247.jpg",
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1609817248.jpg",
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1609817250.jpg",
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1609817252.jpg",
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1609817254.jpg",
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1609817256.jpg",
+  ];
+
+  // 引入 countries.js 脚本,执行 populateCountries
+  useEffect(() => {
+    const script = document.createElement("script");
+    script.src = "/js/countries.js";
+    script.async = true;
+    script.onload = () => {
+      // @ts-ignore
+      populateCountries("country");
+    };
+    document.body.appendChild(script);
+    return () => {
+      document.body.removeChild(script);
+    };
+  }, []);
+
+  const arrowDefault =
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1685492905.png";
+  const arrowFlip =
+    "https://www.asteriahair.com/media/wysiwyg/wholesale/1685492906.png";
+
+  return (
+    <div className="wholesale-page">
+      <h1 className="hidden">
+        Wholesale Human Hair Wig Vendors, Bundles Vendors
+      </h1>
+      {/* Banner */}
+      <div className="wholesale-banner">
+        <Image
+          src="https://www.asteriahair.com/media/wysiwyg/wholesale/1685492900.png"
+          alt="banner"
+          width={1200}
+          height={400}
+          className="w-full h-auto"
+        />
+      </div>
+      <div className="wholesale-banner_bottom flex flex-wrap justify-center items-center">
+        {[
+          "FACTORY <br/> DIRECT SALE",
+          "QUALITY <br/> GUARANTEE",
+          "INTERNATIONAL<br/> SHIPMENT",
+          "PROFESSIONAL<br/> SERVICE",
+        ].map((txt) => (
+          <div
+            key={txt}
+            className="w-[172px] h-[75px] bg-[#F5F5F5] rounded-md text-center font-bold text-black text-base leading-[26px] m-[10px_5px_5px] box-border py-[10px]"
+            dangerouslySetInnerHTML={{ __html: txt }}
+          />
+        ))}
+      </div>
+      {/* Inquiry Form */}
+      <div className="requireLz mt-[15px] px-[10px]">
+        <h2 className="text-center my-[10px] text-black font-semibold text-[24px]">
+          WHOLESALE HAIR INQUIRY
+        </h2>
+        <div className="enquiry-h6 text-center px-[10px]">
+          FILL OUT THE FORM, GET EXCLUSIVE WHOLESALE PRICING INFORMATION!
+        </div>
+        <FormProvider {...addressForm}>
+          <form onSubmit={handleSubmit(onSubmit)} className="mt-[15px]">
+            <ul className="px-[10px]">
+              <li className="mb-[10px]">
+                <input
+                  type="text"
+                  placeholder="* NAME"
+                  {...register("name", { required: "Name required" })}
+                  className="w-full h-[45px] border border-black rounded px-[10px] box-border my-[5px] outline-[#19bd9b]"
+                />
+                {errors.name && (
+                  <p className="text-red-500 text-sm">{errors.name.message}</p>
+                )}
+              </li>
+              <li className="mb-[10px]">
+                <input
+                  type="email"
+                  placeholder="* EMAIL"
+                  {...register("email", { required: "email required" })}
+                  className="w-full h-[45px] border border-black rounded px-[10px] box-border my-[5px] outline-[#19bd9b]"
+                />
+                {errors.email && (
+                  <p className="text-red-500 text-sm">{errors.email.message}</p>
+                )}
+              </li>
+              <li className="mb-[10px]">
+                <input
+                  type="text"
+                  placeholder=" BUSINESS NAME"
+                  {...register("business_name")}
+                  className="w-full h-[45px] border border-black rounded px-[10px] box-border my-[5px] outline-[#19bd9b]"
+                />
+              </li>
+              <li className="mb-[10px]">
+                <input
+                  type="number"
+                  placeholder="* TELEPHONE"
+                  {...register("number", { required: "Telephone required" })}
+                  className="w-full h-[45px] border border-black rounded px-[10px] box-border my-[5px] outline-[#19bd9b]"
+                />
+                {errors.number && (
+                  <p className="text-red-500 text-sm">
+                    {errors.number.message}
+                  </p>
+                )}
+              </li>
+              {/* <li className="mb-[10px]">
+              <select
+                id="country"
+                {...register("country", { required: true })}
+                className="scon-input w-full h-[45px] border border-black rounded px-[10px] box-border my-[5px] outline-[#19bd9b]"
+              ></select>
+            </li> */}
+              <Controller
+                control={addressForm.control}
+                name="country"
+                rules={{ required: "Country is required" }}
+                render={(
+                  {
+                    // field
+                  },
+                ) => {
+                  return (
+                    <Select
+                      placeholder="Country/Region"
+                      {...register("country", {
+                        required: "Country/Region field is required",
+                      })}
+                      options={countriesOptions}
+                      error={errors.country?.message as string}
+                    />
+                  );
+                }}
+              />
+
+              <li className="mb-[10px]">
+                <select
+                  id="businessRole"
+                  {...register("business_role", { required: true })}
+                  className="scon-input w-full h-[45px] border border-black rounded px-[10px] box-border my-[5px] outline-[#19bd9b]"
+                >
+                  <option value="none" selected disabled hidden>
+                    Seclect Your Business Role
+                  </option>
+                  <option value="Salon Owner">Salon Owner</option>
+                  <option value="Beauty Supply Store">
+                    Beauty Supply Store
+                  </option>
+                  <option value="Boutique">Boutique</option>
+                  <option value="Hair Stylist">Hair Stylist</option>
+                  <option value="Wholesaler Hair Business">
+                    Wholesaler Hair Business
+                  </option>
+                  <option value="Star New Business">Star New Business</option>
+                  <option value="Sell Online">Sell Online</option>
+                  <option value="Personal Use">Personal Use</option>
+                </select>
+              </li>
+              <li className="mb-[10px]">
+                <textarea
+                  id="Messages"
+                  placeholder="* MESSAGES"
+                  {...register("message", { required: "Message required" })}
+                  className="w-full h-[100px] border border-black rounded px-[8px] py-2 box-border outline-[#19bd9b] font-[Arial]"
+                ></textarea>
+                {errors.message && (
+                  <p className="text-red-500 text-sm">
+                    {errors.message.message}
+                  </p>
+                )}
+              </li>
+              <li className="mb-[10px]">
+                <button
+                  type="submit"
+                  disabled={isSubmitting}
+                  className="w-full h-[45px] bg-black text-white rounded-md border-none"
+                >
+                  {isSubmitting ? "Submitting..." : "SEND"}
+                </button>
+              </li>
+            </ul>
+          </form>
+        </FormProvider>
+      </div>
+      {/* OR Contact Us */}
+      <div className="whosale-orbox text-center px-[10px] pb-[15px]">
+        <div className="whosale-orbtit flex justify-center">
+          <span className="px-[10px] text-[24px] font-bold text-black leading-[40px] tracking-[4px]">
+            OR
+          </span>
+        </div>
+        <ul className="bg-gradient-to-tr from-[#0E0E0F] to-[#043632] rounded-lg h-[334px] flex flex-col justify-evenly p-[20px_10px] box-border">
+          <h3 className="whosale-orbtit-h3 text-[24px] font-bold text-white leading-[40px] m-0">
+            CONTACT US
+          </h3>
+          <li className="border border-[#19bd9b] mt-[10px] text-black rounded leading-[45px] bg-[#32CFB0]">
+            <div
+              className="callus relative cursor-pointer"
+              onClick={() => setModalContent({ type: "call" })}
+            >
+              CALL US
+              <Image
+                src="https://m.asteriahair.com/media/wysiwyg/wholesale/1685412530.png"
+                alt=""
+                width={24}
+                height={24}
+                className="absolute right-[20px] top-[2px]"
+              />
+            </div>
+          </li>
+          <li className="border border-[#19bd9b] mt-[10px] text-black rounded leading-[45px] bg-[#32CFB0]">
+            <div
+              className="whatsapp relative cursor-pointer"
+              onClick={() => setModalContent({ type: "whatsapp" })}
+            >
+              WHATSAPP
+              <Image
+                src="https://m.asteriahair.com/media/wysiwyg/wholesale/1685412530.png"
+                alt=""
+                width={24}
+                height={24}
+                className="absolute right-[20px] top-[2px]"
+              />
+            </div>
+          </li>
+          <li className="border border-[#19bd9b] mt-[10px] text-black rounded leading-[45px] bg-[#32CFB0]">
+            <div
+              className="email relative cursor-pointer"
+              onClick={() => setModalContent({ type: "email" })}
+            >
+              EMAIL
+              <Image
+                src="https://m.asteriahair.com/media/wysiwyg/wholesale/1685412530.png"
+                alt=""
+                width={24}
+                height={24}
+                className="absolute right-[20px] top-[2px]"
+              />
+            </div>
+          </li>
+        </ul>
+      </div>
+      {/* Flash Sale Block 原来Mwhosalebox 默认隐藏 */}
+      <div className="Mwhosalebox hidden p-[10px] box-border text-center">
+        <div className="Mwhosale_tit1 text-black uppercase text-[24px] font-bold tracking-[3px]">
+          Flash Sale
+        </div>
+        <div className="Mwhosale_tit2 text-[22px] font-bold text-white bg-black my-[10px] mx-auto py-[6px] px-[40px] inline-block rounded-full">
+          Straight U Part Bob
+        </div>
+        <div className="Mwhosale_tit3 text-black text-base font-bold tracking-[2px] leading-[25px]">
+          Natural Black Hair
+        </div>
+        <div className="Mwhosale_tit3 text-black text-base font-bold tracking-[2px] leading-[25px]">
+          40pack Limited Sale
+        </div>
+        <div className="Mwhosale_tit3 text-black text-base font-bold tracking-[2px] leading-[25px]">
+          First come first served!
+        </div>
+        <div className="Mwhos_imgbox">
+          <div className="Mwhos_img mt-[20px]">
+            <Link rel="nofollow" href="https://wa.me/message/BKUAYBXQ6L3JM1">
+              <Image
+                src="https://www.asteriahair.com/media/wysiwyg/wholesale/1618987342.jpg"
+                alt=""
+                width={800}
+                height={800}
+                className="max-w-full h-auto"
+              />
+            </Link>
+          </div>
+          <div className="Mwhos_img mt-[20px]">
+            <Link rel="nofollow" href="https://wa.me/message/BKUAYBXQ6L3JM1">
+              <Image
+                src="https://www.asteriahair.com/media/wysiwyg/wholesale/1618987343.jpg"
+                alt=""
+                width={800}
+                height={800}
+                className="max-w-full h-auto"
+              />
+            </Link>
+          </div>
+        </div>
+      </div>
+      <div className="m_packagedbox hidden py-[30px]">
+        <div className="m_packagedb_tit text-center text-black">
+          <h2 className="text-[22px] mb-0">Wholesale Sale</h2>
+          <div className="m_packagedb_t1 text-[15px] my-[5px] mx-auto">
+            -Start/grow business
+          </div>
+          <div className="m_packagedb_t2 text-[13px]">-Black Friday Sale</div>
+          <div className="m_packagedb_t2 text-[13px]">
+            -Best time to buy in bulk and Make profit
+          </div>
+        </div>
+        <div className="m_packagedb_con pt-[30px] px-[36px] box-border">
+          <div className="m_packagedb_cli">
+            <Image
+              src="https://m.asteriahair.com/media/wysiwyg/wholesale/1637812703.jpg"
+              alt=""
+              width={800}
+              height={600}
+              className="w-full h-auto"
+            />
+          </div>
+        </div>
+      </div>
+      {/* Wholesale Products */}
+      <div className="productList mt-[30px] px-[10px]">
+        <h2 className="text-center text-black text-[24px]">
+          WHOLESALE PRODUCTS
+        </h2>
+        <div className="productBox py-[5px]">
+          <Image
+            src="https://www.asteriahair.com/media/wysiwyg/wholesale/1685492901.png"
+            alt=""
+            width={1000}
+            height={300}
+            className="w-full h-auto"
+          />
+        </div>
+        <div className="productBox py-[5px]">
+          <Image
+            src="https://www.asteriahair.com/media/wysiwyg/wholesale/1685492902.png"
+            alt=""
+            width={1000}
+            height={300}
+            className="w-full h-auto"
+          />
+        </div>
+        <div className="productBox py-[5px]">
+          <Link
+            rel="nofollow"
+            href="https://www.asteriahair.com/asteria-custom-glam-human-hair-mannequin-head-with-shoulders.html"
+          >
+            <Image
+              src="https://www.asteriahair.com/media/wysiwyg/wholesale/1685492903.png"
+              alt=""
+              width={1000}
+              height={600}
+              className="w-full h-auto"
+            />
+          </Link>
+        </div>
+        <h2 className="productList_h2 text-center text-black text-[24px] mt-4">
+          WHOLESALE SERVICE
+        </h2>
+        <div className="productBox py-[5px]">
+          <Image
+            src="https://www.asteriahair.com/media/wysiwyg/wholesale/1685492904.png"
+            alt=""
+            width={1000}
+            height={300}
+            className="w-full h-auto"
+          />
+        </div>
+      </div>
+      {/* FAQ Why choose us */}
+      <div className="product-choose px-[20px]">
+        <h3 className="product-choose-h3 text-center text-[24px] font-bold text-black leading-[36px] my-[10px]">
+          WHY CHOOSE FROM US?
+        </h3>
+        {faqList.map((faq, idx) => (
+          <div key={idx} className="asked border-b border-[#ccc]">
+            <div
+              className="askedTop flex justify-between items-center w-full h-[45px] cursor-pointer"
+              onClick={() => toggleFaq(idx)}
+            >
+              <div>
+                <p className="text-[14px] font-bold text-black leading-[26px]">
+                  {faq.title}
+                </p>
+              </div>
+              <Image
+                src={openFaqIndex === idx ? arrowFlip : arrowDefault}
+                alt="flip"
+                width={20}
+                height={20}
+                className="w-[20px] h-[20px]"
+              />
+            </div>
+            <div
+              className={`panel font-[Poppins,Arial] overflow-hidden transition-all duration-300 ${
+                openFaqIndex === idx ? "max-h-[999px] pb-3" : "max-h-0"
+              }`}
+            >
+              {faq.content}
+            </div>
+          </div>
+        ))}
+      </div>
+      {/* Customer review swiper */}
+      <div className="product-show px-[10px] mt-[30px]">
+        <h2 className="text-center text-black text-[24px]">
+          Voice from clients
+        </h2>
+        <div className="mt-[30px]">
+          <Swiper
+            modules={[Autoplay]}
+            autoplay={{ delay: 2000, disableOnInteraction: false }}
+            slidesPerView={1}
+            spaceBetween={2}
+            slidesPerGroup={1}
+            loop={true}
+          >
+            {swiperImgList.map((src, i) => (
+              <SwiperSlide key={i}>
+                <Image
+                  src={src}
+                  alt={`review ${i}`}
+                  width={1000}
+                  height={400}
+                  className="w-full h-auto"
+                />
+              </SwiperSlide>
+            ))}
+          </Swiper>
+        </div>
+      </div>
+      {/* Bottom popup */}
+      {showModal && (
+        <div
+          className="product-opener fixed inset-0 bg-black/40 z-50"
+          onClick={closeModal}
+        >
+          <div className="product-opener-content absolute bottom-0 w-full h-[226px] flex flex-col justify-center items-center">
+            <div className="product-opener-href w-[95%] rounded-[14px] bg-[#eee] text-center">
+              {modalContent?.type === "call" && (
+                <>
+                  <Link
+                    rel="nofollow"
+                    href="tel:8615038065852"
+                    className="block h-[56px] text-[#0A84FF] leading-[56px] border-b border-[#aaa]"
+                  >
+                    +8615038065852
+                  </Link>
+                  <Link
+                    rel="nofollow"
+                    href="tel:8615136424039"
+                    className="block h-[56px] text-[#0A84FF] leading-[56px]"
+                  >
+                    +8615136424039
+                  </Link>
+                </>
+              )}
+              {modalContent?.type === "whatsapp" && (
+                <>
+                  <Link
+                    rel="nofollow"
+                    href="https://wa.me/message/BKUAYBXQ6L3JM1"
+                    className="block h-[56px] text-[#0A84FF] leading-[56px] border-b border-[#aaa]"
+                  >
+                    +8615038065852
+                  </Link>
+                  <Link
+                    rel="nofollow"
+                    href="https://wa.me/message/SVMTLNRYWJFJK1"
+                    className="block h-[56px] text-[#0A84FF] leading-[56px]"
+                  >
+                    +8615136424039
+                  </Link>
+                </>
+              )}
+              {modalContent?.type === "email" && (
+                <>
+                  <Link
+                    rel="nofollow"
+                    href="mailto:service@asteriahair.com"
+                    className="block h-[56px] text-[#0A84FF] leading-[56px] border-b border-[#aaa]"
+                  >
+                    service@asteriahair.com
+                  </Link>
+                  <Link
+                    rel="nofollow"
+                    href="mailto:pay@asteriahair.com"
+                    className="block h-[56px] text-[#0A84FF] leading-[56px]"
+                  >
+                    pay@asteriahair.com
+                  </Link>
+                </>
+              )}
+            </div>
+            <div
+              className="product-opener-cancel w-[95%] h-[56px] bg-white rounded-[14px] text-center text-[20px] font-semibold leading-[56px] text-[#007AFF] mt-[10px]"
+              onClick={closeModal}
+            >
+              Cancel
+            </div>
+          </div>
+        </div>
+      )}
+    </div>
+  );
+};
+
+export default WholesalePage;

+ 44 - 0
src/app/api/wholesale/route.ts

@@ -0,0 +1,44 @@
+import { type NextRequest, NextResponse } from "next/server";
+import { restApiFetch } from "@/utils/bagisto";
+export async function POST(req: NextRequest) {
+  try {
+    console.log('req---------------------------acacacac',req);
+    
+    const params = await req.json();
+    const response = await restApiFetch<{
+      data: any; // 这个是返回结果的数据类型,暂时写成any,具体看后端反的数据结构再改成确定的类型1
+      variables: {
+        name: string;
+        Email: string;
+        business_name: string;
+        number: string;
+        country: string;
+        business_role: string;
+        message: string;
+      };
+    }>({
+      api: "/wholesale",
+      method: "POST",
+      cache: "no-store",
+      variables: params,
+    });
+    // 打印后端原始返回结构
+    console.log(
+      "接口原始response.body =",
+      JSON.stringify(response.body, null, 2),
+    );
+    return NextResponse.json(response.body, {
+      status: response.status,
+    });
+  } catch (error) {
+    console.log("/customer/token/address---", error); // 调试用
+
+    return NextResponse.json(
+      {
+        message: "Network error",
+        error: error instanceof Error ? error.message : error,
+      },
+      { status: 500 },
+    );
+  }
+}