1 line
4.3 KiB
JavaScript
1 line
4.3 KiB
JavaScript
"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[1663],{3725:function(e,a,n){var t=n(2180),l=n(4942),c=n(1413),o=n(4165),r=n(5861),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___LuPts",hoverClass:"index-module__hoverClass___Do8gX","full-100":"index-module__full-100___LtPCW",main:"index-module__main___n37Lo",content:"index-module__content___tUSM_",cell:"index-module__cell___E27AP",cellTitle:"index-module__cellTitle___xPvOc",cellContent:"index-module__cellContent___ucxHW",input:"index-module__input___aTOcN",bottomBar:"index-module__bottomBar___YF5PF",bottomBar__text:"index-module__bottomBar__text___s50Lo",error:"index-module__error___F8toV"},x=n(7458),v=n(519),p=n(9179),f=n(1115),b=n(8106),k=n(9498),h=n(5893),j=function AddBankCard(){var e=(0,d.useState)({account:{value:"",validate:function validate(e){return!/^[1-9]\d{9,29}$/.test(e)&&e?"请输入正确的银行卡号":""}},bank_of_deposit:{value:"",validate:function validate(e){return""}},account_bank:{value:"",validate:function validate(e){return""}}}),a=(0,s.Z)(e,2),n=a[0],t=a[1],i=(0,b.C$)().fetchData,j=function(){var e=(0,r.Z)((0,o.Z)().mark((function _callee(){var e;return(0,o.Z)().wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:if(n.account.value&&n.bank_of_deposit.value&&n.account_bank.value){a.next=3;break}return f.Z9.none("请填写完整信息"),a.abrupt("return");case 3:if(!Object.keys(n).some((function(e){return n[e].validate(n[e].value)}))){a.next=7;break}return f.Z9.none("校验不通过,请重新输入"),a.abrupt("return");case 7:return a.next=9,i({account:n.account.value,account_name:n.account_bank.value,bank_of_deposit:n.bank_of_deposit.value,account_type:2});case 9:(e=a.sent).success?(f.Z9.success("添加成功"),setTimeout((function(){_().navigateBack()}),1e3)):f.Z9.error(e.msg);case 11:case"end":return a.stop()}}),_callee)})));return function handleConfirm(){return e.apply(this,arguments)}}(),C=function handleInput(e,a){t((0,c.Z)((0,c.Z)({},n),{},(0,l.Z)({},a,(0,c.Z)((0,c.Z)({},n[a]),{},{value:e.detail.value}))))};return(0,k.av)("pages/bankCardMananger/addBankCard/index"),(0,h.jsxs)(u.G7,{className:m.main,children:[(0,h.jsx)(u.G7,{className:m.content,children:(0,h.jsxs)(v.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:n.account_bank.value,onInput:function onInput(e){return C(e,"account_bank")},placeholder:"请输入开户人姓名"}),n.account_bank.validate(n.account_bank.value)&&(0,h.jsx)(u.xv,{className:m.error,children:n.account_bank.validate(n.account_bank.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:n.account.value,onInput:function onInput(e){return C(e,"account")},placeholder:"请输入银行卡号码"}),n.account.validate(n.account.value)&&(0,h.jsx)(u.xv,{className:m.error,children:n.account.validate(n.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:n.bank_of_deposit.value,onInput:function onInput(e){return C(e,"bank_of_deposit")},placeholder:"请输入银行名称(含开户支行)"}),n.bank_of_deposit.validate(n.bank_of_deposit.value)&&(0,h.jsx)(u.xv,{className:m.error,children:n.bank_of_deposit.validate(n.bank_of_deposit.value)})]})]})]})}),(0,h.jsx)(u.G7,{className:m.bottomBar,children:(0,h.jsx)(p.Z,{round:!0,type:"primary",customTextClassName:m.bottomBar__text,customClassName:m.bottomBar__button,customStyles:{width:"100%"},onClick:j,children:"确认"})})]})};Page((0,t.createPageConfig)(j,"pages/bankCardMananger/addBankCard/index",{root:{cn:[]}},{navigationBarTitleText:"新增银行卡",navigationBarTextStyle:"black",navigationBarBackgroundColor:"#fff",backgroundColorTop:"#fff"}||{}))}},function(e){e.O(0,[2107,1216,8592],(function(){return a=3725,e(e.s=a);var a}));e.O()}]); |