payCenter.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. <template>
  2. <div class="mobile-pay-center mobile-fix-content mobile-centerfix-content" :style="switchType === 'account' ? 'padding-bottom: 1rem;' : ''" id="mobileFixContent" @click="setShowSelect('all', false)">
  3. <!--<div class="mp-head" v-if="!fromUserPage">-->
  4. <!--<span class="inline-block" :class="{'active': switchType === 'record'}" @click="setSwitchType('record')">交易记录</span>-->
  5. <!--<span class="inline-block" :class="{'active': switchType === 'account'}" @click="setSwitchType('account')">付款账户</span>-->
  6. <!--</div>-->
  7. <div class="mp-content" v-if="switchType == 'account'">
  8. <!--<p class="mp-content-header">已设置的账户信息<span class="fr" @click="openAddAccount"><i class="iconfont icon-xinzeng"></i>新增账户</span></p>-->
  9. <ul class="mp-list">
  10. <li v-for="account in accountList">
  11. <div class="content-line">
  12. <span class="inline-block title">开户银行:</span>
  13. <span class="inline-block content text-ellipse">{{account.bankname}}</span>
  14. </div>
  15. <div class="content-line">
  16. <span class="inline-block title">开户支行:</span>
  17. <span class="inline-block content text-ellipse">{{account.branchname}}</span>
  18. </div>
  19. <div class="content-line">
  20. <span class="inline-block title">银行账户:</span>
  21. <span class="inline-block content text-ellipse">{{account.number}}</span>
  22. </div>
  23. <div class="content-line">
  24. <span class="inline-block title">开户名称:</span>
  25. <span class="inline-block content text-ellipse">{{account.accountname}}</span>
  26. </div>
  27. <!-- <div class="content-line clearfix">
  28. <span class="inline-block title">操作:</span>
  29. <a class="fr inline-block default-icon" v-if="account.num == 1">默认账户</a>
  30. <a class="fr inline-block set-default-icon" v-if="account.num != 1" @click="setDefaultAccount(account)">设为默认</a>
  31. <a class="fr inline-block" @click="deleteAccount(account)">删除</a>
  32. </div>-->
  33. <div class="btn-wrap">
  34. <a class="inline-block default-icon" v-if="account.num == 1" @click="setRemindText('该账户是默认账户')"><i class="iconfont icon-gouxuan1"></i>默认账户</a>
  35. <a class="inline-block" v-if="account.num != 1" @click="setDefaultAccount(account)"><i class="iconfont icon-gouxuan1"></i>设为默认</a>
  36. <a class="inline-block" @click="deleteAccount(account)"><i class="iconfont icon-lajitong"></i>删除</a>
  37. </div>
  38. </li>
  39. </ul>
  40. <div class="com-btn-wrap mp-btn-wrap">
  41. <button @click.stop="openAddAccount"><i class="iconfont icon-add"></i>新增账户</button>
  42. </div>
  43. </div>
  44. <div class="mp-record" v-if="switchType == 'record'">
  45. <div class="search-content">
  46. <input type="text" placeholder="卖家名称/订单号" v-model="filterParams.keyword" @keyup.13="filterRecord">
  47. <span @click="filterRecord"><i class="iconfont icon-sousuo"></i></span>
  48. </div>
  49. <!--<div class="filters-wrap">
  50. <div class="date-wrap">
  51. <label>
  52. <i class="iconfont icon-ico-date"></i>
  53. <input type="date" v-model="dateObj.fromDate" @change="setDate('fromDate')">
  54. <p v-if="filterParams.fromDate">{{filterParams.fromDate | date}}</p>
  55. </label>
  56. <span>—</span>
  57. <label>
  58. <i class="iconfont icon-ico-date"></i>
  59. <input type="date" v-model="dateObj.toDate" @change="setDate('toDate')">
  60. <p v-if="filterParams.toDate">{{filterParams.toDate | date}}</p>
  61. </label>
  62. </div>
  63. <ul class="select-wrap">
  64. <li class="inline-block">
  65. <div @click.stop="setShowSelect('method', !showSelectMethod)">{{filterParams.method ? filterParams.method == 1103 ? '线下支付' : '线上支付' : '交易方式'}}</div>
  66. <ul class="select-list" v-show="showSelectMethod">
  67. <li @click.stop="setSelect('method', null)">交易方式</li>
  68. <li @click.stop="setSelect('method', 1103)">线下支付</li>
  69. <li @click.stop="setSelect('method', 1102)">线上支付</li>
  70. </ul>
  71. </li>
  72. <li class="inline-block">
  73. <div @click.stop="setShowSelect('currencyName', !showSelectCurrency)">{{filterParams.currencyName || '币种'}}</div>
  74. <ul class="select-list" v-show="showSelectCurrency">
  75. <li @click.stop="setSelect('currencyName', null)">币种</li>
  76. <li @click.stop="setSelect('currencyName', 'RMB')">RMB</li>
  77. <li @click.stop="setSelect('currencyName', 'USD')">USD</li>
  78. </ul>
  79. </li>
  80. <li class="inline-block">
  81. <div @click.stop="setShowSelect('status', !showSelectStatus)">{{filterParams.status || '状态'}}</div>
  82. <ul class="select-list" v-show="showSelectStatus">
  83. <li @click.stop="setSelect('status', null)">状态</li>
  84. <li @click.stop="setSelect('status', '支付成功')">支付成功</li>
  85. </ul>
  86. </li>
  87. </ul>
  88. </div>-->
  89. <div class="filters-wrap">
  90. <base-filter
  91. v-for="filterOption in filterOptions"
  92. :key="filterOption.selectOption"
  93. :selectItems="filterOption.selectItems"
  94. :defaultVal="filterOption.defaultVal"
  95. :selectOption="filterOption.selectOption"
  96. @selectAction="onSelectAction"
  97. :title="filterOption.title"></base-filter>
  98. </div>
  99. <ul class="mp-list record-list mp-list-record">
  100. <li v-for="record in recordList">
  101. <div class="content-line">
  102. <span class="inline-block title">订单号:</span>
  103. <nuxt-link :to="`/mobile/order/details?uuid=${baseUtils.enidfilter(record.orderid)}&type=buyer`" class="inline-block content link">{{record.orderid}}</nuxt-link>
  104. </div>
  105. <div class="content-line">
  106. <span class="inline-block title">金额:</span>
  107. <span class="inline-block content">{{record.currencyName | currencyFilter}}{{record.ensurePrice}}</span>
  108. </div>
  109. <div class="content-line">
  110. <span class="inline-block title">卖家:</span>
  111. <span class="inline-block content">{{record.sellername}}</span>
  112. </div>
  113. <!--<div class="content-line">
  114. <span class="inline-block title">交易方式:</span>
  115. <span class="inline-block content text-ellipse">{{record.paytype == 1103 ? '线下支付' : '线上支付'}}</span>
  116. </div>-->
  117. <div class="content-line">
  118. <span class="inline-block title">交易方式:</span>
  119. <span class="inline-block content">{{record.remitteeType | payTypeFilter}}</span>
  120. </div>
  121. <div class="content-line">
  122. <span class="inline-block title">时间:</span>
  123. <span class="inline-block content">{{record.paytime | time}}</span>
  124. </div>
  125. <div class="content-line">
  126. <span class="inline-block title">状态:</span>
  127. <span class="inline-block content">支付成功</span>
  128. </div>
  129. </li>
  130. </ul>
  131. </div>
  132. <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
  133. <pull-up :fixId="'mobileFixContent'" :searchMore="fetching" :allPage="allPage" :page="page" @pullUpAction="onPullUpAction"></pull-up>
  134. <!-- 新增账户弹框start -->
  135. <div class="mobile-modal account-modal" @click="showSimilar = false" v-if="showModal">
  136. <div class="account-modal-wrap add-account-modal">
  137. <div class="account-modal">
  138. <p class="title">新增账户</p>
  139. <div class="modal-content-line">
  140. <span class="inline-block"><i>*</i>开户银行:</span>
  141. <input type="text" readonly placeholder="例如:中国银行" v-model="bankAccountObj.bankname" @click.stop="showSimilar = !showSimilar">
  142. <ul v-if="showSimilar" class="similar">
  143. <li class="text-ellipse" v-for="bank in bankList" @click.stop="setBankName(bank)">{{bank}}</li>
  144. </ul>
  145. </div>
  146. <div class="modal-content-line">
  147. <span class="inline-block"><i>*</i>开户支行:</span>
  148. <input type="text" placeholder="例如:乔香支行" v-model="bankAccountObj.branchname" @blur="checkBranchname">
  149. </div>
  150. <div class="modal-content-line">
  151. <span class="inline-block"><i>*</i>银行账号:</span>
  152. <input type="text" placeholder="请填写银行账号" v-model="bankAccountObj.number" @blur="checkNumber">
  153. </div>
  154. <div class="modal-content-line">
  155. <span class="inline-block"><i>*</i>开户名称:</span>
  156. <input type="text" placeholder="请填写开户人姓名或企业名称" v-model="bankAccountObj.accountname" @blur="checkAccountname">
  157. </div>
  158. <div class="modal-content-line clearfix">
  159. <p class="remind"><i>*</i>为保障您的资金安全,账户信息加密显示且不可修改,只能删除后重新提交。</p>
  160. </div>
  161. <div class="am-btn-wrap">
  162. <button @click="showModal = false">取消</button>
  163. <button @click="addAccount">确认</button>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. <empty-status v-if="isEmpty" :text="switchType == 'record' ? '暂无支付记录,请下单购买商品吧!' : '暂无账户信息'" :showLink="true"></empty-status>
  169. <!-- 新增账户弹框end -->
  170. </div>
  171. </template>
  172. <script>
  173. import { RemindBox, PullUp, EmptyStatus } from '~components/mobile/common'
  174. import { ModalWrapper, BaseFilter } from '~components/mobile/base'
  175. export default {
  176. layout: 'mobile',
  177. middleware: 'authenticated',
  178. data () {
  179. return {
  180. fromUserPage: false,
  181. remindText: '',
  182. timeoutCount: '',
  183. page: 1,
  184. count: 10,
  185. accountList: [],
  186. recordList: [],
  187. switchType: 'record',
  188. // 分页重置标志
  189. isChange: false,
  190. showModal: false,
  191. bankList: [],
  192. showSimilar: false,
  193. bankAccountObj: {
  194. bankname: '',
  195. branchname: '',
  196. number: '',
  197. accountname: ''
  198. },
  199. validBankAccountObj: {
  200. bankname: false,
  201. branchname: false,
  202. number: false,
  203. accountname: false
  204. },
  205. filterParams: {
  206. keyword: '',
  207. fromDate: '',
  208. toDate: '',
  209. currencyName: '',
  210. // 交易方式
  211. remitteeType: ''
  212. },
  213. showSelectMethod: false,
  214. showSelectCurrency: false,
  215. showSelectStatus: false,
  216. dateObj: {
  217. fromDate: '',
  218. toDate: ''
  219. },
  220. filterOptions: [
  221. {
  222. title: '交易方式',
  223. selectOption: 'remitteeType',
  224. selectItems: [{key: '全部',
  225. val: null
  226. }, {
  227. key: '卖家收款',
  228. val: 'PAIDTOVENDOR'
  229. }, {
  230. key: '平台代收',
  231. val: 'PAIDTOPLATFORM'
  232. }],
  233. defaultVal: null
  234. },
  235. {
  236. title: '交易币种',
  237. selectOption: 'currencyName',
  238. selectItems: [{key: '全部',
  239. val: null
  240. }, {
  241. key: 'RMB',
  242. val: 'RMB'
  243. }, {
  244. key: 'USD',
  245. val: 'USD'
  246. }],
  247. defaultVal: null
  248. },
  249. // {
  250. // title: '交易状态',
  251. // selectOption: 'status',
  252. // selectItems: [{key: '全部',
  253. // val: null
  254. // }, {
  255. // key: '已付款',
  256. // val: 1
  257. // }, {
  258. // key: '待付款',
  259. // val: 2
  260. // }],
  261. // defaultVal: null
  262. // },
  263. {
  264. title: '交易时间',
  265. selectOption: 'date',
  266. selectItems: [{key: '全部',
  267. val: null
  268. }, {
  269. key: '一个月',
  270. val: 1
  271. }, {
  272. key: '三个月',
  273. val: 2
  274. }, {
  275. key: '六个月',
  276. val: 3
  277. }, {
  278. key: '自定义',
  279. val: 4
  280. }],
  281. defaultVal: null
  282. }
  283. ]
  284. }
  285. },
  286. components: {
  287. RemindBox,
  288. PullUp,
  289. ModalWrapper,
  290. EmptyStatus,
  291. BaseFilter
  292. },
  293. fetch ({store, route}) {
  294. return route.query.type ? Promise.all([
  295. store.dispatch('payCenter/loadBuyerAccount', {count: 10, page: 1, sorting: {num: 'ASC'}, type: 'buyer'})
  296. ]) : Promise.all([
  297. // store.dispatch('payCenter/loadBuyerAccount', {count: 10, page: 1, sorting: {num: 'ASC'}, type: 'buyer'})
  298. store.dispatch('payCenter/loadBuyerRecord', {count: 10, page: 1, sorting: {'paytime': 'DESC'}})
  299. ])
  300. },
  301. filters: {
  302. payTypeFilter: function (type) {
  303. if (type === 'PAIDTOVENDOR') {
  304. return '卖家收款'
  305. } else if (type === 'PAIDTOPLATFORM') {
  306. return '平台代收'
  307. } else {
  308. return '其他'
  309. }
  310. }
  311. },
  312. asyncData({route}) {
  313. return {
  314. fromUserPage: route.query.type ? true : false,
  315. switchType: route.query.switchType || 'record'
  316. }
  317. },
  318. watch: {
  319. 'buyerAccount': {
  320. handler: function (val) {
  321. if (val && val.content) {
  322. if (this.isChange) {
  323. this.accountList = []
  324. this.isChange = false
  325. }
  326. this.accountList = [...this.accountList, ...val.content]
  327. }
  328. },
  329. immediate: true
  330. },
  331. 'buyerRecord': {
  332. handler: function (val) {
  333. if (val && val.content) {
  334. if (this.isChange) {
  335. this.recordList = []
  336. this.isChange = false
  337. }
  338. this.recordList = [...this.recordList, ...val.content]
  339. }
  340. },
  341. immediate: true
  342. }
  343. },
  344. computed: {
  345. accountData () {
  346. return this.$store.state.payCenter.data.buyerAccount
  347. },
  348. recordData () {
  349. return this.$store.state.payCenter.data.buyerRecord
  350. },
  351. buyerAccount () {
  352. return this.accountData.data
  353. },
  354. buyerRecord () {
  355. return this.recordData.data
  356. },
  357. fetching () {
  358. return this.switchType === 'account' ? this.accountData.fetching : this.recordData.fetching
  359. },
  360. allPage () {
  361. return this.switchType === 'account' ? this.buyerAccount.totalPages : this.buyerRecord.totalPages
  362. },
  363. isEmpty () {
  364. return (this.switchType === 'record' && this.recordList.length === 0) || (this.switchType === 'account' && this.accountList.length === 0)
  365. }
  366. },
  367. methods: {
  368. setRemindText: function (str) {
  369. this.remindText = str
  370. this.timeoutCount++
  371. },
  372. reloadList () {
  373. if (this.switchType === 'account') {
  374. this.$store.dispatch('payCenter/loadBuyerAccount', {
  375. count: this.count,
  376. page: this.page,
  377. sorting: {num: 'ASC'},
  378. type: 'buyer'
  379. })
  380. } else {
  381. this.$store.dispatch('payCenter/loadBuyerRecord', {
  382. count: this.count,
  383. page: this.page,
  384. sorting: {'paytime': 'DESC'},
  385. currencyName: this.filterParams.currencyName || null,
  386. fromDate: this.filterParams.fromDate || null,
  387. toDate: this.filterParams.toDate || null,
  388. remitteeType: this.filterParams.remitteeType || null,
  389. keyword: this.filterParams.keyword || null
  390. })
  391. }
  392. },
  393. initList () {
  394. this.isChange = true
  395. this.page = 1
  396. this.reloadList()
  397. },
  398. onPullUpAction () {
  399. this.page++
  400. this.reloadList()
  401. },
  402. setSwitchType (type) {
  403. this.switchType = type
  404. if (type === 'record') {
  405. this.initFilterParams()
  406. }
  407. this.initList()
  408. },
  409. initFilterParams () {
  410. this.filterParams = {
  411. keyword: '',
  412. fromDate: '',
  413. toDate: '',
  414. currencyName: '',
  415. method: ''
  416. }
  417. },
  418. filterRecord () {
  419. this.page = 1
  420. this.isChange = true
  421. this.reloadList()
  422. },
  423. setShowSelect (type, flag) {
  424. if (type === 'all') {
  425. this.showSelectMethod = flag
  426. this.showSelectCurrency = flag
  427. this.showSelectStatus = flag
  428. } else if (type === 'method') {
  429. this.showSelectMethod = flag
  430. this.showSelectCurrency = false
  431. this.showSelectStatus = false
  432. } else if (type === 'currencyName') {
  433. this.showSelectCurrency = flag
  434. this.showSelectStatus = false
  435. this.showSelectMethod = false
  436. } else if (type === 'status') {
  437. this.showSelectStatus = flag
  438. this.showSelectMethod = false
  439. this.showSelectCurrency = false
  440. }
  441. },
  442. setSelect (type, val) {
  443. // if (type === 'method') {
  444. // this.filterParams.method = val
  445. // this.setShowSelect('method', false)
  446. // } else if (type === 'currencyName') {
  447. // this.filterParams.currencyName = val
  448. // this.setShowSelect('currencyName', false)
  449. // } else if (type === 'status') {
  450. // this.filterParams.status = val
  451. // this.setShowSelect('status', false)
  452. // }
  453. if (type === 'date') {
  454. if (val) {
  455. this.filterParams.fromDate = val.fromDate
  456. this.filterParams.toDate = val.toDate
  457. } else {
  458. this.filterParams.fromDate = null
  459. this.filterParams.toDate = null
  460. }
  461. } else {
  462. this.filterParams[type] = val
  463. }
  464. this.filterRecord()
  465. },
  466. onSelectAction (selectObj) {
  467. this.setSelect(selectObj.key, selectObj.value)
  468. },
  469. setDate (type) {
  470. if (this.dateObj[type]) {
  471. this.filterParams[type] = new Date(this.dateObj[type]).getTime() - 8 * 60 * 60 * 1000
  472. if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate > this.filterParams.toDate) {
  473. if (type === 'fromDate') {
  474. this.setRemindText('起始时间不能大于结束时间')
  475. } else {
  476. this.setRemindText('结束时间不能小于起始时间')
  477. }
  478. this.filterParams[type] = null
  479. this.dateObj[type] = null
  480. } else {
  481. if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate === this.filterParams.toDate) {
  482. // 23:59:59
  483. this.filterParams.toDate += 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
  484. }
  485. this.filterRecord()
  486. }
  487. } else {
  488. this.filterParams[type] = null
  489. this.filterRecord()
  490. }
  491. },
  492. setDefaultAccount (account) {
  493. this.$http.get(`/trade/bankInfo/setDefaultAccount/${account.id}`).then(() => {
  494. this.setRemindText('设置完成')
  495. this.initList()
  496. })
  497. },
  498. deleteAccount (account) {
  499. this.$http.delete(`/trade/bankInfo/delete/${account.id}`).then(res => {
  500. if (res.data === 'success') {
  501. this.setRemindText('删除成功')
  502. this.initList()
  503. }
  504. })
  505. },
  506. initAccount () {
  507. this.bankAccountObj = {
  508. bankname: '',
  509. branchname: '',
  510. number: '',
  511. accountname: ''
  512. }
  513. this.validBankAccountObj = {
  514. bankname: false,
  515. branchname: false,
  516. number: false,
  517. accountname: false
  518. }
  519. },
  520. openAddAccount () {
  521. if (!this.bankList || !this.bankList.length) {
  522. this.$http.get('/data/bank.json').then(res => {
  523. this.bankList = res.data.list
  524. this.initAccount()
  525. this.showModal = true
  526. })
  527. } else {
  528. this.initAccount()
  529. this.showModal = true
  530. }
  531. },
  532. setBankName (name) {
  533. this.bankAccountObj.bankname = name
  534. this.showSimilar = false
  535. this.validBankAccountObj.bankname = true
  536. },
  537. checkBranchname () {
  538. this.validBankAccountObj.branchname = true
  539. if (!(this.bankAccountObj.branchname && this.bankAccountObj.branchname.length)) {
  540. this.setRemindText('开户支行不能为空')
  541. this.validBankAccountObj.branchname = false
  542. } else if (this.baseUtils.getRealLen(this.bankAccountObj.branchname) > 40) {
  543. this.setRemindText('开户支行不能大于40字符')
  544. this.validBankAccountObj.branchname = false
  545. } else if (!/^[\u2E80-\u9FFF]+$/.test(this.bankAccountObj.branchname)) {
  546. this.setRemindText('请输入正确的开户支行')
  547. this.validBankAccountObj.branchname = false
  548. }
  549. },
  550. checkNumber () {
  551. this.validBankAccountObj.number = true
  552. if (!(this.bankAccountObj.number && this.bankAccountObj.number.length)) {
  553. this.validBankAccountObj.number = false
  554. this.setRemindText('银行账号不能为空')
  555. } else if (this.baseUtils.getRealLen(this.bankAccountObj.number) > 30) {
  556. this.setRemindText('银行账号不能大于30字符')
  557. this.validBankAccountObj.number = false
  558. } else if (!/^[0-9]+$/.test(this.bankAccountObj.number)) {
  559. this.setRemindText('请输入正确的银行账号')
  560. this.validBankAccountObj.number = false
  561. }
  562. if (this.validBankAccountObj.number) {
  563. this.$http.get('/trade/bankInfo/number/count', {params: {type: 1061, number: this.bankAccountObj.number}}).then(res => {
  564. if (res.data.success) {
  565. this.validBankAccountObj.number = res.data.data === 0
  566. } else {
  567. this.validBankAccountObj.number = false
  568. this.setRemindText(res.data.message || '银行账号校验失败')
  569. }
  570. }, err => {
  571. this.validBankAccountObj.number = false
  572. this.setRemindText(err.response.data || '银行账号校验失败')
  573. console.log(err)
  574. })
  575. }
  576. },
  577. checkAccountname () {
  578. this.validBankAccountObj.accountname = true
  579. if (!(this.bankAccountObj.accountname && this.bankAccountObj.accountname.length)) {
  580. this.validBankAccountObj.accountname = false
  581. this.setRemindText('账户名称不能为空')
  582. } else if (this.baseUtils.getRealLen(this.bankAccountObj.accountname) > 100) {
  583. this.setRemindText('账户名称不能大于100个字符')
  584. this.validBankAccountObj.accountname = false
  585. }
  586. },
  587. addAccount () {
  588. if (!this.validBankAccountObj.bankname) {
  589. this.setRemindText('请选择开户银行')
  590. } else if (!this.validBankAccountObj.branchname) {
  591. this.setRemindText('请填写正确的开户支行')
  592. } else if (!this.validBankAccountObj.number) {
  593. this.setRemindText('请填写正确的银行账号')
  594. } else if (!this.validBankAccountObj.accountname) {
  595. this.setRemindText('请填写正确的开户名称')
  596. } else {
  597. this.$http.post('/trade/bankInfo/save/personal?type=buyer', this.bankAccountObj).then(res => {
  598. if (res.data.id) {
  599. this.setRemindText('新增账户成功')
  600. this.initList()
  601. this.showModal = false
  602. } else {
  603. this.setRemindText('新增账户失败')
  604. }
  605. }, err => {
  606. this.setRemindText(err.response.data || '新增账户失败')
  607. console.log(err)
  608. })
  609. }
  610. }
  611. }
  612. }
  613. </script>
  614. <style lang="scss" scoped>
  615. @import '~assets/scss/mobilePayCenter';
  616. </style>