<template>
	<view>
		<u-image src="../../static/sailun/login_bg.png" mode="widthFix"></u-image>
		<view class="content">
			<u-card padding="50" :head-border-bottom="false" :show-head="false" :show-foot="false">
				<view slot="body">
					<u-field v-model="tel" icon="phone-fill" placeholder="请填写手机号">
					</u-field>
					<u-field v-model="code" icon="lock-fill" placeholder="请填写验证码">
					</u-field>
				</view>
			</u-card>
			<button @tap="submit" :style="[inputStyle]" class="getCaptcha">获取短信验证码</button>
			<view class="alternative">
				<view class="password">密码登录</view>
				<view class="issue">遇到问题</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tel: '',
				code:''
			}
		},
		computed: {
			inputStyle() {
				let style = {};
				if (this.tel) {
					style.color = "#fff";
					style.backgroundColor = this.$u.color['warning'];
				}
				return style;
			}
		},
		methods: {
			submit() {
				if (this.$u.test.mobile(this.tel)) {
					this.$u.route({
						url: 'pages/template/login/code'
					})
				}
			}
		}
	};
</script>

<style lang="scss" scoped>
	.content {
		position: relative;
		top: -300rpx;
	}
</style>
