mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-02-26 01:40:25 +00:00
2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
import{d as e,r as a,k as t,p as r,l,ah as c,H as o,K as n,A as p,t as s,W as d,X as i,a as u,ax as x,aa as _,ay as y,o as f,c as m,w as h,b,x as v,y as g,u as w,f as k,z as T,s as C,n as F,aj as O,az as A,aA as E,aB as j,j as N,E as V,I as M,M as W,F as B,av as I,g as S,i as z,N as L}from"./index-7c3a221b.js";import{_ as $}from"./loading-page.vue_vue_type_script_setup_true_lang.670312d0.js";import{_ as H}from"./_plugin-vue_export-helper.1b428a4d.js";import"./u-loading-icon.2d721490.js";import"./u-transition.2636624c.js";const K=H(e({__name:"apply_cash_out",setup(e){const H=a(!0),K=a(!1),P=t(),U=r({apply_money:"",transfer_type:"",account_type:"money",account_id:0,transfer_payee:{open_id:"",channel:""}}),X=l((()=>P.info?P.info[U.account_type]:0));c((()=>U.transfer_type),(e=>{switch(e){case"bank":U.account_id=ae.value?ae.value.account_id:0;break;case"alipay":U.account_id=Y.value?Y.value.account_id:0;break;case"wechat_code":U.account_id=le.value?le.value.account_id:0;break;default:U.account_id=0}}),{immediate:!0});const q=r({is_auto_transfer:0,is_auto_verify:0,is_open:0,min:0,rate:0,transfer_type:[]});let D={};o((async e=>{D=e,uni.getStorageSync("cashOutAccountType")&&(U.account_type=uni.getStorageSync("cashOutAccountType")),n()&&P.getMemberInfo(),["money","commission"].includes(U.account_type)?await x().then((e=>{for(let a in _(e.data))q[a]=_(e.data[a]);q.transfer_type.includes("wechatpay")&&P.info&&!P.info.wx_openid&&!P.info.weapp_openid?q.transfer_type.splice(q.transfer_type.indexOf("wechatpay"),1):q.transfer_type.includes("wechatpay")&&se(),q.transfer_type.includes("bank")&&te(),q.transfer_type.includes("alipay")&&Z(),q.transfer_type.includes("wechat_code")&&ce(),U.transfer_type=q.transfer_type[0],D.type&&(U.transfer_type=D.type),H.value=!1})):p({title:s("abnormalOperation"),icon:"none",success(){setTimeout((()=>{d().length>1?i({delta:1}):u({url:"/app/pages/member/index",mode:"reLaunch"})}),1500)}})}));const G=l((()=>{let e=0;return U.apply_money&&Number(q.rate)&&(e=Number(U.apply_money)*Number(q.rate)/100),e.toFixed(2)})),J=()=>{parseFloat(X.value)&&(U.apply_money=O(X.value))},Q=()=>{U.apply_money=""},R=a(!1),Y=a(null),Z=()=>{const e={account_type:"alipay",account_id:0};let a=A;D.type&&"alipay"==D.type&&D.account_id&&(a=E,e.account_id=D.account_id),R.value=!0,a(e).then((e=>{e.data&&e.data.account_id&&(Y.value=e.data,"alipay"!=U.transfer_type||U.account_id||(U.account_id=Y.value.account_id)),R.value=!1}))},ee=a(!1),ae=a(null),te=()=>{const e={account_type:"bank",account_id:0};let a=A;D.type&&"bank"==D.type&&D.account_id&&(a=E,e.account_id=D.account_id),ee.value=!0,a(e).then((e=>{e.data&&e.data.account_id&&(ae.value=e.data,"bank"!=U.transfer_type||U.account_id||(U.account_id=ae.value.account_id)),ee.value=!1}))},re=a(!1),le=a(null),ce=()=>{const e={account_type:"wechat_code",account_id:0};let a=A;D.type&&"wechat_code"==D.type&&D.account_id&&(a=E,e.account_id=D.account_id),re.value=!0,a(e).then((e=>{e.data&&e.data.account_id&&(le.value=e.data,"wechat_code"!=U.transfer_type||U.account_id||(U.account_id=le.value.account_id)),re.value=!1}))},oe=()=>{if(U.transfer_type?uni.$u.test.isEmpty(U.apply_money)?(p({title:s("applyMoneyPlaceholder"),icon:"none"}),0):uni.$u.test.amount(U.apply_money)?parseFloat(U.apply_money)>parseFloat(X.value)?(p({title:s("applyMoneyExceed"),icon:"none"}),0):!(parseFloat(U.apply_money)<parseFloat(q.min)&&(p({title:s("applyMoneyBelow"),icon:"none"}),1)):(p({title:s("moneyformatError"),icon:"none"}),0):(p({title:s("noAvailableCashOutType"),icon:"none"}),0)){if(K.value)return;K.value=!0,j(U).then((e=>{K.value=!1,P.getMemberInfo((()=>{"wechatpay"==U.transfer_type?u({url:"/app/pages/member/cash_out_detail",param:{id:e.data}}):u({url:"/app/pages/member/cash_out"})}))})).catch((()=>{K.value=!1}))}},ne=()=>{if(!Y.value)return p({title:s("cashOutToAlipayTips"),icon:"none"}),!1;U.transfer_type="alipay"},pe=()=>{if(!ae.value)return p({title:s("cashOutToBankTips"),icon:"none"}),!1;U.transfer_type="bank"},se=()=>{let e=y();U.transfer_payee.open_id=e.wechat?e.wechat:e.weapp,U.transfer_payee.channel=e.wechat?"wechat":"weapp",U.transfer_type="wechatpay"},de=()=>{if(!le.value)return p({title:s("cashOutToWechatCodeTips"),icon:"none"}),!1;U.transfer_type="wechat_code"};return(e,a)=>{const t=N,r=V,l=M,c=W,o=B,n=I,p=S(z("loading-page"),$);return f(),m(t,{style:F(e.themeColor())},{default:h((()=>[H.value||1!=q.is_open?k("v-if",!0):(f(),m(n,{key:0,"scroll-y":!0,class:"w-screen h-screen bg-[var(--page-bg-color)]"},{default:h((()=>[b(t,{class:"sidebar-margin pt-[var(--top-m)]"},{default:h((()=>[b(t,{class:"card-template"},{default:h((()=>[b(t,{class:"font-500 text-[30rpx] text-[#333] leading-[42rpx]"},{default:h((()=>[v(g(w(s)("cashOutMoneyTip")),1)])),_:1}),b(t,{class:"flex pt-[30rpx] pb-[8rpx] items-center border-0 border-b-[2rpx] border-solid border-[#F1F2F5]"},{default:h((()=>[b(r,{class:"pt-[4rpx] text-[44rpx] text-[#333] iconfont iconrenminbiV6xx price-font"}),b(l,{type:"digit",class:"h-[76rpx] leading-[76rpx] pl-[10rpx] flex-1 font-500 text-[54rpx] bg-[#fff]",modelValue:U.apply_money,"onUpdate:modelValue":a[0]||(a[0]=e=>U.apply_money=e),maxlength:"7",placeholder:U.apply_money?"":w(s)("minWithdrawal")+w(s)("currency")+w(O)(q.min),"placeholder-class":"apply-price","adjust-position":!1},null,8,["modelValue","placeholder"]),Number(w(G))?(f(),m(r,{key:0,class:"text-[24rpx] text-[var(--text-color-light6)] mr-[20rpx]"},{default:h((()=>[v("手续费"+g(w(G)),1)])),_:1})):k("v-if",!0),U.apply_money?(f(),m(r,{key:1,onClick:Q,class:"nc-iconfont nc-icon-cuohaoV6xx1 !text-[32rpx] text-[var(--text-color-light9)]"})):k("v-if",!0)])),_:1}),b(t,{class:"pt-[16rpx] flex items-center justify-between px-[4rpx]"},{default:h((()=>[b(t,{class:"text-[24rpx] text-[var(--text-color-light6)] leading-[36rpx]"},{default:h((()=>[b(r,null,{default:h((()=>[v(g(w(s)("money"))+":"+g(w(s)("currency"))+g(w(O)(w(X))),1)])),_:1}),b(r,null,{default:h((()=>[v(","+g(w(s)("commissionTo"))+g(q.rate+"%"),1)])),_:1})])),_:1}),b(t,{class:"text-[24rpx] text-primary leading-[36rpx]",onClick:J},{default:h((()=>[v(g(w(s)("allTx")),1)])),_:1})])),_:1})])),_:1}),b(t,{class:"mt-[20rpx] card-template"},{default:h((()=>[b(t,{class:"font-500 text-[30rpx] text-[#333] leading-[42rpx] mb-[30rpx]"},{default:h((()=>[v("到账方式")])),_:1}),k(" 提现到微信 "),q.transfer_type.includes("wechatpay")&&w(P).info&&(w(P).info.wx_openid||w(P).info.weapp_openid)?(f(),m(t,{key:0,class:T(["p-[20rpx] mb-[20rpx] flex items-center rounded-[var(--rounded-mid)] border-[1rpx] border-solid border-[#eee]",{"border-[#00C800] bg-[#ECF9EF]":"wechatpay"==U.transfer_type}]),onClick:se},{default:h((()=>[b(t,null,{default:h((()=>[b(c,{class:"h-[60rpx] w-[60rpx]",src:w(L)("static/resource/images/member/apply_withdrawal/wechat.png"),mode:"widthFix"},null,8,["src"])])),_:1}),b(t,{class:"flex-1 px-[20rpx]"},{default:h((()=>[b(t,{class:"text-[28rpx] text-[#333] leading-[40rpx] mb-[6rpx]"},{default:h((()=>[v(g(w(s)("cashOutToWechat")),1)])),_:1}),b(t,{class:"text-[var(--text-color-light9)] text-[24rpx] leading-[34rpx]"},{default:h((()=>[v(g(w(s)("cashOutToWechatTips")),1)])),_:1})])),_:1})])),_:1},8,["class"])):k("v-if",!0),k(" 提现到微信收款码 "),q.transfer_type.includes("wechat_code")?(f(),m(t,{key:1,class:T(["p-[20rpx] mb-[20rpx] flex items-center rounded-[var(--rounded-mid)] border-[1rpx] border-solid border-[#eee]",{"border-[#00C800] bg-[#ECF9EF]":"wechat_code"==U.transfer_type&&le.value}])},{default:h((()=>[b(t,{onClick:de},{default:h((()=>[b(c,{class:"h-[60rpx] w-[60rpx] align-middle",src:w(L)("static/resource/images/member/apply_withdrawal/wechat_code.png"),mode:"widthFix"},null,8,["src"])])),_:1}),b(t,{class:"flex-1 px-[22rpx]",onClick:de},{default:h((()=>[b(t,{class:"text-[28rpx] text-[#333] leading-[40rpx] mb-[6rpx]"},{default:h((()=>[v(g(w(s)("cashOutToWechatCode")),1)])),_:1}),b(t,{class:"text-[var(--text-color-light9)] text-[24rpx] leading-[34rpx]"},{default:h((()=>[le.value?(f(),m(t,{key:0,class:"truncate max-w-[440rpx]"},{default:h((()=>[b(r,null,{default:h((()=>[v(g(w(s)("cashOutTo"))+g(w(s)("wechatCodeAccountNo")),1)])),_:1}),b(r,{class:"text-[#333]"},{default:h((()=>[v(g(le.value.account_no),1)])),_:1})])),_:1})):(f(),m(t,{key:1},{default:h((()=>[v(g(w(s)("cashOutToWechatCodeTips")),1)])),_:1}))])),_:1})])),_:1}),b(t,{class:"flex items-center"},{default:h((()=>[le.value||re.value?(f(),m(r,{key:1,class:"nc-iconfont nc-icon-youV6xx text-[28rpx] text-[var(--text-color-light9)] p-[10rpx]",onClick:a[2]||(a[2]=C((e=>w(u)({url:"/app/pages/member/account",param:{type:"wechat_code",mode:"select"},mode:"redirectTo"})),["stop"]))})):(f(),m(o,{key:0,"hover-class":"none",class:"w-[110rpx] h-[54rpx] flex-center rounded-full p-[0] text-[var(--primary-color)] bg-transparent border-[2rpx] border-solid border-[var(--primary-color)] text-[22rpx]",onClick:a[1]||(a[1]=e=>w(u)({url:"/app/pages/member/account",param:{type:"wechat_code",mode:"select"},mode:"redirectTo"}))},{default:h((()=>[v(g(w(s)("toAdd")),1)])),_:1}))])),_:1})])),_:1},8,["class"])):k("v-if",!0),k(" 提现到支付宝 "),q.transfer_type.includes("alipay")?(f(),m(t,{key:2,class:T(["p-[20rpx] mb-[20rpx] flex items-center rounded-[var(--rounded-mid)] border-[1rpx] border-solid border-[#eee]",{"border-[#009FE8] bg-[#EEF8FC]":"alipay"==U.transfer_type&&Y.value}])},{default:h((()=>[b(t,{onClick:ne},{default:h((()=>[b(c,{class:"h-[60rpx] w-[60rpx] align-middle",src:w(L)("static/resource/images/member/apply_withdrawal/alipay-icon.png"),mode:"widthFix"},null,8,["src"])])),_:1}),b(t,{class:"flex-1 px-[22rpx]",onClick:ne},{default:h((()=>[b(t,{class:"text-[28rpx] text-[#333] leading-[40rpx] mb-[6rpx]"},{default:h((()=>[v(g(w(s)("cashOutToAlipay")),1)])),_:1}),b(t,{class:"text-[var(--text-color-light9)] text-[24rpx] leading-[34rpx]"},{default:h((()=>[Y.value?(f(),m(t,{key:0,class:"truncate max-w-[440rpx]"},{default:h((()=>[b(r,null,{default:h((()=>[v(g(w(s)("cashOutTo"))+g(w(s)("alipayAccountNo")),1)])),_:1}),b(r,{class:"text-[#333]"},{default:h((()=>[v(g(Y.value.account_no),1)])),_:1})])),_:1})):(f(),m(t,{key:1},{default:h((()=>[v(g(w(s)("cashOutToAlipayTips")),1)])),_:1}))])),_:1})])),_:1}),b(t,{class:"flex items-center"},{default:h((()=>[Y.value||R.value?(f(),m(r,{key:1,class:"nc-iconfont nc-icon-youV6xx text-[28rpx] text-[var(--text-color-light9)] p-[10rpx]",onClick:a[4]||(a[4]=C((e=>w(u)({url:"/app/pages/member/account",param:{type:"alipay",mode:"select"},mode:"redirectTo"})),["stop"]))})):(f(),m(o,{key:0,"hover-class":"none",class:"w-[110rpx] h-[54rpx] flex-center rounded-full p-[0] text-[var(--primary-color)] bg-transparent border-[2rpx] border-solid border-[var(--primary-color)] text-[22rpx]",onClick:a[3]||(a[3]=e=>w(u)({url:"/app/pages/member/account",param:{type:"alipay",mode:"select"},mode:"redirectTo"}))},{default:h((()=>[v(g(w(s)("toAdd")),1)])),_:1}))])),_:1})])),_:1},8,["class"])):k("v-if",!0),k(" 提现到银行卡 "),q.transfer_type.includes("bank")?(f(),m(t,{key:3,class:T(["p-[20rpx] flex items-center rounded-[var(--rounded-mid)] border-[1rpx] border-solid border-[#eee]",{"border-[#089C98] bg-[#F6FFFF]":"bank"==U.transfer_type&&ae.value}])},{default:h((()=>[b(t,{onClick:pe},{default:h((()=>[b(c,{class:"h-[42rpx] w-[60rpx] align-middle",src:w(L)("static/resource/images/member/apply_withdrawal/bank-icon.png"),mode:"widthFix"},null,8,["src"])])),_:1}),b(t,{class:"flex-1 px-[20rpx]",onClick:pe},{default:h((()=>[b(t,{class:"text-[28rpx] text-[#333] leading-[40rpx] mb-[6rpx]"},{default:h((()=>[v(g(w(s)("cashOutToBank")),1)])),_:1}),b(t,{class:"text-[var(--text-color-light9)] text-[24rpx] leading-[34rpx]"},{default:h((()=>[ae.value?(f(),m(t,{key:0,class:"truncate max-w-[440rpx]"},{default:h((()=>[b(r,null,{default:h((()=>[v(g(w(s)("cashOutTo"))+g(ae.value.bank_name)+g(w(s)("debitCard")),1)])),_:1}),b(r,{class:"text-[#333]"},{default:h((()=>[v(g(ae.value.account_no.substring(ae.value.account_no.length-4)),1)])),_:1})])),_:1})):(f(),m(t,{key:1},{default:h((()=>[v(g(w(s)("cashOutToBankTips")),1)])),_:1}))])),_:1})])),_:1}),b(t,{class:"flex items-center"},{default:h((()=>[ae.value||ee.value?(f(),m(r,{key:1,class:"nc-iconfont nc-icon-youV6xx text-[28rpx] text-[var(--text-color-light9)] p-[10rpx]",onClick:a[6]||(a[6]=C((e=>w(u)({url:"/app/pages/member/account",param:{type:"bank",mode:"select"},mode:"redirectTo"})),["stop"]))})):(f(),m(o,{key:0,"hover-class":"none",class:"h-[54rpx] flex-center rounded-full p-[0] w-[110rpx] text-[var(--primary-color)] bg-transparent border-[2rpx] border-solid border-[var(--primary-color)] text-[22rpx]",onClick:a[5]||(a[5]=e=>w(u)({url:"/app/pages/member/account",param:{type:"bank",mode:"select"},mode:"redirectTo"}))},{default:h((()=>[v(g(w(s)("toAdd")),1)])),_:1}))])),_:1})])),_:1},8,["class"])):k("v-if",!0)])),_:1}),b(t,{class:"tab-bar-placeholder"}),b(t,{class:"fixed bottom-[0] tab-bar left-0 right-0 px-[var(--sidebar-m)] bg-[var(--page-bg-color)]"},{default:h((()=>[b(o,{class:"h-[80rpx] !text-[#fff] leading-[80rpx] primary-btn-bg rounded-[50rpx] text-[26rpx]",disabled:""==U.apply_money||0==U.apply_money,loading:K.value,onClick:oe},{default:h((()=>[v(g(w(s)("cashOutNow")),1)])),_:1},8,["disabled","loading"]),b(t,{class:"mt-[30rpx] text-center text-[26rpx] text-primary",onClick:a[7]||(a[7]=C((e=>w(u)({url:"/app/pages/member/cash_out"})),["stop"]))},{default:h((()=>[v(g(w(s)("cashOutList")),1)])),_:1})])),_:1})])),_:1})])),_:1})),0!=q.is_open||H.value?k("v-if",!0):(f(),m(t,{key:1,class:"h-[100vh] w-[100vw] bg-[var(--page-bg-color)] overflow-hidden"},{default:h((()=>[b(t,{class:"empty-page"},{default:h((()=>[b(c,{class:"img",src:w(L)("addon/shop/cart-empty.png"),model:"aspectFit"},null,8,["src"]),b(t,{class:"desc"},{default:h((()=>[v(g(w(s)("isOpenApply")),1)])),_:1})])),_:1})])),_:1})),b(p,{loading:H.value},null,8,["loading"])])),_:1},8,["style"])}}}),[["__scopeId","data-v-05c6b1ad"]]);export{K as default};
|