You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
14 KiB
1 lines
14 KiB
import{d as e,r as a,m as t,M as r,k as l,a9 as c,q as o,t as n,x as p,G as s,V as d,W as i,a as u,bG as x,a_ as _,bH as y,o as f,c as m,w as b,b as h,z as v,A as g,u as w,f as k,S as T,B as C,n as F,ab as O,bI as A,bJ as E,bK as V,j,E as M,ag as N,C as W,D as S,ap as B,g as I,i as G,F as L}from"./index-ed377420.js";import{_ as P}from"./loading-page.vue_vue_type_script_setup_true_lang.1c79156d.js";import{_ as U}from"./_plugin-vue_export-helper.1b428a4d.js";import"./u-loading-icon.9ec5388c.js";import"./u-transition.62225ebb.js";const $=U(e({__name:"apply_cash_out",setup(e){const U=a(!0),$=a(!1),q=t(),z=r({apply_money:"",transfer_type:"",account_type:"money",account_id:0,transfer_payee:{open_id:"",channel:""}}),D=l((()=>q.info?q.info[z.account_type]:0));c((()=>z.transfer_type),(e=>{switch(e){case"bank":z.account_id=ae.value?ae.value.account_id:0;break;case"alipay":z.account_id=Y.value?Y.value.account_id:0;break;case"wechat_code":z.account_id=le.value?le.value.account_id:0;break;default:z.account_id=0}}),{immediate:!0});const H=r({is_auto_transfer:0,is_auto_verify:0,is_open:0,min:0,rate:0,transfer_type:[]});let J={};o((async e=>{J=e,uni.getStorageSync("cashOutAccountType")&&(z.account_type=uni.getStorageSync("cashOutAccountType")),n()&&q.getMemberInfo(),["money","commission"].includes(z.account_type)?await x().then((e=>{for(let a in _(e.data))H[a]=_(e.data[a]);H.transfer_type.includes("wechatpay")&&q.info&&!q.info.wx_openid&&!q.info.weapp_openid?H.transfer_type.splice(H.transfer_type.indexOf("wechatpay"),1):H.transfer_type.includes("wechatpay")&&se(),H.transfer_type.includes("bank")&&te(),H.transfer_type.includes("alipay")&&Z(),H.transfer_type.includes("wechat_code")&&ce(),z.transfer_type=H.transfer_type[0],J.type&&(z.transfer_type=J.type),U.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 K=l((()=>{let e=0;return z.apply_money&&Number(H.rate)&&(e=Number(z.apply_money)*Number(H.rate)/100),e.toFixed(2)})),Q=()=>{parseFloat(D.value)&&(z.apply_money=O(D.value))},R=()=>{z.apply_money=""},X=a(!1),Y=a(null),Z=()=>{const e={account_type:"alipay",account_id:0};let a=A;J.type&&"alipay"==J.type&&J.account_id&&(a=E,e.account_id=J.account_id),X.value=!0,a(e).then((e=>{e.data&&e.data.account_id&&(Y.value=e.data,"alipay"!=z.transfer_type||z.account_id||(z.account_id=Y.value.account_id)),X.value=!1}))},ee=a(!1),ae=a(null),te=()=>{const e={account_type:"bank",account_id:0};let a=A;J.type&&"bank"==J.type&&J.account_id&&(a=E,e.account_id=J.account_id),ee.value=!0,a(e).then((e=>{e.data&&e.data.account_id&&(ae.value=e.data,"bank"!=z.transfer_type||z.account_id||(z.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;J.type&&"wechat_code"==J.type&&J.account_id&&(a=E,e.account_id=J.account_id),re.value=!0,a(e).then((e=>{e.data&&e.data.account_id&&(le.value=e.data,"wechat_code"!=z.transfer_type||z.account_id||(z.account_id=le.value.account_id)),re.value=!1}))},oe=()=>{if(z.transfer_type?uni.$u.test.isEmpty(z.apply_money)?(p({title:s("applyMoneyPlaceholder"),icon:"none"}),0):uni.$u.test.amount(z.apply_money)?parseFloat(z.apply_money)>parseFloat(D.value)?(p({title:s("applyMoneyExceed"),icon:"none"}),0):!(parseFloat(z.apply_money)<parseFloat(H.min)&&(p({title:s("applyMoneyBelow"),icon:"none"}),1)):(p({title:s("moneyformatError"),icon:"none"}),0):(p({title:s("noAvailableCashOutType"),icon:"none"}),0)){if($.value)return;$.value=!0,V(z).then((e=>{$.value=!1,q.getMemberInfo((()=>{"wechatpay"==z.transfer_type?u({url:"/app/pages/member/cash_out_detail",param:{id:e.data}}):u({url:"/app/pages/member/cash_out"})}))})).catch((()=>{$.value=!1}))}},ne=()=>{if(!Y.value)return p({title:s("cashOutToAlipayTips"),icon:"none"}),!1;z.transfer_type="alipay"},pe=()=>{if(!ae.value)return p({title:s("cashOutToBankTips"),icon:"none"}),!1;z.transfer_type="bank"},se=()=>{let e=y();z.transfer_payee.open_id=e.wechat?e.wechat:e.weapp,z.transfer_payee.channel=e.wechat?"wechat":"weapp",z.transfer_type="wechatpay"},de=()=>{if(!le.value)return p({title:s("cashOutToWechatCodeTips"),icon:"none"}),!1;z.transfer_type="wechat_code"};return(e,a)=>{const t=j,r=M,l=N,c=W,o=S,n=B,p=I(G("loading-page"),P);return f(),m(t,{style:F(e.themeColor())},{default:b((()=>[U.value||1!=H.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:b((()=>[h(t,{class:"sidebar-margin pt-[var(--top-m)]"},{default:b((()=>[h(t,{class:"card-template"},{default:b((()=>[h(t,{class:"font-500 text-[30rpx] text-[#333] leading-[42rpx]"},{default:b((()=>[v(g(w(s)("cashOutMoneyTip")),1)])),_:1}),h(t,{class:"flex pt-[30rpx] pb-[8rpx] items-center border-0 border-b-[2rpx] border-solid border-[#F1F2F5]"},{default:b((()=>[h(r,{class:"pt-[4rpx] text-[44rpx] text-[#333] iconfont iconrenminbiV6xx price-font"}),h(l,{type:"digit",class:"h-[76rpx] leading-[76rpx] pl-[10rpx] flex-1 font-500 text-[54rpx] bg-[#fff]",modelValue:z.apply_money,"onUpdate:modelValue":a[0]||(a[0]=e=>z.apply_money=e),maxlength:"7",placeholder:z.apply_money?"":w(s)("minWithdrawal")+w(s)("currency")+w(O)(H.min),"placeholder-class":"apply-price","adjust-position":!1},null,8,["modelValue","placeholder"]),Number(w(K))?(f(),m(r,{key:0,class:"text-[24rpx] text-[var(--text-color-light6)] mr-[20rpx]"},{default:b((()=>[v("手续费"+g(w(K)),1)])),_:1})):k("v-if",!0),z.apply_money?(f(),m(r,{key:1,onClick:R,class:"nc-iconfont nc-icon-cuohaoV6xx1 !text-[32rpx] text-[var(--text-color-light9)]"})):k("v-if",!0)])),_:1}),h(t,{class:"pt-[16rpx] flex items-center justify-between px-[4rpx]"},{default:b((()=>[h(t,{class:"text-[24rpx] text-[var(--text-color-light6)] leading-[36rpx]"},{default:b((()=>[h(r,null,{default:b((()=>[v(g(w(s)("money"))+":"+g(w(s)("currency"))+g(w(O)(w(D))),1)])),_:1}),h(r,null,{default:b((()=>[v(","+g(w(s)("commissionTo"))+g(H.rate+"%"),1)])),_:1})])),_:1}),h(t,{class:"text-[24rpx] text-primary leading-[36rpx]",onClick:Q},{default:b((()=>[v(g(w(s)("allTx")),1)])),_:1})])),_:1})])),_:1}),h(t,{class:"mt-[20rpx] card-template"},{default:b((()=>[h(t,{class:"font-500 text-[30rpx] text-[#333] leading-[42rpx] mb-[30rpx]"},{default:b((()=>[v("到账方式")])),_:1}),k(" 提现到微信 "),H.transfer_type.includes("wechatpay")&&w(q).info&&(w(q).info.wx_openid||w(q).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"==z.transfer_type}]),onClick:se},{default:b((()=>[h(t,null,{default:b((()=>[h(c,{class:"h-[60rpx] w-[60rpx]",src:w(L)("static/resource/images/member/apply_withdrawal/wechat.png"),mode:"widthFix"},null,8,["src"])])),_:1}),h(t,{class:"flex-1 px-[20rpx]"},{default:b((()=>[h(t,{class:"text-[28rpx] text-[#333] leading-[40rpx] mb-[6rpx]"},{default:b((()=>[v(g(w(s)("cashOutToWechat")),1)])),_:1}),h(t,{class:"text-[var(--text-color-light9)] text-[24rpx] leading-[34rpx]"},{default:b((()=>[v(g(w(s)("cashOutToWechatTips")),1)])),_:1})])),_:1})])),_:1},8,["class"])):k("v-if",!0),k(" 提现到微信收款码 "),H.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"==z.transfer_type&&le.value}])},{default:b((()=>[h(t,{onClick:de},{default:b((()=>[h(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}),h(t,{class:"flex-1 px-[22rpx]",onClick:de},{default:b((()=>[h(t,{class:"text-[28rpx] text-[#333] leading-[40rpx] mb-[6rpx]"},{default:b((()=>[v(g(w(s)("cashOutToWechatCode")),1)])),_:1}),h(t,{class:"text-[var(--text-color-light9)] text-[24rpx] leading-[34rpx]"},{default:b((()=>[le.value?(f(),m(t,{key:0,class:"truncate max-w-[440rpx]"},{default:b((()=>[h(r,null,{default:b((()=>[v(g(w(s)("cashOutTo"))+g(w(s)("wechatCodeAccountNo")),1)])),_:1}),h(r,{class:"text-[#333]"},{default:b((()=>[v(g(le.value.account_no),1)])),_:1})])),_:1})):(f(),m(t,{key:1},{default:b((()=>[v(g(w(s)("cashOutToWechatCodeTips")),1)])),_:1}))])),_:1})])),_:1}),h(t,{class:"flex items-center"},{default:b((()=>[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:b((()=>[v(g(w(s)("toAdd")),1)])),_:1}))])),_:1})])),_:1},8,["class"])):k("v-if",!0),k(" 提现到支付宝 "),H.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"==z.transfer_type&&Y.value}])},{default:b((()=>[h(t,{onClick:ne},{default:b((()=>[h(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}),h(t,{class:"flex-1 px-[22rpx]",onClick:ne},{default:b((()=>[h(t,{class:"text-[28rpx] text-[#333] leading-[40rpx] mb-[6rpx]"},{default:b((()=>[v(g(w(s)("cashOutToAlipay")),1)])),_:1}),h(t,{class:"text-[var(--text-color-light9)] text-[24rpx] leading-[34rpx]"},{default:b((()=>[Y.value?(f(),m(t,{key:0,class:"truncate max-w-[440rpx]"},{default:b((()=>[h(r,null,{default:b((()=>[v(g(w(s)("cashOutTo"))+g(w(s)("alipayAccountNo")),1)])),_:1}),h(r,{class:"text-[#333]"},{default:b((()=>[v(g(Y.value.account_no),1)])),_:1})])),_:1})):(f(),m(t,{key:1},{default:b((()=>[v(g(w(s)("cashOutToAlipayTips")),1)])),_:1}))])),_:1})])),_:1}),h(t,{class:"flex items-center"},{default:b((()=>[Y.value||X.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:b((()=>[v(g(w(s)("toAdd")),1)])),_:1}))])),_:1})])),_:1},8,["class"])):k("v-if",!0),k(" 提现到银行卡 "),H.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"==z.transfer_type&&ae.value}])},{default:b((()=>[h(t,{onClick:pe},{default:b((()=>[h(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}),h(t,{class:"flex-1 px-[20rpx]",onClick:pe},{default:b((()=>[h(t,{class:"text-[28rpx] text-[#333] leading-[40rpx] mb-[6rpx]"},{default:b((()=>[v(g(w(s)("cashOutToBank")),1)])),_:1}),h(t,{class:"text-[var(--text-color-light9)] text-[24rpx] leading-[34rpx]"},{default:b((()=>[ae.value?(f(),m(t,{key:0,class:"truncate max-w-[440rpx]"},{default:b((()=>[h(r,null,{default:b((()=>[v(g(w(s)("cashOutTo"))+g(ae.value.bank_name)+g(w(s)("debitCard")),1)])),_:1}),h(r,{class:"text-[#333]"},{default:b((()=>[v(g(ae.value.account_no.substring(ae.value.account_no.length-4)),1)])),_:1})])),_:1})):(f(),m(t,{key:1},{default:b((()=>[v(g(w(s)("cashOutToBankTips")),1)])),_:1}))])),_:1})])),_:1}),h(t,{class:"flex items-center"},{default:b((()=>[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:b((()=>[v(g(w(s)("toAdd")),1)])),_:1}))])),_:1})])),_:1},8,["class"])):k("v-if",!0)])),_:1}),h(t,{class:"tab-bar-placeholder"}),h(t,{class:"fixed bottom-[0] tab-bar left-0 right-0 px-[var(--sidebar-m)] bg-[var(--page-bg-color)]"},{default:b((()=>[h(o,{class:"h-[80rpx] !text-[#fff] leading-[80rpx] primary-btn-bg rounded-[50rpx] text-[26rpx]",disabled:""==z.apply_money||0==z.apply_money,loading:$.value,onClick:oe},{default:b((()=>[v(g(w(s)("cashOutNow")),1)])),_:1},8,["disabled","loading"]),h(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:b((()=>[v(g(w(s)("cashOutList")),1)])),_:1})])),_:1})])),_:1})])),_:1})),0!=H.is_open||U.value?k("v-if",!0):(f(),m(t,{key:1,class:"h-[100vh] w-[100vw] bg-[var(--page-bg-color)] overflow-hidden"},{default:b((()=>[h(t,{class:"empty-page"},{default:b((()=>[h(c,{class:"img",src:w(L)("addon/shop/cart-empty.png"),model:"aspectFit"},null,8,["src"]),h(t,{class:"desc"},{default:b((()=>[v(g(w(s)("isOpenApply")),1)])),_:1})])),_:1})])),_:1})),h(p,{loading:U.value},null,8,["loading"])])),_:1},8,["style"])}}}),[["__scopeId","data-v-05c6b1ad"]]);export{$ as default};
|
|
|