PageSourceSearch

https://petwellhk.com/assets/Wishlist-DXDrxZcj.js

js petwellhk.com collected 2026-10-06 05:23:36 UTC 9,623 bytes, 11 lines download raw bytes

1import{r as g,j as e,L as l}from"./react-vendor-BDHNqS4B.js";import{b as I}from"./Header-BkbupWq-.js";import{F as P}from"./Footer-CtylQEAH.js";import{c as N,B as n,X as S,e as B,h as E,a$ as H,n as L,U}from"./main-m_sUF2N4.js";import{S as z}from"./smartphone-DDWx8wJ5.js";import{B as T}from"./badge-BYBBu8xB.js";import{C as m}from"./card-U4xgiZnN.js";import{u as W}from"./useSEO-CoArDrdl.js";import{a as M,g as p,T as R}from"./usePriceReviewProducts-BeYKlbKA.js";import{C as $}from"./chevron-right-CpkQxGj-.js";import{H as u}from"./heart-DRwCktcb.js";import{T as D}from"./trash-2-e__PZJrZ.js";import{S as K}from"./scale-B2l5za8q.js";import{E as q}from"./external-link-BIpC4MGv.js";import"./amplify-DYDcjoow.js";import"./check-DS0-tR9o.js";import"./tag-D40gy_Nl.js";import"./query-7-WHkg5t.js";import"./textarea-D7qsgB_p.js";import"./reportService-tEzofQZ6.js";import"./phone-B2rvvDkK.js";import"./type-CVgQCqWZ.js";import"./priceReviewApi-BFijUeFQ.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const F=N("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const O=N("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]),f="petwell:appUpsell:dismissed:v1",_=()=>{const[c,d]=g.useState(!0);g.useEffect(()=>{try{d(localStorage.getItem(f)==="1")}catch{d(!1)}},[]);const a=()=>{try{localStorage.setItem(f,"1")}catch{}d(!0)};return c?null:e.jsx("div",{className:"sticky bottom-0 left-0 right-0 z-30 border-t bg-gradient-to-r from-primary to-orange-500 text-white shadow-lg",children:e.jsx("div",{className:"container mx-auto px-4 py-3 md:py-4",children:e.jsxs("div",{className:"flex items-center gap-3 md:gap-5",children:[e.jsxs("div",{className:"hidden sm:flex relative shrink-0 w-16 h-20 md:w-20 md:h-24 items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-white/15 rounded-[14px] border-2 border-white/50"}),e.jsx("div",{className:"absolute top-1 left-1/2 -translate-x-1/2 w-6 h-1 bg-white/40 rounded-full"}),e.jsx(F,{className:"relative w-6 h-6 md:w-8 md:h-8 text-white"})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-semibold text-sm md:text-base leading-tight",children:"想第一時間知道減價?"}),e.jsx("p",{className:"text-xs md:text-sm text-white/90 leading-snug mt-0.5 hidden sm:block",children:"下載 PetWell App,開啟價格提醒,追蹤清單同步手機,唔使再手動格價。"}),e.jsx("p",{className:"text-[11px] text-white/90 leading-snug mt-0.5 sm:hidden",children:"開啟價格提醒,追蹤清單同步手機。"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 md:gap-2 shrink-0",children:[e.jsx(n,{asChild:!0,size:"sm",className:"bg-white text-primary hover:bg-white/90 h-8 md:h-9 px-2.5 md:px-4 text-xs md:text-sm gap-1",children:e.jsxs(l,{to:"/download",children:[e.jsx(z,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden xs:inline",children:"下載 App"}),e.jsx("span",{className:"xs:hidden",children:"下載"})]})}),e.jsx("button",{onClick:a,className:"text-white/90 hover:text-white text-[11px] md:text-xs underline whitespace-nowrap hidden md:inline",children:"繼續喺網頁使用"}),e.jsx("button",{onClick:a,"aria-label":"關閉",className:"md:hidden p-1 -mr-1 text-white/90 hover:text-white",children:e.jsx(S,{className:"w-4 h-4"})})]})]})})})},ge=()=>{W({title:"我的追蹤清單 | PetWell Review",description:"追蹤你想買嘅寵物用品價格,最平價格一目了然。",canonicalUrl:"https://petwellhk.com/wishlist",noindex:!0});const{isAuthenticated:c}=B(),{openPanel:d}=E(),{items:a,remove:w}=H(),b=a.map(s=>s.productId),{data:x,isLoading:v,isError:y,error:k}=M(b),A=new Map(((x==null?void 0:x.items)||[]).map(s=>[s.id,s])),j=a.map(s=>{const t=A.get(s.productId);if(!t)return null;const r=t.lowestPrice-s.priceAtAdd,o=s.priceAtAdd?r/s.priceAtAdd*100:0;return{entry:s,product:t,diff:r,pct:o}}).filter(s=>s!==null);return e.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[e.jsx(I,{}),e.jsxs("main",{className:"flex-1",children:[e.jsx("section",{className:"border-b bg-gradient-to-br from-primary/10 via-background to-accent/10",children:e.jsxs("div",{className:"container mx-auto px-4 py-8 md:py-12",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(l,{to:"/review",className:"hover:text-primary",children:"格價"}),e.jsx($,{className:"h-3 w-3"}),e.jsx("span",{children:"追蹤清單"})]}),e.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold tracking-tight md:text-4xl",children:[e.jsx(u,{className:"h-6 w-6 fill-primary text-primary md:h-8 md:w-8"}),"我的追蹤清單"]}),e.jsxs("p",{className:"mt-2 text-sm text-muted-foreground md:text-base",children:["已儲存 ",a.length," 件產品,價格會以最新公開資料計算。"]})]})}),e.jsx("section",{className:"container mx-auto px-4 py-8",children:!c&&a.length===0?e.jsxs(m,{className:"mx-auto max-w-lg p-8 text-center md:p-12",children:[e.jsx(u,{className:"mx-auto mb-3 h-12 w-12 text-primary"}),e.jsx("h2",{className:"mb-2 text-lg font-semibold md:text-xl",children:"登入後查看追蹤清單"}),e.jsx("p",{className:"mb-5 text-sm text-muted-foreground",children:"登入 PetWell 帳戶,即可儲存追蹤清單及獲取最平價格通知。"}),e.jsxs("div",{className:"flex justify-center gap-2",children:[e.jsx(n,{variant:"outline",onClick:()=>d("LANDING"),children:"登入"}),e.jsx(n,{asChild:!0,children:e.jsx(l,{to:"/register",children:"立即註冊"})})]})]}):a.length===0?e.jsx(G,{}):v?e.jsxs(m,{className:"flex items-center justify-center p-10 text-muted-foreground",children:[e.jsx(L,{className:"mr-2 h-5 w-5 animate-spin"}),"正在載入追蹤產品..."]}):y?e.jsxs(m,{className:"p-6 text-center",children:[e.jsx("h2",{className:"font-semibold",children:"暫時未能載入追蹤清單"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:k.message})]}):j.length===0?e.jsxs(m,{className:"p-8 text-center",children:[e.jsx("h2",{className:"font-semibold",children:"已追蹤產品暫時未有公開價格"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"可能仍在 admin review 或產品已下架。"})]}):e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:j.map(({entry:s,product:t,diff:r,pct:o})=>{const h=r<0,C=r>0,i=t.topOffers[0];return e.jsxs(m,{className:"flex flex-col overflow-hidden",children:[e.jsx(l,{to:p(t),className:"block aspect-[16/10] overflow-hidden bg-muted",children:t.image&&e.jsx("img",{src:t.image,alt:t.name,className:"h-full w-full object-cover transition-transform hover:scale-105"})}),e.jsxs("div",{className:"flex flex-1 flex-col p-4",children:[e.jsx(T,{variant:"outline",className:"mb-1.5 self-start text-[10px]",children:t.brand}),e.jsx(l,{to:p(t),className:"line-clamp-2 text-sm font-semibold leading-tight hover:text-primary md:text-base",children:t.name}),e.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:t.size}),e.jsxs("div",{className:"mt-3 flex items-end justify-between gap-2 border-t pt-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"全網最平"}),e.jsxs("p",{className:"text-xl font-bold leading-tight text-primary",children:["HK$",t.lowestPrice]}),e.jsx("p",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:(i==null?void 0:i.store)||"—"})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"加入後"}),r===0?e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"無變動"}):e.jsxs("p",{className:`inline-flex items-center gap-0.5 text-xs font-semibold ${h?"text-green-600":"text-red-500"}`,children:[h?e.jsx(R,{className:"h-3 w-3"}):e.jsx(O,{className:"h-3 w-3"}),C?"+":"",Math.round(o),"% / ",h?"":"+","HK$",r]}),e.jsxs("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:["入單 HK$",s.priceAtAdd]})]})]}),e.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-1.5",children:[e.jsxs(n,{variant:"outline",size:"sm",onClick:()=>{w(s.productId),U("已從追蹤清單移除",{duration:3e3})},className:"gap-1 text-xs",children:[e.jsx(D,{className:"h-3.5 w-3.5"})," 移除"]}),e.jsx(n,{variant:"outline",size:"sm",asChild:!0,className:"gap-1 text-xs",children:e.jsxs(l,{to:p(t),children:[e.jsx(K,{className:"h-3.5 w-3.5"})," 前往比較"]})})]}),(i==null?void 0:i.url)&&e.jsx(n,{asChild:!0,size:"sm",className:"mt-1.5 w-full gap-1 text-xs",children:e.jsxs("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",children:["前往最平店舖 ",e.jsx(q,{className:"h-3.5 w-3.5"})]})})]})]},s.productId)})})})]}),e.jsx(_,{}),e.jsx(P,{})]})};function G(){return e.jsxs(m,{className:"mx-auto max-w-lg p-8 text-center md:p-12",children:[e.jsx(u,{className:"mx-auto mb-3 h-12 w-12 text-muted-foreground
11/40"}),e.jsx("h2",{className:"mb-2 text-lg font-semibold md:text-xl",children:"仲未有追蹤產品"}),e.jsx("p",{className:"mb-5 text-sm text-muted-foreground",children:"喺格價頁面按心心即可加入追蹤清單。"}),e.jsx(n,{asChild:!0,children:e.jsx(l,{to:"/review",children:"前往格價"})})]})}export{ge as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.