bankInfo.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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" />
  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. </view>
  14. </template>
  15. <script>
  16. export default {
  17. data() {
  18. return {
  19. item: {bankName:'',bankAccount:''},
  20. }
  21. },
  22. onLoad() {
  23. this.http.request({
  24. url: '/sp-admin/app/AppUser/getBankInfo',
  25. success: res => {
  26. console.log("res",res)
  27. this.item.bankName = res.data.data.bankName;
  28. this.item.bankAccount = res.data.data.bankAccount;
  29. }
  30. })
  31. },
  32. methods: {
  33. save() {
  34. let rule = [
  35. { name: 'bankAccount', checkType: 'bank', errorMsg: '银行账号格式不正确' }
  36. ];
  37. if (!this.verify.check(this.item, rule)) {
  38. uni.showModal({ content: this.verify.error, showCancel: false });
  39. return false;
  40. }
  41. this.http.request({
  42. url: '/sp-admin/app/AppUser/saveBankInfo',
  43. data: { bankName:this.item.bankName, bankAccount:this.item.bankAccount },
  44. success: res => {
  45. uni.showToast({title:"提交成功"})
  46. uni.switchTab({ url: '/pages/personal/personal' });
  47. }
  48. })
  49. }
  50. }
  51. }
  52. </script>
  53. <style>
  54. </style>