sqdl.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <view class="content">
  3. <view class="" style="height: 20rpx;">
  4. </view>
  5. <view class="tab">
  6. <view class="bd-wrap flex">
  7. <view class="bg-name">
  8. 真实姓名:
  9. </view>
  10. <view class="bg-val">
  11. <input type="text" value="" placeholder="请输入真实姓名" class="val-ipt" v-model="bankInfo.fullname" ref="name" />
  12. </view>
  13. </view>
  14. <view class="bd-wrap flex">
  15. <view class="bg-name">
  16. 手机号:
  17. </view>
  18. <view class="bg-val">
  19. <input type="text" value="" placeholder="请输入手机号" class="val-ipt" v-model="bankInfo.phone" ref="phone" />
  20. </view>
  21. </view>
  22. <view class="bd-wrap flex">
  23. <view class="bg-name">
  24. 银行卡号:
  25. </view>
  26. <view class="bg-val">
  27. <input type="text" value="" placeholder="请输入银行卡号" class="val-ipt" v-model="bankInfo.bankno"
  28. ref="address" />
  29. </view>
  30. </view>
  31. <view class="bd-wrap flex">
  32. <view class="bg-name">
  33. 开户行:
  34. </view>
  35. <view class="bg-val">
  36. <input type="text" value="" placeholder="请输入开户行" class="val-ipt" v-model="bankInfo.bank"
  37. ref="storenamae" />
  38. </view>
  39. </view>
  40. <view class="bd-wrap flex" >
  41. <view class="bg-name">
  42. 所属支行:
  43. </view>
  44. <view class="bg-val">
  45. <input type="text" value="" placeholder="请输入所属支行" class="val-ipt" v-model="bankInfo.subbranch"
  46. ref="storenamae" />
  47. </view>
  48. </view>
  49. </view>
  50. <view class="btm-btn" @click="bank">
  51. 确认
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import pickerAddress from '@/components/wangding-pickerAddress/wangding-pickerAddress.vue';
  57. import {
  58. enroll
  59. } from '@/api/index.js'
  60. import {
  61. getLevelList,
  62. bank,
  63. bankInfo
  64. } from '@/api/user.js'
  65. import {
  66. mapState,
  67. mapMutations
  68. } from 'vuex';
  69. export default {
  70. components: {
  71. pickerAddress
  72. },
  73. data() {
  74. return {
  75. bankInfo: {
  76. fullname: '',
  77. phone: '',
  78. bankno: '',
  79. bank: '',
  80. subbranch: '',
  81. },
  82. loading: false,
  83. };
  84. },
  85. onLoad(opt) {
  86. },
  87. onShow() {
  88. this.getbankInfo()
  89. },
  90. onReachBottom() {
  91. },
  92. computed: {
  93. ...mapState('user', ['userInfo'])
  94. },
  95. methods: {
  96. getbankInfo() {
  97. bankInfo().then(res => {
  98. console.log(res);
  99. if(res.data && res.data.id) {
  100. this.bankInfo = res.data
  101. uni.setNavigationBarTitle({
  102. title:'修改银行卡信息'
  103. })
  104. }
  105. })
  106. },
  107. // 选中城市切换
  108. onCityClick({
  109. data
  110. }) {
  111. // let address = this.addressData.address;
  112. // address.province = data[0];
  113. // address.city = data[1];
  114. // address.district = data[2];
  115. this.address = data.join('-');
  116. },
  117. bank() {
  118. let that = this
  119. if (that.loading) {
  120. return
  121. }
  122. if (that.bankInfo.fullname == '') {
  123. return that.$api.msg('请输入您的姓名')
  124. }
  125. if (that.bankInfo.phone == '') {
  126. return that.$api.msg('请输入手机号')
  127. }
  128. if (that.bankInfo.bankno == '') {
  129. return that.$api.msg('请输入银行卡号')
  130. }
  131. if (that.bankInfo.bank == '') {
  132. return that.$api.msg('请输入银行')
  133. }
  134. if (that.bankInfo.subbranch == '') {
  135. return that.$api.msg('请输入所属支行')
  136. }
  137. that.loading = true
  138. bank(that.bankInfo).then(res => {
  139. console.log(res);
  140. uni.showToast({
  141. title: '提交成功',
  142. duration: 2000
  143. });
  144. setTimeout(() => {
  145. // uni.switchTab({
  146. // url: '/pages/user/user'
  147. // })
  148. uni.navigateBack()
  149. that.loading = false
  150. }, 1500)
  151. }).catch(err => {
  152. console.log('err');
  153. that.loading = false
  154. })
  155. }
  156. }
  157. };
  158. </script>
  159. <style lang="scss" scoped>
  160. .tab {
  161. width: 690rpx;
  162. margin: auto;
  163. // height: 606rpx;
  164. background: #FFFFFF;
  165. border-radius: 10rpx;
  166. }
  167. .bd-wrap {
  168. width: 690rpx;
  169. // height: 100rpx;
  170. padding: 20rpx 0;
  171. background-color: #fff;
  172. border-bottom: 1px solid #f2f2f2;
  173. // line-height: 100rpx;
  174. font-size: 32rpx;
  175. position: relative;
  176. .code {
  177. position: absolute;
  178. width: 100rpx;
  179. height: 100rpx;
  180. right: 10rpx;
  181. color: #f64342;
  182. font-size: 23rpx;
  183. }
  184. .bg-name {
  185. width: 280rpx;
  186. height: 100%;
  187. padding-left: 20rpx;
  188. }
  189. .bg-val {
  190. width: 430rpx;
  191. height: 100%;
  192. .val-ipt {
  193. padding-top: 10rpx;
  194. display: inline-block;
  195. width: 100%;
  196. height: 100%;
  197. // background-color: #009100;
  198. padding-left: 10rpx;
  199. }
  200. }
  201. }
  202. .btm-btn {
  203. margin: 60rpx auto 0;
  204. font-size: 34rpx;
  205. font-weight: 500;
  206. color: #FFFFFF;
  207. text-align: center;
  208. line-height: 82rpx;
  209. width: 560rpx;
  210. height: 80rpx;
  211. background: #FA2740;
  212. border-radius: 40rpx;
  213. }
  214. </style>