15 changed files with 366 additions and 319 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,242 +1,249 @@ |
|||||||
<template> |
<template> |
||||||
<view class="promoter-list" ref="container"> |
<view class="promoter-list" ref="container"> |
||||||
<view class="header"> |
<view class="header"> |
||||||
<view class="promoterHeader bg-color-red"> |
<view class="promoterHeader bg-color-red"> |
||||||
<view class="headerCon acea-row row-between-wrapper"> |
<view class="headerCon acea-row row-between-wrapper"> |
||||||
<view> |
<view> |
||||||
<view class="name">推广人数</view> |
<view class="name">推广人数</view> |
||||||
<view> |
<view> |
||||||
<text class="num">{{ first + second }}</text> |
<text class="num">{{ first + second||'0' }}</text> |
||||||
<text>人</text> |
<text>人</text> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="nav acea-row row-around"> |
<view class="nav acea-row row-around"> |
||||||
<view class="item" :class="screen.grade == 0 ? 'on' : ''" @click="checkGrade(0)"> |
<view |
||||||
一级({{ first }}) |
class="item" |
||||||
</view> |
:class="screen.grade == 0 ? 'on' : ''" |
||||||
<view class="item" :class="screen.grade == 1 ? 'on' : ''" @click="checkGrade(1)"> |
@click="checkGrade(0)" |
||||||
二级({{ second }}) |
>一级({{ first||'0' }})</view> |
||||||
</view> |
<view |
||||||
</view> |
class="item" |
||||||
<view class="search acea-row row-between-wrapper"> |
:class="screen.grade == 1 ? 'on' : ''" |
||||||
<form @submit.prevent="submitForm"> |
@click="checkGrade(1)" |
||||||
<view class="input"> |
>二级({{ second||'0' }})</view> |
||||||
<input placeholder="点击搜索会员名称" v-model="screen.keyword" /> |
</view> |
||||||
<text class="iconfont icon-guanbi"></text> |
<view class="search acea-row row-between-wrapper"> |
||||||
</view> |
<form @submit.prevent="submitForm"> |
||||||
</form> |
<view class="input"> |
||||||
<view class="iconfont icon-sousuo2"></view> |
<input placeholder="点击搜索会员名称" v-model="screen.keyword" /> |
||||||
</view> |
<text class="iconfont icon-guanbi"></text> |
||||||
</view> |
</view> |
||||||
<view class="list"> |
</form> |
||||||
<view class="sortNav acea-row row-middle" :class="fixedState === true ? 'on' : ''"> |
<view class="iconfont icon-sousuo2"></view> |
||||||
<view class="sortItem" @click="sort('childCount')"> |
</view> |
||||||
团队排序 |
</view> |
||||||
<image src="@/static/images/sort1.png" v-if="childCount == 1" /> |
<view class="list"> |
||||||
<image src="@/static/images/sort2.png" v-if="childCount == 2" /> |
<view class="sortNav acea-row row-middle" :class="fixedState === true ? 'on' : ''"> |
||||||
<image src="@/static/images/sort3.png" v-if="childCount == 3" /> |
<view class="sortItem" @click="sort('childCount')"> |
||||||
</view> |
团队排序 |
||||||
<view class="sortItem" @click="sort('numberCount')"> |
<image src="@/static/images/sort1.png" v-if="childCount == 1" /> |
||||||
金额排序 |
<image src="@/static/images/sort2.png" v-if="childCount == 2" /> |
||||||
<image src="@/static/images/sort1.png" v-if="numberCount == 1" /> |
<image src="@/static/images/sort3.png" v-if="childCount == 3" /> |
||||||
<image src="@/static/images/sort2.png" v-if="numberCount == 2" /> |
</view> |
||||||
<image src="@/static/images/sort3.png" v-if="numberCount == 3" /> |
<view class="sortItem" @click="sort('numberCount')"> |
||||||
</view> |
金额排序 |
||||||
<view class="sortItem" @click="sort('orderCount')"> |
<image src="@/static/images/sort1.png" v-if="numberCount == 1" /> |
||||||
订单排序 |
<image src="@/static/images/sort2.png" v-if="numberCount == 2" /> |
||||||
<image src="@/static/images/sort1.png" v-if="orderCount == 1" /> |
<image src="@/static/images/sort3.png" v-if="numberCount == 3" /> |
||||||
<image src="@/static/images/sort2.png" v-if="orderCount == 2" /> |
</view> |
||||||
<image src="@/static/images/sort3.png" v-if="orderCount == 3" /> |
<view class="sortItem" @click="sort('orderCount')"> |
||||||
</view> |
订单排序 |
||||||
</view> |
<image src="@/static/images/sort1.png" v-if="orderCount == 1" /> |
||||||
<view :class="fixedState === true ? 'sortList' : ''"> |
<image src="@/static/images/sort2.png" v-if="orderCount == 2" /> |
||||||
<view class="item acea-row row-between-wrapper" v-for="(val, spreadListIndex) in spreadList" :key="spreadListIndex"> |
<image src="@/static/images/sort3.png" v-if="orderCount == 3" /> |
||||||
<view class="picTxt acea-row row-between-wrapper"> |
</view> |
||||||
<view class="pictrue"> |
</view> |
||||||
<image :src="val.avatar" /> |
<view :class="fixedState === true ? 'sortList' : ''"> |
||||||
</view> |
<view |
||||||
<view class="text"> |
class="item acea-row row-between-wrapper" |
||||||
<view class="name line1">{{ val.nickname }}</view> |
v-for="(val, spreadListIndex) in spreadList" |
||||||
<view>加入时间: {{ val.time }}</view> |
:key="spreadListIndex" |
||||||
</view> |
> |
||||||
</view> |
<view class="picTxt acea-row row-between-wrapper"> |
||||||
<view class="right"> |
<view class="pictrue"> |
||||||
<view> |
<image :src="val.avatar" /> |
||||||
<text class="font-color-red">{{ val.childCount }}</text> 人 |
</view> |
||||||
</view> |
<view class="text"> |
||||||
<view>{{ val.orderCount }} 单</view> |
<view class="name line1">{{ val.nickname }}</view> |
||||||
<view>{{ val.numberCount ? val.numberCount : 0 }} 元</view> |
<view>加入时间: {{ val.time }}</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
<view class="right"> |
||||||
</view> |
<view> |
||||||
<Loading :loaded="loaded" :loading="loading"></Loading> |
<text class="font-color-red">{{ val.childCount }}</text>人 |
||||||
</view> |
</view> |
||||||
|
<view>{{ val.orderCount }} 单</view> |
||||||
|
<view>{{ val.numberCount ? val.numberCount : 0 }} 元</view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
<Loading :loaded="loaded" :loading="loading"></Loading> |
||||||
|
</view> |
||||||
</template> |
</template> |
||||||
<script> |
<script> |
||||||
import { |
import { getSpreadUser } from "@/api/user"; |
||||||
getSpreadUser |
import Loading from "@/components/Loading"; |
||||||
} from "@/api/user"; |
export default { |
||||||
import Loading from "@/components/Loading"; |
name: "PromoterList", |
||||||
export default { |
components: { |
||||||
name: "PromoterList", |
Loading |
||||||
components: { |
}, |
||||||
Loading |
props: {}, |
||||||
}, |
data: function() { |
||||||
props: {}, |
return { |
||||||
data: function() { |
fixedState: false, |
||||||
return { |
screen: { |
||||||
fixedState: false, |
page: 1, |
||||||
screen: { |
limit: 15, |
||||||
page: 1, |
grade: 0, |
||||||
limit: 15, |
keyword: "", |
||||||
grade: 0, |
sort: "" |
||||||
keyword: "", |
}, |
||||||
sort: "" |
childCount: 2, |
||||||
}, |
numberCount: 2, |
||||||
childCount: 2, |
orderCount: 2, |
||||||
numberCount: 2, |
loaded: false, |
||||||
orderCount: 2, |
loading: false, |
||||||
loaded: false, |
spreadList: [], |
||||||
loading: false, |
loadTitle: "", |
||||||
spreadList: [], |
first: "", |
||||||
loadTitle: "", |
second: "" |
||||||
first: "", |
}; |
||||||
second: "" |
}, |
||||||
}; |
mounted: function() { |
||||||
}, |
this.getSpreadUsers(); |
||||||
mounted: function() { |
}, |
||||||
this.getSpreadUsers(); |
onReachBottom() { |
||||||
}, |
!this.loading && this.getSpreadUsers(); |
||||||
onReachBottom() { |
}, |
||||||
!this.loading && this.getSpreadUsers(); |
watch: { |
||||||
}, |
"screen.sort": function() { |
||||||
watch: { |
this.screen.page = 0; |
||||||
"screen.sort": function() { |
this.loaded = false; |
||||||
this.screen.page = 0; |
this.loading = false; |
||||||
this.loaded = false; |
this.spreadList = []; |
||||||
this.loading = false; |
this.getSpreadUsers(); |
||||||
this.spreadList = []; |
} |
||||||
this.getSpreadUsers(); |
}, |
||||||
} |
methods: { |
||||||
}, |
handleScroll: function() { |
||||||
methods: { |
// var scrollTop = |
||||||
handleScroll: function() { |
// document.documentElement.scrollTop || document.body.scrollTop; |
||||||
// var scrollTop = |
// var offsetTop = document.querySelector(".header").clientHeight; |
||||||
// document.documentElement.scrollTop || document.body.scrollTop; |
// if (scrollTop >= offsetTop) { |
||||||
// var offsetTop = document.querySelector(".header").clientHeight; |
// this.fixedState = true; |
||||||
// if (scrollTop >= offsetTop) { |
// } else { |
||||||
// this.fixedState = true; |
// this.fixedState = false; |
||||||
// } else { |
// } |
||||||
// this.fixedState = false; |
}, |
||||||
// } |
submitForm: function() { |
||||||
}, |
this.screen.page = 0; |
||||||
submitForm: function() { |
this.loaded = false; |
||||||
this.screen.page = 0; |
this.loading = false; |
||||||
this.loaded = false; |
this.spreadList = []; |
||||||
this.loading = false; |
this.getSpreadUsers(); |
||||||
this.spreadList = []; |
}, |
||||||
this.getSpreadUsers(); |
getSpreadUsers: function() { |
||||||
}, |
let that = this, |
||||||
getSpreadUsers: function() { |
screen = that.screen; |
||||||
let that = this, |
if (that.loaded || that.loading) return; |
||||||
screen = that.screen; |
that.loading = true; |
||||||
if (that.loaded || that.loading) return; |
getSpreadUser(screen).then( |
||||||
that.loading = true; |
res => { |
||||||
getSpreadUser(screen).then( |
that.loading = false; |
||||||
res => { |
that.spreadList.push.apply(that.spreadList, res.data.list); |
||||||
that.loading = false; |
that.loaded = res.data.list.length < that.screen.limit; //判断所有数据是否加载完成; |
||||||
that.spreadList.push.apply(that.spreadList, res.data.list); |
that.loadTitle = that.loaded ? "人家是有底线的" : "上拉加载更多"; |
||||||
that.loaded = res.data.list.length < that.screen.limit; //判断所有数据是否加载完成; |
that.screen.page = that.screen.page + 1; |
||||||
that.loadTitle = that.loaded ? "人家是有底线的" : "上拉加载更多"; |
that.first = res.data.total; |
||||||
that.screen.page = that.screen.page + 1; |
that.second = res.data.totalLevel; |
||||||
that.first = res.data.total; |
}, |
||||||
that.second = res.data.totalLevel; |
err => { |
||||||
}, |
uni.showToast({ |
||||||
err => { |
title: |
||||||
uni.showToast({ |
err.msg || err.response.data.msg || err.response.data.message, |
||||||
title: err.msg || err.response.data.msg|| err.response.data.message, |
icon: "none", |
||||||
icon: 'none', |
duration: 2000 |
||||||
duration: 2000 |
}); |
||||||
}); |
}, |
||||||
}, |
300 |
||||||
300 |
); |
||||||
); |
}, |
||||||
}, |
checkGrade: function(val) { |
||||||
checkGrade: function(val) { |
if (val == this.screen.grade) return; |
||||||
if (val == this.screen.grade) return; |
else { |
||||||
else { |
this.screen.page = 1; |
||||||
this.screen.page = 1; |
this.screen.grade = val; |
||||||
this.screen.grade = val; |
this.loading = false; |
||||||
this.loading = false; |
this.loaded = false; |
||||||
this.loaded = false; |
this.spreadList = []; |
||||||
this.spreadList = []; |
this.getSpreadUsers(); |
||||||
this.getSpreadUsers(); |
} |
||||||
} |
}, |
||||||
}, |
sort: function(types) { |
||||||
sort: function(types) { |
let that = this; |
||||||
let that = this; |
switch (types) { |
||||||
switch (types) { |
case "childCount": |
||||||
case "childCount": |
if (that.childCount == 2) { |
||||||
if (that.childCount == 2) { |
that.childCount = 1; |
||||||
that.childCount = 1; |
that.orderCount = 2; |
||||||
that.orderCount = 2; |
that.numberCount = 2; |
||||||
that.numberCount = 2; |
that.screen.sort = "childCount DESC"; |
||||||
that.screen.sort = "childCount DESC"; |
} else if (that.childCount == 1) { |
||||||
} else if (that.childCount == 1) { |
that.childCount = 3; |
||||||
that.childCount = 3; |
that.orderCount = 2; |
||||||
that.orderCount = 2; |
that.numberCount = 2; |
||||||
that.numberCount = 2; |
that.screen.sort = "childCount ASC"; |
||||||
that.screen.sort = "childCount ASC"; |
} else if (that.childCount == 3) { |
||||||
} else if (that.childCount == 3) { |
that.childCount = 2; |
||||||
that.childCount = 2; |
that.orderCount = 2; |
||||||
that.orderCount = 2; |
that.numberCount = 2; |
||||||
that.numberCount = 2; |
that.screen.sort = ""; |
||||||
that.screen.sort = ""; |
} |
||||||
} |
break; |
||||||
break; |
case "numberCount": |
||||||
case "numberCount": |
if (that.numberCount == 2) { |
||||||
if (that.numberCount == 2) { |
that.numberCount = 1; |
||||||
that.numberCount = 1; |
that.orderCount = 2; |
||||||
that.orderCount = 2; |
that.childCount = 2; |
||||||
that.childCount = 2; |
that.screen.sort = "numberCount DESC"; |
||||||
that.screen.sort = "numberCount DESC"; |
} else if (that.numberCount == 1) { |
||||||
} else if (that.numberCount == 1) { |
that.numberCount = 3; |
||||||
that.numberCount = 3; |
that.orderCount = 2; |
||||||
that.orderCount = 2; |
that.childCount = 2; |
||||||
that.childCount = 2; |
that.screen.sort = "numberCount ASC"; |
||||||
that.screen.sort = "numberCount ASC"; |
} else if (that.numberCount == 3) { |
||||||
} else if (that.numberCount == 3) { |
that.numberCount = 2; |
||||||
that.numberCount = 2; |
that.orderCount = 2; |
||||||
that.orderCount = 2; |
that.childCount = 2; |
||||||
that.childCount = 2; |
that.screen.sort = ""; |
||||||
that.screen.sort = ""; |
} |
||||||
} |
break; |
||||||
break; |
case "orderCount": |
||||||
case "orderCount": |
if (that.orderCount == 2) { |
||||||
if (that.orderCount == 2) { |
that.orderCount = 1; |
||||||
that.orderCount = 1; |
that.numberCount = 2; |
||||||
that.numberCount = 2; |
that.childCount = 2; |
||||||
that.childCount = 2; |
that.screen.sort = "orderCount DESC"; |
||||||
that.screen.sort = "orderCount DESC"; |
} else if (that.orderCount == 1) { |
||||||
} else if (that.orderCount == 1) { |
that.orderCount = 3; |
||||||
that.orderCount = 3; |
that.numberCount = 2; |
||||||
that.numberCount = 2; |
that.childCount = 2; |
||||||
that.childCount = 2; |
that.screen.sort = "orderCount ASC"; |
||||||
that.screen.sort = "orderCount ASC"; |
} else if (that.orderCount == 3) { |
||||||
} else if (that.orderCount == 3) { |
that.orderCount = 2; |
||||||
that.orderCount = 2; |
that.numberCount = 2; |
||||||
that.numberCount = 2; |
that.childCount = 2; |
||||||
that.childCount = 2; |
that.screen.sort = ""; |
||||||
that.screen.sort = ""; |
} |
||||||
} |
break; |
||||||
break; |
default: |
||||||
default: |
that.screen.sort = ""; |
||||||
that.screen.sort = ""; |
} |
||||||
} |
} |
||||||
} |
} |
||||||
} |
}; |
||||||
}; |
|
||||||
</script> |
</script> |
||||||
|
Loading…
Reference in new issue