PageSourceSearch

https://www.yulon-gm.com.tw/_nuxt/Cu2SM-76.js

js yulon-gm.com.tw collected 2026-10-07 18:56:45 UTC 5,550 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./C9coexus.js","./D0tXqPSO.js","./entry.BS9mRCZf.css"])))=>i.map(i=>d[i]);
2import{a7 as P,a3 as V,ao as B,o as D,af as U,a2 as T,v as m,x as C,B as u,k as t,F as K,P as E,J as S,y as W,r as _}from"#entry";import{_ as X}from"./CwWaAqBZ.js";import{_ as $}from"./CWdZSodX.js";import{u as q}from"./D_eNtEtI.js";import{u as j}from"./Dmye0YN3.js";import{u as G}from"./CZSOAS9s.js";import"./Cm-Jt2Ds.js";const J={class:"wrap"},z={class:"my-[160px] text-center"},H={key:0,class:"flex flex-col items-center"},Q={class:"mt-4 text-lg text-gray-600"},Y={key:1},Z={class:"text-red-500 text-lg"},ee={key:0,class:"mt-6"},te=["href"],fe={__name:"addlineoa",setup(se){P({title:"加入官方帳號 - 慶通汽車"});const{Members:b,Survey:A}=q(),R=V(),i=j(),{toast:r}=B(i),F=G(),v=_(!0),c=_("載入中..."),d=_(null),w=_(!1),y=_(null);let I=null;const N=()=>{const s=R.query,n=s["liff.state"]?.replace(/^\//,"")||"",e=n?Object.fromEntries(new URLSearchParams(n.startsWith("?")?n:`?${n}`)):{},a=s.linelink||e.linelink,l=s.shareCode||e.shareCode,g=s.lineoaid||e.lineoaid;return a&&l&&g&&(sessionStorage.setItem("surveyAdd_lineLink",a),sessionStorage.setItem("surveyAdd_shareCode",l),sessionStorage.setItem("surveyAdd_lineOAId",g)),{lineLink:a||sessionStorage.getItem("surveyAdd_lineLink"),shareCode:l||sessionStorage.getItem("surveyAdd_shareCode"),lineOAId:g||sessionStorage.getItem("surveyAdd_lineOAId")}},O=()=>{["surveyAdd_lineLink","surveyAdd_shareCode","surveyAdd_lineOAId","surveyAdd_referralCreated"].forEach(s=>sessionStorage.removeItem(s))},f=()=>{I?.isInClient()?I.closeWindow():history.back()},M=async s=>{for(let e=0;e<5;e++){if((await s.getFriendship()).friendFlag)return!0;e===0&&(w.value=!0,c.value="請先加入官方帳號好友"),e<4&&await new Promise(l=>setTimeout(l,3e3))}return!1};return D(async()=>{try{const{lineLink:s,shareCode:o,lineOAId:n}=N();if(!o||!n){d.value="缺少必要參數";return}s&&(y.value=s);const e=(await U(async()=>{const{default:p}=await import("./C9coexus.js");return{default:p}},__vite__mapDeps([0,1,2]),import.meta.url)).default;I=e;const a=await b.getLiffId("recommendAdd",n);if(a.code!=="200"||!a.data?.liffId)throw new Error("無法取得 LIFF ID");if(e.id||await e.init({liffId:a.data.liffId}),!e.isInClient()){d.value="請透過手機 LINE App 開啟";return}if(!e.isLoggedIn()){e.login({redirectUri:`${window.location.origin}/survey/addlineoa`});return}const l=await e.getProfile(),h=e.getDecodedIDToken().sub,x=l.displayName;if(!sessionStorage.getItem("surveyAdd_referralCreated")){c.value="記錄中...";const p=await A.createReferral({shareCode:o,inviteeProviderKey:h,lineOAId:Number(n),inviteeDisplayName:x},{silent:!0});if(p.code!=="200"){i.showError(p.message||"發生錯誤,請稍後再試",{title:"慶通汽車提醒您",autoClose:!1,btnShowConfirm:!0,btnConfirmText:"確定",onConfirm:f});return}sessionStorage.setItem("surveyAdd_referralCreated","true")}c.value="檢查會員狀態...";const k=await b.checkSocialExistence({loginProvider:"Line",providerKey:h});if(k.code==="200"&&!k.data?.isExist){F.setSocialData({provider:"Line",providerKey:h,name:x,email:null,lineOAId:Number(n),service:"recommendAdd"}),sessionStorage.setItem("login_redirect","/survey/addlineoa"),await T("/customer/register?mode=socialBinding",{replace:!0});return}if(c.value="檢查好友狀態...",v.value=!1,!await M(e)){d.value="尚未偵測到您已加入好友,請確認已點選加入後再重試";return}w.value=!1;const L=await A.completeReferral({inviteeProviderKey:h,shareCode:o,lineOAId:Number(n)});L.code==="200"?(O(),i.showSuccess("感謝您的加入!",{title:"慶通汽車提醒您",autoClose:!1,btnShowConfirm:!0,btnConfirmText:"確定",onConfirm:f})):i.showError(L.message||"發生錯誤,請稍後再試",{title:"慶通汽車提醒您",autoClose:!1,btnShowConfirm:!0,btnConfirmText:"確定",onConfirm:f})}catch(s){if(console.error("LIFF 錯誤:",s),s?.response?.status===409){const o=s.response._data?.message||"該用戶已被推薦,請先完成註冊流程";i.showWarning(o,{title:"慶通汽車提醒您",autoClose:!1,btnShowConfirm:!0,btnConfirmText:"前往註冊",btnShowCancel:!0,btnCancelText:"取消",onConfirm:()=>T("/customer/login"),onCancel:f})}else if(s?.response){const o=s.response._data?.message||"發生錯誤,請稍後再試";i.showError(o,{title:"慶通汽車提醒您",autoClose:!1,btnShowConfirm:!0,btnConfirmText:"確定",onConfirm:f})}else d.value="操作失敗,請稍後再試"}finally{v.value=!1}}),(s,o)=>{const n=X,e=$;return m(),C("div",J,[u("div",z,[t(v)?(m(),C("div",H,[K(n),u("p",Q,E(t(c)),1)])):t(d)?(m(),C("div",Y,[u("p",Z,E(t(d)),1),t(w)&&t(y)?(m(),C("div",ee,[u("a",{href:t(y),target:"_blank",class:"inline-block px-6 py-3 bg-[#06C755] text-white rounded-lg text-base font-medium"}," 加入官方帳號好友 ",8,te),o[1]||(o[1]=u("p",{class:"mt-3 text-sm text-gray-500"},"加入好友後將自動繼續流程",-1))])):S("",!0)])):S("",!0)]),t(r)?(m(),W(e,{key:0,modelValue:t(r).show,"onUpdate:modelValue":o[0]||(o[0]=a=>t(r).show=a),"msg-status":t(r).type,"msg-title":t(r).title,"msg-content":t(r).message,"btn-show-cancel":t(r).btnShowCancel,"btn-show-confirm":t(r).btnShowConfirm,"btn-confirm-text":t(r).btnConfirmText,"btn-cancel-text":t(r).btnCancelText,onClose:t(i).handleCancel,onConfirm:t(i).handleConfirm},null,8,["modelValue","msg-status","msg-title","msg-content","btn-show-cancel","btn-show-confirm","btn-confirm-text","btn-cancel-text","onClose","onConfirm"])):S("",!0)])}}};export{fe 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.