PageSourceSearch

https://www.cashback.com.tw/assets/js/ShoplineApplyStatus-BLaMr3vc.js

js cashback.com.tw collected 2026-10-06 23:51:41 UTC 3,794 bytes, 1 lines download raw bytes

1import{F as j,r as l,I as h,j as e,av as f,aw as S,ax as y,ay as N,M as c,L as w}from"./index-Ra6VjJ-9.js";import{S as v}from"./SEO-QS61Zyui.js";import{B as C}from"./badge-CjqAsro2.js";import{s as d,c as A}from"./shoplineOnboardingConsentStorage-DOOZNINQ.js";import{S as R}from"./ShoplineApplyShell-2t5PWFAg.js";import{C as k}from"./clock-D6Br2ppR.js";import{T as E}from"./triangle-alert-l7jpZO-l.js";import{R as x}from"./refresh-cw-CcmaCvr1.js";import{E as O}from"./external-link-oDVWEL5A.js";import"./Helmet-9YOMzIf9.js";const L=a=>a==="rejected",B=a=>{let t=!1;return async()=>{if(t)return!1;t=!0;try{if((await a.logout())?.LoggedOut!==!0)throw new Error("無法清除舊申請登入狀態");a.clearConsent();const r=await a.startOAuth("/shopline/apply/consent");if(!r?.AuthorizeUrl)throw new Error("缺少 Shopline 登入網址");return a.redirect(r.AuthorizeUrl),!0}catch(n){throw t=!1,n}}},F={not_submitted:{label:"尚未送出",className:"border-gray-300 text-gray-700"},pending:{label:"待審核",className:"border-amber-300 bg-amber-50 text-amber-700"},approved:{label:"已核准",className:"border-emerald-300 bg-emerald-50 text-emerald-700"},rejected:{label:"已拒絕",className:"border-red-300 bg-red-50 text-red-700"}},G=()=>{const a=j(),[t,n]=l.useState(null),[r,p]=l.useState(!0),[o,m]=l.useState(!1),g=l.useMemo(()=>B({logout:()=>d.logout(),clearConsent:A,startOAuth:s=>d.startOAuth(s),redirect:s=>window.location.assign(s)}),[]),i=l.useCallback(async()=>{p(!0);try{const s=await d.getStatus();n(s||null)}catch(s){console.error("查詢 Shopline 申請狀態失敗:",s),h.error("請先完成 Shopline 授權"),a("/shopline/apply",{replace:!0})}finally{p(!1)}},[a]);l.useEffect(()=>{i()},[i]);const b=async()=>{if(!o){m(!0);try{await g()}catch(s){console.error("重新開始 Shopline 商家申請失敗:",s),h.error("無法重新開始申請,請稍後再試"),m(!1)}}},u=F[t?.Status||""]||{label:t?.Status||"未知",className:"border-gray-300 text-gray-700"};return e.jsxs(R,{children:[e.jsx(v,{title:"Shopline 商家申請狀態|CashBack 返多多",description:"查詢 Shopline 商家申請審核狀態",url:"/shopline/apply/status",type:"website"}),e.jsx("div",{className:"container mx-auto max-w-3xl px-4 py-16",children:e.jsxs(f,{children:[e.jsx(S,{children:e.jsxs(y,{className:"flex items-center gap-2 text-2xl",children:[e.jsx(k,{className:"h-6 w-6 text-gray-700"}),"申請狀態"]})}),e.jsxs(N,{className:"space-y-6",children:[r?e.jsx("p",{className:"text-gray-600",children:"查詢中..."}):t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"rounded-md border bg-gray-50 p-4",children:[e.jsx("div",{className:"text-sm text-gray-500",children:"審核狀態"}),e.jsx(C,{variant:"outline",className:`mt-2 ${u.className}`,children:u.label})]}),t.ApplicationID&&e.jsxs("div",{className:"rounded-md border bg-gray-50 p-4",children:[e.jsx("div",{className:"text-sm text-gray-500",children:"申請編號"}),e.jsx("div",{className:"mt-1 font-mono text-gray-950",children:t.ApplicationID})]}),t.RejectionReason&&e.jsxs("div",{className:"flex gap-3 rounded-md border border-red-200 bg-red-50 p-4 text-red-800",children:[e.jsx(E,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("div",{children:t.RejectionReason})]})]}):null,e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsxs(c,{onClick:i,disabled:r||o,variant:"outline",children:[e.jsx(x,{className:`h-4 w-4 ${r?"animate-spin":""}`}),"重新查詢"]}),L(t?.Status)&&e.jsxs(c,{onClick:b,disabled:r||o,children:[o?e.jsx(x,{className:"h-4 w-4 animate-spin"}):e.jsx(O,{className:"h-4 w-4"}),o?"正在前往 Shopline...":"重新登入 Shopline 並申請"]}),t?.Status==="not_submitted"&&e.jsx(c,{asChild:!0,children:e.jsx(w,{to:"/shopline/apply/form",children:"回到申請表"})})]})]})]})})]})};export{G 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.