PageSourceSearch

https://zara99.xyz/assets/AddressShopView-26e7ad31.js

js zara99.xyz collected 2026-10-09 22:55:43 UTC 5,612 bytes, 1 lines download raw bytes

1import{d as K,u as Q,a0 as X,r as n,W as ee,f as ae,e as se,g as j,w as g,s as v,o as r,c as u,a as o,t as d,k as t,O as S,P as V,F as O,h as T,n as b,i as F,a1 as oe,j as W,Y as te,Z as ne}from"./index-0c2fc791.js";import{e as le}from"./editAddress-a1912b7b.js";const re={class:"form-add-address-wrap"},ue=["placeholder"],de=["placeholder"],ie={class:"select-option-primary"},ce={class:"option-select"},pe=["onClick"],ve={class:"select-option-primary"},me={class:"option-select"},he=["onClick"],_e={class:"select-option-primary"},ye={class:"option-select"},fe=["onClick"],ge=["placeholder"],be=["placeholder"],Ae={key:0,class:"flex-checkbox-address flex items-center"},ke={class:"text-center w-[60%] mx-auto"},we={class:"!text-[10px] md:!text-sm"},De=K({__name:"AddressShopView",setup(xe){const{t:l,locale:h}=Q(),A=X(),$=le(),z=n(""),_=n(""),y=n(""),m=n(""),i=n(""),c=n(""),p=n(""),k=n(""),M=n(!1),f=n(""),P=n([]),U=n([]),E=n([]);ee(async()=>{A.setWidth("550px"),A.setTitle(x.value?"EditAddressShop":"AddAddressShop")}),ae(()=>{A.widthReset()}),se(()=>{q(),x.value&&w.value&&(_.value=w.value.name,y.value=w.value.phone_number,k.value=w.value.address,z.value=w.value.id)});const w=j(()=>$.data),x=j(()=>$.statusAddress);async function q(){try{const a=await g.getProvince();a.code!==200&&a.error_code!==0?v.error(a.message):P.value=a.payload}catch(a){console.log(a)}}async function I(a){try{const e=await g.getAmphure(a);e.code!==200&&e.error_code!==0?v.error(e.message):U.value=e.payload}catch(e){console.log(e)}}async function R(a){try{const e=await g.getTambon(a);e.code!==200&&e.error_code!==0?v.error(e.message):E.value=e.payload}catch(e){console.log(e)}}async function Y(){const a={address:k.value,amphure:i.value,description:"",name:_.value,phone_number:y.value,province:m.value,tambon:c.value,zip_code:p.value};try{const e=await g.addAddress(a);e.code!==200&&e.error_code!==0?v.error(e.message):(v.success(e.message),L(),A.setCompo(""))}catch(e){console.log(e)}}async function Z(){const a={active:M.value,address:k.value,amphure:i.value,description:"",id:z.value,name:_.value,phone_number:y.value,province:m.value,status:M.value?1:0,tambon:c.value,zip_code:p.value};try{const e=await g.setAddress(a);e.code!==200&&e.error_code!==0?v.error(e.message):(v.success(e.message),L(),A.setCompo(""))}catch(e){console.log(e)}}async function L(){try{const a=await g.shopAddress();a.code!==200&&a.error_code!==0&&v.error(a.message)}catch(a){console.log(a)}}function B(a){f.value=a}function D(){f.value="",document.querySelectorAll(".select-form-primary").forEach(e=>{e.classList.remove("active-option")})}function G(a){i.value="",c.value="",p.value="",m.value=h.value==="en"?a.name_en:a.name_th,I(a.id),D()}function H(a){c.value="",p.value="",i.value=h.value==="en"?a.name_en:a.name_th,R(a.amphure_id),D()}function J(a){c.value=h.value==="en"?a.name_en:a.name_th,p.value=a.zip_code.toString(),D()}return(a,e)=>(r(),u("div",re,[o("p",null,d(t(l)("shopMenu.ContactChannels")),1),S(o("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=s=>_.value=s),placeholder:t(l)("shopMenu.nameLastname")},null,8,ue),[[V,_.value]]),S(o("input",{type:"tel","onUpdate:modelValue":e[1]||(e[1]=s=>y.value=s),placeholder:t(l)("shopMenu.inputPhone")},null,8,de),[[V,y.value]]),o("p",null,d(t(l)("shopMenu.address")),1),o("div",{class:"select-form-primary",onClick:e[2]||(e[2]=s=>B("provinceOption"))},[o("p",null,d(m.value?m.value:t(l)("shopMenu.province")),1)]),o("div",{class:b(["select-option-dropdown",f.value==="provinceOption"?"active-option":""])},[o("div",ie,[o("ul",ce,[(r(!0),u(O,null,T(P.value,(s,C)=>(r(),u("li",{key:C,onClick:N=>G(s)},[o("p",null,d(t(h)==="en"?s.name_en:s.name_th),1)],8,pe))),128))])])],2),o("div",{class:b(["select-form-primary",m.value?"":"disable-input-wrap"]),onClick:e[3]||(e[3]=s=>m.value?B("aumphureOption"):null)},[o("p",null,d(i.value?i.value:t(l)("shopMenu.district")),1)],2),o("div",{class:b(["select-option-dropdown",f.value==="aumphureOption"?"active-option":""])},[o("div",ve,[o("ul",me,[(r(!0),u(O,null,T(U.value,(s,C)=>(r(),u("li",{key:C,onClick:N=>H(s)}
1,[o("p",null,d(t(h)==="en"?s.name_en:s.name_th),1)],8,he))),128))])])],2),o("div",{class:b(["select-form-primary",i.value?"":"disable-input-wrap"]),onClick:e[4]||(e[4]=s=>i.value?B("TambonOption"):null)},[o("p",null,d(c.value?c.value:t(l)("shopMenu.subdistrict")),1)],2),o("div",{class:b(["select-option-dropdown",f.value==="TambonOption"?"active-option":""])},[o("div",_e,[o("ul",ye,[(r(!0),u(O,null,T(E.value,(s,C)=>(r(),u("li",{key:C,onClick:N=>J(s)},[o("p",null,d(t(h)==="en"?s.name_en:s.name_th),1)],8,fe))),128))])])],2),S(o("input",{type:"text","onUpdate:modelValue":e[5]||(e[5]=s=>p.value=s),class:b(c.value?"":"disable-input-wrap"),placeholder:t(l)("shopMenu.zipCode"),readonly:""},null,10,ge),[[V,p.value]]),S(o("input",{type:"text","onUpdate:modelValue":e[6]||(e[6]=s=>k.value=s),placeholder:t(l)("shopMenu.addressDetail")},null,8,be),[[V,k.value]]),x.value?(r(),u("div",Ae,[F(oe,{modelValue:M.value,"onUpdate:modelValue":e[7]||(e[7]=s=>M.value=s),label:t(l)("shopMenu.setDefault"),text:"md:!text-base",value:"true","hide-details":""},null,8,["modelValue","label"])])):W("",!0),o("div",ke,[F(ne,{class:"!rounded-full secondary-button py-0 h-[40px] flex items-center justify-center mt-3",onClick:e[8]||(e[8]=s=>x.value?Z():Y()),disabled:_.value===""||y.value===""||p.value===""},{custom:te(()=>[o("p",we,d(x.value?t(l)("shopMenu.editAddressShop"):t(l)("shopMenu.addToAddress")),1)]),_:1},8,["disabled"])]),f.value?(r(),u("div",{key:1,class:"overlay-form",onClick:e[9]||(e[9]=s=>D())})):W("",!0)]))}});export{De 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.