import{ag as e,r as t,w as s,a4 as o,a5 as n,a3 as i,ad as a,v as r,bH as l,bJ as d,bz as c,bf as p,aL as m,aW as u}from"./vendor-BXdGExd0.js";import{f as x,P as v}from"./souav-BTAG2baT.js";import{u as f}from"./vendor-CFI2yzR1.js";import{_ as b}from"./vendor-KempxfXE.js";import{R as g}from"./vendor-CWL149Ps.js";import{_ as h}from"./vendor-DppN28kL.js";import"./vendor-CDxkAdJH.js";import"./vendor-Cv8m7sE6.js";import"./vendor-BJZ6tUoe.js";import"./vendor-Dm4oB1Pn.js";import"./vendor-DN37M9Hi.js";import"./vendor-DBhUxCDU.js";import"./vendor-BCo6x5W8.js";import"./vendor-bo_0oRCG.js";import"./vendor-CB_mu4eO.js";import"./vendor-Dos3PyFQ.js";import"./vendor-Dwl46Tfs.js";import"./vendor-BHR_E30J.js";import"./vendor-DzK633Zd.js";import"./vendor-CfyHAoLP.js";const w={class:"min-h-dvh bg-[#0E0F12] pb-10"},j={class:"sticky top-0 z-40 flex items-center justify-center h-12 border-b border-[#1D1E22]"},k={class:"p-4 space-y-4"},y={class:"bg-[#1D1E22] rounded-lg overflow-hidden"},B={class:"flex items-center gap-1.5"},C={class:"text-[14px] text-[#9E9BB2] mr-1"},D={class:"flex items-center gap-2.5"},E={class:"bg-[#1D1E22] rounded-lg overflow-hidden mt-2.5"},_={class:"flex items-center gap-1"},F={class:"text-[14px] text-[#9E9BB2]"},I={class:"flex items-center gap-1"},z={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-8"},N={class:"w-full max-w-sm bg-[#1D1E22] rounded-lg p-6 animate-in fade-in zoom-in duration-200"},A={class:"flex gap-4"},U=e({__name:"AccountSecurity",emits:["ppw-close"],setup(e){const U=x(),P=f(),S=t("");s(()=>P.showNicknameDialog,e=>{e&&(S.value="昵称未设置"==U.nickname?"":U.nickname)});const H=async()=>{await P.modifyUserInfo({nickname:S.value})&&(P.showNicknameDialog=!1)},J=()=>{v.open("AvatarsCheck",{transition:"bottom-up"})},L=()=>{P.showNicknameDialog=!0},M=()=>{v.open("SwitchAccount",{transition:"slide-fade"})},R=()=>{v.open("ModifyPassword",{transition:"slide-fade"})},V=()=>{U.isBind||v.open("BindAccount",{transition:"slide-fade"})};return(e,t)=>{var s,x;return u(),o("div",w,[n("header",j,[n("button",{onClick:t[0]||(t[0]=t=>e.$emit("ppw-close")),class:"absolute left-4 p-2"},[...t[5]||(t[5]=[n("i",{class:"icon-sprite icon-back"},null,-1)])]),t[6]||(t[6]=n("h1",{class:"text-lg font-medium text-white"},"账号安全",-1))]),n("main",k,[n("div",y,[n("div",{onClick:J,class:"h-[45px] flex items-center justify-between px-4 cursor-pointer active:bg-[#292B32] transition-colors"},[a(h,{src:null==(x=null==(s=r(U))?void 0:s.userInfo)?void 0:x.avatar,size:32},null,8,["src"]),n("div",B,[t[7]||(t[7]=n("span",{class:"text-[14px] text-[#9E9BB2]"},"修改头像",-1)),a(g)])]),t[8]||(t[8]=n("div",{class:"mx-4 h-[1px] bg-[#292B32]"},null,-1)),a(b,{title:"昵称",onClick:L},{trailing:l(()=>[n("span",C,p(r(U).nickname||"未设置"),1),a(g)]),_:1}),t[9]||(t[9]=n("div",{class:"mx-4 h-[1px] bg-[#292B32]"},null,-1)),a(b,{title:"性别","show-arrow":!1},{trailing:l(()=>{var e,s;return[n("div",D,[n("button",{onClick:t[1]||(t[1]=e=>r(P).modifyUserInfo({gender:1})),class:m(["px-2 py-[3px] rounded-[5px] text-[14px] transition-colors",1===(null==(e=r(U).userInfo)?void 0:e.gender)?"bg-[#32DCB8] text-white":"bg-[#292B32] text-[#757780]"])}," 男 ",2),n("button",{onClick:t[2]||(t[2]=e=>r(P).modifyUserInfo({gender:2})),class:m(["px-2 py-[3px] rounded-[5px] text-[14px] transition-colors",2===(null==(s=r(U).userInfo)?void 0:s.gender)?"bg-[#F56C6C] text-white":"bg-[#292B32] text-[#757780]"])}," 女 ",2)])]}),_:1})]),n("div",E,[a(b,{title:"绑定手机",onClick:V},{trailing:l(()=>{var e;return[n("div",_,[n("span",F,p(r(U).isBind?null==(e=r(U).userInfo)?void 0:e.mobile:"未绑定"),1),a(g)])]}),_:1}),t[10]||(t[10]=n("div",{class:"mx-4 h-[1px] bg-[#292B32]"},null,-1)),a(b,{title:"修改密码",onClick:R},{trailing:l(()=>[n("div",I,[a(g)])]),_:1})]),n("div",{class:"flex justify-center mt-[150px]"},[n("button",{onClick:M,class:"w-[220px] h-[40px] bg-[#F2C94C] text-black text-[14px] font-bold rounded-full hover:opacity-90 active:scale-95 transition-all"}," 切换账号 ")])]),r(P).showNicknameDialog?(u(),o("div",z,[n("div",N,[t[11]||(t[11]=n("h3",{class:"text-lg font-medium text-white mb-4 text-center"},"设置昵称",-1)),d(n("input",{"onUpdate:modelValue":t[3]||(t[3]=e=>S.value=e),placeholder:"请输入新昵称",class:"w-full h-[44px] bg-[#0E0F12] text-white border border-[#292B32] rounded p-2 mb-6 focus:outline-none focus:border-[#F2C94C]"},null,512),[[c,S.value]]),n("div",A,[n("button",{onClick:t[4]||(t[4]=e=>r(P).showNicknameDialog=!1),class:"h-[42px] flex-1 py-2 rounded-full bg-[#292B32] text-[#757780]"},"取消"),n("button",{onClick:H,class:"h-[42px] flex-1 py-2 rounded-full bg-[#FF1052] text-white font-bold"},"确定")])])])):i("",!0)])}}});export{U as default};
