import{f as s,k as e,E as o}from"./souav-BTAG2baT.js";import{S as l,v as t,a}from"./vendor-DeXdhdID.js";import{_ as i}from"./vendor-Dbr4D_Oo.js";import{s as r}from"./vendor-CB_mu4eO.js";import{ag as n,d,q as c,a4 as p,a5 as m,v as u,ad as v,aL as x,bf as b,aW as f}from"./vendor-BXdGExd0.js";import{j,i as w}from"./vendor-BJZ6tUoe.js";import"./vendor-CDxkAdJH.js";import"./vendor-Cv8m7sE6.js";import"./vendor-BCo6x5W8.js";import"./vendor-bo_0oRCG.js";import"./vendor-Dos3PyFQ.js";import"./vendor-Dwl46Tfs.js";import"./vendor-DN37M9Hi.js";import"./vendor-BHR_E30J.js";import"./vendor-DzK633Zd.js";import"./vendor-CfyHAoLP.js";import"./vendor-Dm4oB1Pn.js";import"./vendor-DBhUxCDU.js";const h={class:"min-h-dvh bg-[#0E0F12] flex flex-col"},y={class:"sticky top-0 z-50 flex items-center justify-center h-12 border-b border-[#1D1E22]"},g={class:"flex-1 overflow-y-auto pb-10"},C={class:"pt-[50px] pb-[69px] flex justify-center"},k=["src"],V={class:"px-8 flex flex-col items-center"},B=["disabled"],F=n({__name:"BindAccount",emits:["ppw-close"],setup(n,{emit:F}){const D=F,E=s(),{isBind:I,userInfo:S}=r(E),_=d({mobile:"",password:""});c(()=>{var s;(null==(s=S.value)?void 0:s.mobile)&&(_.mobile=S.value.mobile,_.password="")});const L=async()=>{const s=_.mobile,l=_.password;if(!t(s))return void j("手机号格式有误");if(!a(l))return void j("密码格式有误");const i=w({message:"加载中...",forbidClick:!0,duration:0});try{const s={mobile:_.mobile,password:e.toMD5(_.password)},l=await E.bindMobile(s),{code:t,data:a}=l;t===o.Success?(E.refreshSessionId(a.sessionId),j("绑定成功"),D("ppw-close")):j(l.msg||"绑定失败，请重试")}catch(r){j("网络异常，请稍后重试")}finally{i.close()}},M=()=>{},U=()=>{};return(s,e)=>(f(),p("div",h,[m("header",y,[m("button",{onClick:e[0]||(e[0]=e=>s.$emit("ppw-close")),class:"absolute left-4 p-2"},[...e[3]||(e[3]=[m("i",{class:"icon-sprite icon-back"},null,-1)])]),e[4]||(e[4]=m("h1",{class:"text-lg font-medium text-white font-sans"},"绑定手机",-1))]),m("main",g,[m("div",C,[m("img",{src:u(i),alt:"Logo",class:"w-[140px] h-[90px] object-contain"},null,8,k)]),m("div",V,[v(l,{modelValue:_.mobile,"onUpdate:modelValue":e[1]||(e[1]=s=>_.mobile=s),placeholder:"请输入手机号",type:"tel",disabled:u(I)},null,8,["modelValue","disabled"]),e[7]||(e[7]=m("div",{class:"h-[25px]"},null,-1)),v(l,{modelValue:_.password,"onUpdate:modelValue":e[2]||(e[2]=s=>_.password=s),placeholder:"请输入密码",type:"password",disabled:u(I)},null,8,["modelValue","disabled"]),e[8]||(e[8]=m("div",{class:"h-[15px]"},null,-1)),e[9]||(e[9]=m("div",{class:"text-[#DB2639] text-xs text-left w-full"},"密码必须是8-16位英文字母、数字、字符组合（不能是纯数字）",-1)),e[10]||(e[10]=m("div",{class:"h-[40px]"},null,-1)),m("button",{onClick:L,disabled:u(I),class:x(["w-[220px] h-[40px] rounded-[20px] text-[14px] font-bold transition-all flex items-center justify-center",u(I)?"bg-[#292B32] text-gray-500 cursor-not-allowed":"bg-[#F2C94C] text-black hover:opacity-90 active:scale-95"])},b(u(I)?"已绑定":"绑定"),11,B),e[11]||(e[11]=m("div",{class:"h-[23px]"},null,-1)),m("div",{class:"text-[12px] text-gray-500 text-center leading-relaxed"},[e[5]||(e[5]=m("span",null,"阅读并同意",-1)),m("span",{onClick:M,class:"text-[#F2C94C] cursor-pointer active:opacity-70 mx-1"}," 《用户协议》 "),e[6]||(e[6]=m("span",null,"和",-1)),m("span",{onClick:U,class:"text-[#F2C94C] cursor-pointer active:opacity-70 mx-1"}," 《隐私政策》 ")])])])]))}});export{F as default};
