考试排名只显示前10名
This commit is contained in:
parent
fc8609d851
commit
e69170307c
|
@ -66,9 +66,9 @@ Page({
|
||||||
*/
|
*/
|
||||||
onReachBottom: function () {
|
onReachBottom: function () {
|
||||||
//上拉分页,将页码加1,然后调用分页函数
|
//上拉分页,将页码加1,然后调用分页函数
|
||||||
this.data.page = this.data.page + 1;
|
// this.data.page = this.data.page + 1;
|
||||||
this.getRatelist();
|
// this.getRatelist();
|
||||||
wx.stopPullDownRefresh();
|
// wx.stopPullDownRefresh();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -91,7 +91,6 @@ Page({
|
||||||
},
|
},
|
||||||
success: res => {
|
success: res => {
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
console.log(res.data)
|
|
||||||
if (res.data.rows.length == 0) {
|
if (res.data.rows.length == 0) {
|
||||||
if (page == 1) {
|
if (page == 1) {
|
||||||
this.setData({
|
this.setData({
|
||||||
|
@ -109,7 +108,7 @@ Page({
|
||||||
} else {
|
} else {
|
||||||
let list
|
let list
|
||||||
if (page == 1) {
|
if (page == 1) {
|
||||||
list = res.data.rows
|
list = res.data.rows.slice(0,10)
|
||||||
} else {
|
} else {
|
||||||
list = this.data.ratelist.concat(res.data.rows)
|
list = this.data.ratelist.concat(res.data.rows)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"usingComponents": {},
|
"usingComponents": {},
|
||||||
"navigationBarTitleText": "考试排名",
|
"navigationBarTitleText": "考试排名"
|
||||||
"enablePullDownRefresh": true
|
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
<view class="page">
|
<view class="page">
|
||||||
<view class="head" style="font-weight:bold;font-size:24px">{{examtestname}}</view>
|
<view class="head" style="font-weight:bold;font-size:24px">{{examtestname}}</view>
|
||||||
<view class="head">已有{{total}}人参与</view>
|
<view class="head">已有{{total}}人参与,前10名如下</view>
|
||||||
<block wx:for="{{ratelist}}" wx:key="unique">
|
<block wx:for="{{ratelist}}" wx:key="unique">
|
||||||
<view class="weui-panel__bd">
|
<view class="weui-panel__bd">
|
||||||
<view class="weui-media-box weui-media-box_appmsg" hover-class="weui-cell_active">
|
<view class="weui-media-box weui-media-box_appmsg" hover-class="weui-cell_active">
|
||||||
|
|
Loading…
Reference in New Issue