realName.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <view class="content">
  3. <view class="box" style="margin-top: 70rpx;">
  4. <view class="left">姓名</view>
  5. <view class="right"><input type="text" placeholder="请输入真实姓名" v-model="name"></view>
  6. </view>
  7. <view class="box">
  8. <view class="left">身份证号</view>
  9. <view class="right"><input type="idcard" placeholder="请输入身份证号" v-model="idcard"></view>
  10. </view>
  11. <view class="box">
  12. <view class="left">手机号</view>
  13. <view class="right"><input type="number" placeholder="请输入手机号" v-model="phone"></view>
  14. </view>
  15. <view class="box">
  16. <view class="left">银行卡号</view>
  17. <view class="right"><input type="number" placeholder="请输入银行卡号" v-model="card"></view>
  18. </view>
  19. <button @click="button" class="button">提交认证</button>
  20. </view>
  21. </template>
  22. <script>
  23. import {realname} from '@/api/index.js'
  24. export default {
  25. data() {
  26. return {
  27. idcard: '',
  28. name: '',
  29. phone: '',
  30. card:''
  31. };
  32. },
  33. methods: {
  34. button(){
  35. if(this.name==''){
  36. this.$api.msg('请输入姓名')
  37. return
  38. }
  39. if(this.idcard==''){
  40. this.$api.msg('请输入身份证号')
  41. return
  42. }
  43. if(this.idcard.length!=18){
  44. this.$api.msg('请输入正确身份证号')
  45. return
  46. }
  47. if(this.phone==''){
  48. this.$api.msg('请输入手机号')
  49. return
  50. }
  51. if(this.phone.length!=11){
  52. this.$api.msg('请输入正确手机号')
  53. return
  54. }
  55. if(this.card==''){
  56. this.$api.msg('请输入银行卡号')
  57. return
  58. }
  59. realname(
  60. {
  61. real_name:this.name,
  62. phone:this.phone,
  63. idcard:this.idcard,
  64. bank_code:this.card
  65. }).then(res=>{
  66. console.log(res,'res');
  67. this.$api.msg('已提交,请等待审核')
  68. if(res.status==400){
  69. return
  70. }
  71. })
  72. },
  73. navTo(url) {
  74. uni.navigateTo({
  75. url
  76. })
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="scss">
  82. page,
  83. .content {
  84. background: #111111;
  85. height: 100%;
  86. width: 750rpx;
  87. .box {
  88. display: flex;
  89. justify-content: space-between;
  90. align-items: center;
  91. margin: 0 30rpx;
  92. border-bottom: 2rpx solid #AEAEAE;
  93. padding: 30rpx 40rpx;
  94. .left {
  95. font-size: 26rpx;
  96. font-weight: 500;
  97. color: #FFFFFF;
  98. }
  99. .right {
  100. font-size: 26rpx;
  101. font-weight: 400;
  102. color: #FFFFFF;
  103. .img {
  104. width: 80rpx;
  105. height: 80rpx;
  106. border-radius: 50%;
  107. overflow: hidden;
  108. }
  109. }
  110. }
  111. .button {
  112. margin-top: 100rpx;
  113. width: 690rpx;
  114. height: 80rpx;
  115. background: $bgBaseBg;
  116. border-radius: 10rpx;
  117. font-size: 30rpx;
  118. font-family: PingFang SC;
  119. font-weight: 500;
  120. color: #FFFFFF;
  121. line-height: 80rpx;
  122. }
  123. }
  124. </style>