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

<script>
	import loginPassword from '@/components/ay-login/login-password.vue';
	import backImage from '@/static/home.png';
	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) {
				uni.navigateTo({
					url: '/pages/home/home',
					success: function(res) {}
				});
				this.$http('common.login', data, '登录中', true).then((res) => {
					if (res.success == "true") {
						if (res.data && res.data.length > 0) {
							uni.setStorageSync('token', res.data[0].token);
						}
						uni.showToast({
							title: '登录成功',
							icon: 'none',
							success: function() {
								uni.navigateTo({
									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>