yinhangka.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view class="container">
  3. <!-- <view class="tui-line-cell">
  4. <view class="tui-title">收款银行</view>
  5. <picker @change="bindPickerChange" :value="index_zj" :range="zhengjian">
  6. <view class="tui-input">{{ userName }}</view>
  7. </picker>
  8. </view> -->
  9. <!-- <view class="flex">
  10. <picker @change="bindPickerChange" :value="index_zj" :range="zhengjian">
  11. <view class="uni-input">{{ zhengjian[index_zj] }}</view>
  12. </picker>
  13. </view> -->
  14. <list-cell title="用户名" type="text" placeholder="请输入用户名" v-model="bankCarUserName"></list-cell>
  15. <list-cell title="银行卡号" type="number" placeholder="请输入要绑定的银行卡号" v-model="mobile"></list-cell>
  16. <list-cell title="银行名称" type="text" placeholder="请输入要绑定的银行名称" v-model="userName"></list-cell>
  17. <list-cell title="开户行" type="text" placeholder="请输入要绑定的银行开户行" v-model="bankCardAddress"></list-cell>
  18. <wButton text="绑定账户" :rotate="logining" @click.native="toLogin()"></wButton>
  19. <view style="padding: 32upx 64upx;font-size: 24upx;color: #999999;">提示:请正确填写收款人的银行卡账户和真实的收款人姓名,否则将无法正常收款</view>
  20. </view>
  21. </template>
  22. <script>
  23. import listCell from '@/components/com-input';
  24. import wButton from '../components/watch-login/watch-button.vue'; //button
  25. export default {
  26. components: {
  27. listCell,
  28. wButton
  29. },
  30. data() {
  31. return {
  32. bankCardAddress: '',
  33. bankCarUserName: '',
  34. zhengjian: [],
  35. index_zj: 0,
  36. mobile: '',
  37. userName: '',
  38. logining: false
  39. }
  40. },
  41. onLoad() {
  42. let userId = this.$queue.getData("userId");
  43. if (userId) {
  44. this.$Request.get("/app/user/selectUserById").then(res => {
  45. if (res.code == 0) {
  46. if (res.data.bankCard) {
  47. this.mobile = res.data.bankCard;
  48. }
  49. if (res.data.bankCardName) {
  50. this.userName = res.data.bankCardName;
  51. }
  52. if (res.data.bankCardUserName) {
  53. this.bankCarUserName = res.data.bankCardUserName;
  54. }
  55. if (res.data.bankCardAddress) {
  56. this.bankCardAddress = res.data.bankCardAddress;
  57. }
  58. }
  59. });
  60. }
  61. // this.$Request.getT('/selfActivity/state?state=20').then(res => {
  62. // if (res.status == 0) {
  63. // this.zhengjianList = res.data;
  64. // res.data.forEach(d => {
  65. // this.zhengjian.push(d.title);
  66. // });
  67. // this.userName = this.zhengjian[0];
  68. // }
  69. // });
  70. },
  71. methods: {
  72. bindPickerChange: function(e) {
  73. console.log(e)
  74. this.index_zj = e.target.value;
  75. this.userName = this.zhengjian[this.index_zj];
  76. },
  77. inputChange(e) {
  78. const key = e.currentTarget.dataset.key;
  79. this[key] = e.detail.value;
  80. },
  81. navBack() {
  82. uni.navigateBack();
  83. },
  84. toLogin() {
  85. let userId = this.$queue.getData("userId");
  86. let token = uni.getStorageSync("token");
  87. const {
  88. mobile,
  89. bankCarUserName,
  90. userName,
  91. bankCardAddress
  92. } = this;
  93. if (!mobile) {
  94. this.$queue.showToast("请设置收款人银行卡账号");
  95. } else if (!userName) {
  96. this.$queue.showToast("请设置收款人银行姓名");
  97. } else if (!bankCarUserName) {
  98. this.$queue.showToast("请设置收款人姓名");
  99. } else if (!bankCardAddress) {
  100. this.$queue.showToast("请设置收款人银行开户行");
  101. } else {
  102. this.$queue.showLoading("修改中...");
  103. let data = {
  104. userId: userId,
  105. bankCard: mobile,
  106. bankCardName: userName,
  107. bankCardUserName: bankCarUserName,
  108. bankCardAddress: bankCardAddress
  109. }
  110. this.$Request.postJson("/app/user/updateUser", data).then(
  111. res => {
  112. if (res.code === 0) {
  113. this.$queue.showToast('修改成功!');
  114. setTimeout(d => {
  115. this.navBack();
  116. }, 1000)
  117. } else {
  118. this.$queue.showToast(res.msg)
  119. }
  120. uni.hideLoading();
  121. });
  122. }
  123. },
  124. },
  125. }
  126. </script>
  127. <style lang='scss'>
  128. page {
  129. background: #FFFFFF;
  130. }
  131. .tui-line-cell {
  132. width: 80%;
  133. box-sizing: border-box;
  134. display: flex;
  135. align-items: center;
  136. border-bottom: 2upx solid #f2f2f2;
  137. font-size: 34rpx;
  138. padding: 0 60rpx 16upx;
  139. }
  140. .tui-title {
  141. line-height: 32rpx;
  142. min-width: 120rpx;
  143. flex-shrink: 0;
  144. }
  145. .tui-input {
  146. font-size: 32rpx;
  147. color: #333;
  148. padding-left: 40rpx;
  149. flex: 1;
  150. }
  151. .container {
  152. padding-top: 32upx;
  153. position: relative;
  154. width: 100%;
  155. height: 100%;
  156. overflow: hidden;
  157. background: #fff;
  158. }
  159. .confirm-btn {
  160. width: 300px;
  161. height: 42px;
  162. line-height: 42px;
  163. border-radius: 30px;
  164. margin-top: 70upx;
  165. background: #e10a07;
  166. color: #fff;
  167. font-size: 24rpx;
  168. &:after {
  169. border-radius: 60px;
  170. }
  171. }
  172. </style>