初始化代码
This commit is contained in:
158
uniapp/uni-app/mine/pages/distribution/team.vue
Normal file
158
uniapp/uni-app/mine/pages/distribution/team.vue
Normal file
@@ -0,0 +1,158 @@
|
||||
<template>
|
||||
<view class="mine-distribution-team">
|
||||
<fixed>
|
||||
<tab @change="handerTabChange" :list="tabList" :activeIndex="activeIndex" :activeColor="primaryColor"
|
||||
:width="100/tabList.length + '%'" height="100rpx"></tab>
|
||||
</fixed>
|
||||
|
||||
<view @tap.stop="goDetail(index)" class="partner-item fill-base mt-md ml-md mr-md pd-lg radius-16"
|
||||
:class="[{'mt-md':index!=0}]" v-for="(item,index) in list.data" :key="index">
|
||||
<view class="flex-center pb-lg">
|
||||
<image mode="aspectFill" class="cover radius" :src="item.avatarUrl"></image>
|
||||
<view class="flex-1 ml-md">
|
||||
<view class="f-title c-title text-bold ellipsis" style="max-width: 526rpx;">{{item.nickName}}</view>
|
||||
<view class="f-caption c-caption mt-sm">绑定时间:{{item.fx_bind_time}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="count-info flex-center radius-16">
|
||||
<view class="flex-center flex-column">
|
||||
<view class="f-md-title c-title text-bold">{{item.team_count}}</view>
|
||||
<view class="f-icontext c-desc">推广人数</view>
|
||||
</view>
|
||||
<view class="flex-center flex-column">
|
||||
<view class="f-md-title c-title text-bold">{{item.order_count}}</view>
|
||||
<view class="f-icontext c-desc">消费订单</view>
|
||||
</view>
|
||||
<view class="flex-center flex-column">
|
||||
<view class="f-md-title c-title text-bold">{{item.order_price}}</view>
|
||||
<view class="f-icontext c-desc">消费金额</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<load-more :noMore="list.current_page>=list.last_page&&list.data.length>0" :loading="loading" v-if="loading">
|
||||
</load-more>
|
||||
<abnor v-if="!loading&&list.data.length<=0&&list.current_page==1"></abnor>
|
||||
|
||||
<view class="space-footer"></view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState,
|
||||
} from "vuex"
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
options: {},
|
||||
activeIndex: 0,
|
||||
tabList: [{
|
||||
title: '一级分销商',
|
||||
id: 1
|
||||
}, {
|
||||
title: '二级分销商',
|
||||
id: 2,
|
||||
}],
|
||||
param: {
|
||||
page: 1,
|
||||
},
|
||||
list: {
|
||||
data: []
|
||||
},
|
||||
loading: true,
|
||||
lockTap: false
|
||||
}
|
||||
},
|
||||
computed: mapState({
|
||||
primaryColor: state => state.config.configInfo.primaryColor,
|
||||
subColor: state => state.config.configInfo.subColor,
|
||||
userInfo: state => state.user.userInfo,
|
||||
}),
|
||||
onLoad(options) {
|
||||
this.$util.showLoading()
|
||||
this.options = options
|
||||
let {
|
||||
tab = 0
|
||||
} = options
|
||||
this.activeIndex = tab
|
||||
this.initIndex()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
// #ifndef APP-PLUS
|
||||
uni.showNavigationBarLoading()
|
||||
// #endif
|
||||
this.initRefresh()
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.list.current_page >= this.list.last_page || this.loading) return
|
||||
this.param.page = this.param.page + 1
|
||||
this.loading = true
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
initIndex() {
|
||||
this.getList()
|
||||
},
|
||||
initRefresh() {
|
||||
this.param.page = 1
|
||||
this.initIndex()
|
||||
},
|
||||
handerTabChange(index) {
|
||||
this.activeIndex = index
|
||||
this.$util.showLoading()
|
||||
this.param.page = 1
|
||||
this.list.data = []
|
||||
this.getList()
|
||||
},
|
||||
async getList() {
|
||||
let {
|
||||
list: oldList,
|
||||
param,
|
||||
tabList,
|
||||
activeIndex
|
||||
} = this
|
||||
param.type = tabList[activeIndex].id
|
||||
let newList = await this.$api.mine.myTeam(param);
|
||||
|
||||
if (this.param.page == 1) {
|
||||
this.list = newList
|
||||
} else {
|
||||
newList.data = oldList.data.concat(newList.data)
|
||||
this.list = newList
|
||||
}
|
||||
let {
|
||||
one_count = 0, two_count = 0
|
||||
} = newList
|
||||
this.tabList[0].title = `一级分销商(${one_count})`
|
||||
this.tabList[1].title = `二级分销商(${two_count})`
|
||||
this.loading = false
|
||||
this.$util.hideAll()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
.mine-distribution-team {
|
||||
.partner-item {
|
||||
.cover {
|
||||
width: 104rpx;
|
||||
height: 104rpx;
|
||||
}
|
||||
|
||||
.count-info {
|
||||
height: 124rpx;
|
||||
background: #F5FAF7;
|
||||
|
||||
.flex-column {
|
||||
width: 33.33%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user