import { Component } from '@angular/core'; import {Router} from "@angular/router"; import {DomSanitizer} from "@angular/platform-browser"; declare const sysinfo; import {OauthService} from 'services-components'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { frameurl: any = this.domSanitizer.bypassSecurityTrustResourceUrl(sysinfo.siteroot+'web/index.php?c=home&a=welcome&do=ext&m=imeepos_runner'); firstMenus: any[]; logo:any = sysinfo.avatar; title: string; second: any; mobile: '000'; nickname: string = sysinfo.username; constructor( public router: Router, public domSanitizer: DomSanitizer, public oauth: OauthService ) { this.title = '前台预览'; this.second = { title: '概况', menus: [ { title: '概况', active: true } ] } this.firstMenus = [ { title: '前台预览', active: false, menus: { title: '前台入口', menus: [ { title: '听单入口', active: false, link: ['runner','preview',sysinfo.siteroot+'app/index.php?i='+sysinfo.uniacid+'&c=entry&do=index&m=imeepos_runner'] }, { title: '发布任务', active: false, link: ['runner','preview',sysinfo.siteroot+'app/index.php?i='+sysinfo.uniacid+'&c=entry&do=post&m=imeepos_runner'] }, { title: '会员中心', active: false, link: ['runner','preview',sysinfo.siteroot+'app/index.php?i='+sysinfo.uniacid+'&c=entry&do=home&m=imeepos_runner'] }, { title: '任务大厅', active: false, link: ['runner','preview',sysinfo.siteroot+'app/index.php?i='+sysinfo.uniacid+'&c=entry&do=tasks&m=imeepos_runner'] }, { title: '新版入口', active: true, link: ['runner','preview',sysinfo.siteroot+'app/index.php?i='+sysinfo.uniacid+'&c=entry&do=webapp&m=imeepos_runner'] }, { title: '新版2入口', active: false, link: ['runner','preview',sysinfo.siteroot+'app/index.php?i='+sysinfo.uniacid+'&c=entry&do=map&m=imeepos_runner'] } ] } }, { title: '运营设置', active: true, menus: { title: '认证设置', menus: [ { title: '认证设置', active: true, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=v_set&m=imeepos_runner' }, // { // title: '认证设置', // active: true, // link: ['runner','setting','runner'] // }, { title: '帮我送设置', active: false, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=divider_set&m=imeepos_runner' }, // { // title: '帮我送设置', // active: false, // link: ['runner','setting','send'] // }, { title: '帮我买设置', active: false, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=buy_set&m=imeepos_runner' }, // { // title: '帮我买设置', // active: false, // link: ['runner','setting','buy'] // }, { title: '帮帮忙设置', active: false, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=help_set&m=imeepos_runner' }, // { // title: '帮帮忙设置', // active: false, // link: ['runner','setting','help'] // }, { title: '身份证核实接口', active: false, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=card_set&m=imeepos_runner' }, // { // title: '身份证核实接口', // active: false, // link: ['runner','setting','card'] // }, { title: '短信接口', active: false, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=sms_set&m=imeepos_runner', items: [] }, // { // title: '短信接口', // active: false, // link: ['runner','setting','sms'] // }, { title: '其他设置', active: false, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=plugin&mp=setting&mdo=index&m=imeepos_runner' }, // { // title: '其他设置', // active: false, // link: ['runner','setting','other'] // } ] } }, { title: '短信及模板', active: false, menus: { title: '短信及模板', menus: [ { title: '短信设置', active: true, link: ['opensms','setting','sms'] //sysinfo.siteroot+'web/index.php?c=site&a=entry&do=setting&m=imeepos_opensms' }, { title: '模板设置', active: false, link: ['opensms','setting','tpl'] //sysinfo.siteroot+'web/index.php?c=site&a=entry&code=tpl&do=setting&m=imeepos_opensms' }, { title: '发送记录', active: false, link: ['opensms','send','log']//sysinfo.siteroot+'web/index.php?c=site&a=entry&do=log&m=imeepos_opensms' }, { title: '检查更新', active: false, link: sysinfo.siteroot + 'install/download.php?module=imeepos_opensms' } ] } }, { title: '基础设置', active: false, menus: { title: '基础设置', menus: [ { title: '广告设置', active: true, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=advs&m=imeepos_runner' }, { title: '公告设置', active: false, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=announcement&m=imeepos_runner' },{ title: '导航设置', active: false, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=navs&m=imeepos_runner' },{ title: '分享设置', active: false, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=share_set&m=imeepos_runner' }, { title: '七牛设置', link: ['qiniu','setting'] } ] } }, { title: '会员管理', active: false, menus: { title: '会员管理', menus: [ { title: '会员管理', active: true, link: ['memer','list'] //sysinfo.siteroot+'web/index.php?c=site&a=entry&do=member&m=imeepos_runner' },{ title: '跑腿管理', active: false, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=v&m=imeepos_runner' },{ title: '监控台', active: false, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=runner&m=imeepos_runner' },{ title: '信誉等级', active: false, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=runner_level&m=imeepos_runner' } ] } }, { title: '运营管理', active: false, menus: { title: '运营管理', menus: [ { title: '任务管理', active: true, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=task&m=imeepos_runner' },{ title: '最新接单', active: false, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=recive&m=imeepos_runner' },{ title: '最新评价', active: false, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=star&m=imeepos_runner' },{ title: '最新进度', active: false, link: sysinfo.siteroot+'web/index.php?c=site&a=entry&do=tasks_log&m=imeepos_runner' } ] } } ] this.designMenu(); this.designMoney(); this.qiniuModule(); this.systemMenu(); } systemMenu(){ if(sysinfo['role'] == 'founder'){ let menu = { title: '管理员特权', active: false, menus: { title: '管理员特权', menus: [ { title: '更新升级', active: true, link: ['oauth','update'] }, { title: '站长设置', active: false, link: ['oauth','setting'] } ] } } this.firstMenus.push(menu) } } designMenu(){ let menu = { title: '模板自定义', active: false, menus: { title: '模板自定义', menus: [ { title: '发单首页', active: true, notIframe: true, link: ['runner','design','post_index'] }, { title: '个人中心', active: false, notIframe: true, link: ['runner','design','home'] }, { title: '预约跑腿', active: false, notIframe: true, link: ['runner','design','coach'] }, { title: '任务大厅', active: false, notIframe: true, link: ['runner','design','runner'] }, { title: '语音播报', active: false, notIframe: true, link: ['runner','design','voice'] } ] } } this.firstMenus.push(menu) } designMoney(){ let menu = { title: '财务管理', active: false, menus: { title: '财务管理', menus: [ { title: '财务统计', active: true, notIframe: true, link: ['runner','money','lodash'] } ] } } this.firstMenus.push(menu) } qiniuModule(){ let menu = { title: '七牛空间', active: false, menus: { title: '七牛管理', menus: [ { title: '参数设置', active: false, notIframe: true, link: ['qiniu','setting'] }, { title: '文件管理', active: true, notIframe: true, link: ['qiniu','list'] } ] } } this.firstMenus.push(menu); } ngOnInit() { this.firstMenus.map(res=>{ if(res['active']){ this.second.title = res.menus.title; this.second.menus = res.menus.menus; res.menus.menus.map(re=>{ if(re['active']){ if(re['link']){ if(typeof re['link'] == 'string'){ this.frameurl = re['link']; this.router.navigate(['runner','iframe',this.frameurl]) }else{ this.router.navigate(re.link) } } } }) } }) } showIframe: boolean = false; onFirstClick(e){ this.frameurl = ''; this.second.title = e.menus.title; this.second.menus = e.menus.menus; this.second.menus.map(res=>{ if(res.active){ this.title = res.title; if(res['link']){ if(typeof res['link'] == 'string'){ this.frameurl = res['link']; this.router.navigate(['runner','iframe',this.frameurl]) }else{ this.router.navigate(res.link) this.showIframe = false; } } } }) } onSecondClick(e){ this.title = e.title; console.log(e); if(e['link']){ // this.router.navigate(e.link) if(typeof e['link'] == 'string'){ this.frameurl = e['link']; this.router.navigate(['runner','iframe',this.frameurl]) }else{ this.router.navigate(e.link) } } } onLogout(){ } onBackMain(){ location.href = sysinfo.siteroot+'index.php?c=home&a=welcome&do=ext&m=imeepos_runner'; } }