team.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <!-- 我的积分 -->
  2. <template>
  3. <s-layout class="wallet-wrap" :bgStyle="{'backgroundColor':'#ffffff'}" title="" navbar="normal">
  4. <view class="model-box ss-flex-col">
  5. <view class="all-title ss-p-x-45 ss-p-t-30">
  6. <text style="float: right;">共{{state.teamCount}}人</text>
  7. </view>
  8. <view class="list-box" style="width: 100%;padding: 0;height: calc(100vh - 7.5rem) ;">
  9. <!-- 推荐人 -->
  10. <view>
  11. <view class="list-item ss-flex ss-col-center ss-row-between "
  12. style="padding-top: 30rpx; padding-bottom: 0;">
  13. <view class="ss-flex ss-col-center" style="width: 100%;border-bottom: 1px solid #ededed;padding-bottom: 30rpx">
  14. <view>
  15. &nbsp;&nbsp;
  16. </view>
  17. <!-- 头像 -->
  18. <view class="avatar-box ss-m-x-20">
  19. <image class="avatar-img" :src="state.ancestor.avatar" mode="aspectFill"></image>
  20. </view>
  21. <view class="ss-flex ss-m-t-10"
  22. style="flex-direction: column;align-items: flex-start;width: calc(100% - 5.5rem);">
  23. <view class="name" style="width: 100%;">
  24. <text style="width:50%;display: inline-block;">{{ state.ancestor.username ||'昵称:'+state.ancestor.descNickName }}</text> <text class="time" style="float: right;color: #666666">保留绩效值:{{points2point(state.ancestor.residueSocial)}}</text>
  25. </view>
  26. <view class="time" style="width: 100%;color: #999;">
  27. <text>{{state.ancestor.socialStatusLevel || "等级1" }}</text> / <text>推荐人</text>
  28. <text
  29. style="float: right;">团队:{{state.ancestor.descendantsCount}}人</text>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <!-- 直推人和后代 -->
  36. <view>
  37. <scroll-view style="width: 100%;" scroll-y="true" @touchmove.stop>
  38. <view v-if="state.descendants.total > 0">
  39. <view class="list-item ss-flex ss-col-center ss-row-between "
  40. v-for="(item,index) in state.descendants.list" :key="item.id"
  41. style="padding-top: 30rpx ;padding-bottom: 0;">
  42. <view class="ss-flex ss-col-center" style="width: 100%;border-bottom: 1px solid #ededed;padding-bottom: 30rpx">
  43. <view>
  44. {{item.sort}}
  45. </view>
  46. <!-- 头像 -->
  47. <view class="avatar-box ss-m-x-20">
  48. <image class="avatar-img" :src="
  49. item.avatar || sheep.$url.static('/static/images/default_avatar.png')" mode="aspectFill"></image>
  50. </view>
  51. <view class="ss-flex ss-m-t-10"
  52. style="flex-direction: column;align-items: flex-start;width: calc(100% - 5.5rem);">
  53. <view class="name" style="width: 100%;">
  54. <text style="width:50%;display: inline-block;"> {{ item.username || '昵称:'+ item.descNickName}}</text>
  55. <text class="time" style="float: right;color: #666666;">新增绩效值:{{points2point(item.residueSocial)}}</text>
  56. </view>
  57. <view class="time" style="width: 100%;color: #999">
  58. {{item.socialStatusLevel}} / <text >{{item.depth == 1?'直推人':''}}</text>
  59. <text style="float: right;">团队:{{item.descendantsCount}}人</text>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <s-empty v-else text="暂无团队成员" icon="/static/data-empty.png" />
  66. </scroll-view>
  67. </view>
  68. </view>
  69. </view>
  70. <uni-load-more v-if="state.descendants.total > 0" :status="state.loadStatus" :content-text="{
  71. contentdown: '点击加载更多',
  72. }" @tap="loadMore" />
  73. </s-layout>
  74. </template>
  75. <script setup>
  76. import sheep from '@/sheep';
  77. import {
  78. onLoad,
  79. onReachBottom
  80. } from '@dcloudio/uni-app';
  81. import {
  82. computed,
  83. reactive
  84. } from 'vue';
  85. import _ from 'lodash';
  86. import dayjs from 'dayjs';
  87. import TeamApi from '@/sheep/api/distri/team';
  88. import {
  89. resetPagination
  90. } from '@/sheep/util';
  91. import {
  92. points2point
  93. } from '@/sheep/hooks/useGoods';
  94. const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
  95. const userInfo = computed(() => sheep.$store('user').userInfo);
  96. const sys_navBar = sheep.$platform.navbar;
  97. const state = reactive({
  98. currentTab: 0,
  99. pagination: {
  100. list: 0,
  101. total: 0,
  102. pageSize: 11,
  103. pageNo: 1,
  104. },
  105. loadStatus: '',
  106. descendants: {
  107. total: 0,
  108. list: []
  109. },
  110. teamCount: 0,
  111. ancestor: {
  112. }
  113. });
  114. const dateFilterText = computed(() => {
  115. if (state.date[0] === state.date[1]) {
  116. return state.date[0];
  117. } else {
  118. return state.date.join('~');
  119. }
  120. });
  121. async function getTeam() {
  122. state.loadStatus = 'loading';
  123. let {
  124. code,
  125. data
  126. } = await TeamApi.getTeam({
  127. pageNo: state.pagination.pageNo,
  128. pageSize: state.pagination.pageSize,
  129. });
  130. if (code !== 0) {
  131. return;
  132. }
  133. // 团队人员数量
  134. state.teamCount = data.teamCount
  135. // 直推人
  136. state.ancestor = data.ancestor
  137. let descendantsList = _.concat(state.descendants.list, data.descendants.list);
  138. // 后代
  139. state.descendants.list = descendantsList
  140. // console.log(state.descendants.list)
  141. // state.pagination.list = data.list;
  142. state.descendants.total = data.descendants.total;
  143. state.pagination.total = data.descendants.total;
  144. state.loadStatus = state.descendants.list.length < state.descendants.total ? 'more' : 'noMore';
  145. }
  146. onLoad(() => {
  147. state.today = dayjs().format('YYYY-MM-DD');
  148. state.date = [state.today, state.today];
  149. getTeam();
  150. });
  151. function loadMore() {
  152. if (state.loadStatus === 'noMore') {
  153. return;
  154. }
  155. state.pagination.pageNo++;
  156. getTeam();
  157. }
  158. onReachBottom(() => {
  159. loadMore();
  160. });
  161. </script>
  162. <style lang="scss" scoped>
  163. .score-box {
  164. margin: 20rpx;
  165. border-radius: 20rpx;
  166. padding-top: 100rpx;
  167. }
  168. .avatar-box {
  169. width: 100rpx;
  170. height: 100rpx;
  171. border-radius: 50%;
  172. overflow: hidden;
  173. border: 1px solid #eaeaea;
  174. .avatar-img {
  175. width: 100%;
  176. height: 100%;
  177. }
  178. }
  179. .value-box {
  180. width: 100rpx;
  181. height: 100rpx;
  182. line-height: 100rpx;
  183. text-align: center;
  184. border-radius: 50%;
  185. border: 2px solid #f6f6f6;
  186. }
  187. .btn {
  188. width: 300rpx;
  189. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  190. border-radius: 20rpx;
  191. font-size: 30rpx;
  192. font-weight: 500;
  193. line-height: 80rpx;
  194. color: $white;
  195. position: relative;
  196. z-index: 1;
  197. }
  198. .header-box {
  199. width: 100%;
  200. background: linear-gradient(180deg, var(--ui-BG-Main) 0%, var(--ui-BG-Main-gradient) 100%) no-repeat;
  201. background-size: 750rpx 100%;
  202. padding: 0 0 120rpx 0;
  203. box-sizing: border-box;
  204. .score-box {
  205. height: 100%;
  206. .all-num {
  207. font-size: 50rpx;
  208. font-weight: bold;
  209. color: #fff;
  210. font-family: OPPOSANS;
  211. }
  212. .all-title {
  213. font-size: 26rpx;
  214. font-weight: 500;
  215. color: #fff;
  216. }
  217. .cicon-help-o {
  218. color: #fff;
  219. font-size: 28rpx;
  220. }
  221. }
  222. }
  223. // 筛选
  224. .filter-box {
  225. height: 114rpx;
  226. background-color: $bg-page;
  227. .total-box {
  228. font-size: 24rpx;
  229. font-weight: 500;
  230. color: $dark-9;
  231. }
  232. .date-btn {
  233. background-color: $white;
  234. line-height: 54rpx;
  235. border-radius: 27rpx;
  236. padding: 0 20rpx;
  237. font-size: 24rpx;
  238. font-weight: 500;
  239. color: $dark-6;
  240. .ss-seldate-icon {
  241. font-size: 50rpx;
  242. color: $dark-9;
  243. }
  244. }
  245. }
  246. .list-box {
  247. width: 500rpx;
  248. height: 600rpx;
  249. padding: 0 20rpx;
  250. overflow-y: auto;
  251. .list-item {
  252. background: #fff;
  253. // border-bottom: 1rpx solid #dfdfdf;
  254. padding: 30rpx;
  255. .name {
  256. font-size: 30rpx;
  257. font-weight: 500;
  258. color: rgba(102, 102, 102, 1);
  259. line-height: 30rpx;
  260. display: flex;
  261. align-items: center;
  262. justify-content: space-between;
  263. // margin-bottom: 20rpx;
  264. }
  265. .time {
  266. font-size: 24rpx;
  267. font-weight: 500;
  268. color: rgba(196, 196, 196, 1);
  269. line-height: 24px;
  270. }
  271. .add {
  272. font-size: 30rpx;
  273. font-weight: 500;
  274. color: #e6b873;
  275. }
  276. .minus {
  277. font-size: 30rpx;
  278. font-weight: 500;
  279. color: $dark-3;
  280. }
  281. }
  282. }
  283. </style>