<template>
	<view class="contentBox">
		<button type="primary" class="submitBtn" @click="loginout">退出绑定</button>
	</view>
</template>

<script>
	
	import {changeUser, toLoginout} from "../../api/index.js"
	
	export default{
		data(){
			return {
				username:"",
				phone:""
			}
		},
		methods:{
			loginout(){
				toLoginout().then(res => {
					if(res.error_code === 200){
						uni.clearStorage();
						this.$store.commit('change_userinfo',{})
						uni.redirectTo({
							url:"/pages/index/index"
						})
					}else{
						uni.showToast({
							title:"退出绑定失败",
							icon:"none"
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page{
		width: 100%;
		height: 100%;
		background: $uni-bg-color-normal;
	}
	.contentBox{
		padding: 0 51rpx;
	}
	.labelTitle{
		display: block;
		font-size: 34rpx;
		color: #4D4D4D;
		margin-top: 62rpx;
		margin-bottom: 41rpx;
	}
	.input{
		width: calc(100% - 2px - 102rpx);
		height: 76rpx;
		line-height: 76rpx;
		padding: 0 41rpx;
		font-size: 26rpx;
		border: 1px solid #999999;
		border-radius: 3px;
		background: #FFFFFF;
	}
	.inputHolder{
		color: #DDDDDD;
	}
	.submitBtn{
		width: 432rpx;
		height: 76rpx;
		line-height: 76rpx;
		background: $uni-btn-bg-color !important;
		margin-top: 50rpx;
		font-size: 32rpx;
	}
</style>
