import{d as a,L as s,$ as e,l,c as t,q as n,o as u,a as i,f as o,u as r,g as d,t as c,j as v,C as m,B as p,y as b}from"./vendor-edc0678f.js";import{_ as f,q as _,e as y,w as I,ag as g,r as h,f as w}from"./index-4c745ab9.js";import{C as j,P as q}from"./ProductInfo-18a06758.js";import{p as x,a as C}from"./index-22f349d5.js";const S={class:"infoItem"},L={class:"title fw-bold"},P=["placeholder"],U={class:"tip-list"},V={class:"row"},A={class:"label"},B={class:"value"},N={class:"row"},T={class:"label"},k={class:"value"},D={class:"infoItem"},O=f({__name:"apply",setup(f){const{_toast:O}=_(),$=y();$.getUserInfo();const z=a(),E=s(),F=e({}),G=l(""),H=t(()=>{var a;let s=0;return $.asset.length&&(s=(null==(a=$.asset.filter(a=>"usdt"===a.symbol)[0])?void 0:a.availableAmount)||0),s}),J=l(),K=()=>{var a;let s={userId:null==(a=$.userInfo.user)?void 0:a.userId,ownId:F.id,amount:h(null==F?void 0:F.price,J.value||0),number:J.value||0};J.value>0&&J.value<F.numLimit?x(s).then(a=>{"200"==a.code?(O("Subscription_successful"),setTimeout(()=>{z.push("/subscription/order")},500)):b(a.msg)}):O("Please_ correct_quantity")};return n(()=>{G.value=E.query.id,(async()=>{if(G.value){const a=await C(G.value);200==a.code&&Object.assign(F,a.data)}})()}),(a,s)=>(u(),i("div",null,[o(I,{currentName:r(w)("Apply_subscription")},null,8,["currentName"]),o(j,{data:r(F)},null,8,["data"]),d("div",S,[d("p",L,c(r(w)("Subscription_quantity")),1),v(d("input",{type:"number",class:"numInput",placeholder:r(w)("exchange.input"),"onUpdate:modelValue":s[0]||(s[0]=a=>p(J)?J.value=a:null)},null,8,P),[[m,r(J)]])]),d("div",U,[d("div",V,[d("div",A,c(r(w)("available_quantity")),1),d("div",B,c(r(F).numLimit)+" "+c(r(F).showSymbol),1)]),d("div",N,[d("div",T,c(r(w)("exchange_balance")),1),d("div",k,c(r(H)||0)+" USDT",1)])]),d("div",D,[o(q,{data:r(F)},null,8,["data"])]),d("div",{class:"infoItem btnBox",onClick:K},[o(g,{btnValue:r(w)("btnConfirm")},null,8,["btnValue"])])]))}},[["__scopeId","data-v-f617943b"]]);export{O as default};
