提交 7b48bb9a 编写于 作者: KK's avatar KK

设置菜单调整

上级 c724736d
......@@ -7,26 +7,21 @@
</ion-tab>
</template>
</template>
<ion-tab v-if="useDefaultMenu" key="setting" tab="setting" >
<component :is="'app-setting'" ></component>
</ion-tab>
<template>
</template>
<ion-tab-bar slot="bottom">
<template v-for="item in items">
<template v-if="!item.hidden">
<ion-tab-button :tab="item.name" :key="item.id" :selected="item.id == activeId" @click="active(item)">
<ion-icon :name=" item.iconcls ? item.iconcls : 'home' ">
</ion-icon>
<ion-label>{{$t(`app.menus.${menuName}.${item.name}`)}}</ion-label>
<ion-label v-if="item.appfunctag != 'settings'">{{$t(`app.menus.${menuName}.${item.name}`)}}</ion-label>
<ion-label v-else>{{item.text}}</ion-label>
<ion-badge color="danger" v-if="counterServide && counterServide.counterData && counterServide.counterData[item.counterid]"><ion-label>{{counterServide.counterData[item.counterid]}}</ion-label></ion-badge>
</ion-tab-button>
</template>
</template>
<ion-tab-button v-if="useDefaultMenu" tab="setting" >
<ion-icon name="settings"></ion-icon>
<ion-label>设置</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
</template>
......@@ -123,12 +118,33 @@ export default class AppMobMenuDefaultView extends Vue {
*/
public activeId = "";
public defaultMenu = {
appfunctag: "settings",
componentname: "app-setting",
expanded: false,
hidden: false,
hidesidebar: false,
icon: "",
iconcls: "settings",
id: "setting",
name: "setting",
opendefault: false,
resourcetag: "",
separator: false,
text: "设置",
textcls: "",
tooltip: "设置",
type: "MENUITEM",
};
/**
* 生命周期
*
* @memberof AppMobMenuDefaultView
*/
public created() {
if(this.useDefaultMenu){
this.items.push(this.defaultMenu);
}
let count = 0;
this.items.forEach((item:any,index:number) => {
if(item.hidden == false){
......
<template>
<div class="app-mobile-select" @click="open">
<div class="app-mobile-select">
<div class="activeoption" v-if="activeoption" :style="{'background':activeoption.background,'color':activeoption.color}">{{activeoption.text}}</div>
<ion-select v-show="false" ref="themeselect" :value="curValue" @ionChange="change" interface="action-sheet" :cancel-text="$t('app.button.cancel')">
<ion-select-option v-for="option of options" :key="option.value" :value="option.value" class="mob-select-text">{{option.text}}</ion-select-option>
......
......@@ -40,4 +40,4 @@
--color-hover:#f4f3f8;
}
}
\ No newline at end of file
}
\ No newline at end of file
<template>
<ion-page :className="{ 'view-container': true,'app-setting': true}">
<ion-header>
<ion-header v-if="titleStatus">
<ion-toolbar class="ionoc-view-header">
<ion-title class="view-title">
<label class="title-label">设置</label>
......@@ -21,10 +21,10 @@
<ion-icon name="chevron-forward-outline"></ion-icon>
</div>
</ion-item>
<ion-item>
<ion-item @click="changeTheme">
<div class="content-list-item-content">
<div class="content-list-item-content-text">主题</div>
<app-mob-select-changeTheme></app-mob-select-changeTheme>
<ion-label class="content-list-item-content-text">主题</ion-label>
<app-mob-select-changeTheme ref="changeTheme"></app-mob-select-changeTheme>
</div>
</ion-item>
<ion-item>
......@@ -69,7 +69,8 @@
<ion-list class="content-list">
<ion-item @click="logout">
<div class="content-list-item-content">
<div class="content-list-item-content-text">退出当前账号</div>
<div v-if="!thirdPartyName" class="content-list-item-content-text">退出当前账号</div>
<div v-if="thirdPartyName" class="content-list-item-content-text">退出应用</div>
</div>
</ion-item>
<ion-item @click="clear">
......@@ -95,23 +96,37 @@ import {
components: {},
})
export default class AppRoundList extends Vue {
/**
* 传入item
* @type {any}
* @memberof AppRoundList
*/
// @Prop() public item?:any;
public items = [];
public srfloginname = "";
public thirdPartyName = this.$viewTool.getThirdPartyName();
/**
* created
*/
public created() {
let appdata = this.$store.state.appdata;
this.srfloginname = appdata.context.srfloginname;
this.$viewTool.setViewTitleOfThirdParty("设置");
this.setViewTitleStatus();
}
activated(){
this.$viewTool.setViewTitleOfThirdParty("设置");
}
/**
* 标题状态
*
* @memberof ProductCloseMobEditViewBase
*/
public titleStatus :boolean = true;
public setViewTitleStatus(){
const thirdPartyName = this.$store.getters.getThirdPartyName();
if(thirdPartyName){
this.titleStatus = false;
}
}
/**
......@@ -124,10 +139,13 @@ export default class AppRoundList extends Vue {
const contant: any = this.$t('app.tabpage.sureclosetip.content');
const result = await this.$notice.confirm(title, '确认退出当前账号?',this.$store);
if(result){
if(this.thirdPartyName){
this.$viewTool.ThirdPartyClose();
return
}
const get: Promise<any> = this.$http.get('v7/logout');
get.then((response:any) =>{
if (response && response.status === 200) {
// this.$appService.logout();
this.doLogin();
}
}).catch((error: any) =>{
......@@ -160,6 +178,16 @@ export default class AppRoundList extends Vue {
}
/**
* changeTheme
*/
public changeTheme() {
let changeTheme:any = this.$refs.changeTheme;
if(changeTheme){
changeTheme.open();
}
}
}
</script>
<style lang="less">
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册