bank.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view class="content">
  3. <view class="box">
  4. <view class="item ">
  5. <text>姓名</text>
  6. <input type="text" v-model="name" value="" placeholder="请输入真实姓名" />
  7. </view>
  8. <view class="item top">
  9. <text>银行卡号</text>
  10. <input type="text" v-model="id" value="" placeholder="请输入银行卡账号" />
  11. </view>
  12. <view class="item">
  13. <text>所属银行</text>
  14. <input type="text" v-model="idName" value="" placeholder="请输入银行" />
  15. </view>
  16. <view class="item">
  17. <text>手机号</text>
  18. <input type="text" v-model="phone" value="" placeholder="请输入手机号" />
  19. </view>
  20. </view>
  21. <view class="button" @click="confirm()">确认</view>
  22. </view>
  23. </template>
  24. <script>
  25. import { auction,pay_list } from '@/api/wallet.js';
  26. import { orderData,getUserInfo } from '@/api/user.js';
  27. import { mapState, mapMutations } from 'vuex';
  28. export default {
  29. computed: {
  30. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
  31. },
  32. data() {
  33. return {
  34. name:'',
  35. id:'',
  36. idName:'',
  37. phone:''
  38. };
  39. },
  40. onLoad() {
  41. pay_list().then(({data}) =>{
  42. if(data.bank != ''){
  43. this.name = data.bank.name
  44. this.id = data.bank.payment
  45. this.phone = data.bank.phone
  46. this.idName = data.bank.bank
  47. }
  48. })
  49. },
  50. methods: {
  51. ...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
  52. confirm() {
  53. let obj = this;
  54. if (!obj.name) {
  55. return this.$api.msg('请输入提款人姓名');
  56. }
  57. if (!obj.idName) {
  58. return this.$api.msg('请输入所属银行');
  59. }
  60. if (!obj.id) {
  61. return this.$api.msg('请输入银行卡号');
  62. }
  63. if (!obj.phone) {
  64. return this.$api.msg('请输入手机号码');
  65. }
  66. auction({
  67. type:3,
  68. name: obj.name,
  69. bank: obj.idName,
  70. payment: obj.id,
  71. phone: obj.phone,
  72. }).then(e => {
  73. obj.$api.msg('修改成功');
  74. });
  75. },
  76. }
  77. };
  78. </script>
  79. <style lang="scss">
  80. page,
  81. .content {
  82. height: 100%;
  83. padding: 0;
  84. margin: 0;
  85. }
  86. .top {
  87. border-top: 1rpx solid #f3f3f3;
  88. border-bottom: 1rpx solid #f3f3f3;
  89. }
  90. .box {
  91. background: #ffffff;
  92. margin: 20rpx 0 70rpx 0;
  93. .item {
  94. display: flex;
  95. align-items: center;
  96. text {
  97. margin: 0 40rpx 0 25rpx;
  98. width: 150rpx;
  99. font-size: 30rpx;
  100. font-family: PingFang SC;
  101. font-weight: 400;
  102. color: #333333;
  103. line-height: 100rpx;
  104. }
  105. input {
  106. font-size: 28rpx;
  107. font-family: PingFang SC;
  108. font-weight: 400;
  109. color: #999999;
  110. line-height: 100rpx;
  111. }
  112. }
  113. }
  114. .button {
  115. text-align: center;
  116. width: 560rpx;
  117. height: 80rpx;
  118. background: #FD3B39;
  119. border-radius: 40rpx;
  120. font-size: 30rpx;
  121. font-family: PingFangSC;
  122. font-weight: 500;
  123. color: #ffffff;
  124. line-height: 80rpx;
  125. margin: 0 auto;
  126. }
  127. </style>