<template>
	<view style="background:url('/static/home_bg.png') no-repeat;background-size: cover;min-height: 100vh;">
		<view>
			<tn-nav-bar backgroundColor="transparent" :bottomShadow="false" :fixed="false" :isBack="false">
				<view slot="default" style="color: #ffffff;font-size: 16px;font-weight: 600;">孟易融</view>
			</tn-nav-bar>
		</view>
		<view style="color: #ffffff;padding:60rpx 30rpx;">
			<view style="font-size: 32rpx;">亲爱的用户</view>
			<view style="font-size: 60rpx;font-weight: 600;">欢迎使用孟易融</view>
		</view>
		<view style="position: relative" @click="openUrl('/pages/index/policy')">
			<view :style="{top:h}" class="home_type">--我要了解政策--</view>
			<image src="/static/home_1.png" style="width: 100%" mode="widthFix"></image>
		</view>
		<view style="position: relative" @click="openUrl('/pages/index/add')">
			<view :style="{top:h}" class="home_type">--我要申请贷款--</view>
			<image src="/static/home_2.png" style="width: 100%" mode="widthFix"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				h: '140rpx',

			}
		},
		onLoad() {
			const userAgent = navigator.userAgent.toLowerCase();
			if (/ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/.test(userAgent)) {
				// 移动端
				this.h = '126rpx';
			} else {
				// pc端
				this.h = '140rpx';
			}
		},
		methods: {
			openUrl(url) {
				uni.navigateTo({
					url: url
				})
			},
		}
	}
</script>

<style>
	.home_type {
		font-size: 32rpx;
		font-weight: 600;
		position: absolute;
		z-index: 10;
		width: 100%;
		text-align: center;
	}
</style>