| 1 |
- var L=Object.defineProperty,O=Object.defineProperties;var W=Object.getOwnPropertyDescriptors;var E=Object.getOwnPropertySymbols;var Y=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var D=(c,s,t)=>s in c?L(c,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[s]=t,F=(c,s)=>{for(var t in s||(s={}))Y.call(s,t)&&D(c,t,s[t]);if(E)for(var t of E(s))j.call(s,t)&&D(c,t,s[t]);return c},S=(c,s)=>O(c,W(s));var I=(c,s,t)=>new Promise((f,l)=>{var B=m=>{try{_(t.next(m))}catch(A){l(A)}},k=m=>{try{_(t.throw(m))}catch(A){l(A)}},_=m=>m.done?f(m.value):Promise.resolve(m.value).then(B,k);_((t=t.apply(c,s)).next())});import{d as Q,V as X,e as T,r as x,u as Z,f as J,g as r,aE as R,z as aa,aF as ea,Q as v,B as N,_ as ta,D as y,X as la,Y as oa,o as na,h as n,j as ra,F as a,R as u,P as ua,K as sa,L as d,M as i,U as K,aY as g,Z as b,q as da}from"./index-q8TQmcfk.js";import{_ as ia}from"./wd-navbar.CKQFKmAo.js";import{_ as ca}from"./wd-picker.Swg_ox4o.js";import{_ as ma}from"./wd-form.NSjLwpNU.js";import{h as wa}from"./wallet.DKnOUjfT.js";const fa=Q({name:"Withdraw",__name:"withdraw",setup(c){const s=X(),t=T(()=>ea()),f=x({}),l=x({amount:"",bank:t.value.bank,bankAccountName:t.value.bankAccountName,bankAccount:t.value.bankAccount,currency:"BDT"}),B=[{label:"BKASH",value:"BKASH"},{label:"NAGAD",value:"NAGAD"},{label:"ROCKET",value:"ROCKET"}],k=x(300),_=x(2e4),m=x(!1);function A(){return I(this,null,function*(){if(!l.value.bank){b.info(u("wallet.withdraw.error.bankName"));return}if(!l.value.bankAccountName){b.info(u("wallet.withdraw.error.bankAccountName"));return}if(!l.value.bankAccount){b.info(u("wallet.withdraw.error.bankAccountNo"));return}if(!l.value.amount){b.info(u("wallet.withdraw.error.amount"));return}const o=Number(l.value.amount);if(Number.isNaN(o)){b.info(u("wallet.withdraw.error.amount"));return}if(o<k.value){b.info(u("wallet.withdraw.notes.4",[v(k.value),v(_.value)]));return}if(o>_.value){b.info(u("wallet.withdraw.notes.4",[v(k.value),v(_.value)]));return}const e=Number(f.value.balance);if(o>e){b.info(u("wallet.withdraw.error.amount"));return}m.value=!0;try{const h=yield wa(S(F({},l.value),{accountType:f.value.type,channel:l.value.bank}));h.code==="200"?(s.getUserInfo(),b.success(u("wallet.withdraw.success")),setTimeout(()=>{K()},1500)):b.error(h.message||u("wallet.withdraw.fail"))}finally{m.value=!1}})}const V=x();function H(){return I(this,null,function*(){try{const o=yield R({code:f.value.type==="2"?"earning_withdraw_rate":"withdraw_rate"});V.value=o.data.valueInfo;const e=yield R({code:"min_withdraw_amount"});e.code==="200"&&e.data.valueInfo&&(k.value=Number(e.data.valueInfo));const h=yield R({code:"max_withdraw_amount"});h.code==="200"&&h.data.valueInfo&&(_.value=Number(h.data.valueInfo))}catch(o){}})}const M=T(()=>{const o=Number(l.value.amount);if(!o||Number.isNaN(o)||!V.value)return"0.00";const e=Number(V.value);return v(o*(e/100))});return Z(o=>{f.value=o,H()}),(o,e)=>{const h=N(y("wd-icon"),ta),$=ua,P=N(y("wd-navbar"),ia),p=ra,C=N(y("wd-input"),la),q=N(y("wd-picker"),ca),U=N(y("wd-button"),oa),z=N(y("wd-form"),ma),G=aa("layout-default-uni");return na(),J(G,null,{default:r(()=>[n(p,{class:"min-h-100vh flex flex-col bg-#FEE750"},{default:r(()=>[n(P,{"custom-class":"bg-#FEE750!",bordered:!1,placeholder:"","safe-area-inset-top":"",fixed:"",title:a(u)("wallet.withdraw.title")},{left:r(()=>[n(h,{name:"thin-arrow-left",size:"32rpx",onClick:e[0]||(e[0]=()=>a(K)())})]),right:r(()=>[n($,{class:"text-28rpx",onClick:e[1]||(e[1]=w=>a(sa)({url:"/pages/wallet/withdrawRecord",params:{type:a(f).type}}))},{default:r(()=>[d(i(o.$t("wallet.withdraw.record")),1)]),_:1})]),_:1},8,["title"]),n(p,{class:"px-28rpx pb-28rpx pt-40rpx"},{default:r(()=>[n(p,{class:"text-28rpx"},{default:r(()=>[d(i(o.$t(a(f).type==="2"?"wallet.withdraw.balanceRevenue":"wallet.withdraw.balanceWallet")),1)]),_:1}),n(p,null,{default:r(()=>[n($,{class:"text-28rpx"},{default:r(()=>[d(" ৳ ")]),_:1}),n($,{class:"text-48rpx font-bold"},{default:r(()=>[d(i(a(v)(a(f).balance)),1)]),_:1})]),_:1})]),_:1}),n(p,{class:"flex-1 rounded-t-24rpx bg-white p-24rpx"},{default:r(()=>[n(p,{class:"mb-28rpx text-32rpx"},{default:r(()=>[d(i(o.$t("wallet.withdraw.info")),1)]),_:1}),n(z,{ref:"form",model:a(l),"custom-class":"mb-28rpx"},{default:r(()=>[n(p,{class:"mb-40rpx space-y-32rpx"},{default:r(()=>[n(q,{modelValue:a(l).bank,"onUpdate:modelValue":e[3]||(e[3]=w=>a(l).bank=w),disabled:!!a(t).bank,columns:B,"use-default-slot":""},{default:r(()=>[n(C,{modelValue:a(l).bank,"onUpdate:modelValue":e[2]||(e[2]=w=>a(l).bank=w),placeholder:a(u)("wallet.withdraw.form.bankName"),"no-border":"",readonly:"","custom-class":"bandhu-auth-input-field",disabled:!!a(t).bank},null,8,["modelValue","placeholder","disabled"])]),_:1},8,["modelValue","disabled"]),n(C,{modelValue:a(l).bankAccountName,"onUpdate:modelValue":e[4]||(e[4]=w=>a(l).bankAccountName=w),placeholder:a(u)("wallet.withdraw.form.bankAccountName"),"no-border":"","custom-class":"bandhu-auth-input-field",disabled:!!a(t).bankAccountName},null,8,["modelValue","placeholder","disabled"]),n(C,{modelValue:a(l).bankAccount,"onUpdate:modelValue":e[5]||(e[5]=w=>a(l).bankAccount=w),placeholder:a(u)("wallet.withdraw.form.bankAccountNo"),"no-border":"","custom-class":"bandhu-auth-input-field",disabled:!!a(t).bankAccountName},null,8,["modelValue","placeholder","disabled"]),n(p,{class:"flex items-center gap-20rpx"},{default:r(()=>[n(C,{modelValue:a(l).amount,"onUpdate:modelValue":e[6]||(e[6]=w=>a(l).amount=w),placeholder:a(u)("wallet.withdraw.form.amount"),"no-border":"","custom-class":"flex-1 bandhu-auth-input-field",type:"digit"},null,8,["modelValue","placeholder"]),n(U,{type:"error",plain:"","custom-class":"bandhu-auth-secondary-btn",onClick:e[7]||(e[7]=w=>a(l).amount=a(f).balance)},{default:r(()=>[d(i(o.$t("wallet.withdraw.form.allAmount")),1)]),_:1})]),_:1}),n(p,{class:"text-24rpx"},{default:r(()=>[d(" Service Fee:৳"+i(a(M)),1)]),_:1})]),_:1}),n(U,{plain:"",block:"","custom-class":"h-80rpx!",loading:a(m),onClick:A},{default:r(()=>[d(i(o.$t("wallet.withdraw.form.submit")),1)]),_:1},8,["loading"])]),_:1},8,["model"]),n(p,{class:"text-24rpx text-#5A5A5A line-height-48rpx"},{default:r(()=>[d(i(o.$t("wallet.withdraw.notes.title"))+" ",1),g("br"),d(" "+i(o.$t("wallet.withdraw.notes.1"))+" ",1),g("br"),d(" "+i(o.$t("wallet.withdraw.notes.2"))+" ",1),g("br"),d(" "+i(o.$t("wallet.withdraw.notes.3"))+" ",1),g("br"),d(" "+i(a(u)("wallet.withdraw.notes.4",[a(v)(a(k)),a(v)(a(_))]))+" ",1),g("br"),d(" "+i(a(u)("wallet.withdraw.notes.5",[a(V)])),1)]),_:1})]),_:1})]),_:1})]),_:1})}}}),xa=da(fa,[["__scopeId","data-v-2d67325d"]]);export{xa as default};
|