test_lgq/niucloud/public/wap/assets/app-pages-member-apply_cash_out.f6734c8e.js

2 lines
12 KiB
JavaScript
Raw Normal View History

2024-01-24 17:36:08 +08:00
import{d as e,r as a,X as t,a as l,c as n,aa as s,o,a9 as c,Y as p,ah as i,ai as u,h as r,E as d,i as y,w as f,j as x,J as A,K as m,m as g,l as _,F as b,aj as h,ak as k,al as T,am as B,$ as O,t as v,M as w,an as G,L as Q,p as F,q as C,ao as M,x as P}from"./index-849cf30e.js";import{_ as U}from"./u-button.9fa3f2a0.js";import{_ as S}from"./u-loading-page.195e23a4.js";import"./u-loading-icon.d012ecbf.js";import"./_plugin-vue_export-helper.1b428a4d.js";import"./u-icon.e3aa4770.js";import"./u-transition.75065529.js";const Y=e({__name:"apply_cash_out",setup(e){const Y=a(!0),Z=a(!1),j=t(),E=l({apply_money:"",transfer_type:"",account_type:"money",account_id:0}),H=n((()=>j.info?j.info[E.account_type]:0));s((()=>E.transfer_type),(e=>{switch(e){case"bank":E.account_id=R.value?R.value.account_id:0;break;case"alipay":E.account_id=N.value?N.value.account_id:0;break;default:E.account_id=0}}),{immediate:!0});const V=l({is_auto_transfer:0,is_auto_verify:0,is_open:0,min:0,rate:0,transfer_type:[]});let L={};o((async e=>{L=e,uni.getStorageSync("cashOutAccountType")&&(E.account_type=uni.getStorageSync("cashOutAccountType")),["money","commission"].includes(E.account_type)?await u().then((e=>{for(let a in e.data)V[a]=e.data[a];V.transfer_type.includes("wechat")&&j.info&&!j.info.wx_openid&&!j.info.weapp_openid&&V.transfer_type.splice(0,1),V.transfer_type.includes("bank")&&D(),V.transfer_type.includes("alipay")&&z(),E.transfer_type=V.transfer_type[0],Y.value=!1})):c({title:p("abnormalOperation"),icon:"none",success(){setTimeout((()=>{i({delta:1})}),1500)}})}));const I=()=>{E.apply_money=h(H)},X=()=>{E.apply_money=""},N=a(null),z=()=>{const e={account_type:"alipay",account_id:0};let a=k;L.type&&"alipay"==L.type&&L.account_id&&(a=T,e.account_id=L.account_id),a(e).then((e=>{e.data&&e.data.account_id&&(N.value=e.data)}))},R=a(null),D=()=>{const e={account_type:"bank",account_id:0};let a=k;L.type&&"bank"==L.type&&L.account_id&&(a=T,e.account_id=L.account_id),a(e).then((e=>{e.data&&e.data.account_id&&(R.value=e.data)}))},W=()=>{if(E.transfer_type?uni.$u.test.isEmpty(E.apply_money)?(c({title:p("applyMoneyPlaceholder"),icon:"none"}),0):uni.$u.test.amount(E.apply_money)?parseFloat(E.apply_money)>parseFloat(H.value)?(c({title:p("applyMoneyExceed"),icon:"none"}),0):!(parseFloat(E.apply_money)<parseFloat(V.min)&&(c({title:p("applyMoneyBelow"),icon:"none"}),1)):(c({title:p("moneyformatError"),icon:"none"}),0):(c({title:p("noAvailableCashOutType"),icon:"none"}),0)){if(Z.value)return;Z.value=!0,B(E).then((e=>{O({url:"/app/pages/member/cash_out"})})).catch((()=>{Z.value=!1}))}};return(e,a)=>{const t=v,l=w,n=G,s=Q,o=F(C("u-button"),U),c=M,i=F(C("u-loading-page"),S);return r(),d(b,null,[Y.value?_("v-if",!0):(r(),y(c,{key:0,"scroll-y":"true",class:"w-screen h-screen bg-page"},{default:f((()=>[x(t,null,{default:f((()=>[x(t,{class:"p-[30rpx] bg-white"},{default:f((()=>[x(t,null,{default:f((()=>[A(m(g(p)("cashOutMoneyTip")),1)])),_:1}),x(t,{class:"flex py-[20rpx] items-baseline border-0 border-b-[2rpx] border-solid border-gray-200"},{default:f((()=>[x(l,{class:"text-[60rpx]"},{default:f((()=>[A(m(g(p)("currency")),1)])),_:1}),x(n,{type:"digit",class:"h-[70rpx] leading-[70rpx] pl-[10rpx] flex-1 font-bold text-[60rpx]",modelValue:E.apply_money,"onUpdate:modelValue":a[0]||(a[0]=e=>E.apply_money=e)},null,8,["modelValue"]),E.apply_money?(r(),y(s,{key:0,onClick:X,src:g(P)("static/resource/images/member/apply_withdrawal/close.png"),class:"w-[40rpx] h-[40rpx]",mode:"widthFix"},null,8,["src"])):_("v-if",!0)])),_:1}),x(t,{class:"pt-[20rpx]"},{default:f((()=>[x(l,{class:"text-gray-400 text-[28rpx]"},{default:f((()=>[A(m(g(p)("money"))+""+m(g(p)("currency"))+m(g(h)(g(H))),1)])),_:1}),x(l,{class:"pl-[10rpx] text-[28rpx] text-primary",onClick:I},{default:f((()=>[A(m(g(p)("allTx")),1)])),_:1})])),_:1}),x(t,null,{default:f((()=>[x(l,{class:"text-[24rpx] text-gray-400"},{default:f((()=>[A(m(g(p)("minWithdrawal"))+m(g(p)("currency"))+m(g(h)(V.min)),1)])),_:1}),x(l,{class:"text-[24rpx] text-gray-400"},{default:f((()=>[A(""+m(g(p)("commissionTo"))+m(V.rate+"%"),1)])),_:1})])),_:1