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

设置菜单调整

上级 c724736d
...@@ -7,26 +7,21 @@ ...@@ -7,26 +7,21 @@
</ion-tab> </ion-tab>
</template> </template>
</template> </template>
<ion-tab v-if="useDefaultMenu" key="setting" tab="setting" > <template>
<component :is="'app-setting'" ></component> </template>
</ion-tab>
<ion-tab-bar slot="bottom"> <ion-tab-bar slot="bottom">
<template v-for="item in items"> <template v-for="item in items">
<template v-if="!item.hidden"> <template v-if="!item.hidden">
<ion-tab-button :tab="item.name" :key="item.id" :selected="item.id == activeId" @click="active(item)"> <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 :name=" item.iconcls ? item.iconcls : 'home' ">
</ion-icon> </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-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> </ion-tab-button>
</template> </template>
</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-tab-bar>
</ion-tabs> </ion-tabs>
</template> </template>
...@@ -123,12 +118,33 @@ export default class AppMobMenuDefaultView extends Vue { ...@@ -123,12 +118,33 @@ export default class AppMobMenuDefaultView extends Vue {
*/ */
public activeId = ""; 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 * @memberof AppMobMenuDefaultView
*/ */
public created() { public created() {
if(this.useDefaultMenu){
this.items.push(this.defaultMenu);
}
let count = 0; let count = 0;
this.items.forEach((item:any,index:number) => { this.items.forEach((item:any,index:number) => {
if(item.hidden == false){ if(item.hidden == false){
......
<template> <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> <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 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> <ion-select-option v-for="option of options" :key="option.value" :value="option.value" class="mob-select-text">{{option.text}}</ion-select-option>
......
.app-setting { .app-setting {
background: #f4f3f8; background: #f4f3f8;
.content { .content {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: auto; overflow: auto;
.content-list { .content-list {
margin-top: 12px; margin-top: 12px;
.content-list-item-content { .content-list-item-content {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 0 15px; padding: 0 15px;
justify-content: space-between; justify-content: space-between;
display: flex; display: flex;
align-items: center; align-items: center;
.content-list-item-content-text { .content-list-item-content-text {
font-size: 14px; font-size: 14px;
}
ion-icon {
color: #bbbbbb;
}
.app-mobile-select{
width: 70%;
display: flex;
justify-content: flex-end;
}
} }
.content-list-item-content:active{ ion-icon {
background: #f4f3f8; color: #bbbbbb;
}
.app-mobile-select{
width: 70%;
display: flex;
justify-content: flex-end;
} }
} }
.content-list-item-content:active{
background: #f4f3f8;
}
} }
ion-item { }
--inner-padding-end: 0 !important; ion-item {
--padding-start: 0 !important; --inner-padding-end: 0 !important;
--border-style: 0; --padding-start: 0 !important;
color: #565656; --border-style: 0;
--color-activated: #f4f3f8; color: #565656;
--color-focused: #f4f3f8; --color-activated: #f4f3f8;
--color-hover:#f4f3f8; --color-focused: #f4f3f8;
} --color-hover:#f4f3f8;
}
}
\ No newline at end of file }
\ No newline at end of file
<template> <template>
<ion-page :className="{ 'view-container': true,'app-setting': true}"> <ion-page :className="{ 'view-container': true,'app-setting': true}">
<ion-header> <ion-header v-if="titleStatus">
<ion-toolbar class="ionoc-view-header"> <ion-toolbar class="ionoc-view-header">
<ion-title class="view-title"> <ion-title class="view-title">
<label class="title-label">设置</label> <label class="title-label">设置</label>
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
<ion-icon name="chevron-forward-outline"></ion-icon> <ion-icon name="chevron-forward-outline"></ion-icon>
</div> </div>
</ion-item> </ion-item>
<ion-item> <ion-item @click="changeTheme">
<div class="content-list-item-content"> <div class="content-list-item-content">
<div class="content-list-item-content-text">主题</div> <ion-label class="content-list-item-content-text">主题</ion-label>
<app-mob-select-changeTheme></app-mob-select-changeTheme> <app-mob-select-changeTheme ref="changeTheme"></app-mob-select-changeTheme>
</div> </div>
</ion-item> </ion-item>
<ion-item> <ion-item>
...@@ -69,7 +69,8 @@ ...@@ -69,7 +69,8 @@
<ion-list class="content-list"> <ion-list class="content-list">
<ion-item @click="logout"> <ion-item @click="logout">
<div class="content-list-item-content"> <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> </div>
</ion-item> </ion-item>
<ion-item @click="clear"> <ion-item @click="clear">
...@@ -95,23 +96,37 @@ import { ...@@ -95,23 +96,37 @@ import {
components: {}, components: {},
}) })
export default class AppRoundList extends Vue { export default class AppRoundList extends Vue {
/**
* 传入item
* @type {any}
* @memberof AppRoundList
*/
// @Prop() public item?:any;
public items = [];
public srfloginname = ""; public srfloginname = "";
public thirdPartyName = this.$viewTool.getThirdPartyName();
/** /**
* created * created
*/ */
public created() { public created() {
let appdata = this.$store.state.appdata; let appdata = this.$store.state.appdata;
this.srfloginname = appdata.context.srfloginname; 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 { ...@@ -124,10 +139,13 @@ export default class AppRoundList extends Vue {
const contant: any = this.$t('app.tabpage.sureclosetip.content'); const contant: any = this.$t('app.tabpage.sureclosetip.content');
const result = await this.$notice.confirm(title, '确认退出当前账号?',this.$store); const result = await this.$notice.confirm(title, '确认退出当前账号?',this.$store);
if(result){ if(result){
if(this.thirdPartyName){
this.$viewTool.ThirdPartyClose();
return
}
const get: Promise<any> = this.$http.get('v7/logout'); const get: Promise<any> = this.$http.get('v7/logout');
get.then((response:any) =>{ get.then((response:any) =>{
if (response && response.status === 200) { if (response && response.status === 200) {
// this.$appService.logout();
this.doLogin(); this.doLogin();
} }
}).catch((error: any) =>{ }).catch((error: any) =>{
...@@ -160,6 +178,16 @@ export default class AppRoundList extends Vue { ...@@ -160,6 +178,16 @@ export default class AppRoundList extends Vue {
} }
/**
* changeTheme
*/
public changeTheme() {
let changeTheme:any = this.$refs.changeTheme;
if(changeTheme){
changeTheme.open();
}
}
} }
</script> </script>
<style lang="less"> <style lang="less">
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册