| | |
| | | |
| | | // 文件路径转字符串 |
| | | export const formattingUrls = (urls) => { |
| | | let arr = []; |
| | | for (let i of urls) { |
| | | arr.push(i.name); |
| | | if (!urls.length) { |
| | | return "" |
| | | } else { |
| | | let arr = []; |
| | | for (let i of urls) { |
| | | arr.push(i.name); |
| | | } |
| | | return arr.join(",") |
| | | } |
| | | return arr.join(",") |
| | | |
| | | } |
| | | |
| | | //转换标签颜色 |
| | |
| | | return obj[i] |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | export const getTabbarList = (roleType = 1) => { |
| | | if (roleType == 1) { //居民 |
| | | return [{ |
| | | name: '首页', |
| | | iconPathSelected: '/static/img/tabbar-01-selected.png', |
| | | iconPath: '/static/img/tabbar-01.png', |
| | | url: '/pages/home/index' |
| | | }, |
| | | // { |
| | | // name: '圈子', |
| | | // iconPathSelected: '/static/img/tabbar-02-selected.png', |
| | | // iconPath: '/static/img/tabbar-02.png', |
| | | // url: '/pages/circle/index' |
| | | // }, |
| | | { |
| | | name: '我的', |
| | | iconPathSelected: '/static/img/tabbar-03-selected.png', |
| | | iconPath: '/static/img/tabbar-03.png', |
| | | url: '/pages/user/center' |
| | | } |
| | | ] |
| | | } else if (roleType == 2) { //民警 |
| | | return [{ |
| | | name: '首页', |
| | | iconPathSelected: '/static/img/tabbar-04-selected.png', |
| | | iconPath: '/static/img/tabbar-04.png', |
| | | url: '/pages/home/index' |
| | | }, |
| | | |
| | | { |
| | | name: '驾驶舱', |
| | | iconPathSelected: '/static/img/tabbar-05-selected.png', |
| | | iconPath: '/static/img/tabbar-05.png', |
| | | url: '/pages/statistics/index' |
| | | }, |
| | | |
| | | |
| | | { |
| | | name: '我的', |
| | | iconPathSelected: '/static/img/tabbar-06-selected.png', |
| | | iconPath: '/static/img/tabbar-06.png', |
| | | url: '/pages/user/center' |
| | | } |
| | | ] |
| | | } else if (roleType == 3) { // 网格员 |
| | | return [{ |
| | | name: '首页', |
| | | iconPathSelected: '/static/img/tabbar-01-selected.png', |
| | | iconPath: '/static/img/tabbar-01.png', |
| | | url: '/pages/home/index' |
| | | }, |
| | | |
| | | // { |
| | | // name: '圈子', |
| | | // iconPathSelected: '/static/img/tabbar-02-selected.png', |
| | | // iconPath: '/static/img/tabbar-02.png', |
| | | // url: '/pages/circle/index' |
| | | // }, |
| | | { |
| | | name: '驾驶舱', |
| | | iconPathSelected: '/static/img/tabbar-07-selected.png', |
| | | iconPath: '/static/img/tabbar-07.png', |
| | | url: '/pages/statistics/index' |
| | | }, |
| | | |
| | | { |
| | | name: '我的', |
| | | iconPathSelected: '/static/img/tabbar-03-selected.png', |
| | | iconPath: '/static/img/tabbar-03.png', |
| | | url: '/pages/user/center' |
| | | } |
| | | ] |
| | | } else if (roleType == 4) { //系统管理员 |
| | | return [{ |
| | | name: '首页', |
| | | iconPathSelected: '/static/img/tabbar-01-selected.png', |
| | | iconPath: '/static/img/tabbar-01.png', |
| | | url: '/pages/home/index' |
| | | }, |
| | | { |
| | | name: '驾驶舱', |
| | | iconPathSelected: '/static/img/tabbar-07-selected.png', |
| | | iconPath: '/static/img/tabbar-07.png', |
| | | url: '/pages/statistics/index' |
| | | }, |
| | | { |
| | | name: '我的', |
| | | iconPathSelected: '/static/img/tabbar-03-selected.png', |
| | | iconPath: '/static/img/tabbar-03.png', |
| | | url: '/pages/user/center' |
| | | } |
| | | ] |
| | | } |
| | | } |