var app = getApp();
Page({
  data: {
    sortList: [],
    noThreeSortList: [],
  },
  onLoad: function () {
    let me = this;
    // 请求前加Loading
    wx.showLoading({
      title: '加载中',
      mask: true
    })
    wx.request({
      url: app.globalData.apiUrl + 'ranks/effectedRanking',
      method: 'POST',
      data: {
        token: wx.getStorageSync('token')
      },
      success: function (res) {
        // 请求成功后关闭Loading
        wx.hideLoading();
        if(res.data.errno==200){
          let newArr = res.data.data.filter(item => item.ranking > 3)
          me.setData({
            sortList: res.data.data,
            noThreeSortList: newArr,
          })
        }else{
          wx.showModal({
            title: '提示',
            showCancel: false,
            content: res.data.msg
          })
        }
      }
    })
  },
})