payCenter.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  1. <template>
  2. <div class="mobile-pay-center vendor-pay mobile-fix-content mobile-centerfix-content" :class="{'vendor-pay-record': switchType === 'record' && recordList.length}" id="mobileFixContent">
  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. <!-- 账户信息start -->
  8. <div class="mp-content" v-if="switchType == 'account'">
  9. <!--<p class="mp-content-header">已设置的账户信息<span class="fr" @click="openAddAccount"><i class="iconfont icon-xinzeng"></i>新增账户</span></p>-->
  10. <ul class="mp-list">
  11. <li v-for="account in accountList">
  12. <div class="content-line">
  13. <span class="inline-block title">开户银行:</span>
  14. <span class="inline-block content text-ellipse">{{account.bankname}}</span>
  15. </div>
  16. <div class="content-line">
  17. <span class="inline-block title">开户支行:</span>
  18. <span class="inline-block content text-ellipse">{{account.branchname}}</span>
  19. </div>
  20. <div class="content-line">
  21. <span class="inline-block title">银行账户:</span>
  22. <span class="inline-block content text-ellipse">{{account.number}}</span>
  23. </div>
  24. <div class="content-line">
  25. <span class="inline-block title">开户名称:</span>
  26. <span class="inline-block content text-ellipse">{{account.accountname}}</span>
  27. </div>
  28. <div class="content-line">
  29. <span class="inline-block title">状态:</span>
  30. <span class="inline-block content text-ellipse">
  31. {{account.status | bankStatusFilter}}
  32. <i v-if="account.status == 101" class="iconfont icon-tixing"></i>
  33. </span>
  34. </div>
  35. <div class="btn-wrap clearfix">
  36. <a class="inline-block" @click="reuseAccount(account)"><i class="iconfont icon-gouxuan1"></i>重新使用</a><!-- v-if="account.status == 105"-->
  37. <a class="inline-block" @click="deleteAccount(account)"><i class="iconfont icon-lajitong"></i>删除</a>
  38. </div>
  39. </li>
  40. </ul>
  41. <div class="com-btn-wrap mp-btn-wrap">
  42. <button @click.stop="openAddAccount"><i class="iconfont icon-add"></i>新增账户</button>
  43. </div>
  44. </div>
  45. <!-- 账户信息end -->
  46. <!-- 交易记录start -->
  47. <div class="mp-record" v-if="switchType == 'record'">
  48. <div class="search-content">
  49. <input type="text" placeholder="买家名称/订单号" v-model="filterParams.keyword" @keyup.13="filterRecord">
  50. <span @click="filterRecord"><i class="iconfont icon-sousuo"></i></span>
  51. </div>
  52. <div class="filters-wrap">
  53. <base-filter
  54. v-for="filterOption in filterOptions"
  55. :key="filterOption.selectOption"
  56. :selectItems="filterOption.selectItems"
  57. :defaultVal="filterOption.defaultVal"
  58. :selectOption="filterOption.selectOption"
  59. @selectAction="onSelectAction"
  60. :title="filterOption.title"></base-filter>
  61. </div>
  62. <ul class="mp-list record-list mp-list-record" v-if="recordList.length">
  63. <li v-for="record in recordList">
  64. <div class="content-line">
  65. <span class="inline-block title">订单号:</span>
  66. <nuxt-link :to="`/mobile/order/details?uuid=${baseUtils.enidfilter(record.puid)}&type=saler`" class="inline-block content text-ellipse link">{{record.orderid}}</nuxt-link>
  67. </div>
  68. <div class="content-line">
  69. <span class="inline-block title">金额:</span>
  70. <span class="inline-block content text-ellipse">{{record.currencyName | currencyFilter}}{{record.total}}</span>
  71. </div>
  72. <div class="content-line">
  73. <span class="inline-block title">买家:</span>
  74. <span class="inline-block content text-ellipse">{{record.buyerentername || record.buyername}}</span>
  75. </div>
  76. <div class="content-line">
  77. <span class="inline-block title">交易方式:</span>
  78. <span class="inline-block content text-ellipse">{{record.operateType === 1063 ? '买家付款' : '平台代付'}}</span>
  79. </div>
  80. <div class="content-line">
  81. <span class="inline-block title">时间:</span>
  82. <span class="inline-block content text-ellipse">{{record.transferTime | time}}</span>
  83. </div>
  84. <div class="content-line">
  85. <span class="inline-block title">状态:</span>
  86. <span class="inline-block content text-ellipse">收款成功</span>
  87. </div>
  88. </li>
  89. </ul>
  90. <div class="fix-count-wrap" v-if="recordList.length">
  91. <span class="content">已收总计:<span>{{currencySymbol | currencyFilter}}&nbsp;{{totalRecordPrice}}</span></span>
  92. <!--<span class="content">支出总计:<span>{{currencySymbol | currencyFilter}}&nbsp;0</span></span>
  93. <p>结余:{{currencySymbol | currencyFilter}}&nbsp;{{totalRecordPrice}} (共计{{recordList.length || 0}}笔交易)</p>-->
  94. </div>
  95. </div>
  96. <!-- 交易记录end -->
  97. <!-- 新增账户弹框start -->
  98. <modal-wrapper :noHeader="true" :showModal="showModal" @closeAction="showModal = false">
  99. <div class="add-account-modal in-wrapper">
  100. <div class="account-modal">
  101. <p class="title">新增账户</p>
  102. <div class="modal-content-line">
  103. <span class="inline-block"><i>*</i>开户银行:</span>
  104. <input type="text" readonly placeholder="例如:中国银行" v-model="bankAccountObj.bankname" @click.stop="showSimilar = !showSimilar">
  105. <ul v-if="showSimilar" class="similar">
  106. <li class="text-ellipse" v-for="bank in bankList" @click.stop="setBankName(bank)">{{bank}}</li>
  107. </ul>
  108. </div>
  109. <div class="modal-content-line">
  110. <span class="inline-block"><i>*</i>开户支行:</span>
  111. <input type="text" placeholder="例如:乔香支行" v-model="bankAccountObj.branchname" @blur="checkBranchname">
  112. </div>
  113. <div class="modal-content-line">
  114. <span class="inline-block"><i>*</i>银行账号:</span>
  115. <input type="text" placeholder="请填写银行账号" v-model="bankAccountObj.number" @blur="checkNumber">
  116. </div>
  117. <div class="modal-content-line">
  118. <span class="inline-block"><i>*</i>开户名称:</span>
  119. <input type="text" placeholder="请填写开户人姓名或企业名称" v-model="bankAccountObj.accountname" @blur="checkAccountname">
  120. </div>
  121. <div class="modal-content-line upload">
  122. <span class="inline-block"><i>*</i>上传开户许可证:</span>
  123. <input type="text" v-model="file.name" disabled>
  124. <label class="upload-btn">选择文件
  125. <input type="file" @change="onUpload($event)" accept="image/jpeg,image/jpg,image/png,.pdf">
  126. </label>
  127. </div>
  128. <div class="am-btn-wrap">
  129. <button @click="showModal = false">取消</button>
  130. <button @click="addAccount">确认</button>
  131. </div>
  132. <p class="am-remind-text clearfix">
  133. <i class="fl">*声明:</i>
  134. <span class="fr">
  135. 1. 此账户为卖家收款账户,请仔细核对信息内容,若由信息错误造成的损失,优软商城不承担赔偿责任。
  136. <br/>
  137. 2. 卖家只能有唯一一个“使用中”的收款账户,新增账户审核通过后,原账户将自动失效。
  138. <br/>
  139. 3. 如您的企业名称、开户银行及账号变更,您须在优软商城开展资金结算前进行更正,否则发生转账错误优软商城不承担赔偿责任。
  140. <br/>
  141. 4. 更多的条款请阅读《优软商城代收代付协议》 。
  142. <br/>
  143. 5. 附件仅支持JPG、PNG、PDF格式,大小超过3M。
  144. </span>
  145. </p>
  146. </div>
  147. </div>
  148. </modal-wrapper>
  149. <!-- 新增账户弹框end -->
  150. <!-- 重新使用账户提示框start -->
  151. <div class="mobile-modal reuse-account-modal" v-show="showReuseModal">
  152. <div class="ra-remind">
  153. <div class="header"><i class="iconfont icon-guanbi1" @click="showReuseModal = false"></i></div>
  154. <div class="content"><i class="fa fa-exclamation-circle"></i>
  155. <span>此操作会让使用中的收款账户失效,是否确定重新使用?</span>
  156. </div>
  157. <div class="footer">
  158. <button @click="showReuseModal = false">取消</button>
  159. <button @click="setDefaultAccount()">确认</button>
  160. </div>
  161. </div>
  162. </div>
  163. <!-- 重新使用账户提示框end -->
  164. <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
  165. <pull-up :fixId="'mobileFixContent'" :searchMore="fetching" :allPage="allPage" :page="page" @pullUpAction="onPullUpAction"></pull-up>
  166. <empty-status v-if="isEmpty" :text="switchType == 'record' ? '暂无交易记录' : '暂无账户信息'" :showLink="true"></empty-status>
  167. </div>
  168. </template>
  169. <script>
  170. import { RemindBox, PullUp, EmptyStatus } from '~components/mobile/common'
  171. import { ModalWrapper, BaseFilter } from '~components/mobile/base'
  172. export default {
  173. layout: 'mobile',
  174. middleware: 'authenticated',
  175. data () {
  176. return {
  177. fromUserPage: false,
  178. remindText: '',
  179. timeoutCount: '',
  180. page: 1,
  181. count: 10,
  182. accountList: [],
  183. recordList: [],
  184. switchType: 'record',
  185. // 分页重置标志
  186. isChange: false,
  187. showModal: false,
  188. bankList: [],
  189. showSimilar: false,
  190. bankAccountObj: {
  191. bankname: '',
  192. branchname: '',
  193. number: '',
  194. accountname: ''
  195. },
  196. validBankAccountObj: {
  197. bankname: false,
  198. branchname: false,
  199. number: false,
  200. accountname: false
  201. },
  202. filterParams: {
  203. keyword: '',
  204. fromDate: '',
  205. toDate: '',
  206. method: '',
  207. status: ''
  208. },
  209. currentId: '',
  210. showReuseModal: false,
  211. totalRecordPrice: 0,
  212. file: '',
  213. dateObj: {
  214. fromDate: '',
  215. toDate: ''
  216. },
  217. filterOptions: [
  218. {
  219. title: '交易方式',
  220. selectOption: 'method',
  221. selectItems: [{key: '全部',
  222. val: 0
  223. }, {
  224. key: '买家付款',
  225. val: 1
  226. }, {
  227. key: '平台代付',
  228. val: 2
  229. }],
  230. defaultVal: 0
  231. },
  232. {
  233. title: '交易状态',
  234. selectOption: 'status',
  235. selectItems: [{key: '全部',
  236. val: 0
  237. }, {
  238. key: '已收款',
  239. val: 1
  240. }, {
  241. key: '待收款',
  242. val: 2
  243. }],
  244. defaultVal: 0
  245. },
  246. {
  247. title: '交易时间',
  248. selectOption: 'date',
  249. selectItems: [{key: '全部',
  250. val: 0
  251. }, {
  252. key: '一个月',
  253. val: 1
  254. }, {
  255. key: '三个月',
  256. val: 2
  257. }, {
  258. key: '六个月',
  259. val: 3
  260. }, {
  261. key: '自定义',
  262. val: 4
  263. }],
  264. defaultVal: 0
  265. }
  266. ]
  267. }
  268. },
  269. components: {
  270. RemindBox,
  271. PullUp,
  272. ModalWrapper,
  273. EmptyStatus,
  274. BaseFilter
  275. },
  276. fetch ({store, route}) {
  277. return route.query.type ? Promise.all([store.dispatch('payCenter/loadVendorAccount', {count: 10, page: 1, sorting: {num: 'ASC'}, type: 'sup'})
  278. ]) : Promise.all([store.dispatch('payCenter/loadVendorRecord', {count: 10, page: 1, sorting: {'transferTime': 'DESC'}, type: 'sup'})])
  279. },
  280. asyncData({route}) {
  281. return {
  282. fromUserPage: route.query.type ? true : false,
  283. switchType: route.query.switchType || 'record'
  284. }
  285. },
  286. watch: {
  287. 'vendorAccount': {
  288. handler: function (val) {
  289. if (val && val.content) {
  290. if (this.isChange) {
  291. this.accountList = []
  292. this.isChange = false
  293. }
  294. this.accountList = [...this.accountList, ...val.content]
  295. }
  296. },
  297. immediate: true
  298. },
  299. 'vendorRecord': {
  300. handler: function (val) {
  301. if (val && val.content) {
  302. if (this.isChange) {
  303. this.recordList = []
  304. this.isChange = false
  305. this.totalRecordPrice = 0
  306. }
  307. this.totalRecordPrice = this.baseUtils.priceFixed(this.totalRecordPrice + this.recordData.data.data.total)
  308. this.recordList = [...this.recordList, ...val.content]
  309. }
  310. },
  311. immediate: true
  312. }
  313. },
  314. filters: {
  315. bankStatusFilter: function (status) {
  316. let result = '未知状态'
  317. switch (status) {
  318. case 101 :
  319. result = '待审核'
  320. break
  321. case 104:
  322. result = '使用中'
  323. break
  324. case 103:
  325. result = '未通过'
  326. break
  327. case 105:
  328. result = '已失效'
  329. break
  330. case 112:
  331. result = '已删除'
  332. break
  333. }
  334. return result
  335. }
  336. },
  337. computed: {
  338. accountData () {
  339. return this.$store.state.payCenter.data.vendorAccount
  340. },
  341. recordData () {
  342. return this.$store.state.payCenter.data.vendorRecord
  343. },
  344. vendorAccount () {
  345. return this.accountData.data
  346. },
  347. vendorRecord () {
  348. return this.recordData.data.data ? this.recordData.data.data.data : []
  349. },
  350. fetching () {
  351. return this.switchType === 'account' ? this.accountData.fetching : this.recordData.fetching
  352. },
  353. allPage () {
  354. return this.switchType === 'account' ? this.vendorAccount.totalPages : this.vendorRecord.totalPages
  355. },
  356. isEmpty () {
  357. return (this.switchType === 'record' && this.recordList.length === 0) || (this.switchType === 'account' && this.accountList.length === 0)
  358. },
  359. currencySymbol () {
  360. return this.recordList[0] ? this.recordList[0].currencyName : 'RMB'
  361. }
  362. },
  363. methods: {
  364. setRemindText: function (str) {
  365. this.remindText = str
  366. this.timeoutCount++
  367. },
  368. reloadList () {
  369. if (this.switchType === 'account') {
  370. this.$store.dispatch('payCenter/loadVendorAccount', {
  371. count: this.count,
  372. page: this.page,
  373. sorting: {num: 'ASC'},
  374. type: 'sup'
  375. })
  376. } else {
  377. this.$store.dispatch('payCenter/loadVendorRecord', {
  378. count: this.count,
  379. page: this.page,
  380. sorting: {'transferTime': 'DESC'},
  381. type: 'sup',
  382. fromDate: this.filterParams.fromDate || null,
  383. toDate: this.filterParams.toDate || null,
  384. keyword: this.filterParams.keyword || null
  385. })
  386. }
  387. },
  388. initList () {
  389. this.isChange = true
  390. this.page = 1
  391. this.reloadList()
  392. },
  393. onPullUpAction () {
  394. this.page++
  395. this.reloadList()
  396. },
  397. setSwitchType (type) {
  398. this.switchType = type
  399. if (type === 'record') {
  400. this.initFilterParams()
  401. }
  402. this.initList()
  403. },
  404. initFilterParams () {
  405. this.filterParams = {
  406. keyword: '',
  407. fromDate: '',
  408. toDate: '',
  409. currencyName: '',
  410. method: ''
  411. }
  412. },
  413. filterRecord () {
  414. this.isChange = true
  415. this.reloadList()
  416. },
  417. onSelectAction (selectObj) {
  418. this.setSelect(selectObj.key, selectObj.value)
  419. },
  420. setSelect (type, val) {
  421. if (type === 'date') {
  422. if (val) {
  423. this.filterParams.fromDate = val.fromDate
  424. this.filterParams.toDate = val.toDate
  425. } else {
  426. this.filterParams.fromDate = null
  427. this.filterParams.toDate = null
  428. }
  429. } else {
  430. this.filterParams[type] = val
  431. }
  432. this.filterRecord()
  433. },
  434. setDate (type) {
  435. if (this.dateObj[type]) {
  436. this.filterParams[type] = new Date(this.dateObj[type]).getTime() - 8 * 60 * 60 * 1000
  437. if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate > this.filterParams.toDate) {
  438. if (type === 'fromDate') {
  439. this.setRemindText('起始时间不能大于结束时间')
  440. } else {
  441. this.setRemindText('结束时间不能小于起始时间')
  442. }
  443. this.filterParams[type] = null
  444. this.dateObj[type] = null
  445. } else {
  446. if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate === this.filterParams.toDate) {
  447. // 23:59:59
  448. this.filterParams.toDate += 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
  449. }
  450. this.filterRecord()
  451. }
  452. } else {
  453. this.filterParams[type] = null
  454. this.filterRecord()
  455. }
  456. },
  457. reuseAccount (account) {
  458. if (account.status !== 105) {
  459. this.setRemindText(`该账户${this.$options.filters.bankStatusFilter(account.status)}`)
  460. } else {
  461. this.currentId = account.id
  462. this.showReuseModal = true
  463. }
  464. },
  465. setDefaultAccount () {
  466. this.$http.get(`/trade/bankInfo/setDefaultAccount/${this.currentId}`).then(() => {
  467. this.setRemindText('重新使用完成')
  468. this.initList()
  469. this.showReuseModal = false
  470. })
  471. },
  472. deleteAccount (account) {
  473. this.$http.delete(`/trade/bankInfo/delete/${account.id}`).then(res => {
  474. if (res.data === 'success') {
  475. this.setRemindText('删除成功')
  476. this.initList()
  477. }
  478. })
  479. },
  480. initAccount () {
  481. this.bankAccountObj = {
  482. bankname: '',
  483. branchname: '',
  484. number: '',
  485. accountname: ''
  486. }
  487. this.validBankAccountObj = {
  488. bankname: false,
  489. branchname: false,
  490. number: false,
  491. accountname: false
  492. }
  493. this.file = ''
  494. },
  495. openAddAccount () {
  496. if (!this.bankList || !this.bankList.length) {
  497. this.$http.get('/data/bank.json').then(res => {
  498. this.bankList = res.data.list
  499. this.initAccount()
  500. this.showModal = true
  501. })
  502. } else {
  503. this.initAccount()
  504. this.showModal = true
  505. }
  506. },
  507. setBankName (name) {
  508. this.bankAccountObj.bankname = name
  509. this.showSimilar = false
  510. this.validBankAccountObj.bankname = true
  511. },
  512. checkBranchname () {
  513. this.validBankAccountObj.branchname = true
  514. if (!(this.bankAccountObj.branchname && this.bankAccountObj.branchname.length)) {
  515. this.setRemindText('开户支行不能为空')
  516. this.validBankAccountObj.branchname = false
  517. } else if (this.baseUtils.getRealLen(this.bankAccountObj.branchname) > 40) {
  518. this.setRemindText('开户支行不能大于40字符')
  519. this.validBankAccountObj.branchname = false
  520. } else if (!/^[\u2E80-\u9FFF]+$/.test(this.bankAccountObj.branchname)) {
  521. this.setRemindText('请输入正确的开户支行')
  522. this.validBankAccountObj.branchname = false
  523. }
  524. },
  525. checkNumber () {
  526. this.validBankAccountObj.number = true
  527. if (!(this.bankAccountObj.number && this.bankAccountObj.number.length)) {
  528. this.validBankAccountObj.number = false
  529. this.setRemindText('银行账号不能为空')
  530. } else if (this.baseUtils.getRealLen(this.bankAccountObj.number) > 30) {
  531. this.setRemindText('银行账号不能大于30字符')
  532. this.validBankAccountObj.number = false
  533. } else if (!/^[0-9]+$/.test(this.bankAccountObj.number)) {
  534. this.setRemindText('请输入正确的银行账号')
  535. this.validBankAccountObj.number = false
  536. }
  537. if (this.validBankAccountObj.number) {
  538. this.$http.get('/trade/bankInfo/number/count', {params: {type: 1061, number: this.bankAccountObj.number}}).then(res => {
  539. if (res.data.success) {
  540. if (res.data.data === 0) {
  541. this.validBankAccountObj.number = true
  542. } else {
  543. this.validBankAccountObj.number = false
  544. this.setRemindText('银行账号校验失败')
  545. }
  546. } else {
  547. this.validBankAccountObj.number = false
  548. this.setRemindText(res.data.message || '银行账号校验失败')
  549. }
  550. }, err => {
  551. this.validBankAccountObj.number = false
  552. this.setRemindText(err.response.data || '银行账号校验失败')
  553. console.log(err)
  554. })
  555. }
  556. },
  557. checkAccountname () {
  558. this.validBankAccountObj.accountname = true
  559. if (!(this.bankAccountObj.accountname && this.bankAccountObj.accountname.length)) {
  560. this.validBankAccountObj.accountname = false
  561. this.setRemindText('账户名称不能为空')
  562. } else if (this.baseUtils.getRealLen(this.bankAccountObj.accountname) > 100) {
  563. this.setRemindText('账户名称不能大于100个字符')
  564. this.validBankAccountObj.accountname = false
  565. }
  566. },
  567. addAccount () {
  568. if (!this.validBankAccountObj.bankname) {
  569. this.setRemindText('请选择开户银行')
  570. } else if (!this.validBankAccountObj.branchname) {
  571. this.setRemindText('请填写正确的开户支行')
  572. } else if (!this.validBankAccountObj.number) {
  573. this.setRemindText('请填写正确的银行账号')
  574. } else if (!this.validBankAccountObj.accountname) {
  575. this.setRemindText('请填写正确的开户名称')
  576. } else if (!this.file) {
  577. this.setRemindText('请上传开户许可证')
  578. } else {
  579. let param = new FormData()
  580. param.append('file', this.file, this.file.name)
  581. param.append('bankInfo', JSON.stringify(this.bankAccountObj))
  582. let config = {
  583. headers: {'Content-Type': 'multipart/form-data'}
  584. }
  585. this.$http.post('/trade/bankInfo/save/enterprise?type=sup', param, config).then(res => {
  586. if (res.data.id) {
  587. this.setRemindText('新增账户成功')
  588. this.initList()
  589. this.showModal = false
  590. } else {
  591. this.setRemindText('新增账户失败')
  592. }
  593. }, err => {
  594. this.setRemindText(err.response.data || '新增账户失败')
  595. console.log(err)
  596. })
  597. }
  598. },
  599. onUpload (e) {
  600. let file = e.target.files[0]
  601. let arr = file.name.split('.')
  602. let type = arr[arr.length - 1]
  603. if ('pdf/png/jpg/jpeg'.indexOf(type.toLowerCase()) === -1) {
  604. this.setRemindText('仅支持jpg/jpeg/png/pdf格式的文件')
  605. } else if (file.size > 1024 * 1024 * 3) {
  606. this.setRemindText('请勿大于3M')
  607. } else {
  608. this.file = file
  609. }
  610. }
  611. }
  612. }
  613. </script>
  614. <style lang="scss">
  615. @import '~assets/scss/mobilePayCenter';
  616. .reuse-account-modal {
  617. .ra-remind {
  618. width: 6.3rem;
  619. height: 3.5rem;
  620. position: absolute;
  621. top: 50%;
  622. left: 50%;
  623. margin-top: -1.75rem;
  624. margin-left: -3.15rem;
  625. border-radius: .15rem;
  626. .header {
  627. height: .6rem;
  628. line-height: .6rem;
  629. background: #3976f4;
  630. border-top-left-radius: .15rem;
  631. border-top-right-radius: .15rem;
  632. i {
  633. font-size: .32rem;
  634. color: #fff;
  635. float: right;
  636. margin-right: .28rem;
  637. }
  638. }
  639. .content {
  640. background: #fff;
  641. padding: .53rem .77rem;
  642. span {
  643. font-size: .32rem;
  644. }
  645. i {
  646. font-size: .44rem;
  647. color: #3976f4;
  648. float: left;
  649. margin-right: .2rem;
  650. }
  651. }
  652. .footer {
  653. background: #fff;
  654. padding-bottom: .37rem;
  655. text-align: center;
  656. border-bottom-left-radius: .15rem;
  657. border-bottom-right-radius: .15rem;
  658. margin-top: -0.05rem;
  659. button {
  660. width: 2.22rem;
  661. height: .77rem;
  662. line-height: .77rem;
  663. color: #fff;
  664. font-size: .32rem;
  665. border-radius: .08rem;
  666. background: #bfbfbf;
  667. &:last-child {
  668. background: $base-color;
  669. margin-left: .3rem;
  670. }
  671. }
  672. }
  673. }
  674. }
  675. .record-list {
  676. margin-bottom: 1.26rem
  677. }
  678. .upload {
  679. input[disabled] {
  680. background: #eee;
  681. width: 2.88rem !important;
  682. }
  683. .upload-btn {
  684. display: inline-block;
  685. vertical-align: middle;
  686. width: 1.2rem;
  687. height: .56rem;
  688. line-height: .56rem;
  689. text-align: center;
  690. color: #fff;
  691. background: #fe9d03;
  692. position: relative;
  693. left: .2rem;
  694. border-radius: .04rem;
  695. font-size: .24rem;
  696. font-weight: normal;
  697. margin: 0;
  698. input {
  699. opacity: 0;
  700. width: 1.2rem;
  701. height: .56rem;
  702. position: absolute;
  703. top: 0;
  704. }
  705. }
  706. }
  707. .fix-count-wrap {
  708. position: fixed;
  709. bottom: .98rem;
  710. height: 1.25rem;
  711. text-align: right;
  712. background: #fff;
  713. border-radius: .02rem;
  714. border-top: 1px solid #bfbfbf;
  715. line-height: 1.25rem;
  716. font-size: .28rem;
  717. width: 100%;
  718. padding-right: .3rem;
  719. .content {
  720. margin-left: .39rem;
  721. &:first-child {
  722. span {
  723. color: #fd0303;
  724. }
  725. }
  726. &:nth-of-type(2) {
  727. span {
  728. color: #15b262;
  729. }
  730. }
  731. }
  732. }
  733. .mp-list .content-line .icon-tixing {
  734. font-size: .32rem;
  735. color: $base-color;
  736. margin-left: .05rem;
  737. }
  738. .am-remind-text {
  739. font-size: .26rem;
  740. color: #999;
  741. margin-top: .29rem;
  742. padding: .45rem 0;
  743. border-top: 1px solid #d2d2d2;
  744. i {
  745. color: #fd0303;
  746. width: 12%;
  747. }
  748. .fr {
  749. width: 88%;
  750. }
  751. }
  752. .vendor-pay {
  753. padding-bottom: 1rem;
  754. .mobile-modal .mobile-modal-wrapper {
  755. left: .2rem !important;
  756. right: .2rem !important;
  757. }
  758. }
  759. .vendor-pay-record {
  760. /*bottom: 2.23rem !important;*/
  761. padding-bottom: 1.25rem !important;
  762. }
  763. </style>