bankInfo.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="cmain">
  3. <view class="form_group">
  4. <view class="lable re">开户行</view>
  5. <input type="text" placeholder="请输入开户行" v-model="item.bankName" readonly disabled />
  6. </view>
  7. <view class="form_group">
  8. <view class="lable re">银行账号</view>
  9. <input type="text" placeholder="请输入银行账号" v-model="item.bankAccount" />
  10. </view>
  11. </br></br></br>
  12. <!-- <button class="btn" @click="save()">提交</button> -->
  13. <button class="btn back" @click="back()">返回</button>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. item: {
  21. bankName: '',
  22. bankAccount: ''
  23. },
  24. }
  25. },
  26. onLoad() {
  27. this.http.request({
  28. url: '/sp-admin/app/AppUser/getBankInfo',
  29. success: res => {
  30. console.log("res", res)
  31. this.item.bankName = '云南麻栗坡农村商业银行股份有限公司';
  32. this.item.bankAccount = res.data.data.bankAccount;
  33. }
  34. })
  35. },
  36. methods: {
  37. back() {
  38. uni.navigateBack()
  39. },
  40. save() {
  41. let rule = [{
  42. name: 'bankAccount',
  43. checkType: 'bank',
  44. errorMsg: '银行账号格式不正确'
  45. }];
  46. if (!this.verify.check(this.item, rule)) {
  47. uni.showModal({
  48. content: this.verify.error,
  49. showCancel: false
  50. });
  51. return false;
  52. }
  53. this.http.request({
  54. url: '/sp-admin/app/AppUser/saveBankInfo',
  55. data: {
  56. bankName: this.item.bankName,
  57. bankAccount: this.item.bankAccount
  58. },
  59. success: res => {
  60. uni.showToast({
  61. title: "提交成功"
  62. })
  63. uni.switchTab({
  64. url: '/pages/personal/personal'
  65. });
  66. }
  67. })
  68. }
  69. }
  70. }
  71. </script>
  72. <style>
  73. .back {
  74. background: cadetblue;
  75. margin-top: 15px;
  76. }
  77. </style>