import{S as e}from"./success-6f358333.js";import{_ as s,q as a,f as l,ag as n,ax as d,b as t,ay as o,e as u,w as c}from"./index-4c745ab9.js";import{$ as i,x as p,l as r,o as w,a as v,g as m,f as _,j as P,E as f,u as y,y as g,t as b,e as k,an as h,h as C,w as x}from"./vendor-edc0678f.js";const N={class:"content"},V={class:"input"},U=["type"],F=s({__name:"SetForm",emits:["setPwd"],setup(e,{emit:s}){const{_toast:o}=a(),u=i({pwd:!1}),c=()=>{u.pwd=!u.pwd};p(()=>u.pwd,(e,s)=>{});const b=s,k=r(!1);p(k,e=>{b("setPwd",e)});const h=r({password:""}),C=()=>{""!=h.value.password?d(h.value.password).then(e=>{"200"==e.code?(o("Fund_password_set_success"),k.value=!0):g(e.msg)}):o("Fund_password_noempty")};return(e,s)=>{const a=t;return w(),v("div",N,[m("div",V,[_(a,{name:"mima",class:"icon"}),P(m("input",{type:u.pwd?"text":"password","onUpdate:modelValue":s[0]||(s[0]=e=>y(h).password=e)},null,8,U),[[f,y(h).password]]),_(a,{name:u.pwd?"openeyes":"closeeyse",class:"icon",onClick:c},null,8,["name"])]),m("div",{class:"btnBox",onClick:C},[_(n,{btnValue:y(l)("btnConfirm",["bitmake"])},null,8,["btnValue"])])])}}},[["__scopeId","data-v-fe980e6f"]]),I={class:"content"},j={class:"tip"},S={class:"input"},B=["type","placeholder"],O={class:"tip"},R={class:"input"},T=["type","placeholder"],q={class:"tip"},D={class:"input"},E=["type","placeholder"],$={key:0,class:"pwdDiff"},z=s({__name:"ChangeForm",emits:["setPwd"],setup(e,{emit:s}){const{_toast:d}=a(),u=r(!1),c=r(!1),i=r(!1),h=r({newPwd:"",oldPwd:"",NPwd:""}),C=e=>{"oldPwd"==e?c.value=!c.value:"newPwd"==e?u.value=!u.value:i.value=!i.value},x=s,N=r(!1);p(N,e=>{x("setPwd",e)});const V=r(!1),U=()=>{V.value=!(h.value.newPwd==h.value.NPwd)},F=()=>{""!=h.value.oldPwd?""!=h.value.newPwd?h.value.newPwd===h.value.NPwd?o(h.value.oldPwd,h.value.newPwd,1).then(e=>{"200"==e.code?(d("Fund_password_update_success"),N.value=!0):g(e.msg)}):d("register_pwd_diff"):d("Fund_password_pleaseNew"):d("Fund_password_pleaseOld")};return(e,s)=>{const a=t;return w(),v("div",I,[m("div",j,b(y(l)("Old_Password")),1),m("div",S,[_(a,{name:"mima",class:"icon"}),P(m("input",{type:c.value?"text":"password","onUpdate:modelValue":s[0]||(s[0]=e=>h.value.oldPwd=e),placeholder:y(l)("login_please")},null,8,B),[[f,h.value.oldPwd]]),_(a,{name:c.value?"openeyes":"closeeyse",class:"icon",onClick:s[1]||(s[1]=e=>C("oldPwd"))},null,8,["name"])]),m("div",O,b(y(l)("New_Password")),1),m("div",R,[_(a,{name:"mima",class:"icon"}),P(m("input",{type:u.value?"text":"password","onUpdate:modelValue":s[2]||(s[2]=e=>h.value.newPwd=e),placeholder:y(l)("login_please")},null,8,T),[[f,h.value.newPwd]]),_(a,{name:u.value?"openeyes":"closeeyse",class:"icon",onClick:s[3]||(s[3]=e=>C("newPwd"))},null,8,["name"])]),m("div",q,b(y(l)("Confirm_Password")),1),m("div",D,[_(a,{name:"mima",class:"icon"}),P(m("input",{type:i.value?"text":"password","onUpdate:modelValue":s[4]||(s[4]=e=>h.value.NPwd=e),onInput:U,placeholder:y(l)("login_please")},null,40,E),[[f,h.value.NPwd]]),_(a,{name:i.value?"openeyes":"closeeyse",class:"icon",onClick:s[5]||(s[5]=e=>C("NPwd"))},null,8,["name"])]),V.value?(w(),v("p",$,"*"+b(y(l)("register_pwd_diff")),1)):k("",!0),m("div",{class:"btnBox",onClick:F},[_(n,{btnValue:y(l)("btnConfirm",["bitmake"])},null,8,["btnValue"])])])}}},[["__scopeId","data-v-12e0d4f8"]]),A=s({__name:"fund-password",setup(s){var d;const{_toast:t}=a(),o=u();o.getUserInfo();const{userInfo:i}=h(o),p={iconRight:[{iconName:"kefu",clickTo:"event_serviceChange"}]},P=r(null==(d=i.value.detail)?void 0:d.userTardPwd),f=r(!0),g=()=>{P.value=!0,f.value=!1,o.getUserInfo()},N=e=>{f.value=e,P.value=e,o.getUserInfo()},V=()=>{t("custorm_service")};return(s,a)=>(w(),v("div",null,[_(c,{currentName:y(P)?y(l)("Change_security_password"):y(l)("sidebar_tardPwd",["bitmake"]),cuttentRight:p,border_bottom:!0},null,8,["currentName"]),!y(P)&&y(f)?(w(),C(F,{key:0,onSetPwd:N})):k("",!0),y(P)&&!y(f)?(w(),C(z,{key:1,onSetPwd:N})):k("",!0),y(P)&&y(f)?(w(),C(e,{key:2,text:y(l)("Fund_password_has_set"),imgUrl:"defi/fund.png",class:"success"},{btn:x(()=>[m("div",{class:"btnBox",onClick:g},[_(n,{btnValue:y(l)("Change_security_password")},null,8,["btnValue"])]),m("div",{class:"forgot",onClick:V},b(y(l)("forgot_security_code"))+"?",1)]),_:1},8,["text","imgUrl"])):k("",!0)]))}},[["__scopeId","data-v-570c6da9"]]);export{A as default};
