judge-auth.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view class="">
  3. <u-modal
  4. v-model="show"
  5. :content="content"
  6. :show-cancel-button="true"
  7. @cancel="cancel"
  8. @confirm="confirm"
  9. ></u-modal>
  10. <u-toast ref="uToast" />
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. name: 'judgeAuth',
  16. data() {
  17. return {
  18. show: false,
  19. content: '你还没有认证,该功能需要认证后才能使用!',
  20. auditStatus: null
  21. };
  22. },
  23. methods: {
  24. /**
  25. * @param {Object} bool
  26. */
  27. modalShow(url) {
  28. this.$u.api.getmemberinfo().then(res => {
  29. if (res.code === 200){
  30. this.$u.vuex('vuex_memberInfo', res.data);
  31. if (res.data.auditStatus || res.data.auditStatus === 0) {
  32. this.auditStatus = Number(res.data.auditStatus)
  33. }
  34. switch (Number(res.data.auditStatus)){
  35. case 0:
  36. this.content = '您的认证正在审核中,该功能需要认证后才能使用!'
  37. this.show = true
  38. break;
  39. case 1:
  40. this.content = '您的认证未通过,,该功能需要认证后才能使用!'
  41. this.show = true
  42. break;
  43. case 2:
  44. this.$emit('adoptAuth', url)
  45. break;
  46. case 3:
  47. this.content = '您的认证已被撤销,该功能需要认证后才能使用!'
  48. this.show = true
  49. break;
  50. case 9:
  51. this.content = '您还未进行认证,该功能需要认证后才能使用!'
  52. this.show = true
  53. break;
  54. }
  55. } else {
  56. this.$refs.uToast.show({
  57. title: res.msg,
  58. type: 'error'
  59. })
  60. }
  61. }).catch(err => {
  62. this.$refs.uToast.show({
  63. title: err.msg,
  64. type: 'error'
  65. })
  66. })
  67. },
  68. /**
  69. * 取消
  70. */
  71. cancel() {},
  72. /**
  73. * 确认
  74. */
  75. confirm() {
  76. this.show = false;
  77. if (this.auditStatus === 1 || this.auditStatus === 3 || this.auditStatus === 9) {
  78. uni.navigateTo({
  79. url: '/pages/applyEducationCode/applyEducationCode'
  80. });
  81. }
  82. }
  83. }
  84. };
  85. </script>
  86. <style>
  87. </style>