<template>
	<view class="content">
		<loginPassword :themeColor="themeColor" :logoUrl="logoUrl" @loginFun="loginFun"></loginPassword>
	</view>
</template>

<script>
	import loginPassword from '@/components/ay-login/login-password.vue';
	export default {
		components: {
			loginPassword
		},
		data() {
			return {
				themeColor: '#33CCCC',
				logoUrl: 'https://cdn.pixabay.com/photo/2016/11/23/17/55/beach-1854072__340.jpg',
			}
		},
		onLoad() {

		},
		methods: {
			loginFun(data) {
				this.$http('common.login', data, '登录中', true).then((res) => {
					if (res.success == true) {
						if (res.data) {
							uni.setStorageSync('token', res.data.token);
						}
						uni.showToast({
							title: '登录成功',
							icon: 'none',
							success: function() {
								uni.redirectTo({
									url: '/pages/home/home',
									success: function(res) {}
								});
							}
						}, );
					}
				})
			}
		}
	}
</script>

<style>
	.content {
		width: 100%;
		height: 100%;
		/* 	background: url('../../static/home.png');
		background-size: 100% 100%;
		overflow: auto; */
	}
</style>