<template>
	<view class="page">
		<view class="input">
			<uni-easyinput v-model.trim="account" placeholder="请输入姓名"></uni-easyinput>
		</view>
		<button type="primary" @click="submit">确认</button>
	</view>
</template>

<script>
	import { checkIfAnAccountExists, changeAccount } from '@/apis/modules/user.js'
	export default {
		data() {
			return {
				account: '',
				repeat: false
			}
		},
		onShow() {
			
		},
		methods: {
			submit() {
				const { account } = this
				if(!account) return this.$util.errMsg('请输入姓名')
				changeAccount(account).then(res => {
					this.$util.sucMsg('修改成功！')
					setTimeout(() => {
						uni.navigateBack()
					}, 1000)
				}).catch(e => {})
			}
		}
	}
</script>

<style scoped lang="scss">
.page {
	padding: 20px;
	background-color: #fff;
}
/deep/.input {
	margin-bottom: 15px;
	.is-input-border {
		border-color: #dedede !important;
	}
}
</style>
