import{c as a,w as e,n as s,u as t,i as c,r,o,a as l,I as i,b as n,f as d,d as h,t as m,S as u,p,F as y,q as f,g}from"./index-Bu3F9tAw.js";import{_ as b}from"./guide-nav-bar.yY-zdTOi.js";import{_,r as k}from"./uni-app.es.Da4i0HVV.js";import{f as v,h as w}from"./settlement.QW_qw-3v.js";import{b as C}from"./router.C3rCNR3P.js";import{_ as B}from"./chevron-right.afhjJCen.js";import"./system.CBmUIIZ_.js";const T=_({components:{GuideNavBar:b},data:()=>({cityName:"",cityCode:"",searchKeyword:"",branches:[],loading:!1,loadError:!1,searchTimer:null,isLeaving:!1}),onLoad(a){a&&a.city&&(this.cityName=decodeURIComponent(a.city)),a&&a.cityCode&&(this.cityCode=decodeURIComponent(a.cityCode)),this.loadBranches()},onUnload(){this.searchTimer&&clearTimeout(this.searchTimer)},methods:{goBack(){this.isLeaving||(this.isLeaving=!0,setTimeout(()=>{C("/pages/bank-card-add/index")},280))},onSearchInput(){this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=setTimeout(()=>{this.loadBranches()},250)},loadBranches(){this.loading=!0,this.loadError=!1,w(this.searchKeyword.trim(),this.cityCode).then(a=>{this.branches=a||[],this.loading=!1}).catch(()=>{this.loading=!1,this.loadError=!0})},selectBranch(a){v({branchName:a.branchName,bankName:a.bankName,branchCode:a.branchCode}),t()}}},[["render",function(t,_,v,w,C,T){const x=k(r("guide-nav-bar"),b),N=i,j=n,I=c,L=d,E=u;return o(),a(I,{class:s(["page",{leaving:C.isLeaving}])},{default:e(()=>[l(x,{title:"选择开户行",onBack:T.goBack},null,8,["onBack"]),l(I,{class:"search-section"},{default:e(()=>[l(I,{class:"search-box"},{default:e(()=>[l(N,{class:"search-input",modelValue:C.searchKeyword,"onUpdate:modelValue":_[0]||(_[0]=a=>C.searchKeyword=a),maxlength:"30",placeholder:"搜索银行或支行名称","placeholder-class":"search-placeholder",onInput:T.onSearchInput},null,8,["modelValue","onInput"]),l(j,{class:"search-icon",src:"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23596579'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3ccircle%20cx='11'%20cy='11'%20r='8'/%3e%3cpath%20d='m21%2021-4.3-4.3'/%3e%3c/svg%3e",mode:"aspectFit"})]),_:1}),l(L,{class:"city-tip"},{default:e(()=>[h("当前开户城市:"+m(C.cityName),1)]),_:1})]),_:1}),l(E,{class:"branch-scroll","scroll-y":""},{default:e(()=>[l(I,{class:"branch-card"},{default:e(()=>[(o(!0),p(y,null,f(C.branches,(s,t)=>(o(),a(I,{key:s.id,class:"branch-item",onClick:a=>T.selectBranch(s)},{default:e(()=>[l(L,{class:"branch-name"},{default:e(()=>[h(m(s.branchName),1)]),_:2},1024),l(j,{class:"branch-arrow",src:B,mode:"aspectFit"}),t[l(L,{class:"empty-title"},{default:e(()=>[h("正在加载开户行")]),_:1})]),_:1})):C.loadError?(o(),a(I,{key:1,class:"empty-state",onClick:T.loadBranches},{default:e(()=>[l(L,{class:"empty-title"},{default:e(()=>[h("开户行加载失败")]),_:1}),l(L,{class:"empty-tip"},{default:e(()=>[h("点击重新加载")]),_:1})]),_:1},8,["onClick"])):C.branches.length?g("",!0):(o(),a(I,{key:2,class:"empty-state"},{default:e(()=>[l(L,{class:"empty-title"},{default:e(()=>[h("未找到匹配的开户行")]),_:1}),l(L,{class:"empty-tip"},{default:e(()=>[h("请尝试输入银行简称或支行名称")]),_:1})]),_:1})),l(I,{class:"safe-space"})]),_:1})]),_:1},8,["class"])}],["__scopeId","data-v-2d3b58a9"]]);export{T as default};