acdr-ui/dist/build/mp-weixin/modules/mall/commission/withdraw.js
2024-10-01 09:15:35 +08:00

2 lines
4.7 KiB
JavaScript

"use strict";var e=Object.defineProperty,o=Object.defineProperties,n=Object.getOwnPropertyDescriptors,t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,a=(o,n,t)=>n in o?e(o,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[n]=t,u=(e,o,n)=>new Promise(((t,r)=>{var c=e=>{try{u(n.next(e))}catch(o){r(o)}},a=e=>{try{u(n.throw(e))}catch(o){r(o)}},u=e=>e.done?t(e.value):Promise.resolve(e.value).then(c,a);u((n=n.apply(e,o)).next())}));const s=require("../../../common/vendor.js"),p=require("../sheep/index.js"),i=require("../sheep/hooks/useGoods.js"),l=require("../sheep/api/trade/config.js"),f=require("../sheep/api/trade/brokerage.js");if(!Array){(s.resolveComponent("uni-easyinput")+s.resolveComponent("s-uploader")+s.resolveComponent("s-layout")+s.resolveComponent("layout-default-uni"))()}Math||((()=>"../../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js")+(()=>"../sheep/components/s-uploader/s-uploader.js")+d+(()=>"../sheep/components/s-layout/s-layout.js"))();const d=()=>"./components/account-type-select.js",y={__name:"withdraw",setup(e){s.useCssVars((e=>({"70c4f65d":s.unref(d)})));const d=p.sheep.$url.css("/static/img/shop/user/withdraw_bg.png"),y=2*p.sheep.$platform.device.statusBarHeight,m=p.sheep.$store("user");s.computed((()=>m.userInfo));const I=s.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:[]}),h=e=>{I.accountSelect=e},g=()=>u(this,null,(function*(){if(!I.accountInfo.price||I.accountInfo.price>I.brokerageInfo.price||I.accountInfo.price<=0)return void p.sheep.$helper.toast("请输入正确的提现金额");if(!I.accountInfo.type)return void p.sheep.$helper.toast("请选择提现方式");const{code:e}=yield f.BrokerageApi.createBrokerageWithdraw((u=((e,o)=>{for(var n in o||(o={}))r.call(o,n)&&a(e,n,o[n]);if(t)for(var n of t(o))c.call(o,n)&&a(e,n,o[n]);return e})({},I.accountInfo),i={price:100*I.accountInfo.price},o(u,n(i))));var u,i;0===e&&s.index.showModal({title:"操作成功",content:"您的提现申请已成功提交",cancelText:"继续提现",confirmText:"查看记录",success:e=>{e.confirm?p.sheep.$router.go("/modules/mall/commission/wallet",{type:2}):(b(),I.accountInfo={})}})}));function b(){return u(this,null,(function*(){const{data:e,code:o}=yield f.BrokerageApi.getBrokerageUser();0===o&&(I.brokerageInfo=e)}))}return s.onBeforeMount((()=>{!function(){u(this,null,(function*(){const{code:e,data:o}=yield l.TradeConfigApi.getTradeConfig();0===e&&o&&(I.minPrice=o.brokerageWithdrawMinPrice||0,I.frozenDays=o.brokerageFrozenDays||0,I.withdrawTypes=o.brokerageWithdrawTypes)}))}(),b()})),(e,o)=>s.e({a:s.t(s.unref(i.fen2yuan)(I.brokerageInfo.brokeragePrice)),b:s.o((e=>s.unref(p.sheep).$router.go("/modules/mall/commission/wallet",{type:2}))),c:s.s({marginTop:"-"+Number(y+88)+"rpx",paddingTop:Number(y+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:s.o((e=>h(!0))),j:s.o((e=>I.accountInfo.price=e)),k:s.p({inputBorder:!1,type:"number",placeholder:"请输入提现金额",modelValue:I.accountInfo.price}),l:["2","3","4"].includes(I.accountInfo.type),m:s.o((e=>I.accountInfo.accountNo=e)),n:s.p({inputBorder:!1,placeholder:"请输入提现账号",modelValue:I.accountInfo.accountNo}),o:["2","3","4"].includes(I.accountInfo.type),p:["3","4"].includes(I.accountInfo.type),q:s.o((e=>I.accountInfo.accountQrCodeUrl=e)),r:s.p({fileMediatype:"image",limit:"1",mode:"grid",imageStyles:{width:"168rpx",height:"168rpx"},url:I.accountInfo.accountQrCodeUrl}),s:["3","4"].includes(I.accountInfo.type),t:"2"===I.accountInfo.type,v:s.o((e=>I.accountInfo.name=e)),w:s.p({inputBorder:!1,placeholder:"请输入持卡人姓名",modelValue:I.accountInfo.name}),x:"2"===I.accountInfo.type,y:"2"===I.accountInfo.type,z:s.o((e=>I.accountInfo.bankName=e)),A:s.p({inputBorder:!1,placeholder:"请输入提现银行",modelValue:I.accountInfo.bankName}),B:"2"===I.accountInfo.type,C:"2"===I.accountInfo.type,D:s.o((e=>I.accountInfo.bankAddress=e)),E:s.p({inputBorder:!1,placeholder:"请输入开户地址",modelValue:I.accountInfo.bankAddress}),F:"2"===I.accountInfo.type,G:s.o(g),H:s.t(s.unref(i.fen2yuan)(I.minPrice)),I:s.t(s.unref(i.fen2yuan)(I.brokerageInfo.frozenPrice)),J:s.t(I.frozenDays),K:s.o((e=>h(!1))),L:s.o((e=>I.accountInfo=e)),M:s.p({show:I.accountSelect,round:"10",methods:I.withdrawTypes,modelValue:I.accountInfo}),N:s.p({title:"申请提现",navbar:"inner"}),O:s.s(e.__cssVars())})}},m=s._export_sfc(y,[["__scopeId","data-v-1710a6fa"]]);wx.createPage(m);