1 line
6.0 KiB
JavaScript
1 line
6.0 KiB
JavaScript
"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[1729],{2421:function(e,a,n){var t=n(2180),r=n(4942),c=n(4165),l=n(5861),o=n(1413),s=n(9439),u=n(1515),i=n(2954),_=n.n(i),d=n(7294),m={common_safe_area_y:"index-module__common_safe_area_y___YVEpW",hoverClass:"index-module__hoverClass___bIkzK","full-100":"index-module__full-100___mocvW",main:"index-module__main___Ex2wo",content:"index-module__content___Ts7DB",cell:"index-module__cell___mmVgK",cellTitle:"index-module__cellTitle___ldpVT",cellContent:"index-module__cellContent___D0yZ0",input:"index-module__input___xQrXF",bottomBar:"index-module__bottomBar___HxG6h",bottomBar__text:"index-module__bottomBar__text___VW9q4",error:"index-module__error___Ic2r7"},x=n(7458),p=n(519),v=n(9179),f=n(8106),k=n(1115),b=n(9498),h=n(5893),Z=function EditBankCard(){var e=(0,i.useRouter)(),a=(0,d.useRef)(0),n=(0,d.useState)({account:{value:"",validate:function validate(e){return!/^[1-9]\d{9,29}$/.test(e)&&e?"请输入正确的银行卡号":""}},bank_deposit:{value:"",validate:function validate(e){return""}},bank_remark:{value:"",validate:function validate(e){return""}}}),t=(0,s.Z)(n,2),Z=t[0],j=t[1];(0,i.useDidShow)((function(){var n=JSON.parse(e.params.baseData);a.current=n.account_id,j((function(e){return{account:(0,o.Z)((0,o.Z)({},e.account),{},{value:n.account}),bank_deposit:(0,o.Z)((0,o.Z)({},e.bank_deposit),{},{value:n.bank_deposit}),bank_remark:(0,o.Z)((0,o.Z)({},e.bank_remark),{},{value:n.account_name})}}))}));var C=(0,f.Bb)().fetchData,g=(0,f.xg)().fetchData,B=function(){var e=(0,l.Z)((0,c.Z)().mark((function _callee2(){return(0,c.Z)().wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:if(Z.account.value&&Z.bank_remark.value&&Z.bank_deposit.value){e.next=3;break}return k.Z9.none("请填写完整信息"),e.abrupt("return");case 3:if(!Object.keys(Z).some((function(e){return Z[e].validate(Z[e].value)}))){e.next=7;break}return k.Z9.none("校验不通过,请重新输入"),e.abrupt("return");case 7:_().showModal({content:"确认修改此张银行卡?",confirmText:"修改",cancelText:"取消",confirmColor:"#FF4D4F",success:function(){var e=(0,l.Z)((0,c.Z)().mark((function _callee(e){var n;return(0,c.Z)().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:if(!e.confirm){t.next=5;break}return t.next=3,C({account:Z.account.value,account_id:a.current,account_name:Z.bank_remark.value,bank_of_deposit:Z.bank_deposit.value});case 3:(n=t.sent).success?(k.Z9.success("修改成功"),setTimeout((function(){_().navigateBack()}),1e3)):k.Z9.error(n.msg);case 5:case"end":return t.stop()}}),_callee)})));return function success(a){return e.apply(this,arguments)}}()});case 8:case"end":return e.stop()}}),_callee2)})));return function handleConfirm(){return e.apply(this,arguments)}}(),N=function(){var e=(0,l.Z)((0,c.Z)().mark((function _callee4(){return(0,c.Z)().wrap((function _callee4$(e){for(;;)switch(e.prev=e.next){case 0:_().showModal({content:"确认删除此张银行卡?",confirmText:"删除",cancelText:"取消",confirmColor:"#FF4D4F",success:function(){var e=(0,l.Z)((0,c.Z)().mark((function _callee3(e){var n;return(0,c.Z)().wrap((function _callee3$(t){for(;;)switch(t.prev=t.next){case 0:if(!e.confirm){t.next=5;break}return t.next=3,g({account_id:a.current});case 3:(n=t.sent).success?(k.Z9.success("删除成功"),setTimeout((function(){_().navigateBack()}),1e3)):k.Z9.error(n.msg);case 5:case"end":return t.stop()}}),_callee3)})));return function success(a){return e.apply(this,arguments)}}()});case 1:case"end":return e.stop()}}),_callee4)})));return function handleDelete(){return e.apply(this,arguments)}}(),T=function handleInput(e,a){j((0,o.Z)((0,o.Z)({},Z),{},(0,r.Z)({},a,(0,o.Z)((0,o.Z)({},Z[a]),{},{value:e.detail.value}))))};return(0,b.av)("pages/bankCardMananger/editBankCard/index"),(0,h.jsxs)(u.G7,{className:m.main,children:[(0,h.jsx)(u.G7,{className:m.content,children:(0,h.jsxs)(p.Z,{circle:!0,customStyle:{marginTop:"24rpx",paddingTop:0,paddingBottom:0},children:[(0,h.jsxs)(u.G7,{className:m.cell,children:[(0,h.jsxs)(u.G7,{className:m.cellTitle,children:["开户名称",(0,h.jsx)(u.xv,{children:"*"})]}),(0,h.jsxs)(u.G7,{className:m.cellContent,children:[(0,h.jsx)(x.Z,{value:Z.bank_remark.value,onInput:function onInput(e){return T(e,"bank_remark")},placeholder:"务必与开户姓名一致"}),Z.bank_remark.validate(Z.bank_remark.value)&&(0,h.jsx)(u.xv,{className:m.error,children:Z.bank_remark.validate(Z.bank_remark.value)})]})]}),(0,h.jsxs)(u.G7,{className:m.cell,children:[(0,h.jsxs)(u.G7,{className:m.cellTitle,children:["银行卡号",(0,h.jsx)(u.xv,{children:"*"})]}),(0,h.jsxs)(u.G7,{className:m.cellContent,children:[(0,h.jsx)(x.Z,{type:"number",maxlength:19,className:m.input,value:Z.account.value,onInput:function onInput(e){return T(e,"account")},placeholder:"请输入银行卡号码"}),Z.account.validate(Z.account.value)&&(0,h.jsx)(u.xv,{className:m.error,children:Z.account.validate(Z.account.value)})]})]}),(0,h.jsxs)(u.G7,{className:m.cell,children:[(0,h.jsxs)(u.G7,{className:m.cellTitle,children:["开户银行",(0,h.jsx)(u.xv,{children:"*"})]}),(0,h.jsxs)(u.G7,{className:m.cellContent,children:[(0,h.jsx)(x.Z,{value:Z.bank_deposit.value,onInput:function onInput(e){return T(e,"bank_deposit")},placeholder:"请输入银行名称(含开户支行)"}),Z.bank_deposit.validate(Z.bank_deposit.value)&&(0,h.jsx)(u.xv,{className:m.error,children:Z.bank_deposit.validate(Z.bank_deposit.value)})]})]})]})}),(0,h.jsxs)(u.G7,{className:m.bottomBar,children:[(0,h.jsx)(v.Z,{round:!0,type:"primary",plain:!0,customTextClassName:m.bottomBar__text,customClassName:m.bottomBar__button,customStyles:{width:"48%"},onClick:N,children:"删除"}),(0,h.jsx)(v.Z,{round:!0,type:"primary",customTextClassName:m.bottomBar__text,customClassName:m.bottomBar__button,customStyles:{width:"48%"},onClick:B,children:"修改"})]})]})};Page((0,t.createPageConfig)(Z,"pages/bankCardMananger/editBankCard/index",{root:{cn:[]}},{navigationBarTitleText:"修改银行卡",navigationBarTextStyle:"black",navigationBarBackgroundColor:"#fff",backgroundColorTop:"#fff"}||{}))}},function(e){e.O(0,[2107,1216,8592],(function(){return a=2421,e(e.s=a);var a}));e.O()}]); |