judge-auth.vue 1.8 KB

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