2023-05-15 14:13:36 +08:00

1 line
11 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[9155],{420:function(n,e,a){var i=a(2180),l=a(3433),o=a(4165),t=a(5861),c=a(9439),r=a(1515),s=a(2954),d=a.n(s),_=a(7294),u={common_safe_area_y:"index-module__common_safe_area_y___YKLTE",hoverClass:"index-module__hoverClass___MDu6o","full-100":"index-module__full-100____VpET",main:"index-module__main___OJnI4",header:"index-module__header___Nr5x_",header_balance_total:"index-module__header_balance_total___U2sWc",balance:"index-module__balance___rywiE",balance_num:"index-module__balance_num___aPnjR",withdraw:"index-module__withdraw___faPhC",price_list:"index-module__price_list___yz2a1",price_list_item:"index-module__price_list_item___EFPtH",con:"index-module__con___gb1UJ",background:"index-module__background___ZYUPL",block:"index-module__block___kleCR",title:"index-module__title___me4Gw",inputBar:"index-module__inputBar___dRcKF",unit:"index-module__unit___O1i9k",input:"index-module__input___znSID",allTake:"index-module__allTake___Jxcqu",bankOptions:"index-module__bankOptions___II42K",optionsRight:"index-module__optionsRight___zof9_",tips:"index-module__tips___rmHWn",tipsTitle:"index-module__tipsTitle___VqhAr",tipsContent:"index-module__tipsContent___oR62A",popup:"index-module__popup___ywh71",bank_popup:"index-module__bank_popup___vvd9o",bank_popup_title:"index-module__bank_popup_title___oVP1V",bank_popup_input:"index-module__bank_popup_input___un4lX",bank_bar:"index-module__bank_bar___lsTZM",bank_card:"index-module__bank_card___ZT1X7",bank_card_name:"index-module__bank_card_name___fajn1",bank_bar_addNewCard:"index-module__bank_bar_addNewCard___yqDqL",modal_content:"index-module__modal_content___VUcf7"},m=a(6028),x=a(1115),h=a(4158),p=a(8106),b=a(4456),k=a(519),f=a(7458),C=a(9179),v=a(5679),j=a(4184),g=a.n(j),N=a(1117),w="index-module__modal___FUz_H",y="index-module__modal-title___C2aou",G="index-module__modal-content___mixb6",Z="index-module__modal-bottom___I7Kp5",I="index-module__modal-button___EmZ1k",T="index-module__modal-button-cancel___QAKSD",D="index-module__modal-button-confirm___E0Mg8",S=a(5893),B=function Modal(n,e){var a=n.title,i=void 0===a?"":a,l=n.content,o=void 0===l?"":l,t=n.cancelText,s=void 0===t?"取消":t,d=n.closeOnClickOverlay,u=void 0===d||d,m=n.confirmText,x=void 0===m?"确认":m,h=n.cancelTextColor,p=void 0===h?"":h,b=n.confirmTextColor,k=void 0===b?"":b,f=n.onClose,C=n.onCancel,v=n.onConfirm,j=(0,_.useState)(!1),B=(0,c.Z)(j,2),R=B[0],M=B[1],z=function handleChangeModal(n){M(n)};return(0,_.useImperativeHandle)(e,(function(){return{showModal:R,onChange:z}}),[]),(0,S.jsx)(N.Z,{show:R,closeOnClickOverlay:u,onClose:function handleCloseModal(){M(!1),null==f||f()},onChange:z,children:(0,S.jsxs)(r.G7,{className:w,children:[(0,S.jsx)(r.G7,{className:y,children:i}),(0,S.jsx)(r.G7,{className:G,children:o}),(0,S.jsxs)(r.G7,{className:Z,children:[(0,S.jsx)(r.G7,{className:g()(I,T),style:{color:p},onClick:C,children:s}),(0,S.jsx)(r.G7,{className:g()(I,D),style:{color:k},onClick:v,children:x})]})]})})},R=(0,_.forwardRef)(B),M=a(8093),z=a(9498),O=function Withdraw(){var n;(0,z.av)("pages/activityIncome/withdraw/index");var e=(0,_.useState)([]),a=(0,c.Z)(e,2),i=a[0],j=a[1],g=(0,_.useRef)({bankName:"",bankNumber:"",bankId:0}),N=function(){var n=(0,t.Z)((0,o.Z)().mark((function _callee(){var n,e,a;return(0,o.Z)().wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,y();case 2:if((a=i.sent).success){i.next=6;break}return x.Z9.error("获取数据失败"),i.abrupt("return");case 6:j(null===(n=a.data.account_list)||void 0===n?void 0:n.map((function(n){return n.isChecked=!1,n}))),null!==(e=a.data.account_list)&&void 0!==e&&e.some((function(n){return n.account_id===g.current.bankId}))||(g.current={bankName:"",bankNumber:"",bankId:0}),d().stopPullDownRefresh();case 9:case"end":return i.stop()}}),_callee)})));return function getData(){return n.apply(this,arguments)}}(),w=(0,p.Vz)(),y=w.fetchData,G=w.state;(0,s.usePullDownRefresh)((function(){N()}));(0,s.useDidShow)((function(){N()}));var Z=(0,_.useState)(""),I=(0,c.Z)(Z,2),T=I[0],D=I[1],B=(0,p.sJ)().fetchData,O=(0,M.Ds)((0,t.Z)((0,o.Z)().mark((function _callee2(){var n,e;return(0,o.Z)().wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:if(g.current.bankId){a.next=2;break}return a.abrupt("return");case 2:return a.next=4,B({bank_account_id:g.current.bankId,withdraw_amount:G.data.balance});case 4:(n=a.sent).success?(N(),null===(e=V.current)||void 0===e||e.onChange(!1),x.Z9.success("提现申请成功"),1===n.data.record_type&&(0,x.jD)("/pages/activityIncome/withdrawalRecordDetail/index",{id:n.data.withdraw_id})):x.Z9.error(n.msg);case 6:case"end":return a.stop()}}),_callee2)}))),400),F=(0,_.useState)(!1),P=(0,c.Z)(F,2),A=P[0],E=P[1],J=function handleClose(){E(!1)},L=function handleAddBankCard(){J(),(0,x.jD)("/pages/bankCardMananger/addBankCard/index")},V=(0,_.useRef)(null),K=(0,_.useMemo)((function(){return!g.current.bankId||0===G.data.balance}),[g.current,G.data.balance]),U=(0,_.useRef)(null),q=(0,_.useMemo)((function(){return G.data.is_applying?String((0,h.yb)(G.data.apply_amount,100,!0)):String((0,h.yb)(G.data.balance,100,!0))}),[G]);return(0,S.jsxs)(r.G7,{className:u.main,children:[(0,S.jsx)(r.G7,{className:u.header,children:(0,S.jsxs)(r.G7,{className:u.header_balance_total,children:[(0,S.jsxs)(r.G7,{className:u.balance,children:[(0,S.jsx)(r.G7,{children:"账户余额(元)"}),(0,S.jsx)(r.G7,{className:u.balance_num,children:(0,h.yb)(G.data.balance,100,!0)})]}),(0,S.jsxs)(r.G7,{className:u.withdraw,onClick:function openWithdrawRecord(){(0,x.jD)("/pages/activityIncome/withdrawalRecord/index")},children:[(0,S.jsx)(r.xv,{children:"查看提现记录"}),(0,S.jsx)(m.Z,{name:"icon-rukou",color:"#fff",size:35})]})]})}),(0,S.jsxs)(r.G7,{className:u.con,children:[(0,S.jsx)(r.G7,{className:u.background}),(0,S.jsxs)(k.Z,{customClassName:u.block,circle:!0,children:[(0,S.jsx)(r.G7,{className:u.title,children:G.data.is_applying?"申请中":"提现金额"}),(0,S.jsxs)(r.G7,{className:u.inputBar,children:[(0,S.jsx)(r.G7,{className:u.unit,children:"¥"}),(0,S.jsx)(r.G7,{className:u.input,children:(0,S.jsx)(f.Z,{value:q,disabled:!0,placeholder:"全部提现",customInputStyle:{height:"unset"}})}),(0,S.jsx)(r.G7,{className:u.allTake,children:G.data.is_applying?(0,S.jsx)(r.xv,{style:{color:"#b2b2b2"},children:"不可重复申请"}):"全部提现"})]}),(0,S.jsxs)(r.G7,{className:u.bankOptions,onClick:function handleChangeBank(){var n;i&&0!==i.length?E(!0):null===(n=U.current)||void 0===n||n.onChange(!0)},children:[(0,S.jsx)(r.G7,{className:u.optionsLeft,children:"提现至"}),(0,S.jsxs)(r.G7,{className:u.optionsRight,children:[g.current.bankId?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(m.Z,{name:"icon-yinlian",size:30}),(0,S.jsxs)(r.xv,{children:[g.current.bankName,"(",null===(n=g.current.bankNumber)||void 0===n?void 0:n.slice(-4),")"]})]}):(0,S.jsx)(r.xv,{children:"请选择要提现的银行卡"}),(0,S.jsx)(m.Z,{customStyle:{marginLeft:"10rpx"},name:"icon-rukou",color:"#3b3b3b",size:35})]})]}),G.data.is_applying?(0,S.jsx)(C.Z,{round:!0,type:"primary",customStyles:{marginBottom:"15px"},onClick:function handleCheckApply(){(0,x.jD)("/pages/activityIncome/withdrawalRecordDetail/index",{id:G.data.withdraw_id})},children:"查看申请"}):(0,S.jsx)(C.Z,{round:!0,type:"primary",disabled:K,customStyles:{marginBottom:"15px"},onClick:function handleShowModal(){var n;null===(n=V.current)||void 0===n||n.onChange(!0)},children:"申请提现"})]})]}),(0,S.jsx)(k.Z,{customStyle:{background:"transparent",padding:"0",marginLeft:"30rpx",marginRight:"30rpx"},children:(0,S.jsxs)(r.G7,{className:u.tips,children:[(0,S.jsx)(r.G7,{className:u.tipsTitle,children:"温馨提示:"}),(0,S.jsx)(r.G7,{className:u.tipsContent,children:"每月1号和16号财务进行付款转账具体到帐时间视结算卡银行而定如遇节假日则顺延超过7天未到账请联系我们"})]})}),(0,S.jsx)(v.Z,{customClassName:u.popup,show:A,showTitle:!1,onClose:J,safeAreaInsetBottom:!1,children:(0,S.jsxs)(r.G7,{className:u.bank_popup,children:[(0,S.jsx)(r.G7,{className:u.bank_popup_title,children:"选择提现银行卡"}),(0,S.jsxs)(r.G7,{className:u.bank_popup_input,children:[null==i?void 0:i.map((function(n){var e;return(0,S.jsxs)(r.G7,{className:u.bank_bar,children:[(0,S.jsx)(b.Z,{status:null==n?void 0:n.isChecked,onSelect:function onSelect(){return function selectCallBack(n){var e=i.findIndex((function(e){return e.account_id===n}));j((function(n){var a=(0,l.Z)(n);return a.forEach((function(n,i){return i===e?a[e].isChecked=!0:n.isChecked=!1,n})),a})),D(i[e].account.slice(-4)),g.current={bankName:i[e].bank_deposit,bankNumber:i[e].account,bankId:i[e].account_id}}(n.account_id)},onClose:function onClose(){return function closeCallBack(n){var e=i.findIndex((function(e){return e.account_id===n}));j((function(n){var a=(0,l.Z)(n);return a[e].isChecked=!1,a})),g.current={bankName:"",bankNumber:"",bankId:0},J()}(n.account_id)}}),(0,S.jsxs)(r.G7,{className:u.bank_card,hoverClass:"hoverClass",onClick:function onClick(){return function handleEditBankCard(n){J(),(0,x.jD)("/pages/bankCardMananger/editBankCard/index",{baseData:JSON.stringify(n)})}(n)},children:[(0,S.jsxs)(r.G7,{className:u.bank_card_name,children:[(0,S.jsx)(m.Z,{name:"icon-yinlian",size:30}),(0,S.jsxs)(r.xv,{children:[n.bank_deposit,"(",null===(e=n.account)||void 0===e?void 0:e.slice(-4),")"]})]}),(0,S.jsx)(m.Z,{name:"icon-rukou",color:"#3b3b3b",size:35})]})]},n.account_id)})),(0,S.jsxs)(r.G7,{className:u.bank_bar_addNewCard,hoverClass:"hoverClass",onClick:L,children:[(0,S.jsxs)(r.G7,{className:u.bank_card_name,children:[(0,S.jsx)(m.Z,{name:"icon-yinlian",size:30}),(0,S.jsx)(r.xv,{children:"添加储蓄卡提现"})]}),(0,S.jsx)(m.Z,{customStyle:{marginLeft:"10rpx"},name:"icon-rukou",color:"#3b3b3b",size:35})]})]})]})}),(0,S.jsx)(R,{ref:V,title:"提现确认",content:(0,S.jsxs)(r.G7,{className:u.modal_content,children:["您正在进行余额提现,确认提现至",T,"尾号的银行卡号中"]}),cancelText:"取消",confirmText:"确认提现",onCancel:function handleCancel(){var n;null===(n=V.current)||void 0===n||n.onChange(!1)},onConfirm:O}),(0,S.jsx)(R,{ref:U,title:"",content:(0,S.jsx)(r.G7,{className:u.modal_content,children:"您还没有可用于提现的银行卡,请先添加一张储蓄卡"}),cancelText:"取消",confirmText:"添加银行卡",onCancel:function handleBankModalCancel(){var n;null===(n=U.current)||void 0===n||n.onChange(!1)},onConfirm:function handleBankModalConfirm(){var n;null===(n=U.current)||void 0===n||n.onChange(!1),L()}})]})};Page((0,i.createPageConfig)(O,"pages/activityIncome/withdraw/index",{root:{cn:[]}},{navigationBarTitleText:"立即提现",navigationBarTextStyle:"white",navigationBarBackgroundColor:"#4A7FFF",enablePullDownRefresh:!0,backgroundColorTop:"#4A7FFF"}||{}))}},function(n){n.O(0,[2107,1216,8592],(function(){return e=420,n(n.s=e);var e}));n.O()}]);