judge-auth.vue 2.2 KB

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