fans.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <profile-relation-list
  3. ref="list"
  4. :user-no="userNo"
  5. list-type="fans"
  6. :title="copy.fansTitle"
  7. :empty-text="copy.fansEmpty"
  8. :default-bio="copy.defaultBio"
  9. :follow-label="copy.follow"
  10. :unfollow-label="copy.followed"
  11. :loading-text="copy.loading"
  12. :no-more-text="copy.noMore"
  13. :load-more-hint="copy.loadMore"
  14. :load-failed-text="copy.loadFailed"
  15. :action-failed-text="copy.actionFailed"
  16. :shop-tag="copy.shopTag"
  17. />
  18. </template>
  19. <script>
  20. import ProfileRelationList from '@/components/profile/relation-list.vue'
  21. export default {
  22. components: { ProfileRelationList },
  23. data() {
  24. return {
  25. userNo: ''
  26. }
  27. },
  28. computed: {
  29. copy() {
  30. const t = this.$t.bind(this)
  31. return {
  32. fansTitle: t('relation.fansTitle'),
  33. fansEmpty: t('relation.fansEmpty'),
  34. defaultBio: t('findUser.defaultBio'),
  35. follow: t('mine.follow'),
  36. followed: t('mine.followed'),
  37. loading: t('relation.loading'),
  38. noMore: t('relation.noMore'),
  39. loadMore: t('relation.loadMore'),
  40. loadFailed: t('relation.loadFailed'),
  41. actionFailed: t('relation.actionFailed'),
  42. shopTag: t('relation.shopTag')
  43. }
  44. }
  45. },
  46. onLoad(query) {
  47. this.userNo = (query && query.id) || ''
  48. },
  49. onPullDownRefresh() {
  50. const list = this.$refs.list
  51. if (list && list.reload) {
  52. list.reload().finally(() => uni.stopPullDownRefresh())
  53. } else {
  54. uni.stopPullDownRefresh()
  55. }
  56. }
  57. }
  58. </script>