new-proxy.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view class="new-proxy">
  3. <view class="content">
  4. <view class="swiper-nav">
  5. <view v-for="(item, index) in typeList" :key="index" class="item" :class="{ active: MIXIN_ActiveIndex === index }" @tap="switchSwiper(index)">{{ item }}</view>
  6. <view class="moveBar" :style="{ left: MIXIN_MoveBarLeft + 'px', width: 100 / typeList.length + '%' }"><text></text></view>
  7. </view>
  8. <view class="swiper-area">
  9. <pulldown-refresher ref="pulldownRefresher" @pulldownRefresh="MIXIN_pulldownrefresh">
  10. <swiper class="swiper" :current="MIXIN_NowIndex" :duration="234" @transition="MIXIN_transition" @change="MIXIN_change" @animationfinish="MIXIN_animationfinish">
  11. <swiper-item v-for="(item, index) in typeList" :key="index">
  12. <scroll-view scroll-y :style="{ height: MIXIN_ScrollViewHeight + 'px' }" @scrolltolower="MIXIN_scrolltolower">
  13. <view class="team-item" v-for="(item, itemIndex) in lists[index]" :key="itemIndex" @tap="toPerson(item.id)">
  14. <view class="left">
  15. <image :src="item.avatar"></image>
  16. <text class="ellipsis name">{{ item.nickname }}</text>
  17. <view class="level-name"><text class="cuIcon-crownfill"></text>{{ item.level_name }}</view>
  18. </view>
  19. <view class="right">
  20. <view>查看详情</view>
  21. <text class="cuIcon-right"></text>
  22. </view>
  23. </view>
  24. <custom-reach-bottom v-if="lists[index].length" :nomore="page[index] === 0" />
  25. <swiper-status v-else :page="page[index]" unit="新增团队成员" />
  26. </scroll-view>
  27. </swiper-item>
  28. </swiper>
  29. </pulldown-refresher>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import MIXIN from '@/mixin/swiper-list.js'
  36. import swiperStatus from '@/components/public/swiper-status.vue'
  37. import pulldownRefresher from '@/components/public/pulldown-refresher.vue'
  38. import customReachBottom from '@/components/public/custom-reach-bottom.vue'
  39. import { _API_TeamNewList_Day, _API_TeamNewList_Month } from '@/apis/team.js'
  40. export default {
  41. mixins: [MIXIN],
  42. components: { swiperStatus, customReachBottom, pulldownRefresher },
  43. data() {
  44. return {
  45. page: [1, 1], // 每种类型的页数 当页数为 0 时表示当前类型没有更多了 -1 表示请求失败
  46. lists: { 0: [], 1: []}, // 数据
  47. typeList: ['今日新增(0)', '本月新增(0)'],
  48. apis: [_API_TeamNewList_Day, _API_TeamNewList_Month]
  49. };
  50. },
  51. onLoad({ type, day, month }) { // 发起请求
  52. this.typeList = [`今日新增(${day})`, `本月新增(${month})`]
  53. this.MIXIN_NowIndex = this.MIXIN_ActiveIndex = this.MIXIN_FinishedIndex = +type
  54. this.MIXIN_MoveBarLeft = this.MIXIN_NowIndex * (this.MIXIN_ScreenWidth / this.typeList.length)
  55. this.MIXIN_request()
  56. },
  57. methods: {
  58. toPerson(id) {
  59. uni.navigateTo({ url: `../person-card/person-card?id=${id}` })
  60. }
  61. }
  62. }
  63. </script>
  64. <style lang="scss">
  65. .new-proxy {
  66. @include page();
  67. .content {
  68. @include flex(column);
  69. .swiper-nav {
  70. text {
  71. width: 56rpx;
  72. }
  73. margin-bottom: 10rpx;
  74. }
  75. .swiper-area {
  76. scroll-view {
  77. .team-item {
  78. @include flex();
  79. height: 90rpx;
  80. background: #FFFFFF;
  81. padding: 0 30rpx;
  82. box-sizing: border-box;
  83. border-bottom: 1rpx solid $app-base-bg;
  84. .left {
  85. @include flex();
  86. flex: 1;
  87. justify-content: flex-start;
  88. height: 100%;
  89. image {
  90. width: 66rpx;
  91. height: 66rpx;
  92. border-radius: 50%;
  93. }
  94. .name {
  95. max-width: 268rpx;
  96. margin: 0 30rpx;
  97. }
  98. }
  99. .right {
  100. @include flex();
  101. height: 100%;
  102. color: #999999;
  103. justify-content: space-between;
  104. > view { font-size: 24rpx; }
  105. >text { font-size: 32rpx; }
  106. }
  107. }
  108. }
  109. margin-bottom: 10rpx;
  110. }
  111. }
  112. }
  113. </style>