You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
1.4 KiB
73 lines
1.4 KiB
2 years ago
|
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,
|
||
|
});
|
||
|
},
|
||
|
},
|
||
|
});
|