<template>
	<view class="setting">
		<!-- <Header :title="title"></Header>
		<view style="height:94upx"></view> -->
		<view class="setting-warp">
			<view class="item-warp">
				<view class="item" @tap="topage('/pages/index/setting/changepassword')">
					<text class="name">密码修改</text>
					<image src="../../../static/images/moreicon.png" class="more"></image>
				</view>
			</view>
			<view class="item-warp cellme-warp">
				<view class="item cellme" @tap="topage('/pages/index/setting/cellme')">
					<text class="name">联系我们</text>
					<image src="../../../static/images/moreicon.png" class="more"></image>
				</view>
			</view>
			<view class="item-warp">
				<view class="item" @tap="topage('/pages/index/setting/notice')">
					<text class="name">公告管理</text>
					<image src="../../../static/images/moreicon.png" class="more"></image>
				</view>
			</view>
			<view class="item-warp">
				<view class="item" @tap="logout()">
					<text class="name">退出登陆</text>
					<image src="../../../static/images/moreicon.png" class="more"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import Header from '../../components/header';
export default {
	name: 'setting',
	components: {
		Header
	},
	data() {
		return {
			title: '设置'
		};
	},
	onLoad() {},
	methods: {
		topage(url) {
			console.log(url);
			this.$mRouter.push({ route: url });
		},

		// 退出登陆
		async logout() {
			await this.$http.post('/logout',{}).then(res => {
				console.log('退出登陆');
				console.log(res);
				this.$mHelper.toast('退出成功')
				uni.removeStorageSync('user')
				uni.removeStorageSync('role')
				this.$mRouter.reLaunch({route: '/pages/public/login'})
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.setting {
	height: 100vh;
	background-color: #f4f4f4;
	.setting-warp {
		.item-warp {
			background-color: #fff;
			padding: 0 33upx;
			margin-top: 25upx;
			.item {
				display: flex;
				justify-content: space-between;
				align-items: center;
				height: 93upx;
				.name {
					font-size: 32upx;
					color: #232828;
					letter-spacing: 2upx;
				}
				.more {
					width: 19upx;
					height: 27upx;
				}
			}
		}
		.cellme-warp {
			margin-top: 0;
			.cellme {
				border-top: 1px solid #e7e7e7;
			}
		}
	}
}
</style>
