<template>
	<view class="box">
		<!-- 自定义导航 -->
		<view class="zdyNavBox">
			<view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
			<view class="zdyNav">
				<view class="zdyNavLeft">
					<image src="../../static/img/nav_icon_back.png" mode="aspectFit" class="backImg" @click="goback">
					</image>

				</view>
				<view class="zdyNavTitle">车型件</view>
				<!-- <view class="zdyNavRight"></view> -->
				<view style="width: 50px;"></view>
			</view>
		</view>
		<view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
		<view style="height: 44px;"></view>


		<view class="mainBox">
			<image class="barner" src="../../static/img/banner_chexingjian.png" mode=""></image>
			<image @click="goIndex()" class="searchBtn" src="../../static/img/button_search.png" mode=""></image>
			
			<image class="title" src="../../static/img/text_zhongjian.png" mode=""></image>
			
			<image class="content" src="../../static/img/text_shuoming.png" mode=""></image>
			
			
		</view>


	</view>
</template>

<script>
	import searchBox from '@/components/searchBox/searchBox.vue'
	export default {
		components: {
			searchBox
		},
		data() {
			return {
				iStatusBarHeight: '',
				
				searchValue: '',
			}
		},
		onLoad() {
			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;

		},
		methods: {
			search(val) {
				// console.log(val);
				this.searchValue = val
			
			},
			goIndex() {
				uni.navigateTo({
					url: 'index'
				})
			},
			
			goback() {
				console.log('返回');
				// uni.navigateBack({})
				//app交互
				var standalone = window.navigator.standalone
				var userAgent = window.navigator.userAgent.toLowerCase()
				var safari = /safari/.test(userAgent)
				var ios = /iphone|ipod|ipad|mac/.test(userAgent)
				var android = /android/.test(userAgent)
				if (ios) {
								 if ( true) {//!standalone&& !safari
								   window.webkit.messageHandlers.goMyNav.postMessage(null)
								 }
				} else if (android) {
								 window.android.postMessage()
				}
			},
		}
	}
</script>

<style>
	.box {
		min-height: 100vh;
		background: #ffffff;
		/* iOS 底部安全区 */
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);
	}

	.zdyNavBox {
		width: 100vw;
		background: #FFFFFF;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 9999999;


	}

	.zdyNav {
		height: 44px;
		display: flex;
		justify-content: space-between;

		align-items: center;

	}

	.backImg {
		width: 44rpx;
		height: 44rpx;
		margin-left: 10rpx;
		margin-right: 20rpx;
	}

	.homeImg {
		width: 44rpx;
		height: 44rpx;

	}

	.zdyNavLeft {
		display: flex;
		align-items: center;
	}

	.zdyNavTitle {

		height: 44px;
		background: #FFFFFF;
		text-align: center;
		font-size: 34rpx;
		line-height: 44px;
	}

	.zdyNavRight {
		height: 44px;
		background: #FFFFFF;
		text-align: center;
		font-size: 28rpx;
		line-height: 44px;
		color: #3F90F7;
		margin-right: 24rpx;
	}

	

	.mainBox {
		background: #FFFFFF;
		min-height: 100vh;
		width: 100vw;
	}

	.barner{
		height: 390rpx;
		width: 100%;
	}
	.searchBtn{
		padding: 30rpx 24rpx 0;
		width: calc(100vw - 48rpx);
		height: 92rpx;
	}
	.centerBox{
		margin-top: 140rpx;
		margin-bottom: 100rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	
	.title{
		padding: 142rpx 116rpx 100rpx;
		width: calc(100vw - 232rpx);
		height: 40rpx;
	}
	.content{
		padding: 0 47rpx;
		width: calc(100vw - 94rpx);
		height: 224rpx;
	}
</style>
