teacher_authorize.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view>
  3. <view v-show="isShow">
  4. <view class="requires" @click="requireDetail(item)">
  5. <uni-row >
  6. <uni-col offset="1">
  7. <text class="fontStyle">用户ID:</text>{{item.uid}}
  8. </uni-col>
  9. </uni-row>
  10. <uni-row >
  11. <uni-col offset="1">
  12. <text class="fontStyle">显示名:</text> {{item.name}} <text>教员</text>
  13. </uni-col>
  14. </uni-row>
  15. <uni-row >
  16. <uni-col offset="1">
  17. <text class="fontStyle">当前高校:</text>{{item.school}}
  18. </uni-col>
  19. </uni-row>
  20. <uni-row>
  21. <uni-col offset="1" :span="11">
  22. <text class="fontStyle">当前学历:</text>{{item.education}}
  23. </uni-col>
  24. <uni-col :span="12">
  25. <text class="fontStyle">手机号:</text>{{item.phone}}
  26. </uni-col>
  27. </uni-row>
  28. <uni-row >
  29. <uni-col offset="1" :span="18">
  30. <text class="fontStyle">微信号:</text>{{item.weixinId}}
  31. </uni-col>
  32. <uni-col :span="5">
  33. <text class="authorize">{{authentication}}</text>
  34. </uni-col>
  35. </uni-row>
  36. </view>
  37. </view>
  38. <uni-fab :pattern="pattern" horizontal="left" vertical="bottom" :content="content"
  39. direction="horizontal" @trigger="trigger" />
  40. </view>
  41. </template>
  42. <script>
  43. import { mapState, mapMutations } from 'vuex';
  44. export default {
  45. computed: {
  46. ...mapState('m_user', ['authentication'])
  47. },
  48. data() {
  49. return {
  50. pattern: {
  51. color: '#7A7E83',
  52. backgroundColor: '#E2F0D9',
  53. selectedColor: '#1296db',
  54. buttonColor: '#E2F0D9',
  55. iconColor: '#000000'
  56. },
  57. content: [{
  58. iconPath: '/static/authorized.png',
  59. selectedIconPath: '/static/authorizedd.png',
  60. text: '老师认证',
  61. active: false
  62. }
  63. ],
  64. item: {},
  65. isShow: false
  66. };
  67. },
  68. created() {
  69. this.getPersonAuthorize()
  70. },
  71. onShow() {
  72. this.content[0].active = false
  73. },
  74. methods: {
  75. ...mapMutations('m_user', ['updateAuthentication', 'updateAuthorizePhoto']),
  76. // 获取认证信息
  77. async getPersonAuthorize() {
  78. const { data: result } = await uni.$http.get('/education/teacher-certifications/findInfosByUid')
  79. console.log(result)
  80. this.item = result.data.one
  81. if (this.item == null) {
  82. this.updateAuthentication('未申请认证')
  83. } else {
  84. this.isShow = true
  85. this.updateAuthentication(result.data.one.verifyStatus)
  86. }
  87. },
  88. trigger(e) {
  89. this.content[e.index].active = true
  90. if (this.authentication === '未申请认证') {
  91. uni.navigateTo({
  92. url:'/subpkg/add_teacher_authorize/add_teacher_authorize'
  93. })
  94. } else if (this.authentication === '审核中') {
  95. uni.$showMsg('正在审核中…')
  96. this.content[e.index].active = false
  97. return
  98. } else if (this.authentication === '已通过') {
  99. return uni.$showMsg('你已认证过')
  100. } else if (this.authentication === '未通过') {
  101. return uni.$showMsg('认证失败')
  102. }
  103. },
  104. requireDetail(item) {
  105. const authorizePhoto = {
  106. diplomaPhoto: this.item.diplomaPhoto,
  107. idCardBack: this.item.idCardBack,
  108. idCardFront: this.item.idCardFront,
  109. profilePhoto: this.item.profilePhoto
  110. }
  111. this.updateAuthorizePhoto(authorizePhoto)
  112. uni.navigateTo({
  113. url: '/subpkg/teacher_authorize_detail/teacher_authorize_detail?item=' + encodeURIComponent(JSON.stringify(this.item))
  114. })
  115. }
  116. }
  117. }
  118. </script>
  119. <style lang="scss">
  120. .requires {
  121. background-color: #FFF2CC;
  122. margin: 0 20rpx;
  123. border-radius: 10%;
  124. .fontStyle {
  125. font-weight: 600;
  126. }
  127. .authorize {
  128. color: red;
  129. }
  130. }
  131. </style>