瀏覽代碼

vin对接

twt 2 年之前
父節點
當前提交
47712ccd0d
共有 7 個文件被更改,包括 111 次插入16 次删除
  1. 107 14
      pages/mobile/homePage.vue
  2. 4 2
      pages/mobile/index.vue
  3. 二進制
      static/img/icon_home_1@2x.png
  4. 二進制
      static/img/icon_home_2@2x.png
  5. 二進制
      static/img/icon_home_3@2x.png
  6. 二進制
      static/img/icon_home_4@2x.png
  7. 二進制
      static/img/icon_home_scan@2x.png

+ 107 - 14
pages/mobile/homePage.vue

@@ -10,7 +10,7 @@
 					
 				</view>
 				<view class="zdyNavTitle">车型件</view>
-				<view class="zdyNavRight" @click="goOe">OE查询</view>
+				<view class="zdyNavRight" ></view>
 				
 			</view>
 		</view>
@@ -20,7 +20,7 @@
 
 		<view class="mainBox">
 			<!-- 轮播图 -->
-			<swiper class="swiper" :circular="true" :indicator-dots="true" indicator-active-color="#FF4F00">
+			<!-- <swiper class="swiper" :circular="true" :indicator-dots="true" indicator-active-color="#FF4F00">
 				<swiper-item v-for="(item,index) in bannerArr">
 				
 					<image :src="item" mode="" class="swpImg"></image>
@@ -29,16 +29,40 @@
 					
 				</swiper-item>
 				
-			</swiper>
-			
-			<view class="btnBox">
-				<image @click="goIndex()" class="searchBtn" src="../../static/img/button_search.png" mode=""></image>
-				<view @click="goSelectCarModel()" class="brand">选择品牌</view>
-			</view>
+			</swiper> -->
+		<!-- 	
+		<view class="btnBox">
+			<image @click="goIndex()" class="searchBtn" src="../../static/img/button_search.png" mode=""></image>
+			<view @click="goSelectCarModel()" class="brand">选择品牌</view>
+		</view>
+		<image class="content"  src="../../static/img/text_shuoming.png" mode=""></image> -->
+			<view class="vinSbimgBox" >
+				<img src="../../static/img/icon_home_scan@2x.png" alt="" @click="ScanVin" class="vinSbimg">
+				<image class="titleiMG" src="../../static/img/text_zhongjian.png" mode=""></image>
+			</view>
+			<view class="contBox">
+				<view class="contLine" @click="ImgVin">
+					<image src="../../static/img/icon_home_1@2x.png" mode="" class="contLineImg"></image>
+					<view class="contLineTxt">VIN相册</view>
+				</view>
+				<view class="contLine" @click="goSelectCarModel()">
+					<image src="../../static/img/icon_home_2@2x.png" mode="" class="contLineImg"></image>
+					<view class="contLineTxt">车型查询</view>
+				</view>
+				<view class="contLine" @click="goIndex()">
+					<image src="../../static/img/icon_home_3@2x.png" mode="" class="contLineImg"></image>
+					<view class="contLineTxt">手输VIN</view>
+				</view>
+				<view class="contLine" @click="goOe">
+					<image src="../../static/img/icon_home_4@2x.png" mode="" class="contLineImg"></image>
+					<view class="contLineTxt">OE查询</view>
+				</view>
+				
+			</view>
+		
 			
-			<image class="title" src="../../static/img/text_zhongjian.png" mode=""></image>
 			
-			<image class="content"  src="../../static/img/text_shuoming.png" mode=""></image>
+		
 			
 			
 		</view>
@@ -59,10 +83,16 @@
 				iStatusBarHeight: '',
 				bannerArr:['../../static/img/home_banner1.png','../../static/img/home_banner2.png','../../static/img/home_banner3.png'],
 				searchValue: '',
-				
+				vin:'',
 			}
 		},
-		onLoad() {
+		onLoad(opt) {
+			this.vin=opt.Vin;
+			if(this.vin){
+				uni.navigateTo({
+					url:'index?vin='+this.vin
+				})
+			}
 			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 
 		},
@@ -87,7 +117,30 @@
 					url: 'SelectCarModel'
 				})
 			},
-			
+			ImgVin(){
+				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) {
+					 window.webkit.messageHandlers.goImgVin.postMessage(null)
+				} else if (android) {
+								// window.android.postMessage()
+				}
+			},
+			ScanVin(){
+				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) {
+					 window.webkit.messageHandlers.goScanVin.postMessage(null)
+				} else if (android) {
+								// window.android.postMessage()
+				}
+			},
 			goback() {
 				console.log('返回');
 				// uni.navigateBack({})
@@ -109,7 +162,47 @@
 	}
 </script>
 
-<style>
+<style scoped>
+	.vinSbimg{
+		width: 484rpx;
+		height: 484rpx;
+		
+	}
+	.titleiMG{
+		width: 518rpx;
+		height: 40rpx;
+		
+	}
+	.vinSbimgBox{
+		text-align: center;
+		padding-top: 32rpx;
+	}
+	.contBox{
+		display: flex;
+		flex-wrap: wrap;
+		justify-content: space-around;
+	}
+	.contLine{
+		width: 331rpx;
+		height: 74rpx;
+		background: #F4F5F7;
+		border-radius: 20rpx;
+		display: flex;
+		justify-content: center;
+		margin-top: 40rpx;
+		padding: 30rpx 0;
+	}
+	.contLineImg{
+		width: 73rpx;height: 73rpx;
+	}
+	.contLineTxt{
+		font-size: 30rpx;
+		font-family: PingFangSC-Regular, PingFang SC;
+		font-weight: 400;
+		color: #333333;
+		line-height: 73rpx;
+		padding-left: 20rpx;
+	}
 	.box {
 		min-height: 100vh;
 		background: #ffffff;

+ 4 - 2
pages/mobile/index.vue

@@ -29,8 +29,10 @@
 				vin: ''
 			}
 		},
-		onLoad() {
-           
+		onLoad(opt) {
+           if(opt.vin){
+			   this.vin=opt.vin
+		   }
 		},
 		methods: {
 			clear(){

二進制
static/img/icon_home_1@2x.png


二進制
static/img/icon_home_2@2x.png


二進制
static/img/icon_home_3@2x.png


二進制
static/img/icon_home_4@2x.png


二進制
static/img/icon_home_scan@2x.png