|
@@ -6,8 +6,8 @@
|
|
积分排行榜
|
|
积分排行榜
|
|
|
|
|
|
</view>
|
|
</view>
|
|
- <view class="self" v-if="top" >
|
|
|
|
- <view class="rank">
|
|
|
|
|
|
+ <view class="self" v-if="plusInfo" >
|
|
|
|
+ <view class="rank" v-if="top">
|
|
|
|
|
|
<img v-if="top.rank==1" src="../../../assets/img/Gold Medal@1x.png" alt="">
|
|
<img v-if="top.rank==1" src="../../../assets/img/Gold Medal@1x.png" alt="">
|
|
<img v-else-if="top.rank==2" src="../../../assets/img/Silver Medal Copy@1x.png" alt="">
|
|
<img v-else-if="top.rank==2" src="../../../assets/img/Silver Medal Copy@1x.png" alt="">
|
|
@@ -15,14 +15,14 @@
|
|
<span v-else>{{top.rank}}</span>
|
|
<span v-else>{{top.rank}}</span>
|
|
</view>
|
|
</view>
|
|
<view class="photo">
|
|
<view class="photo">
|
|
- <img v-if="top.userImg" :src="top.userImg" alt="">
|
|
|
|
|
|
+ <img v-if="userInfo.headImg" :src="userInfo.headImg" alt="">
|
|
<u-avatar v-else size="80" ></u-avatar>
|
|
<u-avatar v-else size="80" ></u-avatar>
|
|
</view>
|
|
</view>
|
|
<view class="name">
|
|
<view class="name">
|
|
- {{top.userName}}
|
|
|
|
|
|
+ {{userInfo.name}}
|
|
</view>
|
|
</view>
|
|
<view class="points">
|
|
<view class="points">
|
|
- {{top.userScore}}积分
|
|
|
|
|
|
+ {{top?top.userScore:plusInfo.userPoints}}积分
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
@@ -53,7 +53,7 @@
|
|
</view>
|
|
</view>
|
|
|
|
|
|
</view>
|
|
</view>
|
|
- <u-divider :isnone="!list.length" nonetext="统计中,敬请期待" bg-color="#F2F4F4" border-color="#CFD2D5">已经到底了</u-divider>
|
|
|
|
|
|
+ <u-divider :isnone="!list.length" nonetext="统计中,敬请期待" bg-color="#F2F4F4" border-color="#CFD2D5">只显示前{{recordsTotal}}条</u-divider>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -71,23 +71,54 @@
|
|
},
|
|
},
|
|
recordsTotal:0,
|
|
recordsTotal:0,
|
|
top:null,
|
|
top:null,
|
|
-
|
|
|
|
|
|
+ userInfo:{},
|
|
|
|
+ plusInfo:{}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
this.listForm.year=new Date().getFullYear()
|
|
this.listForm.year=new Date().getFullYear()
|
|
this.getList();
|
|
this.getList();
|
|
|
|
+ this.userInfo=this.carhelp.getPersonInfo()
|
|
|
|
+ this.plusInfo=this.carhelp.getPersonInfoPlus()
|
|
|
|
+
|
|
|
|
+ if(this.userInfo){
|
|
|
|
+ this.myPointsSort();
|
|
|
|
+ }
|
|
|
|
+
|
|
},
|
|
},
|
|
onReachBottom() {
|
|
onReachBottom() {
|
|
- if (this.list.length < this.recordsTotal) {
|
|
|
|
- this.myLoadmore();
|
|
|
|
- }
|
|
|
|
|
|
+ // if (this.list.length < this.recordsTotal) {
|
|
|
|
+ // this.myLoadmore();
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
myLoadmore(){
|
|
myLoadmore(){
|
|
this.listForm.pageIndex += 1;
|
|
this.listForm.pageIndex += 1;
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
|
|
+ myPointsSort(){
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ API.myPointsSort(this.listForm).then((res) => {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if(res.data.myPoint){
|
|
|
|
+ this.top=res.data.myPoint
|
|
|
|
+ if(res.data.myPoint.userSortNo){
|
|
|
|
+ this.top.rank=parseInt(res.data.myPoint.userSortNo)
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: error,
|
|
|
|
+ icon: "none"
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
getList(){
|
|
getList(){
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
title: "加载中",
|
|
title: "加载中",
|
|
@@ -100,15 +131,15 @@
|
|
...this.list,
|
|
...this.list,
|
|
...res.data.pointsList.data
|
|
...res.data.pointsList.data
|
|
];
|
|
];
|
|
- this.recordsTotal = res.data.pointsList.recordsTotal;
|
|
|
|
|
|
+ this.recordsTotal = res.data.pointsList.pageSize;
|
|
|
|
|
|
- if(res.data.myPoint){
|
|
|
|
- this.top=res.data.myPoint
|
|
|
|
- if(res.data.myPoint.userSortNo){
|
|
|
|
- this.top.rank=parseInt(res.data.myPoint.userSortNo)
|
|
|
|
|
|
+ // if(res.data.myPoint){
|
|
|
|
+ // this.top=res.data.myPoint
|
|
|
|
+ // if(res.data.myPoint.userSortNo){
|
|
|
|
+ // this.top.rank=parseInt(res.data.myPoint.userSortNo)
|
|
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
|
|
|