team.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  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" :key="tab.value" @tap="onTab(index)">
  20. <view class="u-flex">
  21. <text class="tab-title" :class="{ 'title-active': tabCurrent === index }">{{ index+1 }}级团队</text>
  22. <text v-if="tabCurrent == index">({{total}}人)</text>
  23. </view>
  24. <text class="underline" :class="{ 'underline-active': tabCurrent === index }"></text>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="content_box">
  29. <view class="log-list u-flex" v-for="(item,index) in jobList" :key="index">
  30. <view class="log-avatar-wrap">
  31. <u-avatar :src="item.avatar" size="30"></u-avatar>
  32. <!-- <image class="log-avatar" :src="item.avatar" mode=""></image> -->
  33. </view>
  34. <view class="item-right">
  35. <view class="name">{{ item.nickname?item.nickname+'('+item.id_number+')':'未注册用户'}}</view>
  36. <view class="item-bottom u-flex u-row-between">
  37. <view class="time">{{ item.create_time }}</view>
  38. <view class="from-text">来自链接分享</view>
  39. </view>
  40. </view>
  41. </view>
  42. <!-- <scroll-view scroll-y="true" @scrolltolower="loadMore" class="scroll-box"> -->
  43. <!-- 分享记录列表 -->
  44. <!-- <view class="log-list u-flex" v-for="item in shareLogList" :key="item.userinfo.id">
  45. <view class="log-avatar-wrap"><image class="log-avatar" :src="item.userinfo.avatar" mode=""></image></view>
  46. <view class="item-right">
  47. <view class="name">{{ item.userinfo.nickname }}</view> -->
  48. <!-- <view class="content u-flex">
  49. <view class="content-img-wrap" v-if="item.type_data"><image class="content-img" :src="item.type_data.image" mode=""></image></view>
  50. <view class="content-text">{{ item.msg }}</view>
  51. </view> -->
  52. <!-- <view class="item-bottom u-flex u-row-between">
  53. <view class="time">{{ item.create_time }}</view>
  54. <view class="from-text">来自链接分享</view>
  55. </view>
  56. </view>
  57. </view> -->
  58. <!-- 缺省页 -->
  59. <!-- <shopro-empty v-if="isEmpty" :image="$IMG_URL + '/imgs/empty/no_data.png'" tipText="暂无数据"></shopro-empty> -->
  60. <!-- 更多 -->
  61. <!-- <u-loadmore v-if="shareLogList.length" height="0rpx" :status="loadStatus" icon-type="flower" color="#ccc" />
  62. </scroll-view> -->
  63. </view>
  64. <view class="foot_box"></view>
  65. </view>
  66. </z-paging>
  67. <wike-loading-page :isLoading="isLoading"></wike-loading-page>
  68. </view>
  69. </template>
  70. <script>
  71. import { mapMutations, mapActions, mapState, mapGetters } from 'vuex';
  72. export default {
  73. data() {
  74. return {
  75. jobList: [],
  76. isLoading: true,
  77. shareLogList: [], //分享记录
  78. tabCurrent: 0, //默认
  79. tabsList: [
  80. // {
  81. // name: '全部',
  82. // value: 'all'
  83. // },
  84. // {
  85. // name: '名片',
  86. // value: 'index'
  87. // },
  88. // {
  89. // name: '商品',
  90. // value: 'goods'
  91. // },
  92. // {
  93. // name: '拼团',
  94. // value: 'groupon'
  95. // }
  96. {
  97. name: '一级团队',
  98. value: 'first'
  99. },
  100. {
  101. name: '二级团队',
  102. value: 'second'
  103. },
  104. {
  105. name: '三级团队',
  106. value: 'third'
  107. }
  108. ],
  109. typeObj: {
  110. index: '名片',
  111. goods: '商品',
  112. groupon: '拼团',
  113. link: '链接'
  114. },
  115. loadStatus: 'loadmore', //loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
  116. currentPage: 1,
  117. lastPage: 1,
  118. level: 1,
  119. isEmpty: false,
  120. tobheight: 45,
  121. platform: this.$platform.get(),
  122. setting:{},
  123. total:0
  124. };
  125. },
  126. computed: {
  127. ...mapGetters(['appInfo', 'userInfo'])
  128. },
  129. onLoad() {
  130. const that = this;
  131. if (this.platform == 'wxMiniProgram') {
  132. var menumtop = uni.getMenuButtonBoundingClientRect().top - uni.getSystemInfoSync().statusBarHeight;
  133. var paddingtop = uni.getSystemInfoSync().statusBarHeight + menumtop;
  134. this.tobheight = menumtop + paddingtop + uni.getMenuButtonBoundingClientRect().height;
  135. }
  136. this.getSetting();
  137. },
  138. // onPullDownRefresh() {
  139. // this.currentPage = 1;
  140. // this.lastPage = 1;
  141. // this.shareLogList = [];
  142. // this.getShareLog();
  143. // },
  144. methods: {
  145. queryList(pageNo, pageSize) {
  146. //这里的pageNo和pageSize会自动计算好,直接传给服务器即可
  147. const params = {
  148. page: pageNo,
  149. limit: pageSize,
  150. level: this.level
  151. };
  152. this.$http('commission.teamList', params).then(res => {
  153. if (res.code == 0) {
  154. this.total = res.data.total
  155. this.$refs.paging.complete(res.data.data);
  156. this.isLoading = false;
  157. }
  158. });
  159. },
  160. getSetting(){
  161. this.$http('conf.getGroupConf',{group:'system.commission'}).then(res => {
  162. if (res.code == 0) {
  163. uni.setNavigationBarTitle({
  164. title: this.appInfo.site_name
  165. });
  166. this.setting = res.data
  167. }
  168. });
  169. },
  170. // 切换分类
  171. onTab(index) {
  172. this.tabCurrent = index;
  173. this.level = index+1;
  174. // this.shareLogList = [];
  175. // this.getShareLog();
  176. // if (this.tabCurrent !== type) {
  177. // this.tabCurrent = type;
  178. // this.currentPage = 1;
  179. // this.lastPage = 1;
  180. // this.shareLogList = [];
  181. // this.getShareLog();
  182. // }
  183. this.jobList = [];
  184. this.$refs.paging.reload(true);
  185. },
  186. // 分享记录数据
  187. // getShareLog() {
  188. // let that = this;
  189. // that.loadStatus = 'loading';
  190. // that.$http('commission.teamList', {
  191. // level: that.level,
  192. // page: that.currentPage
  193. // }).then(res => {
  194. // uni.stopPullDownRefresh();
  195. // if (res.code === 0) {
  196. // that.shareLogList = [...that.shareLogList, ...res.data.data];
  197. // that.lastPage = res.data.last_page;
  198. // that.isEmpty = !that.shareLogList.length;
  199. // that.loadStatus = that.currentPage < res.data.last_page ? 'loadmore' : 'nomore';
  200. // }
  201. // });
  202. // },
  203. // 加载更多
  204. // loadMore() {
  205. // if (this.currentPage < this.lastPage) {
  206. // this.currentPage += 1;
  207. // this.getShareLog();
  208. // }
  209. // }
  210. }
  211. };
  212. </script>
  213. <style lang="scss">
  214. // nav
  215. .head_box {
  216. height: 280rpx;
  217. background: url('http://file.shopro.top/imgs/commission/share_head_bg.png') no-repeat;
  218. background-size: 100% auto;
  219. position: relative;
  220. }
  221. // 分类
  222. .tab-box {
  223. background-color: #fff;
  224. border-radius: 20rpx 20rpx 0px 0px;
  225. position: absolute;
  226. width: 100%;
  227. bottom: 0;
  228. .tab-item {
  229. height: 100%;
  230. display: flex;
  231. flex-direction: column;
  232. align-items: center;
  233. justify-content: center;
  234. .tab-title {
  235. color: #666;
  236. font-weight: 500;
  237. font-size: 28rpx;
  238. line-height: 90rpx;
  239. }
  240. .title-active {
  241. color: #333;
  242. }
  243. .underline {
  244. display: block;
  245. width: 68rpx;
  246. height: 4rpx;
  247. background: #fff;
  248. border-radius: 2rpx;
  249. }
  250. .underline-active {
  251. background: #5e49c3;
  252. display: block;
  253. width: 68rpx;
  254. height: 4rpx;
  255. border-radius: 2rpx;
  256. }
  257. }
  258. }
  259. // 分享记录列表
  260. .log-list {
  261. background-color: #fff;
  262. padding: 30rpx;
  263. margin: 10rpx 0;
  264. align-items: flex-start;
  265. .log-avatar-wrap {
  266. margin-right: 14rpx;
  267. .log-avatar {
  268. width: 60rpx;
  269. height: 60rpx;
  270. border-radius: 50%;
  271. }
  272. }
  273. .item-right {
  274. flex: 1;
  275. .name {
  276. font-size: 28rpx;
  277. font-weight: 500;
  278. color: #7f7aa5;
  279. margin-bottom: 28rpx;
  280. }
  281. .content {
  282. background: rgba(241, 241, 241, 0.46);
  283. border-radius: 2rpx;
  284. padding: 10rpx;
  285. margin-bottom: 20rpx;
  286. .content-img-wrap {
  287. margin-right: 16rpx;
  288. width: 80rpx;
  289. height: 80rpx;
  290. .content-img {
  291. width: 80rpx;
  292. height: 80rpx;
  293. border-radius: 6rpx;
  294. }
  295. }
  296. .content-text {
  297. font-size: 24rpx;
  298. font-weight: 500;
  299. color: #333333;
  300. }
  301. }
  302. .item-bottom {
  303. width: 100%;
  304. .time {
  305. font-size: 22rpx;
  306. font-weight: 500;
  307. color: #c8c8c8;
  308. }
  309. .from-text {
  310. font-size: 22rpx;
  311. font-weight: 500;
  312. color: #c8c8c8;
  313. }
  314. }
  315. }
  316. }
  317. </style>