黔西南积分
This commit is contained in:
@@ -6,28 +6,31 @@
|
||||
</u-tabs>
|
||||
</AiTopFixed>
|
||||
<div class="list-data">
|
||||
<div class="item">
|
||||
<div class="item" v-for="(item, index) in list" :key="index">
|
||||
<div class="flex-left">
|
||||
<div class="item-rank">
|
||||
<img src="./img/top1.png" alt="">
|
||||
<!-- <span>4</span> -->
|
||||
<img :src="imgList[index]" alt="" v-if="index < 3">
|
||||
<span v-else>{{index+1}}</span>
|
||||
</div>
|
||||
<div class="item-user">
|
||||
<img src="./img/top1.png" alt="">李毅
|
||||
<img :src="item.avatar" alt="">{{item.name}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-right">50</div>
|
||||
<div class="flex-right">{{item.score}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty description="暂无数据" v-if="!list.length"/>
|
||||
<div class="list-data footer" v-if="currentTabs<1">
|
||||
<div class="item">
|
||||
<div class="flex-left">
|
||||
<div class="item-rank">
|
||||
<span>4</span>
|
||||
<span>{{userNum}}</span>
|
||||
</div>
|
||||
<div class="item-user">
|
||||
<img src="./img/top1.png" alt="">李毅
|
||||
<img :src="userRank.avatar" alt="">{{userRank.name}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-right">50</div>
|
||||
<div class="flex-right">{{userRank.score}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -39,7 +42,6 @@
|
||||
appName: '积分排行',
|
||||
data() {
|
||||
return {
|
||||
current: 1,
|
||||
list: [],
|
||||
currentTabs: 0,
|
||||
tabList: [
|
||||
@@ -64,6 +66,9 @@
|
||||
'font-weight' : '400',
|
||||
'color': '#000000'
|
||||
},
|
||||
imgList: [require('./img/top0.png'),require('./img/top1.png'),require('./img/top2.png')],
|
||||
userRank: {},
|
||||
userNum: ''
|
||||
}
|
||||
},
|
||||
|
||||
@@ -72,13 +77,8 @@
|
||||
},
|
||||
|
||||
created() {
|
||||
// this.$dict.load("workTaskType").then(() => {
|
||||
// this.getList()
|
||||
// })
|
||||
// uni.$on('getList', () => {
|
||||
// this.current = 1
|
||||
// this.getList()
|
||||
// })
|
||||
this.getRanking()
|
||||
this.getUserRank()
|
||||
},
|
||||
|
||||
onShow() {
|
||||
@@ -88,7 +88,29 @@
|
||||
methods: {
|
||||
change(index) {
|
||||
this.currentTabs = index
|
||||
// this.getListInit()
|
||||
this.getRanking()
|
||||
},
|
||||
getRanking() {
|
||||
this.$http.post(`/app/appscoredetail/scoreRanking?type=${this.currentTabs}&size=100`).then(res=> {
|
||||
if(res?.data) {
|
||||
this.list = res.data.records
|
||||
this.list.map((item) => {
|
||||
if(this.user.phone == item.phone) {
|
||||
this.userRank = {...item}
|
||||
}
|
||||
})
|
||||
if(this.currentTabs<1) {
|
||||
this.getUserRank()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getUserRank() {
|
||||
this.$http.post(`/app/appscoredetail/myScore`).then(res=> {
|
||||
if(res?.data) {
|
||||
this.userNum = res.data['积分排行']
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -160,5 +182,16 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.footer {
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
.item {
|
||||
border-radius: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user