PageSourceSearch

https://www.ftu.org.hk/_nuxt/sZ0uN2G5.js

js ftu.org.hk collected 2026-10-02 17:37:32 UTC 13,663 bytes, 1 lines download raw bytes

1import{d as wt,f as Lt,h as Tt,ae as Ut,i as I,c as y,u as Mt,S as $t,k as Kt,l as m,o as _,m as t,y as k,e as s,t as c,w as ct,v as lt,p as E,q as Rt,E as qt,F as z,x as Q,C as G,G as P,cx as Ft,cy as xt,B as Yt,s as it,_ as Bt}from"./rNMPrltl.js";import{_ as Dt}from"./Cu3F01sb.js";/* empty css        *//* empty css        *//* empty css        */import{g as Ht}from"./amgjlrLq.js";import{m as Vt,p as D,s as Et,e as zt,l as Qt}from"./CiocIsmi.js";import{m as Gt,i as Jt,s as jt,c as Wt,f as Xt,l as Zt}from"./CfwGkrE3.js";import{r as ut,a as J}from"./reULBR4r.js";import{p as te,b as ee,d as se,e as rt,f as oe,c as ne}from"./C2IpH1DR.js";import{b as ae,c as L,d as j,e as W,f as X}from"./BoKaWBEY.js";const ce={class:"shop-checkout-pc-container"},le={class:"checkout-main"},ie={class:"checkout-left"},ue={class:"checkout-module pickup-module"},re=["src"],de={class:"module-title"},pe={key:0,class:"module-content"},he={class:"content-section"},me={class:"section-title"},_e={class:"form-row"},ve={class:"form-item"},fe={class:"form-label"},ke={class:"form-item"},ye={class:"form-label"},Pe={class:"phone-input-wrapper"},ge={class:"content-section"},Ne={class:"section-title"},be={class:"address-list"},Ie=["onClick"],Ce={class:"address-name"},Se={class:"address-text"},Oe={key:0,class:"address-hours"},Ae={class:"checkout-module delivery-module"},we={class:"module-header module-header-disabled"},Le=["src"],Te={class:"module-title"},Ue={class:"checkout-module product-module"},Me={class:"module-header product-header product-header-with-select"},$e={class:"module-title"},Ke={class:"product-list"},Re=["src","aria-checked","onClick"],qe={class:"product-image"},Fe={class:"product-info"},xe={class:"merchant-name"},Ye={class:"product-name"},Be={class:"product-qty"},De={class:"product-price-col"},He={class:"product-price"},Ve={key:0,class:"price-amount"},Ee={key:1,class:"price-connector"},ze={key:2,class:"price-points"},Qe={class:"price-points-num"},Ge={class:"price-points-label"},Je={key:0,class:"product-no-stock-msg"},je={class:"product-subtotal"},We={class:"subtotal-label"},Xe={class:"subtotal-amount"},Ze={key:0,class:"subtotal-amount-num"},ts={key:1,class:"subtotal-connector"},es={key:2,class:"subtotal-points"},ss={class:"subtotal-points-num"},os={class:"subtotal-points-label"},ns={class:"checkout-right"},as={class:"payment-module"},cs={class:"module-title"},ls={class:"payment-sub"},is={class:"sub-title"},us=["src"],rs={class:"amount-row"},ds={class:"amount-label"},ps={class:"amount-value"},hs={class:"amount-total"},ms={class:"total-label"},_s={class:"total-value"},vs={class:"payment-sub"},fs={class:"sub-title"},ks=["src"],ys={class:"amount-row"},Ps={class:"amount-label"},gs={class:"amount-value amount-value-points"},Ns=["src"],bs={key:0,class:"amount-row"},Is={class:"amount-label"},Cs={class:"amount-value amount-value-points"},Ss=["src"],Os=["src"],As={class:"amount-total"},ws={class:"total-label"},Ls={class:"total-value total-value-points"},Ts=["src"],Us=["disabled"],Ms=wt({__name:"pc",setup($s){const{t:a}=Lt(),Z=Tt(),dt=Ut(),g=I("PICKUP"),O=I(0),K=I(null),p=I([]),N=I(null),R=I(!1),q=ae(),v=I({name:"",phone:"",areaCode:"+852"}),pt=[{label:"+852",value:"+852"},{label:"+86",value:"+86"}],ht=n=>String(n)==="0",b=I([]),mt=I(0),F=y(()=>p.value.filter(n=>n.checked!==!1)),tt=y(()=>p.value.length>0&&p.value.every(n=>n.checked!==!1)),_t=y(()=>!N.value||!p.value.length?!1:F.value.length===p.value.length&&p.value.every(n=>n.checked!==!1));function vt(n,o){return String(n.id||`${n.productId||""}_${n.payMethod||"ONLY_AMOUNT"}_${o}`)}function ft(n){const o=p.value[n];o&&(o.checked=o.checked===!1)}function kt(){const n=!tt.value;p.value.forEach(o=>{o.checked=n})}const yt=y(()=>{var n,o;return(o=(n=b.value[O.value])==null?void 0:n.id)!=null?o:""});function x(n){var o;return Jt(n,{deliveryType:g.value,selectedShopId:yt.value,productStockList:(o=N.value)==null?void 0:o.productStockList})}const Pt=y(()=>{const n=F.value;return n.length?n.every(o=>!x(o)):!1}),C=n=>{var f;const o=n.payMethod||"ONLY_AMOUNT",u=q.value;let d=0,h=0;o==="ONLY_AMOUNT"?d=L(u,n):o==="ONLY_POINT"?h=j(u,n):o==="AMOUNT_POINT"?(d=W(u,n),h=X(u,n)):d=L(u,n);const l=(f=n.quantity)!=null?f:1,e=d*l,i=h*l;return o==="ONLY_AMOUNT"?{amount:`HK$ ${e}`,pointsNum:null,pointsLabel:null}:o==="ONLY_POINT"?{amount:null,pointsNum:String(i),pointsLabel:a("shop.points")}:o==="AMOUNT_POINT"?{amount:`HK$ ${e}`,pointsNum:String(i),pointsLabel:a("shop.points")}:{amount:`HK$ ${e}`,pointsNum:null,pointsLabel:null}};Mt({title:a("shop.checkoutTitle")});const Y=y(()=>{var d,h;if(_t.value&&N.value)return{amount:(d=N.value.totalAmount)!=null?d:0,points:(h=N.value.totalPoints)!=null?h:0};let n=0,o=0;const u=q.value;return F.value.forEach(l=>{var M;const e=(M=l.quantity)!=null?M:1,i=l.payMethod||"ONLY_AMOUNT";let f=0,A=0;i==="ONLY_AMOUNT"?f=L(u,l):i==="ONLY_POINT"?A=j(u,l):i==="AMOUNT_POINT"?(f=W(u,l),A=X(u,l)):f=L(u,l);const T=f*e,U=A*e;i==="ONLY_AMOUNT"?n+=T:i==="ONLY_POINT"?o+=U:i==="AMOUNT_POINT"&&(n+=T,o+=U)}),{amount:n,points:o}}),H=y(()=>Y.value.points),S=y(()=>{const{amount:n,points:o}=Y.value;return n>0&&o>0?{amount:`HK$ ${n}`,pointsNum:String(o),pointsLabel:a("shop.points")}:o>0?{amount:null,pointsNum:String(o),pointsLabel:a("shop.points")}:{amount:`HK$ ${n}`,pointsNum:null,pointsLabel:null}}),et=y(()=>Y.value.amount),gt=y(()=>{var o;
1return(((o=K.value)!=null?o:0)-H.value+mt.value).toLocaleString()}),Nt=async()=>{var A,T,U,M,st,ot,nt;if(!((A=p.value)!=null&&A.length)){P.warning(a("common.noData")||"购物车为空");return}const n=F.value;if(!n.length){P.warning(a("shop.checkoutSelectAtLeastOne"));return}if(n.some(r=>x(r))){P.warning(a("shop.checkoutCannotPayDueToStock"));return}const o=((T=n[0])==null?void 0:T.deptId)||((U=n[0])==null?void 0:U.deptName)||"";if(!o){P.warning(a("shop.checkoutDeptRequired")||"缺少工会信息");return}if(g.value==="PICKUP"){if(!((M=v.value.name)!=null&&M.trim())){P.warning(a("shop.checkoutNameRequired")||"请输入姓名");return}if(!((st=v.value.phone)!=null&&st.trim())){P.warning(a("shop.checkoutPhoneRequired")||"请输入电话");return}if(!((ot=b.value)!=null&&ot.length)){P.warning(a("shop.checkoutSelectPickupAddress")||"请选择取货地址");return}}const u=g.value==="PICKUP"&&b.value[O.value]?b.value[O.value].id:"",d=((nt=v.value.name)==null?void 0:nt.trim())||"",h=`${v.value.areaCode||""}${v.value.phone||""}`.trim(),l=q.value,e=n.map(r=>{var at;const w=Math.max(1,(at=r.quantity)!=null?at:1),V=r.payMethod||"ONLY_AMOUNT";let $=0,B=0;V==="ONLY_AMOUNT"?$=L(l,r):V==="ONLY_POINT"?B=j(l,r):V==="AMOUNT_POINT"?($=W(l,r),B=X(l,r)):$=L(l,r);const Ot=$*w,At=Math.round(B*w);return{productId:String(r.productId||r.id||""),quantity:w,payMethod:r.payMethod||"ONLY_AMOUNT",...r.id?{cartItemId:r.id}:{},frontUnitAmount:$,frontUnitPoints:Math.round(B),frontTotalAmount:Ot,frontTotalPoints:At}}),{amount:i,points:f}=Y.value;R.value=!0;try{const r=await Et({deptId:o,itemList:e,isSubmitOrder:!0,shopId:g.value==="PICKUP"?u:void 0,receiverName:g.value==="PICKUP"?d:void 0,receiverPhone:g.value==="PICKUP"?h:void 0,frontTotalAmount:i,frontTotalPoints:f});if(!r){P.error(a("shop.checkoutSubmitFailed")||"提交失败,请重试");return}const w=i>0;if(!w&&"onlyPointsOrder"in r&&r.onlyPointsOrder===!0&&r.orderKey){Z.push({path:"/shop/paySuccess",query:{orderNumber:r.orderKey}});return}if(w&&"onlyPointsOrder"in r&&r.onlyPointsOrder===!0){P.error(a("shop.checkoutSubmitFailed")||"提交失败,请重试");return}typeof window<"u"&&window.sessionStorage&&sessionStorage.setItem("mallPaymentRequest",JSON.stringify(r)),Z.push({path:"/externalPaymentTwo",query:{type:"mall"}})}catch(r){P.error((r==null?void 0:r.message)||a("shop.checkoutSubmitFailed")||"提交失败,请重试")}finally{R.value=!1}},bt=async()=>{var n;try{const o=await Ht();K.value=(n=o==null?void 0:o.availablePoint)!=null?n:0}catch{K.value=null}},It=async()=>{var n,o;try{const[u,d]=await Promise.all([Ft(),xt()]),h=(o=(n=d==null?void 0:d.mobile)!=null?n:u==null?void 0:u.mobile)!=null?o:"",{areaCode:l,localNumber:e}=jt(h),i=Wt(u==null?void 0:u.nickname);i&&(v.value.name=i),e&&(v.value.phone=e),l&&(v.value.areaCode=l)}catch{}},Ct=async()=>{const n=te();let o=!1,u=!1;try{let d;if(n)o=!0,d=[ee(n)];else{const e=se(),i=await zt();if(!i||i.length===0){e&&e.length&&rt(),p.value=[],N.value=null;return}if(e&&e.length>0?(u=!0,d=oe(i,e)):d=Xt(i,dt),!d.length){p.value=[],N.value=null;return}}const{productList:h,settlement:l}=await Zt(d,{loggedIn:q.value});p.value=h.map(e=>{var i;return{...e,checked:(i=e.checked)!=null?i:!0}}),N.value=l}catch{p.value=[],N.value=null}finally{o&&ne(),u&&rt()}},St=async()=>{var d,h;const n=p.value.filter(l=>l.checked!==!1),o=n.map(l=>l.productId||l.id).filter(Boolean),u=((d=n[0])==null?void 0:d.deptId)||((h=n[0])==null?void 0:h.deptName)||"";if(!o.length){b.value=[];return}try{const l=await Qt({deptId:u,productIds:o,onlyHasStock:!1});b.value=(l||[]).map(e=>({id:e.id,storeName:e.shopName,address:e.shopAddress,hours:e.shopBusinessTime||""})),b.value.length>0&&(O.value=0)}catch{b.value=[]}};return $t(p,()=>St(),{deep:!0}),Kt(async()=>{bt(),await Promise.all([Ct(),It()])}),(n,o)=>{var l;const u=Yt,d=qt,h=Dt;return _(),m("div",ce,[t("div",le,[t("div",ie,[t("div",ue,[t("div",{class:"module-header",onClick:o[0]||(o[0]=e=>g.value="PICKUP")},[t("img",{src:s(g)==="PICKUP"?s(ut):s(J),class:"radio-icon",alt:""},null,8,re),t("span",de,c(s(a)("shop.checkoutSelfPickup")),1)]),s(g)==="PICKUP"?(_(),m("div",pe,[t("div",he,[t("div",me,c(s(a)("shop.checkoutEnterInfo")),1),t("div",_e,[t("div",ve,[t("label",fe,c(s(a)("shop.checkoutName")),1),ct(t("input",{"onUpdate:modelValue":o[1]||(o[1]=e=>s(v).name=e),type:"text",class:"form-input"},null,512),[[lt,s(v).name]])]),t("div",ke,[t("label",ye,c(s(a)("shop.checkoutPhone")),1),t("div",Pe,[E(d,{modelValue:s(v).areaCode,"onUpdate:modelValue":o[2]||(o[2]=e=>s(v).areaCode=e),class:"phone-area-select","popper-class":"checkout-phone-
1area-dropdown"},{default:Rt(()=>[(_(),m(z,null,Q(pt,e=>E(u,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),o[4]||(o[4]=t("div",{class:"phone-input-divider"},null,-1)),ct(t("input",{"onUpdate:modelValue":o[3]||(o[3]=e=>s(v).phone=e),type:"text",class:"phone-number-input"},null,512),[[lt,s(v).phone]])])])])]),t("div",ge,[t("div",Ne,c(s(a)("shop.checkoutSelectPickupAddress")),1),t("div",be,[(_(!0),m(z,null,Q(s(b),(e,i)=>(_(),m("div",{key:i,class:it(["address-item",{selected:s(O)===i}]),onClick:f=>O.value=i},[t("div",Ce,c(e.storeName),1),t("div",Se,c(e.address),1),ht(e.id)?k("",!0):(_(),m("div",Oe,c(s(a)("shop.checkoutBusinessHours"))+": "+c(e.hours),1))],10,Ie))),128))])])])):k("",!0)]),t("div",Ae,[t("div",we,[t("img",{src:s(J),class:"radio-icon",alt:""},null,8,Le),t("span",Te,c(s(a)("shop.checkoutDelivery")),1)])]),t("div",Ue,[t("div",Me,[t("span",$e,c(s(a)("shop.checkoutProductDetails")),1),s(p).length>1?(_(),m("button",{key:0,type:"button",class:"select-all-btn",onClick:kt},c(s(tt)?s(a)("shop.checkoutDeselectAll"):s(a)("shop.checkoutSelectAll")),1)):k("",!0)]),t("div",Ke,[(_(!0),m(z,null,Q(s(p),(e,i)=>(_(),m("div",{key:vt(e,i),class:it(["product-item",{"is-unchecked":e.checked===!1,"is-no-stock-at-shop":x(e)}])},[t("img",{src:e.checked!==!1?s(ut):s(J),class:"product-check-icon",alt:"",role:"checkbox","aria-checked":e.checked!==!1,onClick:f=>ft(i)},null,8,Re),t("div",qe,[E(h,{src:e.publicizeImage||e.image||e.productImage,class:"img",alt:""},null,8,["src"])]),t("div",Fe,[t("div",xe,c(e.deptName||e.unionName||""),1),t("div",Ye,c(e.productName||e.name||""),1),t("div",Be,c(s(a)("shop.checkoutQuantity"))+" x"+c(e.quantity||1),1)]),t("div",De,[t("div",He,[C(e).amount?(_(),m("span",Ve,c(C(e).amount),1)):k("",!0),C(e).amount&&C(e).pointsNum?(_(),m("span",Ee," + ")):k("",!0),C(e).pointsNum?(_(),m("span",ze,[t("span",Qe,c(C(e).pointsNum),1),t("span",Ge,c(C(e).pointsLabel),1)])):k("",!0)]),x(e)?(_(),m("div",Je,c(s(a)("shop.checkoutNoStockAtShop")),1)):k("",!0)])],2))),128))]),t("div",je,[t("span",We,c(s(a)("shop.cartSubtotal")),1),t("span",Xe,[s(S).amount?(_(),m("span",Ze,c(s(S).amount),1)):k("",!0),s(S).amount&&s(S).pointsNum?(_(),m("span",ts," + ")):k("",!0),s(S).pointsNum?(_(),m("span",es,[t("span",ss,c(s(S).pointsNum),1),t("span",os,c(s(S).pointsLabel),1)])):k("",!0)])])])]),t("div",ns,[t("div",as,[t("div",cs,c(s(a)("shop.checkoutPaymentDetails")),1),t("div",ls,[t("div",is,[t("img",{src:s(Vt),class:"sub-icon",alt:""},null,8,us),t("span",null,c(s(a)("shop.checkoutPayment")),1)]),t("div",rs,[t("span",ds,c(s(a)("shop.cartSubtotal")),1),t("span",ps,"HK$ "+c(s(et)),1)]),t("div",hs,[t("span",ms,c(s(a)("shop.checkoutTotalPayment")),1),t("span",_s,"HK$ "+c(s(et)),1)])]),t("div",vs,[t("div",fs,[t("img",{src:s(D),class:"sub-icon",alt:""},null,8,ks),t("span",null,c(s(a)("shop.points")),1)]),t("div",ys,[t("span",Ps,c(s(a)("shop.checkoutAvailablePoints")),1),t("span",gs,[t("img",{src:s(D),class:"amount-point-icon",alt:""},null,8,Ns),G(" "+c(((l=s(K))!=null?l:0).toLocaleString()),1)])]),s(H)>0?(_(),m("div",bs,[t("span",Is,c(s(a)("shop.checkoutUsedPoints")),1),t("span",Cs,[t("img",{src:s(Gt),class:"amount-sign-icon amount-minus-icon",alt:""},null,8,Ss),t("img",{src:s(D),class:"amount-point-icon",alt:""},null,8,Os),G(" "+c(s(H)),1)])])):k("",!0),t("div",As,[t("span",ws,c(s(a)("shop.checkoutRemainingPoints")),1),t("span",Ls,[t("img",{src:s(D),class:"amount-point-icon",alt:""},null,8,Ts),G(" "+c(s(gt)),1)])])]),t("button",{class:"confirm-btn",disabled:s(R)||!s(Pt),onClick:Nt},c(s(R)?s(a)("shop.checkoutSubmitting"):s(a)("shop.checkoutConfirmPayment")),9,Us)])])])])}}}),zs=Bt(Ms,[["__scopeId","data-v-14fa3103"]]);export{zs 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.