var list = [{ current: 0, iconPath: "bar-chart-box-fill", selectedIconPath: "bar-chart-box-fill", text: '统计', customIcon: true, pagePath2: "/pagesFinance/statistics/index", //权限 0默认,-1必有 role:[0,1], }, { current: 1, iconPath: "article-fill", selectedIconPath: "article-fill", text: '明细', midButton: true, customIcon: true, pagePath2: "/pagesFinance/detailed/index", role:[0,1], }, { current: 1, iconPath: "file-text-fill", selectedIconPath: "file-text-fill", text: '充值', midButton: true, customIcon: false, pagePath2: "/pagesFinance/statistics/recharge", role:[], accountType:true, }, { current: 2, iconPath: "money-cny-box-fill", selectedIconPath: "money-cny-box-fill", text: '分润', midButton: true, customIcon: true, pagePath2: "/pagesFinance/share/index", role:[0,1], }, { current: 4, iconPath: "bar-chart-box-fill", selectedIconPath: "bar-chart-box-fill", text: '企业充电', show: false, customIcon: true, pagePath2: "/pagesFinance/accountType8/chagingrecord/index", //权限 only:true, role:[2], }, { current: 4, iconPath: "bar-chart-box-fill", selectedIconPath: "bar-chart-box-fill", text: '优惠券记录', show: false, customIcon: true, pagePath2: "/pagesFinance/coupon/index", //权限 //only:true, role:[3], }, { current: 3, iconPath: "account-pin-box-fill", selectedIconPath: "account-pin-box-fill", text: '我的', role:[-1], customIcon: true, pagePath2: "/pagesFinance/user/index", } ]; var relist = [] function role(info) { relist=[] var accountTopics=info.accountTopics?info.accountTopics:"0"; for (var i in list) { var item = list[i] var sz =item.role; if(item.accountType){ if(info.accountType==1){ relist.push(item) } }else if(item.only){ if(accountTopics==sz[0]){ relist.push(item) } }else{ var bl=false; for(var j in sz){ var s=sz[j]; if(accountTopics.indexOf(s)>=0){ bl=true; } } if(bl||sz[0]==-1){ relist.push(item) } } } } export function getToIndex(info) { role(info); return relist[0].pagePath2; } export function getList(info) { role(info); return relist; }