team.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <!-- 分享记录 -->
  2. <template>
  3. <view class="">
  4. <view style="color: #000000;">
  5. <tn-nav-bar backgroundColor="#ffffff" :bottomShadow="false">我的团队</tn-nav-bar>
  6. <!-- <view :style="{height: tobheight+'px'}"></view> -->
  7. </view>
  8. <z-paging ref="paging" refresher-complete-delay="200" v-model="jobList" @query="queryList">
  9. <view slot="top" class="z_tabs" :style="{ marginTop: tobheight + 'px' }"></view>
  10. <view class="page_box">
  11. <!-- 标题栏 -->
  12. <view class="head_box">
  13. <view class="nav-box">
  14. <!-- 标题栏 -->
  15. <!-- <shopro-navbar back-icon-color="#fff" :background="{}" :backTextStyle="{ color: '#fff', fontSize: '40rpx', fontWeight: '500' }" backText="分享记录"></shopro-navbar> -->
  16. </view>
  17. <!-- 分类tab -->
  18. <view class="tab-box u-flex">
  19. <view class="tab-item u-flex-1" v-if="setting.level > index" v-for="(tab, index) in tabsList"
  20. :key="tab.value" @tap="onTab(index)">
  21. <view class="u-flex">
  22. <text class="tab-title"
  23. :class="{ 'title-active': tabCurrent === index }">{{ index+1 }}级团队</text>
  24. <text v-if="tabCurrent == index">({{total}}人)</text>
  25. </view>
  26. <text class="underline" :class="{ 'underline-active': tabCurrent === index }"></text>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="content_box">
  31. <view class="log-list u-flex" v-for="(item,index) in jobList" :key="index">
  32. <view class="log-avatar-wrap">
  33. <u-avatar :src="item.avatar" size="30"></u-avatar>
  34. <!-- <image class="log-avatar" :src="item.avatar" mode=""></image> -->
  35. </view>
  36. <view class="item-right">
  37. <view class="name">{{ item.nickname?item.nickname+'('+item.id_number+')':'未注册用户'}}</view>
  38. <view class="item-bottom u-flex u-row-between">
  39. <view class="time">{{ item.create_time }}</view>
  40. <view class="from-text">来自链接分享</view>
  41. </view>
  42. <view class="teamerDetail">
  43. <view class="item">
  44. <view class="num">
  45. {{item.question_count}}
  46. </view>
  47. <view class="txt">
  48. 问答次数
  49. </view>
  50. </view>
  51. <view class="item">
  52. <view class="num">
  53. {{item.gallery_count}}
  54. </view>
  55. <view class="txt">
  56. 绘图次数
  57. </view>
  58. </view>
  59. <view class="item">
  60. <view class="num">
  61. {{item.digit_count}}
  62. </view>
  63. <view class="txt">
  64. 数字人次数
  65. </view>
  66. </view>
  67. <view class="item">
  68. <view class="num">
  69. {{Number(item.payTotal).toFixed(2) }}
  70. </view>
  71. <view class="txt">
  72. 充值金额
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. <!-- <scroll-view scroll-y="true" @scrolltolower="loadMore" class="scroll-box"> -->
  79. <!-- 分享记录列表 -->
  80. <!-- <view class="log-list u-flex" v-for="item in shareLogList" :key="item.userinfo.id">
  81. <view class="log-avatar-wrap"><image class="log-avatar" :src="item.userinfo.avatar" mode=""></image></view>
  82. <view class="item-right">
  83. <view class="name">{{ item.userinfo.nickname }}</view> -->
  84. <!-- <view class="content u-flex">
  85. <view class="content-img-wrap" v-if="item.type_data"><image class="content-img" :src="item.type_data.image" mode=""></image></view>
  86. <view class="content-text">{{ item.msg }}</view>
  87. </view> -->
  88. <!-- <view class="item-bottom u-flex u-row-between">
  89. <view class="time">{{ item.create_time }}</view>
  90. <view class="from-text">来自链接分享</view>
  91. </view>
  92. </view>
  93. </view> -->
  94. <!-- 缺省页 -->
  95. <!-- <shopro-empty v-if="isEmpty" :image="$IMG_URL + '/imgs/empty/no_data.png'" tipText="暂无数据"></shopro-empty> -->
  96. <!-- 更多 -->
  97. <!-- <u-loadmore v-if="shareLogList.length" height="0rpx" :status="loadStatus" icon-type="flower" color="#ccc" />
  98. </scroll-view> -->
  99. </view>
  100. <view class="foot_box"></view>
  101. </view>
  102. </z-paging>
  103. <wike-loading-page :isLoading="isLoading"></wike-loading-page>
  104. </view>
  105. </template>
  106. <script>
  107. import {
  108. mapMutations,
  109. mapActions,
  110. mapState,
  111. mapGetters
  112. } from 'vuex';
  113. export default {
  114. data() {
  115. return {
  116. jobList: [],
  117. isLoading: true,
  118. shareLogList: [], //分享记录
  119. tabCurrent: 0, //默认
  120. tabsList: [
  121. // {
  122. // name: '全部',
  123. // value: 'all'
  124. // },
  125. // {
  126. // name: '名片',
  127. // value: 'index'
  128. // },
  129. // {
  130. // name: '商品',
  131. // value: 'goods'
  132. // },
  133. // {
  134. // name: '拼团',
  135. // value: 'groupon'
  136. // }
  137. {
  138. name: '一级团队',
  139. value: 'first'
  140. },
  141. {
  142. name: '二级团队',
  143. value: 'second'
  144. },
  145. {
  146. name: '三级团队',
  147. value: 'third'
  148. }
  149. ],
  150. typeObj: {
  151. index: '名片',
  152. goods: '商品',
  153. groupon: '拼团',
  154. link: '链接'
  155. },
  156. loadStatus: 'loadmore', //loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
  157. currentPage: 1,
  158. lastPage: 1,
  159. level: 1,
  160. isEmpty: false,
  161. tobheight: 45,
  162. platform: this.$platform.get(),
  163. setting: {},
  164. total: 0
  165. };
  166. },
  167. computed: {
  168. ...mapGetters(['appInfo', 'userInfo'])
  169. },
  170. onLoad() {
  171. const that = this;
  172. if (this.platform == 'wxMiniProgram') {
  173. var menumtop = uni.getMenuButtonBoundingClientRect().top - uni.getSystemInfoSync().statusBarHeight;
  174. var paddingtop = uni.getSystemInfoSync().statusBarHeight + menumtop;
  175. this.tobheight = menumtop + paddingtop + uni.getMenuButtonBoundingClientRect().height;
  176. }
  177. this.getSetting();
  178. },
  179. // onPullDownRefresh() {
  180. // this.currentPage = 1;
  181. // this.lastPage = 1;
  182. // this.shareLogList = [];
  183. // this.getShareLog();
  184. // },
  185. methods: {
  186. queryList(pageNo, pageSize) {
  187. //这里的pageNo和pageSize会自动计算好,直接传给服务器即可
  188. const params = {
  189. page: pageNo,
  190. limit: pageSize,
  191. level: this.level
  192. };
  193. this.$http('commission.teamList', params).then(res => {
  194. if (res.code == 0) {
  195. this.total = res.data.total
  196. this.$refs.paging.complete(res.data.data);
  197. this.isLoading = false;
  198. }
  199. });
  200. },
  201. getSetting() {
  202. this.$http('conf.getGroupConf', {
  203. group: 'system.commission'
  204. }).then(res => {
  205. if (res.code == 0) {
  206. uni.setNavigationBarTitle({
  207. title: this.appInfo.site_name
  208. });
  209. this.setting = res.data
  210. }
  211. });
  212. },
  213. // 切换分类
  214. onTab(index) {
  215. this.tabCurrent = index;
  216. this.level = index + 1;
  217. // this.shareLogList = [];
  218. // this.getShareLog();
  219. // if (this.tabCurrent !== type) {
  220. // this.tabCurrent = type;
  221. // this.currentPage = 1;
  222. // this.lastPage = 1;
  223. // this.shareLogList = [];
  224. // this.getShareLog();
  225. // }
  226. this.jobList = [];
  227. this.$refs.paging.reload(true);
  228. },
  229. // 分享记录数据
  230. // getShareLog() {
  231. // let that = this;
  232. // that.loadStatus = 'loading';
  233. // that.$http('commission.teamList', {
  234. // level: that.level,
  235. // page: that.currentPage
  236. // }).then(res => {
  237. // uni.stopPullDownRefresh();
  238. // if (res.code === 0) {
  239. // that.shareLogList = [...that.shareLogList, ...res.data.data];
  240. // that.lastPage = res.data.last_page;
  241. // that.isEmpty = !that.shareLogList.length;
  242. // that.loadStatus = that.currentPage < res.data.last_page ? 'loadmore' : 'nomore';
  243. // }
  244. // });
  245. // },
  246. // 加载更多
  247. // loadMore() {
  248. // if (this.currentPage < this.lastPage) {
  249. // this.currentPage += 1;
  250. // this.getShareLog();
  251. // }
  252. // }
  253. }
  254. };
  255. </script>
  256. <style lang="scss" scoped>
  257. @import './team.scss';
  258. </style>