rank.js 780 Bytes
let app = getApp();
Page({
  data: {
    rank: [],
    downRank: [],
    myRank: {}
  },
  onShareAppMessage() {},
  onLoad(options) {
    this.initData();
  },
  initData() {
    app.post({
      url: app.api.rank,
      data: {}
    }).then((result) => {
      console.log("result:", result);
      let downRank = result.rank.filter((item) => {
        return !(item.no == 1 || item.no == 2 || item.no == 3);
      })
      console.log("downRank:", downRank);
      this.setData({
        rank: result.rank,
        myRank: result.my,
        downRank: downRank
      })
    })
  },
  // 子组件事件
  evtcomp(evt) {
    let {
      name,
      data
    } = evt.detail;
    switch (name) {
      case "_evt_hide":
        break;

      default:
        break;
    }
  },
})