clubStarList.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { mapGetters } from 'vuex'
  2. import { drawLogo } from '@/utils'
  3. export default {
  4. data() {
  5. return {
  6. isRequest: false,
  7. list: [],
  8. }
  9. },
  10. computed: {
  11. ...mapGetters(['authUserId', 'routePrefix']),
  12. total() {
  13. return this.list.length
  14. },
  15. },
  16. mounted() {
  17. this.fetchList()
  18. },
  19. methods: {
  20. // 绘制logo的方法
  21. drawLogo,
  22. // 查看详情
  23. toDetail(item) {
  24. const url = `${this.routePrefix}/approve/club/detail?id=${item.authId}`
  25. this.$router.push(url)
  26. },
  27. async fetchList() {
  28. // 自定义加载图标
  29. this.$toast.loading({
  30. message: '正在获取明星机构...',
  31. duration: 0,
  32. })
  33. try {
  34. const res = await this.$http.api.getAuthClubStarList({
  35. authUserId: this.authUserId,
  36. })
  37. this.list = res.data
  38. } catch (error) {
  39. console.log(error)
  40. } finally {
  41. this.$toast.clear()
  42. }
  43. },
  44. // 格式化地址
  45. formatAddress(a1, a2) {
  46. let resutl = ''
  47. if (a1) resutl += a1
  48. if (a2) resutl += a2
  49. return resutl || '暂无'
  50. },
  51. },
  52. }