<template>
	<view class="modifyWrapper">
				<image class="avatar" :src="userinfo.avatar"></image>
				<view class="tips-text">{{userinfo.alias}}</view>
<!-- 			<view>
				<button class="alias-submit"  @click="forExit">退出小程序</button>
			</view>
			 -->
			
		<!--此方法只需要在wxml里添加下面代码即可，无需用 bindtap关联函数-->
		<navigator  target="miniProgram" open-type="exit">
		   <button class="alias-submit"  @click="truelyExit">退出小程序</button>
		</navigator>
		
	</view>
</template>

<script>
	import {
		mapMutations,
		mapState
	} from 'vuex'

	export default {
		computed: {
			...mapState('m_user', ['userinfo'])
		},
		methods: {
			...mapMutations('m_user', ['updateUserInfo', 'updateToken']),

				truelyExit(){
					//console.log("exit")
					this.updateToken("")
				}
		}
	}
</script>

<!-- 设置页面背景 -->
<style lang="scss">
	page{
		height: 100%;
		padding: 0 20rpx;
		// background-color: #FFF;
	}
</style>

<style lang="scss" scoped>
	.modifyWrapper{
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	}
.avatar{
	width: 300rpx;
	height: 300rpx;
	margin: 60rpx;
	border-radius: 50rpx;
}

	.alias-submit {
		width: 500rpx;
		margin-top: 50rpx;
		border-radius: 50rpx;
		background-color: #35b882;
		font-size: 35rpx;
		//font-weight: bold;
		padding: 10rpx;
		color: #fff;
	}
	.tips-text {
		margin: 10rpx;
		font-size: 35rpx;
		color: gray;
		font-weight: bold;
	}
</style>
