const app = getApp(); Component({ data: { showMyGroup: false, menus: [ { name: "网格内排名", type: "grid", }, { name: "总排名", type: "customer", }, { name: "我所在小组排名", type: "mine", }, ], currentMenuType: "grid", gridId: "", customerId: "", }, properties: { list: { type: Array, value: [], }, }, lifetimes: { async attached() { await app.doAfterLogin(); let userRoleList = app.globalData.userRoleList; if ( userRoleList.indexOf("warmhearted") >= 0 || userRoleList.indexOf("partymember") >= 0 ) { this.setData({ showMyGroup: true, }); } else { this.setData({ showMyGroup: false, }); } this.setData({ gridId: app.globalData.gridId, customerId: app.globalData.customerId, }); }, }, methods: { handleReachBottom() { const { currentMenuType } = this.data; const $ele = this.selectComponent(`#${currentMenuType}`); $ele.getMore(); }, shiftTab(e) { const { currentTarget: { dataset: { type }, }, } = e; this.setData({ currentMenuType: type, }); }, }, });