2 lines
20 KiB
JavaScript
2 lines
20 KiB
JavaScript
import{b as de,c as ue,B as me,I as G}from"./yM3z5qW0.js";import{d as b,C as a,k as q,r as j,J as oe,u as W,Q as Y,H as P,ag as T,dd as J,ah as K,y as c,z as r,A as t,S as x,I as e,a6 as Q,B as o,a1 as U,a2 as D,bm as _e,ai as pe,U as M,D as _,F as k,E as S,a3 as F,au as ve,a0 as fe,d8 as ge,a8 as he,o as xe}from"./BAjARngS.js";import{m as H,l as ye,c as ne}from"./QwKuTeKk.js";import{_ as $e}from"./bZLhHpjY.js";import{e as Se,f as be}from"./CjKkvmcb.js";import{S as ke}from"./Cs5Y0TzT.js";import{u as I}from"./B-NRJSso.js";import{p as E}from"./BhyLDQnJ.js";import{B,u as we}from"./sroyubh1.js";import{B as L}from"./DlKYmSOP.js";import{e as X}from"./DWEdiVkG.js";import{_ as N}from"./C5gzKFf9.js";import{B as Ce}from"./CYmASLfI.js";import{A as Ie,g as Pe,_ as Ae}from"./CECqBpEI.js";import{C as Ue}from"./CRrCupn2.js";import"./Cli8zMmH.js";import{_ as je,R as Z}from"./PgKwocdp.js";import{O as ze}from"./CF6CnGvi.js";import{_ as Be}from"./DlAUqK2U.js";import"./n5o86z8W.js";import"./CRKy6TM5.js";import"./DjvBa-1E.js";import"./BpD_6mz8.js";import"./CLgN2r-F.js";import"./B8AwamLT.js";import"./CscEAC8U.js";import"./B7wqwN_w.js";import"./Ca60TAIM.js";import"./BvUK-b93.js";import"./dWia4Hno.js";import"./DyeV-5jh.js";import"./D8uJfFT-.js";import"./CokIlSLI.js";import"./DX3u28oT.js";import"./D6qJbdzf.js";import"./DSADCaFZ.js";import"./3l5V6q_Q.js";import"./DplKu3xL.js";import"./N95fDo6C.js";import"./DlKvdlGZ.js";import"./CGvvlX7g.js";import"./B_BgEfll.js";import"./GS5tzE_p.js";import"./-2fOlCHx.js";import"./CS-3Sg0Y.js";import"./DPwDOHKb.js";import"./CpBL-IIx.js";import"./_8s0YEqS.js";import"./Lb6ve5HJ.js";import"./BSFNXxy5.js";import"./BrC2YlYe.js";import"./DZj86G17.js";import"./Cj99RmFE.js";import"./DWSY5jUG.js";import"./DWxdb7Mz.js";import"./D-fG2MNR.js";import"./haC2wmdZ.js";import"./D19XOyLS.js";import"./C9DHwG_R.js";import"./DLjY2jVd.js";import"./D6G6qshU.js";import"./DAkDyVa1.js";import"./DQB7sloh.js";import"./CYrqpEEi.js";import"./4rHVhLBf.js";import"./C18GdnBI.js";import"./CrnD3mgQ.js";const[ae,ee]=ne("steps"),Le={active:ye(0),direction:H("horizontal"),activeIcon:H("checked"),iconPrefix:String,finishIcon:String,activeColor:String,inactiveIcon:String,inactiveColor:String},re=Symbol(ae);var Oe=b({name:ae,props:Le,emits:["clickStep"],setup(p,{emit:i,slots:s}){const{linkChildren:d}=de(re);return d({props:p,onClickStep:n=>i("clickStep",n)}),()=>{var n;return a("div",{class:ee([p.direction])},[a("div",{class:ee("items")},[(n=s.default)==null?void 0:n.call(s)])])}}});const[Ne,C]=ne("step");var De=b({name:Ne,setup(p,{slots:i}){const{parent:s,index:d}=ue(re);if(!s)return;const l=s.props,n=()=>{const v=+l.active;return d.value<v?"finish":d.value===v?"process":"waiting"},m=()=>n()==="process",u=q(()=>({background:n()==="finish"?l.activeColor:l.inactiveColor})),f=q(()=>{if(m())return{color:l.activeColor};if(n()==="waiting")return{color:l.inactiveColor}}),$=()=>s.onClickStep(d.value),z=()=>{const{iconPrefix:v,finishIcon:h,activeIcon:A,activeColor:w,inactiveIcon:O}=l;return m()?i["active-icon"]?i["active-icon"]():a(G,{class:C("icon","active"),name:A,color:w,classPrefix:v},null):n()==="finish"&&(h||i["finish-icon"])?i["finish-icon"]?i["finish-icon"]():a(G,{class:C("icon","finish"),name:h,color:w,classPrefix:v},null):i["inactive-icon"]?i["inactive-icon"]():O?a(G,{class:C("icon"),name:O,classPrefix:v},null):a("i",{class:C("circle"),style:u.value},null)};return()=>{var v;const h=n();return a("div",{class:[me,C([l.direction,{[h]:h}])]},[a("div",{class:C("title",{active:m()}),style:f.value,onClick:$},[(v=i.default)==null?void 0:v.call(i)]),a("div",{class:C("circle-container"),onClick:$},[z()]),a("div",{class:C("line"),style:u.value},null)])}}});const te=W(),g=j(0),V=j(!1),le=oe(),R=P(),y=T();q(()=>g.value==0?R.useString("submitOrder"):R.useString("completeOrder"));const ce=async()=>{try{if(V.value=!0,!le.user){await te.push({name:"auth-login",query:{back:"cart_address"}}),Y.warn(R.useString("pleaseLoginOrRegister"));return}if(g.value==0){g.value=1;return}const p={address:y.address,address_id:y.address?.id,payment_type:y.payment_type,note:"",total_discounts:y.sumDiscount,total_price:y.sumCart,total_tax:0,sum_gold:y.sumGoldPrice,sum_silver:y.sumSilverPrice,profit:y.sumDiscount,percent_profit:y.sumPercentProfit,items:y.list.map(s=>{const{price:d,qty:l,title:n,profit:m,discountPercent:u}=J(s.product);return{title:n.value,note:"",qty:l.value,total_price:l.value*d.value,variant_id:s.variant?.id??void 0,price:d.value,collection_id:s.product.collection_id,product_id:s.product.id,discount:0,profit:m.value,percent_profit:u.value}})},i=await Se(p);if(y.payment_type==3){const s=await be(i.id,"zarinpall");await se(),s.url&&(window.location.href=s.url)}else await se(),Y.success(R.useString("orderSubmitted")),await te.replace({name:"cart-id",params:{id:i.id}}),g.value=2;y.reset()}catch(p){console.log(p)}finally{V.value=!1}};async function se(){await le.getUserInfo(),await R.getConfig()}const Re=""+new URL("empty_cart.BKAjJ1Mc.svg",import.meta.url).href,Ee={class:"flex justify-between"},Te={class:"flex items-center w-full"},Ge={class:"h-6rem w-6rem"},qe=["alt"],Me={class:"h-full ps-4 pt-2 w-5/6 flex-1"},Fe={class:"font-semibold truncate text-sm"},Ve={key:0,class:"flex mt1 text-gray-8"},We={class:"text-xs"},Je={key:0},Ke={key:1,class:"h-2"},Qe={key:2,class:"flex gap-1 text-xs"},Ye={class:"font-semibold"},He={key:3,class:"flex gap-1 text-xs"},Xe={class:"font-semibold"},Ze={class:"flex justify-between w-full items-end"},et={class:"flex flex-col font-bold me-3"},tt={key:0,class:"font-medium text-gray-400 text-xs line-through"},st={class:"text-sm"},it={class:"text-xs text-end"},ot={key:0,class:"py-4 mx-3"},ie=b({__name:"CartItem",props:{cartItem:{},isLast:{type:Boolean}},setup(p){const i=p,s=j(i.cartItem.variant?.variant_attribute_values?.map(v=>v.attribute_values.value)),d=T(),l=P(),{originalImage:n,qty:m,price:u,title:f,hasDiscount:$,originalPrice:z}=J(i.cartItem.product,i.cartItem.variant);return(v,h)=>{const A=K("lazy");return r(),c("div",null,[t("div",Ee,[t("div",Te,[a(B,{icon:"vuesax-linear:add",class:"rotate-45",onClick:h[0]||(h[0]=w=>e(d)?.removeProduct(i.cartItem.product.id))}),t("div",Ge,[Q(t("img",{alt:e(l).appName.en,class:"bg-zinc-1 w-full aspect-square rounded-2xl object-contain ms-2"},null,8,qe),[[A,{src:e(n),loading:e(E),error:e(E)}]])]),t("div",Me,[t("div",Fe,o(e(f)),1),s.value&&s.value?.length!==0?(r(),c("div",Ve,[(r(!0),c(U,null,D(s.value,(w,O)=>(r(),c("div",{class:"flex items-center ms1",key:O},[t("div",We,o(w),1),s.value.length-1!==O?(r(),c("div",Je,",")):x("",!0)]))),128))])):(r(),c("div",Ke)),i.cartItem.product?.weight?(r(),c("div",Qe,[t("div",Ye,o(e(l).useString("weight"))+":",1),t("div",null,o(i.cartItem.product?.weight)+" "+o(e(l).useString("gram")),1)])):x("",!0),i.cartItem.product?.weight?(r(),c("div",He,[t("div",Xe,o(e(l).useString("fee"))+":",1),t("div",null,o(i.cartItem.product?.percent_fee)+" %",1)])):x("",!0),t("div",Ze,[a(ke,{value:e(m),"onUpdate:value":h[1]||(h[1]=w=>_e(m)?m.value=w:null),countAdd:i.cartItem.product?.sell_type==="box"?i.cartItem.product?.box_size:1,class:"w-30 mt-5"},null,8,["value","countAdd"]),t("div",et,[e($)?(r(),c("span",tt,o(e(I)(e(z),!0,"")),1)):x("",!0),t("span",st,o(e(I)(e(u),!0,"")),1),t("span",it,o(e(l).priceUnit),1)])])])])]),v.isLast?x("",!0):(r(),c("div",ot,h[2]||(h[2]=[t("div",{class:"h-2px bg-gray-3"},null,-1)])))])}}}),nt={class:"flex items-center mb-5 mt-2 gap-3"},at=["alt"],rt={class:"h-full"},lt={class:"font-bold"},ct={class:"text-sm text-gray-6"},dt={key:0},ut={key:1},mt={key:0,class:"w-full mt-5 text-end"},_t={class:"flex justify-between items-baseline"},pt={class:"text-sm"},vt={class:"flex gap-1 items-baseline"},ft={class:"font-bold"},gt={class:"text-xs"},ht={class:"flex justify-between items-baseline mt-2"},xt={class:"text-sm"},yt={class:"flex gap-1 items-baseline"},$t={class:"font-bold"},St={class:"text-xs"},bt={key:0,class:"flex justify-between items-baseline mt-2"},kt={class:"text-sm"},wt={class:"flex gap-1 items-baseline"},Ct={class:"font-bold"},It={class:"text-xs"},Pt={key:1,class:"flex justify-between items-baseline mt-2"},At={class:"text-sm"},Ut={class:"flex gap-1 items-baseline"},jt={class:"font-bold"},zt={class:"text-xs"},Bt={class:"flex justify-between items-baseline mt-2"},Lt={class:"text-sm"},Ot={class:"flex gap-1 items-baseline"},Nt={class:"font-bold"},Dt={class:"text-xs"},Rt={class:"flex flex-col items-center"},Et={class:"flex gap-1 items-baseline mt-2"},Tt={class:"font-bold text-xl"},Gt={key:1,class:"text-center mt-5 flex flex-col items-center"},qt=["src"],Mt={class:"text-xs text-gray-400"},Ft=b({__name:"CartList",setup(p){const i=T(),s=P(),d=j(!1);return(l,n)=>{const m=N,u=K("lazy");return r(),c("div",null,[e(i).list.length>0?(r(),c(U,{key:0},[t("div",nt,[Q(t("img",{alt:e(s).appName.en,class:"w-3rem aspect-square rounded-full"},null,8,at),[[u,{src:e(pe)(e(s).sellerConfig?.store?.avatar??""),loading:e(X),error:e(X)}]]),t("div",rt,[t("div",lt,o(e(s).sellerConfig?.store?.name??""),1),t("div",ct,o(e(s).useString("seller")),1)])]),a(m),a(M,{mode:"out-in",name:"slide-left"},{default:_(()=>[d.value?(r(),c("div",ut,[(r(!0),c(U,null,D(e(i).list,(f,$)=>(r(),k(ie,{key:f.product.id,"cart-item":f,isLast:e(i).list.length-1===$},null,8,["cart-item","isLast"]))),128))])):(r(),c("div",dt,[(r(!0),c(U,null,D(e(i).list.slice(0,3),(f,$)=>(r(),k(ie,{key:f.product.id,"cart-item":f,isLast:e(i).list.length<3?e(i).list.length-1===$:$===2},null,8,["cart-item","isLast"]))),128))]))]),_:1}),e(i).list.length>3?(r(),c("div",mt,[a(M,{mode:"out-in",name:"slide-right"},{default:_(()=>[d.value?(r(),k(L,{key:0,onClick:n[0]||(n[0]=f=>d.value=!d.value),size:"small"},{default:_(()=>[S(o(e(s).useString("less")),1)]),_:1})):(r(),k(L,{key:1,onClick:n[1]||(n[1]=f=>d.value=!d.value),size:"small"},{default:_(()=>[S(o(e(s).useString("more")),1)]),_:1}))]),_:1})])):x("",!0),a(m),t("div",null,[t("div",_t,[t("div",pt,o(e(s).useString("totalPrice"))+":",1),t("div",vt,[t("div",ft,o(e(I)(e(i).sumOriginalPrice,!0,"")),1),t("div",gt,o(e(s).priceUnit),1)])]),t("div",ht,[t("div",xt,o(e(s).useString("totalItems"))+":",1),t("div",yt,[t("div",$t,o(e(i).count),1),t("div",St,o(e(s).useString("item2")),1)])]),e(i).sumGoldPrice!==0?(r(),c("div",bt,[t("div",kt,o(e(s).useString("totalGoldWeight"))+":",1),t("div",wt,[t("div",Ct,o(e(i).sumGoldPrice),1),t("div",It,o(e(s).useString("gram")),1)])])):x("",!0),e(i).sumSilverPrice!==0?(r(),c("div",Pt,[t("div",At,o(e(s).useString("totalSilverWeight"))+":",1),t("div",Ut,[t("div",jt,o(e(i).sumSilverPrice),1),t("div",zt,o(e(s).useString("gram")),1)])])):x("",!0),t("div",Bt,[t("div",Lt,o(e(s).useString("yourProfit"))+":",1),t("div",Ot,[t("div",Nt,o(e(I)(e(i).sumDiscountCart,!0,"")),1),t("div",Dt,o(e(s).priceUnit),1)])])]),a(m),t("div",Rt,[t("div",null,o(e(s).useString("payable")),1),t("div",Et,[t("span",Tt,o(e(I)(e(i).sumCart,!0,"")),1),t("span",null,o(e(s).priceUnit),1)])]),a(L,{block:"",class:"mt-4",type:"primary",onClick:e(ce)},{default:_(()=>[S(o(e(s).useString("placeOrder")),1)]),_:1},8,["onClick"])],64)):(r(),c("div",Gt,[t("img",{src:e(Re),class:"w-40"},null,8,qt),t("span",Mt,o(e(s).useString("cartIsEmpty")),1)]))])}}}),Vt={class:"w-20 h-20 product-image !p-2"},Wt=["alt"],Jt=b({__name:"CartItemBadge",props:{cartItem:{}},setup(p){const{prefixCls:i}=we("cart-item-badge"),s=p,{originalImage:d}=J(s.cartItem.product);return(l,n)=>{const m=K("lazy");return r(),c("div",{class:F([e(i)])},[a(e(Ce),{count:s.cartItem.qty},{default:_(()=>[t("div",Vt,[Q(t("img",{alt:l.config.appName.en,class:"object-cover w-full h-full rounded-xl bg-zinc-100"},null,8,Wt),[[m,{src:e(d),loading:e(E),error:e(E)}]])])]),_:1},8,["count"])],2)}}}),Kt=""+new URL("add_address.CLIjEQ3m.svg",import.meta.url).href,Qt={class:"flex items-center justify-center"},Yt={class:"flex flex-col items-center"},Ht=["src","alt"],Xt=b({__name:"AddAddress",setup(p){const i=P(),s=j(!1);return(d,l)=>(r(),k(e(Ue),{class:"border-dashed border-primary cursor-pointer py-4",onClick:l[2]||(l[2]=n=>s.value=!0)},{default:_(()=>[t("div",Qt,[t("div",Yt,[t("img",{src:e(Kt),alt:e(i).appName.en},null,8,Ht),a(e(ve),{type:"link",class:"text-xl"},{default:_(()=>[S(o(e(i).useString("submitNewAddress")),1)]),_:1})])]),a(Ie,{open:s.value,"onUpdate:open":l[0]||(l[0]=n=>s.value=n),onSuccess:l[1]||(l[1]=n=>d.$emit("success"))},null,8,["open"])]),_:1}))}}),Zt={class:"w-full"},es={class:"card-padding-4"},ts={class:"flex flex-col gap-2 overflow-y-scroll max-h-90 w-full mt-3 none-scroll"},ss=b({__name:"SelectAddressModal",props:{open:{type:Boolean,default:!1},address:{default:null}},emits:["update:open","update:address"],setup(p,{emit:i}){const s=p,d=P(),l=j([]),n=i,m=v=>{n("update:open",!1)},u=()=>{n("update:open",!1)},f=v=>{n("update:address",v),n("update:open",!1)},$=oe();async function z(){l.value=await Pe($.user?.id)}return fe(()=>s.open,async()=>{await z()}),(v,h)=>(r(),c("div",null,[a(e(ge),{title:e(d).useString("chooseAddress"),open:s.open,centered:"",footer:null,onOk:m,onCancel:u},{default:_(()=>[t("div",Zt,[t("div",es,[a(Xt,{onSuccess:z})]),t("div",ts,[(r(!0),c(U,null,D(l.value,A=>(r(),k(Ae,{key:A.id,class:"cursor-pointer",data:A,"show-more":!1,onClick:w=>f(A)},null,8,["data","onClick"]))),128))])])]),_:1},8,["title","open"])]))}}),is=""+new URL("empty_address.CxbbYGDo.svg",import.meta.url).href,os={class:"col-span-3 flex flex-col gap-3"},ns={class:"text-sm font-medium"},as={key:0,class:"flex item-center justify-between"},rs={key:0,class:"flex"},ls={class:"text-gray-500 mr-2"},cs={key:1,class:"flex items-center gap-2"},ds=["src","alt"],us={class:"text-gray-500"},ms={class:"flex items-center cursor-pointer"},_s={key:2,class:"mt-4"},ps={class:"block mb-4 text-gray-500"},vs={class:"flex gap-4 flex-col"},fs={class:"text-gray-500 flex items-center gap-1"},gs={class:"text-xs"},hs={class:"flex gap-3 mt-4 overflow-x-scroll none-scroll py-4"},xs={class:"flex justify-between items-baseline"},ys={class:"text-sm"},$s={class:"flex gap-1 items-baseline"},Ss={class:"font-bold"},bs={class:"text-xs"},ks={class:"flex justify-between items-baseline mt-2"},ws={class:"text-sm"},Cs={class:"flex gap-1 items-baseline"},Is={class:"font-bold"},Ps={class:"text-xs"},As={key:0,class:"flex justify-between items-baseline mt-2"},Us={class:"text-sm"},js={class:"flex gap-1 items-baseline"},zs={class:"font-bold"},Bs={class:"text-xs"},Ls={key:1,class:"flex justify-between items-baseline mt-2"},Os={class:"text-sm"},Ns={class:"flex gap-1 items-baseline"},Ds={class:"font-bold"},Rs={class:"text-xs"},Es={class:"flex justify-between items-baseline mt-2"},Ts={class:"text-sm"},Gs={class:"flex gap-1 items-baseline"},qs={class:"font-bold"},Ms={class:"text-xs"},Fs={class:"flex flex-col items-center"},Vs={class:"flex gap-1 items-baseline mt-2"},Ws={class:"font-bold text-xl"},Js=b({__name:"CartAddress",setup(p){const i=T(),s=P(),d=j(!1);return(l,n)=>{const m=N;return r(),c("div",null,[t("div",os,[t("div",ns,[("getToken"in l?l.getToken:e(he))()?(r(),c("div",as,[e(i).address?(r(),c("div",rs,[a(B,{icon:"vuesax-linear:location",class:"text-primary"}),t("div",ls,o(e(s).useString("orderDeliveryAddress")),1)])):(r(),c("div",cs,[t("img",{src:e(is),class:"w-10",alt:e(s).appName.en},null,8,ds),t("span",us,o(e(s).useString("addressNotFound")),1)])),t("div",ms,[t("div",{class:"text-gray-500 ml-3",onClick:n[0]||(n[0]=u=>d.value=!0)},o(e(i).address?e(s).useString("changeAddress"):e(s).useString("chooseAddress")),1),a(B,{icon:"vuesax-linear:edit-2",color:"#374151",size:"20"})])])):(r(),k(L,{key:1,block:"",class:"text-center",onClick:n[1]||(n[1]=u=>l.$router.push({name:"auth-login"}))},{default:_(()=>[S(o(e(s).useString("pleaseLoginOrRegister")),1)]),_:1})),e(i).address?(r(),c("div",_s,o(e(i).address?.payload?.province)+" - "+o(e(i).address?.payload?.city)+" - "+o(e(i).address?.payload?.address)+" - "+o(e(i).address?.payload?.zip),1)):x("",!0)]),a(e(N),{class:"!my-0"}),t("div",null,[t("span",ps,o(e(s).useString("paymentType")),1),a(e(je),{value:e(i).payment_type,"onUpdate:value":n[4]||(n[4]=u=>e(i).payment_type=u),class:"!text-sm w-full px-4"},{default:_(()=>[t("div",vs,[t("div",{class:"flex items-center gap-2 cursor-pointer",onClick:n[2]||(n[2]=u=>e(i).payment_type=3)},[a(e(Z),{value:3}),t("div",{class:F(["flex items-center gap-1",e(s).isNightStore?"text-white":""])},[a(B,{icon:"vuesax-linear:card",size:"16"}),t("span",null,o(e(s).useString("online")),1)],2)]),t("div",{class:"flex items-center gap-2 cursor-pointer",onClick:n[3]||(n[3]=u=>e(i).payment_type=1)},[a(e(Z),{value:1}),t("div",{class:F(["flex items-center gap-1",e(s).isNightStore?"text-white":""])},[a(B,{icon:"vuesax-linear:moneys",size:"16"}),t("span",null,o(e(s).useString("onTheSpot")),1)],2)])])]),_:1},8,["value"])]),a(e(N),{class:"!my-0"}),t("div",fs,[t("span",null,o(e(s).useString("orderItems")),1),t("span",gs,"("+o(e(i).list.length)+")",1)]),t("div",hs,[(r(!0),c(U,null,D(e(i).list,(u,f)=>(r(),k(Jt,{key:f,"cart-item":u},null,8,["cart-item"]))),128))]),a(e(N),{class:"!my-0"}),t("div",null,[t("div",xs,[t("div",ys,o(e(s).useString("totalPrice"))+":",1),t("div",$s,[t("div",Ss,o(e(I)(e(i).sumOriginalPrice,!0,"")),1),t("div",bs,o(e(s).priceUnit),1)])]),t("div",ks,[t("div",ws,o(e(s).useString("totalItems"))+":",1),t("div",Cs,[t("div",Is,o(e(i).count),1),t("div",Ps,o(e(s).useString("item2")),1)])]),e(i).sumGoldPrice!==0?(r(),c("div",As,[t("div",Us,o(e(s).useString("totalGoldWeight"))+":",1),t("div",js,[t("div",zs,o(e(i).sumGoldPrice),1),t("div",Bs,o(e(s).useString("gram")),1)])])):x("",!0),e(i).sumSilverPrice!==0?(r(),c("div",Ls,[t("div",Os,o(e(s).useString("totalSilverWeight"))+":",1),t("div",Ns,[t("div",Ds,o(e(i).sumSilverPrice),1),t("div",Rs,o(e(s).useString("gram")),1)])])):x("",!0),t("div",Es,[t("div",Ts,o(e(s).useString("yourProfit"))+":",1),t("div",Gs,[t("div",qs,o(e(I)(e(i).sumDiscountCart,!0,"")),1),t("div",Ms,o(e(s).priceUnit),1)])])]),a(m,{class:"my-3"}),t("div",Fs,[t("div",null,o(e(s).useString("payable")),1),t("div",Vs,[t("span",Ws,o(e(I)(e(i).sumCart,!0,"")),1),t("span",null,o(e(s).priceUnit),1)])]),a(L,{block:"",class:"mt-4",type:"primary",disabled:!e(i).address,loading:e(V),onClick:e(ce)},{default:_(()=>[S(o(e(i).address?e(s).useString("completeOrder"):e(s).useString("pleaseChooseAddress")),1)]),_:1},8,["disabled","loading","onClick"])]),a(ss,{open:d.value,"onUpdate:open":n[5]||(n[5]=u=>d.value=u),address:e(i).address,"onUpdate:address":n[6]||(n[6]=u=>e(i).address=u)},null,8,["open","address"])])}}}),Ks=b({__name:"OrderFinal",setup(p){const i=W(),s=P();function d(){g.value=0,i.push({name:"home"})}return(l,n)=>(r(),c(U,null,[a(ze),a(L,{block:"",type:"primary",onClick:d},{default:_(()=>[S(o(e(s).useString("IUnderstand")),1)]),_:1})],64))}}),Qs={class:"h-screen"},Ys={class:"absolute top-0 w-inherit right-0 left-0"},Hs={class:"flex justify-between w-full p-4"},Xs={class:"flex items-center gap-2"},Zs={class:"font-semibold text-lg flex items-center"},ei={class:"px-2",dir:"ltr"},ti={class:"px-4 h-82vh overflow-y-auto pb-5vh"},si={key:0},ii={key:1},oi={key:2},ni=b({__name:"index",setup(p){const i=W(),s=P();return xe(()=>{i.currentRoute.value.params.id&&(g.value=2)}),(d,l)=>{const n=De,m=Oe,u=$e;return r(),c("div",Qs,[t("div",Ys,[t("div",Hs,[t("div",Xs,[e(g)===1||e(g)===0?(r(),k(B,{key:0,icon:e(s).isRTL?"vuesax-linear:arrow-right":"vuesax-linear:arrow-left",onClick:l[0]||(l[0]=f=>e(g)===0?e(i).back():g.value--)},null,8,["icon"])):x("",!0),t("div",Zs,o(e(g)===0?e(s).useString("cart"):e(g)===1?e(s).useString("address"):e(s).useString("payment")),1)])]),t("div",ei,[a(m,{active:e(g),"active-icon":"success","active-color":"#07c160",class:"cartStep"},{default:_(()=>[a(n,null,{default:_(()=>[S(o(e(s).useString("cart")),1)]),_:1}),a(n,null,{default:_(()=>[S(o(e(s).useString("address")),1)]),_:1}),a(n,null,{default:_(()=>[S(o(e(s).useString("payment")),1)]),_:1})]),_:1},8,["active"])]),a(u,null,{default:_(()=>[t("div",ti,[a(M,{mode:"out-in",name:"slide-left"},{default:_(()=>[e(g)===0?(r(),c("div",si,[a(Ft)])):e(g)===1?(r(),c("div",ii,[a(Js)])):e(g)===2?(r(),c("div",oi,[a(Ks)])):x("",!0)]),_:1})])]),_:1})])])}}}),yo=Be(ni,[["__scopeId","data-v-ab8e3d9d"]]);export{yo as default};
|