vip-user.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template>
  2. <view class="vip-user-container">
  3. <TuanPageHead :scroll-top="scrollTop" fixed title="会员列表" bacokground="#fff">
  4. <tui-icon slot="left" name="arrowleft" color="#3d3d3d" @click="handleBack"></tui-icon>
  5. </TuanPageHead>
  6. <view class="list">
  7. <LoadingMore v-show="loading !== 'none'" :status="loading"></LoadingMore>
  8. <view v-if="list.length" class="list-container">
  9. <FansPane v-for="item in list" :key="item.id" :fans-info="item" @view="handleViewFans"></FansPane>
  10. </view>
  11. <view v-if="!list.length && loading != 'loading'" class="no-data"> 暂无数据... </view>
  12. </view>
  13. <!-- 查看会员列表 -->
  14. <tui-bottom-popup :z-index="1002" :mask-z-index="1001" :show="subFansListVisible" @close="handleClosePopup">
  15. <view class="fans-list">
  16. <view class="fans-header">
  17. <view class="fans-title"><text class="user-name">{{ subFansInfo.phone }}</text> 的粉丝列表</view>
  18. <tui-icon class="close-icon" :size="20" name="close" color="#ccc" @click="handleClosePopup"></tui-icon>
  19. </view>
  20. <FansPane v-for="item in subFansInfo.paramLists" :key="item.id" :fans-info="item"></FansPane>
  21. </view>
  22. </tui-bottom-popup>
  23. </view>
  24. </template>
  25. <script>
  26. import { T_STORAGE_KEY } from '../../../constant'
  27. import { getFansListApi } from '../../../api/anotherTFInterface'
  28. import FansPane from './components/FansPane.vue'
  29. export default {
  30. components: {
  31. FansPane
  32. },
  33. data() {
  34. return {
  35. scrollTop: 0,
  36. userInfo: null,
  37. list: [],
  38. loading: '',
  39. subFansListVisible: false,
  40. subFansInfo: {}
  41. }
  42. },
  43. onLoad(params) {
  44. this.userInfo = uni.getStorageSync(T_STORAGE_KEY)
  45. if (this.userInfo) {
  46. this.getCommanderVipUserList(params.date === 'now')
  47. }
  48. },
  49. methods: {
  50. handleBack() {
  51. uni.navigateBack({
  52. delta: 1
  53. })
  54. },
  55. async getCommanderVipUserList(isToday) {
  56. try {
  57. this.loading = 'loading'
  58. const res = await getFansListApi({
  59. today: isToday ? 1 : 0
  60. })
  61. this.list = res.data.paramLists
  62. } catch (error) {
  63. this.ttoast({
  64. type: 'fail',
  65. title: '会员列表获取失败',
  66. content: error
  67. })
  68. this.commissionDataList = []
  69. } finally {
  70. this.loading = 'more'
  71. uni.stopPullDownRefresh()
  72. }
  73. },
  74. // 查看粉丝列表
  75. handleViewFans(currentFansInfo) {
  76. const { paramLists } = currentFansInfo
  77. if (paramLists && paramLists.length) {
  78. // this.subFansList = paramLists
  79. this.subFansInfo = currentFansInfo
  80. this.subFansListVisible = true
  81. }
  82. },
  83. // 关闭弹窗
  84. handleClosePopup() {
  85. this.subFansList = {}
  86. this.subFansListVisible = false
  87. }
  88. },
  89. onPageScroll(e) {
  90. this.scrollTop = e.scrollTop
  91. },
  92. onPullDownRefresh() {
  93. this.getCommanderVipUserList()
  94. }
  95. }
  96. </script>
  97. <style lang="less" scoped>
  98. .vip-user-container {
  99. width: 100vw;
  100. background-color: #f6f6f5;
  101. min-height: 100vh;
  102. .list {
  103. .list-container {
  104. display: flex;
  105. align-items: center;
  106. flex-direction: column;
  107. .item {
  108. margin-top: 30upx;
  109. padding: 20upx;
  110. box-sizing: border-box;
  111. width: 700upx;
  112. background-color: #fff;
  113. border-radius: 10upx;
  114. display: flex;
  115. align-items: flex-start;
  116. .avatar-wrapper {
  117. position: relative;
  118. border-radius: 10upx;
  119. overflow: hidden;
  120. .mask {
  121. position: absolute;
  122. left: 0;
  123. right: 0;
  124. bottom: 0;
  125. width: 100%;
  126. height: 40upx;
  127. background-color: rgba(0, 0, 0, 0.5);
  128. font-size: 24upx;
  129. color: #fff;
  130. text-align: center;
  131. line-height: 40upx;
  132. }
  133. }
  134. .avatar {
  135. flex-shrink: 0;
  136. width: 100upx;
  137. height: 100upx;
  138. border-radius: 10upx;
  139. display: block;
  140. }
  141. .info {
  142. flex: 1;
  143. margin-left: 20upx;
  144. .name {
  145. display: flex;
  146. align-items: center;
  147. justify-content: space-between;
  148. font-size: 28upx;
  149. font-weight: 500;
  150. .add-time {
  151. font-size: 24upx;
  152. }
  153. }
  154. .phone {
  155. display: flex;
  156. align-items: center;
  157. justify-content: space-between;
  158. font-size: 24upx;
  159. margin-top: 16upx;
  160. .uni-btn {
  161. display: flex;
  162. align-items: center;
  163. color: #ccc;
  164. font-size: 24upx;
  165. .icon {
  166. margin-right: 10upx !important;
  167. }
  168. }
  169. }
  170. }
  171. }
  172. }
  173. }
  174. }
  175. .no-data {
  176. height: 600upx;
  177. width: 100vw;
  178. text-align: center;
  179. line-height: 600upx;
  180. color: #929292;
  181. font-size: 28upx;
  182. letter-spacing: 1em;
  183. }
  184. .fans-list {
  185. background-color: #f4f4f4;
  186. display: flex;
  187. align-items: center;
  188. flex-direction: column;
  189. height: 800upx;
  190. overflow: auto;
  191. .fans-header {
  192. display: flex;
  193. align-items: center;
  194. justify-content: center;
  195. width: 100%;
  196. position: relative;
  197. height: 90upx;
  198. margin-bottom: -20upx;
  199. .user-name {
  200. color: orange;
  201. }
  202. .close-icon {
  203. position: absolute;
  204. right: 40upx;
  205. top: 50%;
  206. transform: translateY(-50%);
  207. }
  208. }
  209. }
  210. </style>