Authentication.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <div>
  3. <div class="right-modifyPsw">
  4. <div class="right-modifyPsw-title">
  5. <span style="font-size: 18px;font-weight: bold">身份认证</span>
  6. </div>
  7. <el-row :gutter="20" v-loading="loading">
  8. <el-col :span="12">
  9. <div class="authentication-card" :class="selectedCardImg" @click="gotoPersonalAuth" v-if="authType<2">
  10. <div class="authentication-card-title">个人认证</div>
  11. <el-row :gutter="10">
  12. <el-col :span="5">
  13. <div class="authentication-card-img">
  14. <img src="../../assets/img/idcard1.png" >
  15. </div>
  16. </el-col>
  17. <!-- 未认证-->
  18. <el-col :span="19" v-if="authType===0">
  19. <div class="authentication-card-title">手持证件照上传</div>
  20. <div class="authentication-card-info">需要进行人工审核,审核周期1-3个工作日</div>
  21. </el-col>
  22. <!-- 已认证,个人或者企业-->
  23. <el-col :span="19" v-if="authType!==0">
  24. <div class="authentication-card-title">
  25. <el-tag :type="authStatus.style">{{authStatus.text}}</el-tag></div>
  26. <div class="authentication-card-info" v-if="authStatus.style=='warning'">需要进行人工审核,审核周期1-3个工作日</div>
  27. <div class="authentication-card-info" v-if="authStatus.style=='success'">认证成功,点击查看认证信息</div>
  28. <div class="authentication-card-info" v-if="authStatus.style=='info'">认证失败,查看失败原因</div>
  29. </el-col>
  30. </el-row>
  31. </div >
  32. </el-col>
  33. <el-col :span="12">
  34. <div class="authentication-card" :class="selectedCardImg" @click="gotoEnterpriseAuth" v-if="authType===2 || authType ===0">
  35. <div class="authentication-card-title">企业认证</div>
  36. <el-row :gutter="10">
  37. <el-col :span="5">
  38. <div class="authentication-card-img">
  39. <img src="../../assets/img/idcard2.png" >
  40. </div>
  41. </el-col>
  42. <!-- 未认证-->
  43. <el-col :span="19" v-if="authType===0">
  44. <div class="authentication-card-title">手持证件照上传</div>
  45. <div class="authentication-card-info">需要进行人工审核,审核周期1-3个工作日</div>
  46. </el-col>
  47. <!-- 已认证,企业-->
  48. <el-col :span="19" v-if="authType!==0">
  49. <div class="authentication-card-title">
  50. <el-tag :type="authStatus.style">{{authStatus.text}}</el-tag></div>
  51. <div class="authentication-card-info" v-if="authStatus.style=='warning'">需要进行人工审核,审核周期1-3个工作日</div>
  52. <div class="authentication-card-info" v-if="authStatus.style=='success'">认证成功,点击查看认证信息</div>
  53. <div class="authentication-card-info" v-if="authStatus.style=='info'">认证失败,查看失败原因</div>
  54. </el-col>
  55. </el-row>
  56. </div>
  57. </el-col>
  58. </el-row>
  59. </div>
  60. </div>
  61. </template>
  62. <script>
  63. import Http from '@/js/http.js'
  64. import {storageGet} from '@/js/index'
  65. import {notify} from '@/constants/index'
  66. export default {
  67. name: "Authentication",
  68. data() {
  69. return {
  70. loading: false,
  71. selectedCardImg:'',
  72. authType:-1,
  73. authDetail:{},
  74. authInfo:{},
  75. authStatus:''
  76. }
  77. },
  78. methods: {
  79. showLoading() {
  80. this.loading = true
  81. },
  82. hideLoading() {
  83. this.loading = false
  84. },
  85. gotoPersonalAuth(){
  86. this.$router.push({path:'/personal/authentication/individual'})
  87. },
  88. gotoEnterpriseAuth(){
  89. this.$router.push({path:'/personal/authentication/enterprise'})
  90. },
  91. //获取当前资质状态
  92. getAuthStatus(){
  93. this.showLoading();
  94. let userId = storageGet('user')&&storageGet('user').userVO.id;
  95. Http.get(`/api/user/${userId}`).then(res=>{
  96. this.authInfo = res;
  97. if(res.personalAuthVO){
  98. this.authType = 1 //个人
  99. this.authDetail = res.personalAuthVO
  100. this.authStatus = res.personalAuthVO.authStatus
  101. this.selectedCardImg = 'authentication-card-select'
  102. }else if(res.agencyVO){
  103. this.authType = 2 //企业
  104. this.authDetail = res.agencyVO
  105. this.authStatus = res.agencyVO.authStatus
  106. this.selectedCardImg = 'authentication-card-select'
  107. }else if((!res.enterpriseAuthVO) || (!res.agencyVO)){
  108. this.authType = 0 //无
  109. }
  110. this.hideLoading();
  111. })
  112. }
  113. },
  114. mounted() {
  115. this.getAuthStatus();
  116. }
  117. }
  118. </script>
  119. <style scoped lang="less">
  120. .right-modifyPsw {
  121. padding: 20px;
  122. background: rgba(255, 255, 255, 1);
  123. box-shadow: 0px 1px 6px 0px rgba(8, 6, 6, 0.13);
  124. .right-modifyPsw-title {
  125. padding: 10px;
  126. border-bottom: 1px solid #ccc;
  127. margin-bottom: 20px;
  128. }
  129. .authentication-card{
  130. background:rgba(249,249,249,1);
  131. padding: 20px 20px 30px 20px;
  132. .authentication-card-title {
  133. font-size:20px;
  134. font-family:Source Han Sans CN;
  135. font-weight:500;
  136. margin-bottom: 20px;
  137. }
  138. .authentication-card-info{
  139. font-size:16px;
  140. font-family:Source Han Sans CN;
  141. font-weight:400;
  142. color:rgba(153,153,153,1);
  143. }
  144. .authentication-card-img {
  145. background:rgba(0,118,203,1);
  146. border-radius:50%;
  147. width: 65px;
  148. height: 65px;
  149. text-align: center;
  150. vertical-align: middle;
  151. display: table-cell;
  152. }
  153. }
  154. .authentication-card-select {
  155. background-image: url("../../assets/img/selectAuthentication.png");
  156. background-size: 100% 100%;
  157. }
  158. }
  159. </style>