real_info.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <div class="real-info">
  3. <h1>实名信息验证</h1>
  4. <div class="line"></div>
  5. <el-form ref="ruleForm" class="contents" :model="ruleForm" :rules="rules">
  6. <el-form-item prop="mobile">
  7. <div class="mobile">旧手机号</div>
  8. <el-input placeholder="请输入手机号" v-model="ruleForm.mobile"></el-input>
  9. </el-form-item>
  10. <el-form-item prop="idCardNo">
  11. <div class="code">身份证号</div>
  12. <el-input placeholder="请输入身份证号" v-model="ruleForm.idCardNo"></el-input>
  13. </el-form-item>
  14. </el-form>
  15. <div class="sub-container">
  16. <el-button class="next-btn" type="primary" @click="clickNext">下一步</el-button>
  17. </div>
  18. </div>
  19. </template>
  20. <script>
  21. import VerCode from '@/components/ver_code'
  22. export default {
  23. components: {
  24. VerCode,
  25. },
  26. data() {
  27. return {
  28. ruleForm: {
  29. mobile: '',
  30. idCardNo: '',
  31. },
  32. rules: {
  33. mobile: [
  34. { required: true, message: '手机号错误', trigger: 'blur' }
  35. ],
  36. idCardNo: [
  37. { required: true, message: '身份证号不能为空', trigger: 'blur' }
  38. ],
  39. }
  40. }
  41. },
  42. methods: {
  43. clickNext() {
  44. this.$refs['ruleForm'].validate(async (valid) => {
  45. if(valid) {
  46. let res = await this.$axios.$post('/api/user/checkUserIdentify', {
  47. mobile: this.ruleForm.mobile,
  48. id_card_no: this.ruleForm.idCardNo,
  49. })
  50. if(res) {
  51. this.$message({
  52. message: res.info,
  53. type: 'success'
  54. })
  55. setTimeout(() => {
  56. this.$router.push('/setting/check/change_mobile')
  57. }, 1000)
  58. }
  59. } else {
  60. console.log('error submit!!')
  61. return false
  62. }
  63. });
  64. }
  65. }
  66. }
  67. </script>
  68. <style scoped>
  69. .real-info {
  70. display: flex;
  71. flex-direction: column;
  72. align-items: center;
  73. width: 1000px;
  74. height: 588px;
  75. background: white;
  76. margin-top: 20px;
  77. }
  78. h1 {
  79. margin: 27px 0 25px;
  80. }
  81. .line {
  82. width: 960px;
  83. height: 2px;
  84. background: rgba(0, 0, 0, 0.06);
  85. }
  86. .el-input {
  87. width: 311px;
  88. height: 44px;
  89. }
  90. .mobile {
  91. margin: 102px 0 5px;
  92. }
  93. .code {
  94. margin: 0 0 5px;
  95. }
  96. .sub-container {
  97. width: 311px;
  98. }
  99. .next-btn {
  100. width: 125px;
  101. margin: 20px 0 41px;
  102. }
  103. .el-form-item {
  104. margin: 0;
  105. }
  106. </style>