2 lines
6.0 KiB
JavaScript
2 lines
6.0 KiB
JavaScript
import{_ as B,k as E,r as l,I as R,w as z,o as A,c as u,l as g,q as o,b as e,D as G,E as Q,a7 as P,t as r,ac as U,F as V,x as F,v as k,m as S,J as M,aO as K,u as O,j as c,G as T,y as $}from"./index-CIAVq8iD-1776148658686.js";import{_ as H}from"./search-D2xJuklA-1776148658686.js";import{s as J}from"./payeeStore-BUBSCe8t-1776148658686.js";import{a as W}from"./toast-aIWCznBB-1776148658686.js";import{h as C}from"./imageHandler-DstQGL3Z-1776148658686.js";import{G as X}from"./GeneralHeader-ClI1i1Ud-1776148658686.js";import{G as Y}from"./GradientBorder-CfwSeIMB-1776148658686.js";import{m as Z}from"./MaskLayer-CMaJd7Gb-1776148658686.js";const ee={class:"search-payee"},te={class:"content"},oe={style:{display:"flex",gap:"4px"}},ae={style:{flex:"1","background-color":"white","border-radius":"32px",border:"1px solid #fff","box-sizing":"border-box",display:"flex","align-items":"center",gap:"4px",padding:"4px 12px"}},se=["placeholder"],re={key:0,class:"loading-state"},ne={key:1,style:{margin:"20px 0"}},ie={style:{padding:"16px"}},le={style:{display:"flex","align-items":"center","justify-content":"space-between",gap:"4px"}},ce={style:{flex:"1","min-width":"0",display:"flex","align-items":"center",gap:"4px"}},de={style:{width:"3.5em","align-self":"stretch",display:"flex","align-items":"center","justify-content":"center"}},ue=["src"],fe={style:{flex:"1","min-width":"0","align-self":"stretch",display:"flex","flex-direction":"column",gap:"4px"}},pe={style:{"font-weight":"700",overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},ye={style:{"font-size":"0.9em","font-weight":"500",color:"rgba(0, 0, 0, 0.4)"}},ge=["onClick"],he={key:2,class:"loading-state"},ve={style:{width:"80%","border-radius":"12px",background:"#fff",padding:"20px",display:"flex","flex-direction":"column","align-items":"center",gap:"8px"}},me={style:{"font-size":"1.2em",color:"rgba(0, 0, 0, 0.8)","font-weight":"800"}},_e={style:{color:"rgba(0, 0, 0, 0.4)","font-weight":"600","font-size":"1em"}},xe={style:{width:"100%",display:"flex","justify-content":"space-around","align-items":"center"}},be={__name:"SearchPayee",setup(we){const{t:a,locale:_}=E(),h=O(),p=M(),j=l(p.query||null);_.value&&R(_.value);const i=l(""),d=l([]),v=l(!1),f=l(!1),L=l(!1),y=l(!1),m=l({}),x=async()=>{if(console.log("searchQuery.value:",i.value),!i.value.trim()){d.value=[];return}v.value=!0,f.value=!1;try{const t=await K(i.value.trim(),"TRANSFER");if(t.status&&t.body){const s={id:t.body.id,account:t.body.account,name:t.body.userNickname,avatar:t.body.userAvatar,sex:t.body.userSex,age:t.body.age,countryName:t.body.countryName,countryCode:t.body.countryCode,accountStatus:t.body.accountStatus,goodID:t.body?.ownSpecialId?.account};d.value=[s]}else d.value=[]}catch(t){console.error("Search failed:",t),d.value=[],W(a("user_not_found_or_search_failed"))}finally{v.value=!1,f.value=!0}},q=()=>{f.value=!1,i.value="",d.value=[]},D=t=>{m.value=t,y.value=!0},I=()=>{m.value={},y.value=!1},N=async()=>{if(J({...m.value}),Object.keys(p.query).length>0){console.log("route.query:",p.query);try{await h.replace({path:p.query.from,query:{activeAction:p.query.activeAction}}),console.log("路由替换成功")}catch(t){console.error("路由替换失败:",t),h.go(-1)}}else h.go(-1),y.value=!1};return z(()=>i.value,()=>{f.value&&(f.value=!1)}),A(()=>{}),(t,s)=>{const b=U;return c(),u("div",ee,[g(X,{showLanguageList:!0,title:o(a)("search_payee"),backQuery:j.value,color:"black"},null,8,["title","backQuery"]),e("div",te,[e("div",oe,[e("div",ae,[s[4]||(s[4]=e("img",{src:H,alt:"",style:{width:"1.5em",opacity:"0.6"}},null,-1)),G(e("input",{"onUpdate:modelValue":s[0]||(s[0]=n=>i.value=n),type:"text",placeholder:o(a)("search_user"),class:"search-input",style:{flex:"1",border:"none",padding:"4px 0",background:"transparent",outline:"none",width:"100%"},onKeyup:P(x,["enter"])},null,40,se),[[Q,i.value]])]),!f.value&&i.value?(c(),u("button",{key:0,style:{border:"none",color:"rgba(0, 0, 0, 0.4)","font-weight":"600","background-color":"transparent"},onClick:x},r(o(a)("search")),1)):(c(),u("button",{key:1,style:{border:"none","font-weight":"600","background-color":"transparent"},onClick:q},r(o(a)("cancel")),1))]),L.value?(c(),u("div",re,[g(b,{margin:"0 auto 16px"}),e("p",null,r(o(a)("checking_permissions"))+"...",1)])):d.value.length>0?(c(),u("div",ne,[(c(!0),u(V,null,F(d.value,n=>(c(),T(Y,{key:n.id,style:{"margin-bottom":"12px"}},{default:S(()=>[e("div",ie,[e("div",le,[e("div",ce,[e("div",de,[e("img",{src:n.avatar||"",style:{display:"block",width:"100%","aspect-ratio":"1/1","border-radius":"50%","object-fit":"cover"},onError:s[1]||(s[1]=(...w)=>o(C)&&o(C)(...w))},null,40,ue)]),e("div",fe,[e("div",pe,r(n.name),1),e("div",ye,r(o(a)("user_id_prefix"))+" "+r(n.goodID||n.account),1)])]),e("div",{style:{width:"auto",color:"white","border-radius":"12px",background:"linear-gradient(269deg, #feb219 7.04%, #ff9326 96.78%)","font-size":"0.9em","font-weight":"500",padding:"4px 10px",cursor:"pointer"},onClick:w=>D(n)},r(o(a)("add")),9,ge)])])]),_:2},1024))),128))])):k("",!0),v.value?(c(),u("div",he,[g(b,{margin:"0 auto 16px"}),e("p",null,r(o(a)("searching"))+"...",1)])):k("",!0)]),g(Z,{maskLayerShow:y.value,onClick:s[3]||(s[3]=n=>y.value=!1)},{default:S(()=>[e("div",{style:{width:"100%",height:"100%",display:"flex","justify-content":"center","align-items":"center"},onClick:s[2]||(s[2]=$(()=>{},["stop"]))},[e("div",ve,[e("div",me,r(o(a)("tips")),1),e("div",_e,r(o(a)("confirm_transfer_to_user")),1),e("div",xe,[e("div",{style:{display:"flex","justify-content":"center","align-items":"center",background:"#fff","border-radius":"70px",border:"1px solid #ffb805",color:"#ff9500","font-weight":"800",padding:"8px 12px",width:"45%"},onClick:I},r(o(a)("cancel")),1),e("div",{style:{display:"flex","justify-content":"center","align-items":"center","border-radius":"70px",background:"linear-gradient(269deg, #feb219 7.04%, #ff9326 96.78%)",color:"#fff","font-weight":"800",padding:"8px 12px",width:"45%"},onClick:N},r(o(a)("confirm")),1)])])])]),_:1},8,["maskLayerShow"])])}}},Ne=B(be,[["__scopeId","data-v-fcf186ff"]]);export{Ne as default};
|