twt 2 anni fa
parent
commit
c7fb99fcf0

+ 18 - 1
pages.json

@@ -8,7 +8,24 @@
 			}
 
 		},
-
+        {
+        	"path": "pages/mobile/oeindex",
+        	"style": {
+        		"navigationBarTitleText": "配件查询"
+        	}
+        },
+		{
+			"path": "pages/mobile/OESearch",
+			"style": {
+				"navigationBarTitleText": "OE搜索"
+			}
+		},
+		{
+			"path": "pages/mobile/OEDetail",
+			"style": {
+				"navigationBarTitleText": "OE信息"
+			}
+		},
 		{
 			"path": "pages/mobile/index",
 			"style": {

+ 178 - 0
pages/mobile/OEDetail.vue

@@ -0,0 +1,178 @@
+<template>
+	<view class="box">
+		
+			<!-- <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
+				:duration="duration">
+				<swiper-item v-for="(item,index) in oedata.image.epc">
+					<view class="swiper-item ">
+						<image class="swiper-itemIMg" :src="item.pic" mode="aspectFit"></image>
+					</view>
+				</swiper-item>
+				
+			</swiper> -->
+		<view class="TOP">
+			<image :src="oedata.image.epc.pic" mode="" class="picIMg"></image>
+		</view>
+		<!-- <view class="brandBox">
+			<span>共{{oedata.epc_info.length}}个品牌,已选品牌:{{oedata.brand}}</span>
+			<view class="switch" @click="switchBrand">切换</view>
+		</view> -->
+		<view >
+			 <picker   @change="bindChange" class="picker-view" :range="oedata.epc_info" :range-key="'brand'">
+				<view class="brandBox">
+					<span>共{{oedata.epc_info.length}}个品牌,已选品牌:{{oedata.brand}}</span>
+					<view class="switch" @click="switchBrand" v-if="oedata.epc_info.length>1">切换</view>
+				</view>
+			</picker>
+			
+		</view>
+		<view class="line">
+			<view class="lineLeft">结构位置</view>
+			<view class="lineRight">{{oedata.image.epc.refernum}}</view>
+		</view>
+		<view class="line">
+			<view class="lineLeft">配件OE</view>
+			<view class="lineRight">{{partsnum}}</view>
+		</view>
+		<view class="line">
+			<view class="lineLeft">配件名称</view>
+			<view class="lineRight">{{oedata.caption}}</view>
+		</view>
+		<view class="line">
+			<view class="lineLeft">备注</view>
+			<view class="lineRight">{{oedata.remark}}</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		components: {
+
+		},
+
+		data() {
+			return {
+				partsnum:'',
+				indicatorDots: true,
+				autoplay: true,
+				interval: 5000,
+				duration: 500,
+				oedata:"",
+				index:0,
+				brand_id:'',
+				epc_id:'',
+				brandShow:false,
+			}
+		},
+		onLoad(opt) {
+			console.log('opt+', opt);
+			this.partsnum = opt.partnum;
+			this.find()
+
+		},
+		methods: {
+			switchBrand(){
+				this.brandShow=true;
+			},
+			bindChange(e){
+				console.log(e)
+				this.epc_id=this.oedata.epc_info[e.detail.value].epc_id;
+				this.brand_id=this.oedata.epc_info[e.detail.value].brand_id;
+				this.find()
+			},
+			
+			// 配件查询
+			find() {
+				uni.showLoading({
+					title: '加载中'
+				});
+				this.$http('advancedEpc/parts/detail', {
+					partsnum: this.partsnum,
+					brand_id:this.brand_id,
+					epc_id:this.epc_id
+				}, 'GET').then(res => {
+					uni.hideLoading();
+                    if (res.data.number == 200 || res.data.number == 5212) {
+                    	this.oedata=res.data.result
+                    				
+                    } else {
+                    	uni.showToast({
+                    		title: res.data.message,
+                    		icon: 'none',
+                    		duration: 3000
+                    	});
+                    }
+					
+
+
+				});
+			},
+
+		},
+		// 下拉刷新 上拉加载更多
+		onPullDownRefresh() {
+			// this.page = 1
+			// this.getItemData()
+			setTimeout(function() {
+				uni.stopPullDownRefresh();
+			}, 1000);
+		},
+		onReachBottom() {
+			
+		}
+	}
+</script>
+
+<style>
+	.box {
+		min-height: 100vh;
+		background: #FFFFFF;
+		padding-bottom: constant(safe-area-inset-bottom);
+		padding-bottom: env(safe-area-inset-bottom);
+	}
+	.swiper-item{
+		width: 750rpx;
+		height: 500rpx;
+	}
+	.swiper{
+		width: 750rpx;
+		height: 500rpx;
+	}
+    .swiper-itemIMg{
+		width: 750rpx;
+		height: 500rpx;
+	}
+	.picIMg{
+		width: 100%;
+	}
+	.brandBox{
+		padding:20rpx 24px;
+		color: #333333;
+		border-bottom: 1rpx solid #eeeeee;
+		font-size: 28rpx;
+	}
+	.line{
+		padding:20rpx 24px;
+		color: #333333;
+		border-bottom: 1rpx solid #eeeeee;
+		font-size: 26rpx;
+		display: flex;
+		justify-content: space-between;
+	}
+	.brandBox{
+		display: flex;
+        justify-content: space-between;
+	}
+	.lineLeft{
+		width: 200rpx;
+	}
+	.switch{
+		    color: #3F90F7;
+			padding-left: 20rpx;
+	}
+	.lineRight{
+		width: 500rpx;
+		
+	}
+</style>

+ 295 - 0
pages/mobile/OESearch.vue

@@ -0,0 +1,295 @@
+<template>
+	<view class="box">
+		<view class="brand">当前品牌:{{this.itemList[0].brands}}</view>
+
+		<!-- <view class="tab">
+			<view class="tabLine" :class="{tabActive:tabIndex==0}" @click="tabClick(0)">品牌下搜索</view>
+			<view class="tabLine" :class="{tabActive:tabIndex==1}" @click="tabClick(1)">车型下搜索</view>
+
+		</view> -->
+		<!-- 搜索 -->
+		<view class="searchBox">
+			<image src="../../static/img/icon_search.png" class="searchImg"></image>
+			<input type="text" class="searchInput" placeholder='OE/品牌号' v-model="inputValue" @confirm="search" />
+			<image src="../../static/img/icon_close.png" class="searchClose" v-if="inputValue!=''" @click="clear">
+			</image>
+		</view>
+
+
+		<view class="history" v-if="inputValue.length==0">
+			<view class="historyTop">
+				<view class="historyTopTxt">历史搜索</view>
+				<!-- <image src="../../static/img/icon_delete.png" mode="" class="historyDelImg"></image> -->
+			</view>
+			<view v-for="(item,index) in 1" class="historyLIneBox">
+				<view class="historyLIne" @click="goSearch('16176RTA004')">16176RTA004</view>
+			</view>
+
+		</view>
+
+
+		<view @click="goCarModelList(item.partsnum)" class="commentBox" v-for="(item,index) in itemList" :key="index">
+
+			<view class="name">{{item.description}}</view>
+			<view class="comment">{{item.brands}}</view>
+			<view class="code">{{inputValue}}</view>
+		</view>
+
+
+	</view>
+</template>
+
+<script>
+	export default {
+		components: {
+
+		},
+
+		data() {
+			return {
+				inputValue: '',
+				tabIndex: 0,
+
+				historyList: [],
+				itemData: {},
+				itemList: [],
+				brandList: [],
+				brand: '',
+				epc_id: '',
+				vin: '',
+				token: '',
+				param: '',
+				access_time: '',
+				page: 1,
+				total_page: 1,
+				om:'',
+			}
+		},
+		onLoad(opt) {
+			console.log('opt+', opt);
+			this.om = opt.om;
+			this.inputValue=opt.om
+			this.find()
+
+		},
+		methods: {
+			search() {
+				if (!this.inputValue) return;
+				//console.log(this.inputValue);
+				this.$emit('search', this.inputValue);
+				this.page = 1;
+				this.find();
+			},
+			clear() {
+				this.inputValue = ''
+				this.$emit('search', '');
+			},
+			goCarModelList(partnum) {
+				uni.navigateTo({
+					url: 'OEDetail?partnum=' + partnum
+				})
+			},
+			tabClick(num) {
+				this.tabIndex = num;
+			},
+			
+			goSearch(str) {
+				this.inputValue = str
+				this.page = 1;
+				this.getItemData();
+			},
+			// 配件查询
+			find() {
+				uni.showLoading({
+					title: '加载中'
+				});
+				this.$http('advancedEpc/parts/find', {
+					partsnums: this.inputValue,
+				}, 'GET').then(res => {
+					uni.hideLoading();
+                    if (res.data.number == 200 || res.data.number == 5212) {
+                    	this.itemList=res.data.result
+                    				
+                    } else {
+                    	uni.showToast({
+                    		title: res.data.message,
+                    		icon: 'none',
+                    		duration: 3000
+                    	});
+                    }
+					
+
+
+				});
+			},
+
+		},
+		// 下拉刷新 上拉加载更多
+		onPullDownRefresh() {
+			// this.page = 1
+			// this.getItemData()
+			setTimeout(function() {
+				uni.stopPullDownRefresh();
+			}, 1000);
+		},
+		onReachBottom() {
+			if (this.page <= this.total_page) {
+				this.page++;
+
+				this.getItemData()
+			}
+		}
+	}
+</script>
+
+<style>
+	.box {
+		min-height: 100vh;
+		background: #FFFFFF;
+		padding-bottom: constant(safe-area-inset-bottom);
+		padding-bottom: env(safe-area-inset-bottom);
+	}
+
+	.brand {
+
+		background: linear-gradient(110deg, #48B9F9 0%, #3F90F7 100%);
+		padding: 24rpx;
+		color: #FFFFFF;
+		font-size: 28rpx;
+	}
+
+	.tab {
+		background: #FFFFFF;
+		display: flex;
+		justify-content: space-around;
+		line-height: 87rpx;
+		/* position: fixed; */
+		width: calc(100vw - 100rpx);
+		padding-left: 50rpx;
+		padding-right: 50rpx;
+		height: 87rpx;
+		/* z-index: 11; */
+	}
+
+	.tabLine {
+
+		font-size: 32rpx;
+		color: #999999;
+		text-align: center;
+	}
+
+	.tabActive {
+		color: #3F90F7;
+		font-weight: bold;
+		border-bottom: 4rpx solid #3F90F7;
+
+	}
+
+	.searchBoxBg {
+
+		width: 100%;
+		background-color: #FFFFFF;
+		border-top: 1rpx solid #EEEEEE;
+		border-bottom: 1rpx solid #EEEEEE;
+	}
+
+	.searchBox {
+		height: 72rpx;
+		margin: 24rpx;
+		background-color: #F4F5F7;
+		border-radius: 36rpx;
+		display: flex;
+		position: relative;
+	}
+
+	.searchImg {
+		margin-top: 20rpx;
+		margin-left: 20rpx;
+		width: 32rpx;
+		height: 32rpx;
+	}
+
+	.searchInput {
+		height: 72rpx;
+		font-size: 28rpx;
+		padding-left: 16rpx;
+		width: 78%;
+	}
+
+	.searchClose {
+		position: absolute;
+		width: 36rpx;
+		height: 36rpx;
+		right: 36rpx;
+		top: 20rpx;
+
+	}
+
+	.history {
+		padding: 24rpx;
+	}
+
+	.historyTop {
+		display: flex;
+		justify-content: space-between;
+	}
+
+	.historyDelImg {
+		width: 34rpx;
+		height: 34rpx;
+	}
+
+	.historyTopTxt {
+		font-size: 28rpx;
+		font-weight: 400;
+		color: #666666;
+		line-height: 34rpx;
+	}
+
+	.historyLIneBox {
+		display: inline-flex;
+
+		flex-wrap: wrap;
+	}
+
+	.historyLIne {
+		color: #333333;
+		font-size: 24rpx;
+		height: 64rpx;
+		background: #F4F5F7;
+		border-radius: 32rpx;
+		line-height: 64rpx;
+		padding: 0 24rpx;
+		margin-top: 20rpx;
+		margin-right: 24rpx;
+	}
+
+	.commentBox {
+
+		padding: 20rpx 24rpx;
+		border-bottom: 1rpx solid #EEEEEE;
+	}
+
+
+
+	.name {
+		color: #333333;
+		font-size: 26rpx;
+		font-weight: bold;
+		padding-top: 16rpx;
+		padding-bottom: 10rpx;
+	}
+
+	.comment {
+		color: #999999;
+		font-size: 24rpx;
+		padding-bottom: 14rpx;
+	}
+
+
+
+	.code {
+		color: #3F90F7;
+		font-size: 24rpx;
+	}
+</style>

+ 6 - 1
pages/mobile/homePage.vue

@@ -38,7 +38,7 @@
 			
 			<image class="title" src="../../static/img/text_zhongjian.png" mode=""></image>
 			
-			<image class="content" src="../../static/img/text_shuoming.png" mode=""></image>
+			<image class="content" @click="goOe" src="../../static/img/text_shuoming.png" mode=""></image>
 			
 			
 		</view>
@@ -72,6 +72,11 @@
 				this.searchValue = val
 			
 			},
+			goOe(){
+				uni.navigateTo({
+					url: 'oeindex'
+				})
+			},
 			goIndex() {
 				uni.navigateTo({
 					url: 'index'

+ 5 - 4
pages/mobile/modelTwo.vue

@@ -61,7 +61,7 @@
 				<view class="lineRIght">
 					<view class="lineName">{{item.caption}}</view>
 					<view class="lineBm">{{item.code}}</view>
-					<view class="linejs">{{item.remark}}</view>
+					<view class="linejs" v-html="item.remark"></view>
 				</view>
 
 
@@ -158,7 +158,8 @@
 					vin: this.vin,
 					access_time: this.access_time,
 					param: this.param,
-					token: this.token
+					token: this.token,
+					 epc_id:this.epc_id,
 
 				}, 'GET').then(res => {
 					uni.hideLoading();
@@ -191,8 +192,8 @@
 					vin: this.vin,
 					access_time: this.access_time,
 					param: this.param,
-					token: this.token
-
+					token: this.token,
+                     epc_id:this.epc_id,
 				}, 'GET').then(res => {
 					uni.hideLoading();
 					//console.log(res.data.number);

+ 158 - 0
pages/mobile/oeindex.vue

@@ -0,0 +1,158 @@
+<template>
+	<view class="content">
+		<view class="top">
+			<view class="inputBox">
+				<img src="../../static/img/icon_search.png" alt="" class="searchImg">
+				<input v-model="om" type="text" placeholder="OE/品牌号" class="topInput" @confirm="inputconfirm">
+				<image src="../../static/img/icon_close.png" class="searchClose" v-if="vin!=''"
+					@click="clear"></image>
+				<!-- <image src="../../static/img/icon_camera.png" mode="" class="cameraImg"></image> -->
+			</view>
+		</view>
+		<view class="history">
+			<view class="historyTop">
+				<view class="historyTopTxt">历史搜索</view>
+				<!-- <image src="../../static/img/icon_delete.png" mode="" class="historyDelImg"></image> -->
+			</view>
+			<view v-for="(item,index) in 1" class="historyLIneBox">
+				<view class="historyLIne" @click="gogroup2('16176RTA004')">16176RTA004</view>
+			</view>
+			
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				om: ''
+			}
+		},
+		onLoad() {
+           
+		},
+		methods: {
+			clear(){
+				this.om = ''
+				this.$emit('search','');
+			},
+			inputconfirm(){
+				console.log(this.om)
+				// if (this.vin.length != 17) {
+				// 	uni.showToast({
+				// 		title: '请输入正确VIN',
+				// 		icon: 'none',
+				// 		duration: 3000
+				// 	});
+				// 	return;
+				// }
+				
+				this.$http('advancedEpc/parts/find', {
+					partsnums: this.om,
+				}, 'GET').then(res => {
+					/* uni.hideLoading(); */
+					//console.log(res.data.number);
+					if (res.data.number == 200 || res.data.number == 5212) {
+						this.gogroup()
+				
+					} else {
+						uni.showToast({
+							title: res.data.message,
+							icon: 'none',
+							duration: 3000
+						});
+					}
+				
+				});
+			},
+            gogroup(){
+				uni.navigateTo({
+					url:'OESearch?om='+this.om
+				})
+			},
+			gogroup2(om){
+				uni.navigateTo({
+					url:'OESearch?om='+om
+				})
+			}
+		}
+	}
+</script>
+
+<style scoped>
+	.comment{
+		padding-bottom: constant(safe-area-inset-bottom);
+		padding-bottom: env(safe-area-inset-bottom);
+	}
+	.top{
+		height: 96rpx;
+		border-bottom: 1px solid #EEEEEE;
+		padding-top: 24rpx;
+	}
+	.searchImg{
+		width: 40rpx;
+		height: 40rpx;
+		margin-top: 16rpx;
+		margin-left: 20rpx;
+	}
+	.inputBox{
+		width: 702rpx;
+		height: 72rpx;
+		background: #F4F5F7;
+		border-radius: 36rpx;
+		margin-left: 24rpx;
+		display:flex;
+		position: relative;
+	}
+	.topInput{
+		font-size: 28rpx;
+		height: 72rpx;
+		line-height: 72rpx;
+		padding-left: 16rpx;
+		width: 500rpx;
+	}
+	.searchClose {
+		position: absolute;
+		width: 36rpx;
+		height: 36rpx;
+		right: 36rpx;
+		top: 20rpx;
+	
+	}
+	.cameraImg{
+		position: absolute;
+		width: 40rpx;
+		height: 40rpx;
+		top: 16rpx;
+		right: 20rpx;
+	}
+	.history{
+		padding: 24rpx;
+	}
+	.historyTop{
+		display: flex;
+		justify-content: space-between;
+	}
+	.historyDelImg{
+		width: 34rpx;height: 34rpx;
+	}
+	.historyTopTxt{
+		font-size: 28rpx;
+		font-weight: 400;
+		color: #666666;
+		line-height: 34rpx;
+	}
+	.historyLIne{
+		color: #333333;font-size: 24rpx;
+		height: 64rpx;
+		background: #F4F5F7;
+		border-radius: 32rpx;
+		line-height: 64rpx;
+		padding: 0 24rpx;
+		margin-top: 20rpx;
+	}
+	.historyLIneBox{
+		display: flex;
+	}
+</style>