team-manage.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <view class="team-manage">
  3. <view class="content">
  4. <view class="add-num">
  5. <view class="left" @tap="toNewList(0)">
  6. <view class="num basecolor"><text>{{ dayAdd || 0 }}人</text></view>
  7. <view class="text">今日新增代理</view>
  8. </view>
  9. <view class="right" @tap="toNewList(1)">
  10. <view class="num basecolor"><text>{{ monthAdd || 0 }}人</text></view>
  11. <view class="text">本月新增代理</view>
  12. </view>
  13. </view>
  14. <view class="swiper-nav">
  15. <view v-for="(item, index) in typeList" :key="index" class="item" :class="{ active: MIXIN_ActiveIndex === index }" @tap="switchSwiper(index)">{{ item }}</view>
  16. <view class="moveBar" :style="{ left: MIXIN_MoveBarLeft + 'px', width: 100 / typeList.length + '%' }"><text></text></view>
  17. </view>
  18. <view class="swiper-area">
  19. <pulldown-refresher ref="pulldownRefresher" @pulldownRefresh="MIXIN_pulldownrefresh">
  20. <swiper class="swiper" :current="MIXIN_NowIndex" :duration="234" @transition="MIXIN_transition" @change="MIXIN_change" @animationfinish="MIXIN_animationfinish">
  21. <swiper-item v-for="(item, index) in typeList" :key="index">
  22. <scroll-view scroll-y :style="{ height: MIXIN_ScrollViewHeight + 'px' }" @scrolltolower="MIXIN_scrolltolower">
  23. <view class="team-item" v-for="(item, itemIndex) in lists[index]" :key="itemIndex" @tap="toPerson(item.id)">
  24. <view class="left">
  25. <image :src="item.avatar"></image>
  26. <text class="ellipsis">{{ item.nickname }}</text>
  27. </view>
  28. <view class="right">
  29. <view class="level-name"><text class="cuIcon-crownfill"></text>{{ item.level_name }}</view>
  30. <text class="cuIcon-right"></text>
  31. </view>
  32. </view>
  33. <custom-reach-bottom v-if="lists[index].length" :nomore="page[index] === 0" />
  34. <swiper-status v-else :page="page[index]" unit="团队成员" />
  35. </scroll-view>
  36. </swiper-item>
  37. </swiper>
  38. </pulldown-refresher>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import MIXIN from '@/mixin/swiper-list.js'
  45. import swiperStatus from '@/components/public/swiper-status.vue'
  46. import pulldownRefresher from '@/components/public/pulldown-refresher.vue'
  47. import customReachBottom from '@/components/public/custom-reach-bottom.vue'
  48. import { _API_TeamList_Direct, _API_TeamList_Down } from '@/apis/team.js'
  49. export default {
  50. mixins: [MIXIN],
  51. components: { swiperStatus, customReachBottom, pulldownRefresher },
  52. data() {
  53. return {
  54. title: '团队管理',
  55. dayAdd: 0,
  56. monthAdd: 0,
  57. page: [1, 1], // 每种类型的页数 当页数为 0 时表示当前类型没有更多了 -1 表示请求失败
  58. lists: { 0: [], 1: []}, // 数据
  59. typeList: ['直属代理', '下级代理'],
  60. apis: [_API_TeamList_Direct, _API_TeamList_Down]
  61. }
  62. },
  63. onLoad() { // 发起请求
  64. this.MIXIN_request()
  65. },
  66. methods: {
  67. MIXIN_requestHandle(res) {
  68. this.dayAdd = res.data.today_new
  69. this.monthAdd = res.data.month_new
  70. },
  71. toPerson(id) {
  72. uni.navigateTo({ url: `../person-card/person-card?id=${id}` })
  73. },
  74. toNewList(type) {
  75. uni.navigateTo({ url: `../new-proxy/new-proxy?type=${type}&day=${this.dayAdd}&month=${this.monthAdd}` })
  76. }
  77. }
  78. }
  79. </script>
  80. <style lang="scss">
  81. .team-manage {
  82. @include page();
  83. .content {
  84. @include flex(column);
  85. .swiper-nav {
  86. text {
  87. width: 56rpx;
  88. }
  89. margin-bottom: 10rpx;
  90. }
  91. .swiper-area {
  92. scroll-view {
  93. .team-item {
  94. @include flex();
  95. height: 90rpx;
  96. background: #FFFFFF;
  97. padding: 0 30rpx;
  98. box-sizing: border-box;
  99. border-bottom: 1rpx solid $app-base-bg;
  100. .left {
  101. @include flex();
  102. flex: 1;
  103. height: 100%;
  104. justify-content: flex-start;
  105. image {
  106. width: 66rpx;
  107. height: 66rpx;
  108. border-radius: 50%;
  109. }
  110. text {
  111. width: 370rpx;
  112. margin-left: 30rpx;
  113. }
  114. }
  115. .right {
  116. @include flex();
  117. height: 100%;
  118. width: 180rpx;
  119. justify-content: space-between;
  120. >text {
  121. font-size: 32rpx;
  122. }
  123. }
  124. }
  125. }
  126. margin-bottom: 10rpx;
  127. }
  128. .add-num {
  129. @include flex();
  130. width: 100%;
  131. height: 200rpx;
  132. background: #FFFFFF;
  133. margin-bottom: 10rpx;
  134. >view {
  135. @include flex(column);
  136. flex: 1;
  137. height: 100%;
  138. .num {
  139. text {
  140. font-size: 42rpx;
  141. }
  142. }
  143. .text {
  144. font-size: 26rpx;
  145. margin-top: 30rpx;
  146. }
  147. }
  148. }
  149. }
  150. }
  151. </style>