2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
"use strict";/*! For license information please see index.js.LICENSE.txt */
|
||
(wx.webpackJsonp=wx.webpackJsonp||[]).push([["pages/activityIncome/withdraw/index"],{"./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/activityIncome/withdraw/index.tsx":function(e,n,a){var t=a("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),o=a("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),l=a("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),i=a("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),d=a("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),s=a("./node_modules/@tarojs/taro/index.js"),c=a.n(s),r=a("./node_modules/react/cjs/react.production.min.js"),u=a("./src/pages/activityIncome/withdraw/index.module.scss"),_=a("./src/components/iconfont/iconfont.tsx"),m=a("./src/common/common.ts"),x=a("./src/common/format.ts"),f=a("./src/api/user.ts"),p=a("./src/components/checkbox/index.tsx"),h=a("./src/components/layoutBlock/index.tsx"),b=a("./src/components/InputX/index.tsx"),k=a("./src/components/normalButton/index.tsx"),w=a("./src/components/popup/index.tsx"),j=a("./src/components/Modal/index.tsx"),v=a("./src/common/util.ts"),C=a("./src/use/useCommon.ts"),g=a("./node_modules/react/cjs/react-jsx-runtime.production.min.js");n.default=function Withdraw(){var e;(0,C.useBuriedDataPoint)("pages/activityIncome/withdraw/index");var n=(0,r.useState)([]),a=(0,i.default)(n,2),y=a[0],N=a[1],V=(0,r.useRef)({bankName:"",bankNumber:"",bankId:0}),I=function(){var e=(0,l.default)((0,o.default)().mark((function _callee(){var e,n,a;return(0,o.default)().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,B();case 2:if((a=t.sent).success){t.next=6;break}return m.alert.error("获取数据失败"),t.abrupt("return");case 6:N(null===(e=a.data.account_list)||void 0===e?void 0:e.map((function(e){return e.isChecked=!1,e}))),null!==(n=a.data.account_list)&&void 0!==n&&n.some((function(e){return e.account_id===V.current.bankId}))||(V.current={bankName:"",bankNumber:"",bankId:0}),c().stopPullDownRefresh();case 9:case"end":return t.stop()}}),_callee)})));return function getData(){return e.apply(this,arguments)}}(),T=(0,f.GetUserBankList)(),B=T.fetchData,S=T.state;(0,s.usePullDownRefresh)((function(){I()}));(0,s.useDidShow)((function(){I()}));var R=(0,r.useState)(""),D=(0,i.default)(R,2),M=D[0],P=D[1],L=(0,f.ApplyWithdraw)().fetchData,O=(0,v.debounce)((0,l.default)((0,o.default)().mark((function _callee2(){var e,n;return(0,o.default)().wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:if(V.current.bankId){a.next=2;break}return a.abrupt("return");case 2:return a.next=4,L({bank_account_id:V.current.bankId,withdraw_amount:S.data.balance});case 4:(e=a.sent).success?(I(),null===(n=K.current)||void 0===n||n.onChange(!1),m.alert.success("提现申请成功"),1===e.data.record_type&&(0,m.goLink)("/pages/activityIncome/withdrawalRecordDetail/index",{id:e.data.withdraw_id})):m.alert.error(e.msg);case 6:case"end":return a.stop()}}),_callee2)}))),400),A=(0,r.useState)(!1),z=(0,i.default)(A,2),F=z[0],E=z[1],J=function handleClose(){E(!1)},U=function handleAddBankCard(){J(),(0,m.goLink)("/pages/bankCardMananger/addBankCard/index")},K=(0,r.useRef)(null),W=(0,r.useMemo)((function(){return!V.current.bankId||0===S.data.balance}),[V.current,S.data.balance]),Z=(0,r.useRef)(null),q=(0,r.useMemo)((function(){return S.data.is_applying?String((0,x.formatPriceDiv)(S.data.apply_amount,100,!0)):String((0,x.formatPriceDiv)(S.data.balance,100,!0))}),[S]);return(0,g.jsxs)(d.View,{className:u.default.main,children:[(0,g.jsx)(d.View,{className:u.default.header,children:(0,g.jsxs)(d.View,{className:u.default.header_balance_total,children:[(0,g.jsxs)(d.View,{className:u.default.balance,children:[(0,g.jsx)(d.View,{children:"账户余额(元)"}),(0,g.jsx)(d.View,{className:u.default.balance_num,children:(0,x.formatPriceDiv)(S.data.balance,100,!0)})]}),(0,g.jsxs)(d.View,{className:u.default.withdraw,onClick:function openWithdrawRecord(){(0,m.goLink)("/pages/activityIncome/withdrawalRecord/index")},children:[(0,g.jsx)(d.Text,{children:"查看提现记录"}),(0,g.jsx)(_.default,{name:"icon-rukou",color:"#fff",size:35})]})]})}),(0,g.jsxs)(d.View,{className:u.default.con,children:[(0,g.jsx)(d.View,{className:u.default.background}),(0,g.jsxs)(h.default,{customClassName:u.default.block,circle:!0,children:[(0,g.jsx)(d.View,{className:u.default.title,children:S.data.is_applying?"申请中":"提现金额"}),(0,g.jsxs)(d.View,{className:u.default.inputBar,children:[(0,g.jsx)(d.View,{className:u.default.unit,children:"¥"}),(0,g.jsx)(d.View,{className:u.default.input,children:(0,g.jsx)(b.default,{value:q,disabled:!0,placeholder:"全部提现",customInputStyle:{height:"unset"}})}),(0,g.jsx)(d.View,{className:u.default.allTake,children:S.data.is_applying?(0,g.jsx)(d.Text,{style:{color:"#b2b2b2"},children:"不可重复申请"}):"全部提现"})]}),(0,g.jsxs)(d.View,{className:u.default.bankOptions,onClick:function handleChangeBank(){var e;y&&0!==y.length?E(!0):null===(e=Z.current)||void 0===e||e.onChange(!0)},children:[(0,g.jsx)(d.View,{className:u.default.optionsLeft,children:"提现至"}),(0,g.jsxs)(d.View,{className:u.default.optionsRight,children:[V.current.bankId?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(_.default,{name:"icon-yinlian",size:30}),(0,g.jsxs)(d.Text,{children:[V.current.bankName,"(",null===(e=V.current.bankNumber)||void 0===e?void 0:e.slice(-4),")"]})]}):(0,g.jsx)(d.Text,{children:"请选择要提现的银行卡"}),(0,g.jsx)(_.default,{customStyle:{marginLeft:"10rpx"},name:"icon-rukou",color:"#3b3b3b",size:35})]})]}),S.data.is_applying?(0,g.jsx)(k.default,{round:!0,type:"primary",customStyles:{marginBottom:"15px"},onClick:function handleCheckApply(){(0,m.goLink)("/pages/activityIncome/withdrawalRecordDetail/index",{id:S.data.withdraw_id})},children:"查看申请"}):(0,g.jsx)(k.default,{round:!0,type:"primary",disabled:W,customStyles:{marginBottom:"15px"},onClick:function handleShowModal(){var e;null===(e=K.current)||void 0===e||e.onChange(!0)},children:"申请提现"})]})]}),(0,g.jsx)(h.default,{customStyle:{background:"transparent",padding:"0",marginLeft:"30rpx",marginRight:"30rpx"},children:(0,g.jsxs)(d.View,{className:u.default.tips,children:[(0,g.jsx)(d.View,{className:u.default.tipsTitle,children:"温馨提示:"}),(0,g.jsx)(d.View,{className:u.default.tipsContent,children:"每月1号和16号财务进行付款转账,具体到帐时间视结算卡银行而定,如遇节假日则顺延,超过7天未到账请联系我们"})]})}),(0,g.jsx)(w.default,{customClassName:u.default.popup,show:F,showTitle:!1,onClose:J,safeAreaInsetBottom:!1,children:(0,g.jsxs)(d.View,{className:u.default.bank_popup,children:[(0,g.jsx)(d.View,{className:u.default.bank_popup_title,children:"选择提现银行卡"}),(0,g.jsxs)(d.View,{className:u.default.bank_popup_input,children:[null==y?void 0:y.map((function(e){var n;return(0,g.jsxs)(d.View,{className:u.default.bank_bar,children:[(0,g.jsx)(p.default,{status:null==e?void 0:e.isChecked,onSelect:function onSelect(){return function selectCallBack(e){var n=y.findIndex((function(n){return n.account_id===e}));N((function(e){var a=(0,t.default)(e);return a.forEach((function(e,t){return t===n?a[n].isChecked=!0:e.isChecked=!1,e})),a})),P(y[n].account.slice(-4)),V.current={bankName:y[n].bank_deposit,bankNumber:y[n].account,bankId:y[n].account_id}}(e.account_id)},onClose:function onClose(){return function closeCallBack(e){var n=y.findIndex((function(n){return n.account_id===e}));N((function(e){var a=(0,t.default)(e);return a[n].isChecked=!1,a})),V.current={bankName:"",bankNumber:"",bankId:0},J()}(e.account_id)}}),(0,g.jsxs)(d.View,{className:u.default.bank_card,hoverClass:"hoverClass",onClick:function onClick(){return function handleEditBankCard(e){J(),(0,m.goLink)("/pages/bankCardMananger/editBankCard/index",{baseData:JSON.stringify(e)})}(e)},children:[(0,g.jsxs)(d.View,{className:u.default.bank_card_name,children:[(0,g.jsx)(_.default,{name:"icon-yinlian",size:30}),(0,g.jsxs)(d.Text,{children:[e.bank_deposit,"(",null===(n=e.account)||void 0===n?void 0:n.slice(-4),")"]})]}),(0,g.jsx)(_.default,{name:"icon-rukou",color:"#3b3b3b",size:35})]})]},e.account_id)})),(0,g.jsxs)(d.View,{className:u.default.bank_bar_addNewCard,hoverClass:"hoverClass",onClick:U,children:[(0,g.jsxs)(d.View,{className:u.default.bank_card_name,children:[(0,g.jsx)(_.default,{name:"icon-yinlian",size:30}),(0,g.jsx)(d.Text,{children:"添加储蓄卡提现"})]}),(0,g.jsx)(_.default,{customStyle:{marginLeft:"10rpx"},name:"icon-rukou",color:"#3b3b3b",size:35})]})]})]})}),(0,g.jsx)(j.default,{ref:K,title:"提现确认",content:(0,g.jsxs)(d.View,{className:u.default.modal_content,children:["您正在进行余额提现,确认提现至",M,"尾号的银行卡号中"]}),cancelText:"取消",confirmText:"确认提现",onCancel:function handleCancel(){var e;null===(e=K.current)||void 0===e||e.onChange(!1)},onConfirm:O}),(0,g.jsx)(j.default,{ref:Z,title:"",content:(0,g.jsx)(d.View,{className:u.default.modal_content,children:"您还没有可用于提现的银行卡,请先添加一张储蓄卡"}),cancelText:"取消",confirmText:"添加银行卡",onCancel:function handleBankModalCancel(){var e;null===(e=Z.current)||void 0===e||e.onChange(!1)},onConfirm:function handleBankModalConfirm(){var e;null===(e=Z.current)||void 0===e||e.onChange(!1),U()}})]})}},"./src/components/Modal/index.tsx":function(e,n,a){var t=a("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),o=a("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),l=a("./node_modules/classnames/index.js"),i=a.n(l),d=a("./node_modules/react/cjs/react.production.min.js"),s=a("./src/components/Dialog/index.tsx"),c=a("./src/components/Modal/index.module.scss"),r=a("./node_modules/react/cjs/react-jsx-runtime.production.min.js"),u=function Modal(e,n){var a=e.title,l=void 0===a?"":a,u=e.content,_=void 0===u?"":u,m=e.cancelText,x=void 0===m?"取消":m,f=e.closeOnClickOverlay,p=void 0===f||f,h=e.confirmText,b=void 0===h?"确认":h,k=e.cancelTextColor,w=void 0===k?"":k,j=e.confirmTextColor,v=void 0===j?"":j,C=e.onClose,g=e.onCancel,y=e.onConfirm,N=(0,d.useState)(!1),V=(0,t.default)(N,2),I=V[0],T=V[1],B=function handleChangeModal(e){T(e)};return(0,d.useImperativeHandle)(n,(function(){return{showModal:I,onChange:B}}),[]),(0,r.jsx)(s.default,{show:I,closeOnClickOverlay:p,onClose:function handleCloseModal(){T(!1),null==C||C()},onChange:B,children:(0,r.jsxs)(o.View,{className:c.default.modal,children:[(0,r.jsx)(o.View,{className:c.default["modal-title"],children:l}),(0,r.jsx)(o.View,{className:c.default["modal-content"],children:_}),(0,r.jsxs)(o.View,{className:c.default["modal-bottom"],children:[(0,r.jsx)(o.View,{className:i()(c.default["modal-button"],c.default["modal-button-cancel"]),style:{color:w},onClick:g,children:x}),(0,r.jsx)(o.View,{className:i()(c.default["modal-button"],c.default["modal-button-confirm"]),style:{color:v},onClick:y,children:b})]})]})})};n.default=(0,d.forwardRef)(u)},"./src/pages/activityIncome/withdraw/index.tsx":function(e,n,a){var t=a("./node_modules/@tarojs/runtime/dist/runtime.esm.js"),o=a("./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/activityIncome/withdraw/index.tsx");Page((0,t.createPageConfig)(o.default,"pages/activityIncome/withdraw/index",{root:{cn:[]}},{navigationBarTitleText:"立即提现",navigationBarTextStyle:"white",navigationBarBackgroundColor:"#4A7FFF",enablePullDownRefresh:!0,backgroundColorTop:"#4A7FFF"}||{})),o.default},"./src/components/Modal/index.module.scss":function(e,n){n.default={common_safe_area_y:"index-module__common_safe_area_y___JINZY",hoverClass:"index-module__hoverClass___C869G","full-100":"index-module__full-100___cFlO8",modal:"index-module__modal___FUz_H","modal-title":"index-module__modal-title___C2aou","modal-content":"index-module__modal-content___mixb6","modal-bottom":"index-module__modal-bottom___I7Kp5","modal-button":"index-module__modal-button___EmZ1k","modal-button-cancel":"index-module__modal-button-cancel___QAKSD","modal-button-confirm":"index-module__modal-button-confirm___E0Mg8"}},"./src/pages/activityIncome/withdraw/index.module.scss":function(e,n){n.default={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"}}},function(e){e.O(0,["taro","vendors","common"],(function(){return n="./src/pages/activityIncome/withdraw/index.tsx",e(e.s=n);var n}));e.O()}]); |