index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view class="fan-statistics-container">
  3. <JHeader title="粉丝统计" width="50" height="50" style="padding: 24upx 0 0;"></JHeader>
  4. <view style="padding: 0 28upx;">
  5. <view v-if="statistics.userName" style="display: flex;align-items: center;font-size: 36upx;">
  6. <view>
  7. <JAvatar :src="common.seamingImgUrl(statistics.headImage)" :size="60" style="margin: 0 24upx 0 0;line-height: 1;"></JAvatar>
  8. </view>
  9. <view style="margin-right: 16upx;">{{ statistics.userName }}</view>
  10. <view>【{{ statistics.phone }}】</view>
  11. </view>
  12. <view v-if="statistics.paramLists && statistics.paramLists.length" style="margin-top: 20upx;">
  13. <view style="font-size: 28upx;font-weight: bold;">粉丝列表</view>
  14. <view style="margin-top: 20upx;">
  15. <view v-for="(item, index) in statistics.paramLists" :key="index" style="margin-bottom: 20upx;">
  16. <tui-collapse :index="index" :current="currentIndexMain" hd-bg-color="#ffffff" @click="changeCurrentMain">
  17. <template #title>
  18. <tui-list-cell background-color="transparent">
  19. <view style="display: flex;align-items: center;">
  20. <view>
  21. <JAvatar :src="common.seamingImgUrl(item.headImage)" :size="40" style="margin: 0 24upx 0 0;line-height: 1;"></JAvatar>
  22. </view>
  23. <view style="margin-right: 16upx;">{{ item.userName }}</view>
  24. <view>【{{ item.phone }}】</view>
  25. </view>
  26. </tui-list-cell>
  27. </template>
  28. <template #content>
  29. <view v-if="item.paramLists && item.paramLists.length">
  30. <view
  31. v-for="(part, count) in item.paramLists" :key="count"
  32. style="display: flex;align-items: center;padding: 18upx 0 18upx 38upx;margin-bottom: 4upx;background-color: #ebebea;"
  33. >
  34. <view>
  35. <JAvatar :src="common.seamingImgUrl(part.headImage)" :size="40" style="margin: 0 24upx 0 0;line-height: 1;"></JAvatar>
  36. </view>
  37. <view style="margin-right: 16upx;">{{ part.userName }}</view>
  38. <view>【{{ part.phone }}】</view>
  39. </view>
  40. </view>
  41. <view v-else style="padding: 28upx 0;text-align: center;background-color: #ebebea;">
  42. 该粉丝暂无下级粉丝~
  43. </view>
  44. </template>
  45. </tui-collapse>
  46. </view>
  47. </view>
  48. </view>
  49. <view v-else style="padding-top: 48upx;text-align: center;">
  50. 暂无粉丝!
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import { getStatisticsPlatformRelationshipApi } from '../../../api/anotherTFInterface'
  57. export default {
  58. name: 'FanStatistics',
  59. data() {
  60. return {
  61. statistics: {
  62. userName: '',
  63. headImage: '',
  64. phone: '',
  65. paramLists: []
  66. },
  67. currentIndexMain: 0
  68. }
  69. },
  70. onLoad() {
  71. this.getMyFansStatistics()
  72. },
  73. methods: {
  74. getMyFansStatistics() {
  75. uni.showLoading({
  76. title: '加载中'
  77. })
  78. getStatisticsPlatformRelationshipApi({})
  79. .then(({ data }) => {
  80. console.log(data)
  81. this.statistics.userName = data.userName || ''
  82. this.statistics.headImage = data.headImage || ''
  83. this.statistics.phone = data.phone || ''
  84. this.statistics.paramLists = data.paramLists || []
  85. uni.hideLoading()
  86. })
  87. .catch(() => {
  88. uni.hideLoading()
  89. })
  90. },
  91. changeCurrentMain(e) {
  92. this.currentIndexMain = this.currentIndexMain == e.index ? -1 : e.index
  93. }
  94. }
  95. }
  96. </script>
  97. <style lang="less" scoped>
  98. .fan-statistics-container {
  99. min-height: 100vh;
  100. background-color: #f9f9f9;
  101. box-sizing: border-box;
  102. }
  103. </style>