123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- <template>
- <view class="MyGroup">
- <view class="top-view">
- <view class="num-ul">
- <view class="num-li">
- <view class="num-li-tit">{{ text_set.Offline || '下线' }}总数</view>
- <view class="num-li-num">{{ subTotal }}</view>
- </view>
- <view class="num-li-line"></view>
- <view class="num-li">
- <view class="num-li-tit">{{ text_set.name || '分销商名称' }}总数</view>
- <view class="num-li-num">{{ businessmanTotal }}</view>
- </view>
- </view>
- <view class="grade-ul" v-if="grade_list.length">
- <view class="grade-li" @click="tabChange(index)" :class="[level === index + 1 ? 'grade-on' : '']" v-for="(item, index) in grade_list" :key="index">
- {{ item.name }}
- <view class="ibonfont ibonxiangshangjiantou top-jt-icon" v-if="level === index + 1"></view>
- </view>
- </view>
- </view>
- <view class="total-view clearfix" v-if="grade_list.length">
- <view class="total-left float_left">
- <view class="left-num">总数:{{ pageTotal }}</view>
- <view class="line-num"></view>
- <view class="left-num">{{ text_set.name || '分销商名称' }}总数:{{ subBusinessmanTotal }}</view>
- </view>
- </view>
- <scroll-view @scrolltolower="scrollBootom" scroll-y="true" :style="style" class="group-ul">
- <view class="group-li" v-for="(item, index) in group_list" :key="index">
- <view class="user-avator-view"><image class="user-avator" :src="item.avatar" mode="aspectFill"></image></view>
- <view class="user-info clearfix">
- <view class="user-info-left float_left">
- <view class="user-name ellipsis">{{ item.name }}</view>
- <view class="user-time">消费:¥{{ item.totalMoney || 0 }}</view>
- </view>
- <view class="user-info-right float_right">
- <view class="user-time" style="padding-top: 0;">{{ $_utils.formatDate(item.createTime) }}</view>
- <view class="user-time">订单:{{ item.orderTotal }}</view>
- </view>
- </view>
- </view>
- <u-loadmore margin-top="20" v-if="group_list.length" :status="loading_status" />
- </scroll-view>
- </view>
- </template>
- <script>
- export default {
- computed: {
- style() {
- const systemInfo = uni.getSystemInfoSync();
- if(this.distribution_set.level===1){
- return `height: calc(100vh - ${systemInfo.statusBarHeight + 82}px)`;
- }else{
- return `height: calc(100vh - ${systemInfo.statusBarHeight + 171}px)`;
- }
- },
- location() {
- return this.$store.state.locationObj;
- }
- },
- data() {
- return {
- loading_status: 'loadmore',
- isLogin: false,
- grade_list: [],
- current: 0,
- myId: 0,
- group_list: [],
- page: 1,
- pageSize: 10,
- pageTotal: 0,
- level: 1,
- text_set: {},
- topTotal: 0,
- subTotal: 0,
- businessmanTotal: 0,
- subBusinessmanTotal: 0,
- distribution_set:{}
- };
- },
- onLoad(options) {
- uni.setNavigationBarColor({
- frontColor: '#ffffff',
- backgroundColor: '#fe582e'
- });
- this.text_set = this.$store.state.distributionTextSet;
- this.distribution_set = this.$store.state.distributionSet;
- this.myId = parseInt(options.id);
- if(this.distribution_set.level===2){
- this.grade_list = [
- {
- name: this.text_set.level_one || '一级'
- },
- {
- name: this.text_set.level_two || '二级'
- }
- ];
- }else if(this.distribution_set.level===3){
- this.grade_list = [
- {
- name: this.text_set.level_one || '一级'
- },
- {
- name: this.text_set.level_two || '二级'
- },
- {
- name: this.text_set.level_three || '三级'
- }
- ];
- }
- },
- onShow() {
- this.getAllSub();
- },
- methods: {
- // 查询分销商的下级
- async getAllSub() {
- this.loading_status = 'loading';
- this.$u.api.getAllSub({
- id: this.myId,
- level: this.level,
- page: this.page,
- pageSize: this.pageSize
- }).then(data=>{
- if (this.page === 1) {
- this.group_list = data.data;
- } else {
- this.group_list = this.group_list.concat(data.data);
- }
- this.pageTotal = data.pageTotal;
- this.topTotal = data.topTotal;
- this.subTotal = data.subTotal;
- this.businessmanTotal = data.businessmanTotal;
- this.subBusinessmanTotal = data.subBusinessmanTotal;
- this.loading_status = this.$_utils.loadStatus(this.page, this.pageSize, this.pageTotal);
- });
- },
- scrollBootom() {
- if (this.pageTotal / this.pageSize > this.page) {
- this.page += 1;
- this.getAllSub();
- }
- },
- tabChange(index) {
- this.current = index;
- this.level = index + 1;
- this.page = 1;
- this.getAllSub();
- }
- }
- };
- </script>
- <style lang="scss">
- .top-view {
- color: #ffffff;
- background-color: #fe582e;
- .num-ul {
- padding: 40upx 0;
- display: flex;
- .num-li {
- flex: 2;
- text-align: center;
- .num-li-tit {
- font-size: 24upx;
- }
- .num-li-num {
- font-size: 40upx;
- padding-top: 30upx;
- }
- }
- .num-li-line {
- width: 1upx;
- height: 56upx;
- background-color: #fff;
- opacity: 0.5;
- transform: translateY(70upx);
- }
- }
- .grade-ul {
- background-color: rgba($color: #ffffff, $alpha: 0.2);
- font-size: 28upx;
- display: flex;
- color: rgba($color: #ffffff, $alpha: 0.7);
- .grade-li {
- flex: 2;
- text-align: center;
- line-height: 90upx;
- position: relative;
- .top-jt-icon {
- position: absolute;
- bottom: -10upx;
- left: 50%;
- transform: translateX(-50%);
- display: block;
- height: 30upx;
- line-height: 30upx;
- font-size: 32upx;
- color: rgba($color: #ffffff, $alpha: 1);
- }
- }
- .grade-on {
- color: rgba($color: #ffffff, $alpha: 1);
- font-size: 32upx;
- }
- }
- }
- .total-view {
- line-height: 90upx;
- color: #3d404d;
- background-color: #fff1f0;
- font-size: 24upx;
- .total-left {
- .left-num {
- padding: 0 24upx;
- display: inline-block;
- }
- .line-num {
- display: inline-block;
- width: 2upx;
- height: 28upx;
- background-color: #fff;
- }
- }
- }
- .group-ul {
- .group-li {
- padding: 20upx;
- background-color: #fff;
- border-radius: 8upx;
- .user-avator-view {
- display: inline-block;
- padding-right: 20upx;
- .user-avator {
- display: block;
- width: 100upx;
- height: 100upx;
- border-radius: 100%;
- }
- }
- .user-info {
- border-bottom: 1upx solid #f4f4f4;
- width: 588upx;
- display: inline-block;
- padding-bottom: 20upx;
- .user-name{
- width: 310rpx;
- -webkit-line-clamp:1;
- height: 40rpx;
- line-height: 40rpx;
- }
- .user-time {
- color: #999;
- font-size: 24upx;
- padding-top: 10upx;
- }
- .user-info-right {
- text-align: right;
- }
- }
- }
- }
- </style>
|