2 lines
8.5 KiB
JavaScript
2 lines
8.5 KiB
JavaScript
import{_ as W,k as Y,I as J,o as K,c as d,l as v,q as s,b as e,t as i,m as C,v as y,r as l,S as T,u as O,j as u,D as q,E as H,y as D,a3 as Z,a4 as $,X as ee,a5 as te,a6 as se}from"./index-CIAVq8iD-1776148658686.js";import{_ as oe}from"./coin-Dqu2_ND9-1776148658686.js";import{g as ae}from"./coinSellerStore-FCN4A8Yr-1776148658686.js";import{a as p,s as ie}from"./toast-aIWCznBB-1776148658686.js";import{u as ne}from"./pageConfig-BUpLPO7w-1776148658686.js";import{h as A}from"./imageHandler-DstQGL3Z-1776148658686.js";import{G as re}from"./GeneralHeader-ClI1i1Ud-1776148658686.js";import{G as F}from"./GradientBorder-CfwSeIMB-1776148658686.js";import{m as le}from"./MaskLayer-CMaJd7Gb-1776148658686.js";const ce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAAT1JREFUeAG1VIFxwjAMfLpAGcGdoO0EzQgdIRuUTkA2KExAOkGvE7QbtBuQDYAJgh5Lh2NsE47j7/4SW/L7o9gCrkQPzIU9nxxPRqxxwifhVNgJ/4XbQLC398kZvVr449eckPOVCjbqsFHRE9DJly6gk091Rdzr/KuOF8J3FECxP3Wx0HEKTjdl3qok+KFJDcah1fxZblerTypG57FjjtfCTSJ2+EQKVgnBuhCbaYw5uAsCj/A/4ReXodXnSyzocPybl2CrdLEgMT2z+A3pz06CRd9kYrwpLL4d7HWwucPxmA0cfmtSlRBkKR6Ez8IlfJ3t+lWBoQEc8scmBzs2oeMB7OjMMQ4rFA627WhXj8kuk8d5axxtGMg1B4qxAXTw9WINd/DNgfPWzpYldzHqwG22fcUY22CNHaIGe3PsAWfOXpFuCeqiAAAAAElFTkSuQmCC",de={class:"coin-seller"},ue={key:0,class:"content"},fe={style:{"margin-bottom":"12px",display:"flex","align-items":"center","justify-content":"space-between"}},pe={style:{margin:"0 1%","font-weight":"600","font-size":"1.3em"}},ge={style:{padding:"16px"}},he={class:"user-info"},_e={class:"avatar"},me=["src"],ve={class:"user-details"},ye={style:{display:"flex","align-items":"center"}},Ae={style:{"font-weight":"600"}},xe={style:{"margin-top":"12px",width:"100%",display:"flex","align-items":"center"}},be={style:{color:"#ffb627","font-weight":"590","margin-left":"5px"}},we={style:{padding:"16px"}},ke={key:0},Ce={style:{"margin-bottom":"12px","font-weight":"600",color:"#333"}},Ee={class:"selected-user"},je={class:"user-info"},Ie={class:"user-avatar"},Re=["src"],Be={class:"user-details"},Se={class:"user-name"},Te={class:"user-id"},De={style:{display:"flex","align-items":"center"}},Fe={key:1,style:{display:"flex","justify-content":"center","align-items":"center"}},Le={key:2,style:{"margin-top":"12px"}},Ue={style:{"margin-bottom":"12px","font-weight":"600",color:"#333"}},ze={style:{"margin-bottom":"16px","background-color":"white",padding:"10px 16px","border-radius":"8px",background:"#ffe5a1"}},Ne=["placeholder"],Ge={style:{display:"flex","justify-content":"center"}},Qe=["disabled"],Pe={style:{width:"100%",height:"100%",display:"flex","justify-content":"center","align-items":"center"}},Xe={style:{position:"relative",width:"100%"}},Me={style:{"text-align":"center",color:"rgba(0, 0, 0, 0.8)","font-weight":"800"}},Ve={style:{color:"rgba(0, 0, 0, 0.5)","font-weight":"600","text-align":"center"}},We={style:{color:"rgba(0, 0, 0, 0.8)","font-weight":"700","font-size":"1.3em"}},Ye={style:{color:"rgba(0, 0, 0, 0.4)","font-weight":"600","font-size":"1.1em"}},Je={style:{width:"80%",display:"flex","justify-content":"space-between","align-items":"center"}},Ke={__name:"index",setup(Oe){const{t:a,locale:E}=Y(),x=O();E.value&&J(E.value);const g=l(!1),b=l("0"),j=l(!1),I=l({}),w=l(!1),k=l(!1),L=T(()=>w.value||k.value),r=l({id:"",name:""}),h=()=>{w.value=!1,k.value=!1},U=()=>{console.log("取消选择"),h()},z=()=>{console.log("确认选择"),X(),h()},N=t=>{let o=t.target.value;o=o.replace(/[^0-9]/g,""),(o===""||parseInt(o)<1)&&(o=""),t.target.value=o,c.value=parseFloat(o)||0},G=t=>{[".","e","+","-"].includes(t.key)&&t.preventDefault()},Q=async()=>{try{const t=await Z();if(t&&t.status!==void 0&&(g.value=t.body===!0,!g.value)){p(a("not_authorized"));return}}catch(t){console.error("Permission verification failed:",t),g.value=!1,x.go(-1)}},P=async()=>{try{j.value=!0;const t=await $();t&&t.status&&t.body!==void 0&&(b.value=t.body.toString())}catch(t){console.error("获取金币余额失败:",t)}finally{j.value=!1}},X=async()=>{try{let t={deliveryThreshold:I.value.value};await se(t),I.value={}}catch(t){console.log("设置失败:",t)}},M=()=>{const t=ae();t&&t.id&&(r.value={...t})},c=l(""),f=l(!1),R=T(()=>r.value.id&&c.value&&parseFloat(c.value)>0&&!f.value),V=()=>{x.push("/seller-records")},B=()=>{x.push("/coin-seller-search")},S=ee(async()=>{if(!R.value||f.value)return;const t=parseFloat(c.value);if(t<=0){p(a("please_enter_valid_amount"));return}const o=r.value.id;if(!o){p(a("user_not_found_or_search_failed"));return}try{f.value=!0;const m=await te({acceptUserId:o,quantity:t});m&&m.status?(m.body!==void 0&&(b.value=m.body.toString()),ie(a("transfer_coin_success",{amount:t,name:r.value.name})),c.value=""):p(a("transfer_coin_failed",{amount:t}))}catch(n){console.error("币商充值金币失败:",n),p(n.response.errorMsg||a("transfer_coin_failed",{amount:t}))}finally{f.value=!1}},2e3),{userInfo:_}=ne("COIN_SELLER",{onDataLoaded:t=>{Q(),P(),M()}});return K(()=>{}),(t,o)=>(u(),d("div",de,[v(re,{isHomePage:!0,showLanguageList:!0,title:s(a)("recharge_agency"),color:"black"},null,8,["title"]),g.value?(u(),d("div",ue,[e("div",fe,[e("div",pe,i(s(a)("my_account")),1),e("img",{onClick:V,src:ce,alt:"",style:{width:"1.5em","aspect-ratio":"1/1",display:"block","object-fit":"cover"}})]),v(F,{style:{"margin-bottom":"12px"}},{default:C(()=>[e("div",ge,[e("div",he,[e("div",_e,[e("img",{src:s(_).userAvatar||"",alt:"",style:{display:"block","object-fit":"cover",width:"100%","aspect-ratio":"1/1","border-radius":"50%"},onError:o[0]||(o[0]=(...n)=>s(A)&&s(A)(...n))},null,40,me)]),e("div",ve,[e("h3",null,i(s(_).userNickname||s(_).name),1),e("p",null,[e("span",ye,[e("span",null,i(s(a)("user_id_prefix"))+" "+i(s(_).id),1)])])])]),e("div",null,[e("div",Ae,i(s(a)("my_coins")),1),e("div",xe,[o[6]||(o[6]=e("img",{src:oe,alt:"",height:"20px",style:{display:"block"}},null,-1)),e("div",be,i(b.value),1)])])])]),_:1}),v(F,{style:{"margin-bottom":"16px"}},{default:C(()=>[e("div",we,[r.value.id?(u(),d("div",ke,[e("div",Ce,i(s(a)("user")),1),e("div",Ee,[e("div",je,[e("div",Ie,[e("img",{src:r.value.userAvatar||"",alt:"",style:{display:"block","object-fit":"cover",width:"100%","aspect-ratio":"1/1","border-radius":"50%"},onError:o[1]||(o[1]=(...n)=>s(A)&&s(A)(...n))},null,40,Re)]),e("div",Be,[e("div",Se,i(r.value.name),1),e("div",Te,[e("span",De,[e("span",null,i(s(a)("user_id_prefix"))+" "+i(r.value.account),1)])])])]),e("button",{class:"change-btn",onClick:B},i(s(a)("change")),1)])])):(u(),d("div",Fe,[e("div",{style:{"font-weight":"590",color:"white",padding:"10px 16px","border-radius":"20px",background:"linear-gradient(269deg, #feb219 7.04%, #ff9326 96.78%)"},onClick:B},i(s(a)("search")),1)])),r.value.id?(u(),d("div",Le,[e("div",Ue,i(s(a)("recharge"))+": ",1),e("div",ze,[q(e("input",{"onUpdate:modelValue":o[2]||(o[2]=n=>c.value=n),placeholder:s(a)("enter_recharge_amount"),class:"amount-input",onInput:N,onKeydown:G,dir:"ltr",inputmode:"decimal"},null,40,Ne),[[H,c.value]])]),e("div",Ge,[e("button",{class:"recharge-btn",disabled:!R.value||f.value,onClick:o[3]||(o[3]=(...n)=>s(S)&&s(S)(...n))},i(f.value?s(a)("loading"):s(a)("recharge_now")),9,Qe)])])):y("",!0)])]),_:1})])):y("",!0),v(le,{maskLayerShow:L.value,onClick:h},{default:C(()=>[e("div",Pe,[w.value?(u(),d("div",{key:0,style:{width:"80%","border-radius":"12px",background:"#fff",padding:"20px",display:"flex","flex-direction":"column","align-items":"center",gap:"8px"},onClick:o[4]||(o[4]=D(()=>{},["stop"]))},[e("div",Xe,[e("div",Me,i(s(a)("tips")),1),e("div",{style:{position:"absolute",top:"0",right:"0"},onClick:h},"X")]),e("div",Ve,i(s(a)("min_transfer_amount_tip")),1)])):y("",!0),k.value?(u(),d("div",{key:1,style:{width:"80%","border-radius":"12px",background:"#fff",padding:"20px",display:"flex","flex-direction":"column","align-items":"center",gap:"8px"},onClick:o[5]||(o[5]=D(()=>{},["stop"]))},[e("div",We,i(s(a)("tips")),1),e("div",Ye,i(s(a)("confirm_transfer_limit")),1),e("div",Je,[e("div",{style:{display:"flex","justify-content":"center","align-items":"center",background:"#fff","border-radius":"70px",border:"1px solid #ffb805",color:"#ffb805","font-weight":"800",padding:"8px 12px",width:"40%"},onClick:U},i(s(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:"40%"},onClick:z},i(s(a)("confirm")),1)])])):y("",!0)])]),_:1},8,["maskLayerShow"])]))}},it=W(Ke,[["__scopeId","data-v-0d1778c7"]]);export{it as default};
|