1import{s as ie}from"./BGTg9lt2.js";import{s as se}from"./DU3PGotH.js";import{_ as le,u as $,b as re,c as ae,G as de,e1 as ce,e0 as ue,M as ge,w as pe,a as me,ap as he,h as fe,o as Ce,m as g,n as S,p as s,J as L,v as P,L as c,bf as f,dL as C,i as y,x as R,j as x,F as V,B as a,e3 as ye,R as B,S as v,W as ve,U as E,et as _e,e8 as Ie,e9 as Se,H as xe,e4 as be,e5 as we,k as d,s as Te,K as ke,y as M,A as Ue}from"./_q-8vOEp.js";import{a as Ne,s as $e}from"./D4dKC0Y7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{u as Le}from"./C0ETftDV.js";import{p as Pe,s as Re,f as Ve,h as Be}from"./D8O6dqu-.js";import{E as Ee}from"./DeGCGUhn.js";import"./C9ECwIFj.js";import"./CvasESir.js";import"./C7pAnjzh.js";import"./DLQuys82.js";import"./BB_Ol6Sd.js";import"./DCN34tA8.js";import"./_vbQzgA3.js";import"./Cq9Fpw4b.js";import"./G5QO0MlA.js";import"./y0dbEz7I.js";import"./CcWsNIm2.js";import"./BFqd4BFT.js";import"./3NlJDhOf.js";const Me={class:"bgfff"},qe={class:"flex align-items-center"},De={class:"h5-input-box flex1"},We=["placeholder"],Fe=["placeholder"],ze={class:"flex align-items-center mtop10"},He={class:"h5-input-box flex1"},Ae=["placeholder"],Ge={class:"flex align-items-center mtop10"},je={class:"h5-input-box flex1 flex h5-input-give-code"},Je=["placeholder"],Ke={key:0,class:"login-text"},Oe={class:"flex align-items-center mtop10"},Ze={key:1,class:"h5-add flex flex-center"},Qe={key:2,class:"h5-add flex flex-center"},Xe={class:"h5-btn flex flex-center login-btn",disabled:""},Ye={class:"h5-country-code-title"},et={class:"publish-countrys-scroll"},tt={__name:"loginCodeDirect",setup(ot){const{goBack:q}=Le();let{t:l}=$(),{locale:b}=$();const p=re(),m=ae(),e=de({storeId:ge(),logo:null,phoneCode:"",timerId:null,safeCode:"",graphicCodeUrl:"",vcodeText:l("login.getCode"),countryCode:ue(),phoneNum:"",wholePhone:"",vcodeLength:8,countryCodeListShow:!1,publishCountry:"tw",redirectUrl:"",countries:ce(),vcodeTextShow:!0,directEnable:0,directSellingId:"",registerBgImageUrlStyle:null,registerContentStyle:null,distributeEnabled:!0,isClause:!1,themeColor:"#004f51"});pe(()=>e.phoneNum,()=>{e.timerId&&(clearTimeout(e.timerId),e.timerId=null),e.vcodeText=l("login.getCode"),e.vcodeTextShow=!0});let D=me("theme");e.themeColor=D.value||"#004f51";const{setToken:W}=he(),F=()=>{var t,n,r;let o=JSON.parse(localStorage.getItem("storeInfo"));o!=null&&o!==void 0&&(e.codePrompt=o.codePrompt,((t=o.storeRectangleLogo)==null?void 0:t.fullPath)!==null&&((n=o.storeRectangleLogo)==null?void 0:n.fullPath)!==""&&(e.logo=(r=o.storeRectangleLogo)==null?void 0:r.fullPath),e.title=o.storeName,e.directEnable=o.direct_sell_is_enable)},z=()=>{e.phoneCode=e.phoneCode.replace(/\s+/g,"")},H=()=>{e.safeCode=String(e.safeCode).replace(/[^\d]/g,""),e.safeCode.length==4?T():(e.timerId&&(clearTimeout(e.timerId),e.timerId=null),e.vcodeText=l("login.getCode"),e.vcodeTextShow=!0)},w=async()=>{const o={w:78,h:34};try{const t=await Pe(o);e.graphicCodeUrl=t}catch(t){console.error("è·åå¾å½¢éªè¯ç 失败:",t)}},A=()=>{e.safeCode="",w()},T=()=>{if(!e.vcodeTextShow){a(l("message.getVcodeFrequently"));return}if(e.phoneNum){if(!U()){a(l("login.mobileRule"));return}}else{a(l("login.enterMobileMsg"));return}if(!e.safeCode||e.safeCode.length!=4){a(l("login.graphicCodeInput"));return}let t={mobile:e.countryCode+ye(e.phoneNum),store_id:e.storeId,safeCode:e.safeCode};B({duration:0,forbidClick:!0,message:l("message.getVcodeing")}),Re(t).then(n=>{v(),n.code!=200&&n.code!="200"?a(n.data):N(60)})}
1,k=fe(()=>e.phoneNum?e.countryCode=="+886"?be(e.phoneNum):e.countryCode=="+86"?we(e.phoneNum):!0:!1),U=()=>k.value?(e.wholePhone=e.countryCode+e.phoneNum,!0):!1,N=o=>{e.timerId&&clearTimeout(e.timerId),o>0?(e.vcodeText=o+"s",e.vcodeTextShow=!1,o--,e.timerId=setTimeout(()=>{N(o)},1e3)):(e.vcodeText=l("login.getCode"),e.vcodeTextShow=!0,e.timerId=null)},G=()=>{if(!e.isClause)return a(l("verify.pleasePrivacyPolicy"));if(!e.phoneNum){a(l("message.pleaceWriteMobile"));return}if(!U()){a(l("login.mobileRule"));return}if(!e.phoneCode){a(l("login.codeInput"));return}var o={};o={mobile_code:e.phoneCode,mobile:e.wholePhone,country_code:e.countryCode},j(o)},j=o=>{B({message:l("login.logging"),forbidClick:!0}),Be(o).then(t=>{try{t.code=="200"?(v(),J(t.data,"CompleteRegistration")):t.code==44020?(v(),E(l("message.userRegistered")),setTimeout(()=>{p.push({path:"/login/login-code"})},3e3)):(v(),a(t.data))}catch{E("register res parse error")}})},J=(o,t)=>{W(o.logintoken),K(t),""+localStorage.getItem("directSellingId"),a(l("login.loginSuccess")),setTimeout(()=>{e.directSellingId?p.push({path:"/user/user/center/list",query:{directSellingParent_id:e.directSellingId,directType:e.directType}}):Z()},2e3)},K=o=>{let t={type:_e()};Ie(t).then(n=>{if(n.code=="200"){Se("userInfo",n.data);let{data:r}=n;const u=xe();u.userName=r.nick_name||r.realName,u.getCountCart(),O(o,r)}})},O=(o,t)=>{let n={event:"CustomEvent",custom_label:o,custom_data:{user_id:t.id,phone:t.mobile,email:t.email}};window.dataLayer.push(n)},Z=()=>{e.redirectUrl!=null&&e.redirectUrl!=""&&e.redirectUrl?window.location.href=e.redirectUrl:p.push({path:"/home"})},Q=()=>{var o;e.redirectUrl=((o=m.query)==null?void 0:o.redirectUrl)||""},X=()=>{q()},Y=()=>{let o={store_id:e.storeId};Ve(o).then(t=>{if(t.code=="200"){e.registerBgImageUrlStyle=t.data.registerBgImageUrl;let n=t.data.registerTop/650,r=t.data.registerLeft/375;n>0&&(n=n.toFixed(3)),r>0&&(r=r.toFixed(3));let u=document.documentElement.clientHeight-50,_=document.documentElement.clientWidth,h=Math.round(u*n),I=Math.round(_*r);t.data.registerLeft>0?e.registerContentStyle=` 2 margin-top:${h}px; 3 margin-left:${I/2}px; 4 `:e.registerContentStyle=` 5 margin:${h}px auto 0 auto; 6 `,e.distributeEnabled==!1&&Ee.alert(l("message.redEnd"),l("message.warmTip"),{confirmButtonText:l("button.backHomeBtn"),type:"warning"}).then(()=>{p.push({path:"/home"})}).catch(()=>{})}})},ee=()=>{var o,t,n,r;(o=m.query)!=null&&o.directSellingParent_id?(e.directSellingId=(t=m.query)==null?void 0:t.directSellingParent_id,e.directType=(n=m.query)==null?void 0:n.directType):e.directSellingId=localStorage.getItem("directSellingId"),(r=m.query)!=null&&r.redirectUrl&&Q(),F(),Y()},te=()=>{e.isClause=!e.isClause},oe=()=>{p.push({path:"/articles/privacy"})};return Ce(()=>{ee(),w()}),(o,t)=>{const n=ie,r=se,u=Ue,_=$e,h=Ne,I=ve;return d(),g(V,null,[S(n,{title:o.$t("login.codeLogin"),"left-arrow":"",placeholder:"",fixed:"","z-index":"2",onClickLeft:X},null,8,["title"]),s("div",Me,[s("div",{class:"direct-infoBox",style:L({backgroundImage:"url("+e.registerBgImageUrlStyle+")"})},[s("div",{class:"register-content h5-login-content",style:L(e.registerContentStyle)},[s("div",qe,[s("div",{class:"h5-input-box h5-country-code",onClick:t[0]||(t[0]=i=>e.countryCodeListShow=!0)},c(e.countryCode),1),s("div",De,[e.directSellingId?f((d(),g("input",{key:1,class:"h5-text-input h5-input-write","onUpdate:modelValue":t[3]||(t[3]=i=>e.phoneNum=i),onInput:t[4]||(t[4]=i=>e.phoneNum=String(e.phoneNum).replace(/[^\d]/g,"")),placeholder:o.$t("message.pleaceWriteMobile")},null,40,Fe)),[[C,e.phoneNum]]):f((d(),g("input",{key:0,disabled:"",class:"h5-text-input h5-input-write","onUpdate:modelValue":t[1]||(t[1]=i=>e.phoneNum=i),onInput:t[2]||(t[2]=i=>e.phoneNum=String(e.phoneNum).replace(/[^\d]/g,"")),placeholder:o.$t("message.pleaceWriteMobile")},null,40,We)),[[C,e.phoneNum]])])]),s("div",ze,[s("div",He,[f(s("input",{class:"h5-text-input h5-placeholder","onUpdate:modelValue":t[5]||(t[5]=i=>e.safeCode=i),maxlength:"4",onInput:H,placeholder:o.$t("login.graphicCodeInput")},null,40,Ae),[[C,e.safeCode]])]),s("div",{class:"graphic-code-img",onClick:A},[e.graphicCodeUrl?(d(),y(r,{key:0,src:"data:image/png;base64,"+e.graphicCodeUrl,width:"100px",height:"40px"},null,8,["src"])):P("",!0)])]),s("div",Ge,[s("div",je,[f(s("input",{class:"h5-text-input","onUpdate:modelValue":t[6]||(t[6]=i=>e.phoneCode=i),maxlength:8,onInput:t[7]||(t[7]=i=>z()),placeholder:o.$t("login.codeInput")},null,40,Je),[[C,e.phoneCode]]),s("div",{class:R(["h5-give-code",!e.safeCode||e.safeCode.length!==4||!k.value?"disabled-code":""]),onClick:T},c(e.vcodeText),3)])]),e.directSellingId?(d(),g("div",Ke,c(o.$t("login.directSellingId"))+": "+c(e.directSellingId),1)):P("",!0),s("div",Oe,[s("div",{class:R(["checkbox-inner mright10",{"checkbox-inner-activ":e.isClause}]),onClick:t[8]||(t[8]=i=>te())},[e.isClause?(d(),y(u,{key:0,name:"duihao-color"})):(d(),y(u,{key:1,name:"duihao",width:1,height:1}))],2),s("span",{class:"is-fen-qi font12",style:{color:"#1690cf"},onClick:t[9]||(t[9]=i=>oe())},c(o.$t("order.payment.agreeCofitTerm")),1)]),e.directSellingId?(d(),g("div",Ze,[
6s("div",{class:"h5-btn flex flex-center login-btn",onClick:t[10]||(t[10]=i=>G())},c(o.$t("login.register")),1)])):(d(),g("div",Qe,[s("div",Xe,c(o.$t("login.register")),1)]))],4)],4),S(I,{show:e.countryCodeListShow,"onUpdate:show":t[13]||(t[13]=i=>e.countryCodeListShow=i),closeable:"",position:"bottom",style:{height:"60%"}},{default:x(()=>[s("div",Ye,c(o.$t("message.countryTitle")),1),s("div",et,[S(h,{modelValue:e.countryCode,"onUpdate:modelValue":t[11]||(t[11]=i=>e.countryCode=i),onChange:t[12]||(t[12]=i=>(e.countryCodeListShow=!1,e.phoneCode="")),"checked-color":e.themeColor,"icon-size":"18px",class:"font14"},{default:x(()=>[(d(!0),g(V,null,Te(e.countries,(i,ne)=>(d(),y(_,{name:i.phoneCode,key:ne,class:"country-code-radio"},{default:x(()=>[ke(c(M(b)=="tw"?i.countryNameTw:M(b)=="zh"?i.countryNameCn:i.countryNameEn)+" "+c(i.phoneCode),1)]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue","checked-color"])])]),_:1},8,["show"])])],64)}}},Nt=le(tt,[["__scopeId","data-v-60430bf9"]]);export{Nt 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.