<template>
	<view class="super-login">
		<u-input auto-focus v-model="mobile" focus type="number" placeholder="请输入手机号"></u-input>
		<view class="line-view"></view>
		<view class="button-view">
			<u-button class="change-button" type="primary" @click="handleClick">确认切换</u-button>
		</view>
			<view>
				<u-toast ref="uToast" />
			</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				mobile: ''
			}
		},
		methods: {
			handleClick() {
				this.otherUser()
			},
			async otherUser() {
				let res = await this.$u.api.otherUser({mobile: this.mobile})
				console.log(res)
				if (res && res.code == 200) {
					this.$u.vuex("vuex_token", res.data);
					
					const callBack = (vm, result) => {
						if (result && result.record) {
							uni.navigateBack({
							})
						}
					};
					await getApp().getBaseInfo(this, callBack);
					
					
				} else {
					this.$refs.uToast.show({
						title: res.message,
						type: 'error'
					})
				}
				
			},
		}
	}
</script>

<style lang="scss" scoped>
.super-login {
	padding: 30rpx;
	margin: 30rpx;
	background-color: #FFFFFF;
	border-radius: 12rpx;
	.line-view {
		background-color: #F4F5F7;
		height: 2rpx;
	}
	.button-view {
		margin-top: 40rpx;
	}
}
</style>
