judge-auth.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. }
  48. } else {
  49. this.$refs.uToast.show({
  50. title: res.msg,
  51. type: 'error'
  52. })
  53. }
  54. }).catch(err => {
  55. this.$refs.uToast.show({
  56. title: err.msg,
  57. type: 'error'
  58. })
  59. })
  60. },
  61. /**
  62. * 取消
  63. */
  64. cancel() {},
  65. /**
  66. * 确认
  67. */
  68. confirm() {
  69. this.show = false;
  70. if (this.auditStatus === 1 || this.auditStatus === 3 ) {
  71. uni.navigateTo({
  72. url: '/pages/applyEducationCode/applyEducationCode'
  73. });
  74. }
  75. }
  76. }
  77. };
  78. </script>
  79. <style>
  80. </style>