withdraw.js 5.4 KB

1
  1. "use strict";const e=require("../../common/vendor.js"),o=require("../../sheep/index.js"),r=require("../../sheep/hooks/useGoods.js"),n=require("../../sheep/api/trade/config.js"),t=require("../../sheep/api/trade/brokerage.js");if(require("../../sheep/url/index.js"),require("../../sheep/store/index.js"),require("../../sheep/store/app.js"),require("../../sheep/api/promotion/diy.js"),require("../../sheep/request/index.js"),require("../../sheep/config/index.js"),require("../../sheep/platform/index.js"),require("../../sheep/platform/provider/wechat/index.js"),require("../../sheep/platform/provider/wechat/miniProgram.js"),require("../../sheep/api/member/auth.js"),require("../../sheep/api/member/social.js"),require("../../sheep/api/member/user.js"),require("../../sheep/platform/provider/apple/index.js"),require("../../sheep/platform/share.js"),require("../../sheep/router/index.js"),require("../../sheep/hooks/useModal.js"),require("../../sheep/helper/index.js"),require("../../sheep/helper/test.js"),require("../../sheep/helper/digit.js"),require("../../sheep/api/member/signin.js"),require("../../sheep/helper/throttle.js"),require("../../sheep/platform/pay.js"),require("../../sheep/api/pay/order.js"),require("../../sheep/store/user.js"),require("../../sheep/store/cart.js"),require("../../sheep/api/trade/cart.js"),require("../../sheep/api/pay/wallet.js"),require("../../sheep/api/trade/order.js"),require("../../sheep/api/promotion/coupon.js"),require("../../sheep/store/sys.js"),require("../../sheep/store/modal.js"),require("../../sheep/config/zIndex.js"),require("../../sheep/util/index.js"),!Array){(e.resolveComponent("uni-easyinput")+e.resolveComponent("s-uploader")+e.resolveComponent("s-layout"))()}Math||((()=>"../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js")+(()=>"../../sheep/components/s-uploader/s-uploader.js")+a+(()=>"../../sheep/components/s-layout/s-layout.js"))();const a=()=>"./components/account-type-select.js",s={__name:"withdraw",setup(a){e.useCssVars((o=>({"74ffe326":e.unref(s)})));const s=o.sheep.$url.css("/static/img/shop/user/withdraw_bg.png"),c=2*o.sheep.$platform.device.statusBarHeight,p=o.sheep.$store("user");e.computed((()=>p.userInfo));const i=e.reactive({accountInfo:{type:void 0,accountNo:void 0,accountQrCodeUrl:void 0,name:void 0,bankName:void 0,bankAddress:void 0},accountSelect:!1,brokerageInfo:{},frozenDays:0,minPrice:0,withdrawTypes:[]}),u=e=>{i.accountSelect=e},d=async()=>{if(!i.accountInfo.price||i.accountInfo.price>i.brokerageInfo.price||i.accountInfo.price<=0)return void o.sheep.$helper.toast("请输入正确的提现金额");if(!i.accountInfo.type)return void o.sheep.$helper.toast("请选择提现方式");let{code:r}=await t.BrokerageApi.createBrokerageWithdraw({...i.accountInfo,price:100*i.accountInfo.price});0===r&&e.index.showModal({title:"操作成功",content:"您的提现申请已成功提交",cancelText:"继续提现",confirmText:"查看记录",success:e=>{e.confirm?o.sheep.$router.go("/pages/commission/wallet",{type:2}):(f(),i.accountInfo={})}})};async function f(){const{data:e,code:o}=await t.BrokerageApi.getBrokerageUser();0===o&&(i.brokerageInfo=e)}return e.onBeforeMount((()=>{!async function(){let{code:e,data:o}=await n.TradeConfigApi.getTradeConfig();0===e&&o&&(i.minPrice=o.brokerageWithdrawMinPrice||0,i.frozenDays=o.brokerageFrozenDays||0,i.withdrawTypes=o.brokerageWithdrawTypes)}(),f()})),(n,t)=>e.e({a:e.t(e.unref(r.fen2yuan)(i.brokerageInfo.brokeragePrice)),b:e.o((r=>e.unref(o.sheep).$router.go("/pages/commission/wallet",{type:2}))),c:e.s({marginTop:"-"+Number(c+88)+"rpx",paddingTop:Number(c+108)+"rpx"}),d:!i.accountInfo.type},(i.accountInfo.type,{}),{e:"1"===i.accountInfo.type},(i.accountInfo.type,{}),{f:"2"===i.accountInfo.type},(i.accountInfo.type,{}),{g:"3"===i.accountInfo.type},(i.accountInfo.type,{}),{h:"4"===i.accountInfo.type},(i.accountInfo.type,{}),{i:e.o((e=>u(!0))),j:e.o((e=>i.accountInfo.price=e)),k:e.p({inputBorder:!1,type:"number",placeholder:"请输入提现金额",modelValue:i.accountInfo.price}),l:["2","3","4"].includes(i.accountInfo.type),m:e.o((e=>i.accountInfo.accountNo=e)),n:e.p({inputBorder:!1,placeholder:"请输入提现账号",modelValue:i.accountInfo.accountNo}),o:["2","3","4"].includes(i.accountInfo.type),p:["2","3"].includes(i.accountInfo.type),q:e.o((e=>i.accountInfo.accountQrCodeUrl=e)),r:e.p({fileMediatype:"image",limit:"1",mode:"grid",imageStyles:{width:"168rpx",height:"168rpx"},url:i.accountInfo.accountQrCodeUrl}),s:["2","3"].includes(i.accountInfo.type),t:"4"===i.accountInfo.type,v:e.o((e=>i.accountInfo.name=e)),w:e.p({inputBorder:!1,placeholder:"请输入持卡人姓名",modelValue:i.accountInfo.name}),x:"4"===i.accountInfo.type,y:"4"===i.accountInfo.type,z:e.o((e=>i.accountInfo.bankName=e)),A:e.p({inputBorder:!1,placeholder:"请输入提现银行",modelValue:i.accountInfo.bankName}),B:"4"===i.accountInfo.type,C:"4"===i.accountInfo.type,D:e.o((e=>i.accountInfo.bankAddress=e)),E:e.p({inputBorder:!1,placeholder:"请输入开户地址",modelValue:i.accountInfo.bankAddress}),F:"4"===i.accountInfo.type,G:e.o(d),H:e.t(e.unref(r.fen2yuan)(i.minPrice)),I:e.t(e.unref(r.fen2yuan)(i.brokerageInfo.frozenPrice)),J:e.t(i.frozenDays),K:e.o((e=>u(!1))),L:e.o((e=>i.accountInfo=e)),M:e.p({show:i.accountSelect,round:"10",methods:i.withdrawTypes,modelValue:i.accountInfo}),N:e.s(n.__cssVars()),O:e.p({title:"申请提现",navbar:"inner"})})}},c=e._export_sfc(s,[["__scopeId","data-v-428203f0"]]);wx.createPage(c);