twt il y a 1 an
Parent
commit
5156144da1

+ 10 - 10
pages/index/carConfiguration.vue

@@ -7,43 +7,43 @@
 	  <view class="box">
 		  <view class="line">
 			  <view class="lineLeft">品牌</view>
-			  <view class="lineRight">宝马</view>
+			  <view class="lineRight">{{info.brand}}</view>
 		  </view>
 		  <view class="line">
 			  <view class="lineLeft">车型</view>
-			  <view class="lineRight">宝马 iX3 G08 电动</view>
+			  <view class="lineRight">{{info.carModel}}</view>
 		  </view>
 		  <view class="line">
 			  <view class="lineLeft">销售名称</view>
-			  <view class="lineRight">宝马 iX3 G08 电动</view>
+			  <view class="lineRight">{{info.salesName}}</view>
 		  </view>
 		  <view class="line">
 			  <view class="lineLeft">款型年份</view>
-			  <view class="lineRight">宝马 iX3 G08 电动</view>
+			  <view class="lineRight">{{info.listedYear}}</view>
 		  </view>
 		  <view class="line">
 			  <view class="lineLeft">生产年份</view>
-			  <view class="lineRight">宝马 iX3 G08 电动</view>
+			  <view class="lineRight">{{info.productionYear}}</view>
 		  </view>
 		  <view class="line">
 			  <view class="lineLeft">停产年份</view>
-			  <view class="lineRight">宝马 iX3 G08 电动</view>
+			  <view class="lineRight">{{info.discontinuationYear}}</view>
 		  </view>
 		  <view class="line">
 			  <view class="lineLeft">排量</view>
-			  <view class="lineRight">宝马 iX3 G08 电动</view>
+			  <view class="lineRight">{{info.brakeoilqty}}</view>
 		  </view>
 		  <view class="line">
 			  <view class="lineLeft">进气形式</view>
-			  <view class="lineRight">宝马 iX3 G08 电动</view>
+			  <view class="lineRight">{{info.intakeForm}}</view>
 		  </view>
 		  <view class="line">
 			  <view class="lineLeft">燃油类型</view>
-			  <view class="lineRight">宝马 iX3 G08 电动</view>
+			  <view class="lineRight">{{info.fuelLabeling}}</view>
 		  </view>
 		  <view class="line">
 			  <view class="lineLeft">发动机型号</view>
-			  <view class="lineRight">宝马 iX3 G08 电动</view>
+			  <view class="lineRight">{{info.engineDescription}}</view>
 		  </view>
 	  </view>
 	  

+ 20 - 4
pages/index/engineOil.vue

@@ -21,12 +21,12 @@
 			<view class="jiyouBox">
 				<view class="jiyouTop">
 					<view class="jiyoutopTitle">机油推荐</view>
-					<view class="jyzl">机油加注量:<span style="color: #FF4F00;">6.0L</span> </view>
+					<view class="jyzl">机油加注量:<span style="color: #FF4F00;">{{oilusage}}</span> </view>
 				</view>
 				<view class="jylineBox">
 					<view class="jyline" v-for="(item,index) in MaintainPartList" @click="godetail(item)">
 						<view class="jyimgBox">
-							<image :src="item.imgs" mode="" class="jyimg"></image>
+							<image :src="item.imgs.split(',')[0]" mode="" class="jyimg"></image>
 						</view>
 						<view class="jyName">
 							<!-- <span class="best">最佳</span> -->
@@ -53,13 +53,14 @@
 			return {
                optdata:'',
 			   MaintainPartList:[],
+			   oilusage:'',
 			}
 		},
 		onLoad(opt) {
 			  console.log(opt)
               this.optdata=opt;
 			  this.queryMaintainPartList()
-			 
+			  this.queryOilInfoByGroupID()
 		},
 		methods: {
              queryMaintainPartList(){
@@ -73,7 +74,22 @@
 				 	this.MaintainPartList=res.data
 				 })
 			 },
-			
+			 queryOilInfoByGroupID(){
+				 var that=this;
+				 this.$http('matchingByOpen/queryOilInfoByGroupID', {
+				  // mileage:'30000',
+				   groupId:this.optdata.id,
+				   
+				  },'POST').then(res => {
+				 		var arr = res.data
+						arr.forEach(item=>{
+							if(item[0]=='机油'){
+								that.oilusage=item[2]
+							}
+						})
+						console.log(that.oilusage)
+				 })
+			 },
 			 goby(){
 				 uni.navigateTo({
 				 	url:'/pages/index/maintenance?nLevelID='+this.optdata.nLevelID+'&id='+this.optdata.id

+ 1 - 1
pages/index/gearboxOil.vue

@@ -15,7 +15,7 @@
 				<view class="jylineBox">
 					<view class="jyline" v-for="(item,index) in MaintainPartList" @click="godetail(item)">
 						<view class="jyimgBox">
-							<image :src="item.imgs" mode="" class="jyimg"></image>
+							<image :src="item.imgs.split(',')[0]" mode="" class="jyimg"></image>
 						</view>
 						<view class="jyName">
 							<!-- <span class="best">最佳</span> -->

+ 6 - 1
pages/index/history.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="content">
 	  <view class="box">
-		  <view class="historyLine" v-for="(item,index) in historyList">
+		  <view class="historyLine" v-for="(item,index) in historyList" @click="goDetail(item)">
 		  	<image :src="item.logo" mode="" class="historylinecarImg"></image>
 		  	<view class="historylinecar">{{item.title}}</view>
 		  </view>
@@ -23,6 +23,11 @@
           this.queryHistory()
 		},
 		methods: {
+			goDetail(e){
+				uni.navigateTo({
+					url:'/pages/index/byItem?nLevelID='+e.nLevelID+'&logo='+e.logo+'&value='+e.title+'&id='+e.groupID
+				}) 
+			},
            queryHistory(){
 			 this.$http2('queryHistory', {
 			   

+ 8 - 3
pages/index/index.vue

@@ -21,7 +21,7 @@
 					<view class="historyTitle">历史查询</view>
 					<image src="../../static/img/icon_arrow.png" mode="" class="jiantouimg"></image>
 				</view>
-				<view class="historyLine" v-for="(item,index) in historyList" v-if="index<3">
+				<view class="historyLine" v-for="(item,index) in historyList" v-if="index<3" @click="gocarDetail(item)">
 					<image :src="item.logo" mode="" class="historylinecarImg"></image>
 					<view class="historylinecar">{{item.title}}</view>
 				</view>
@@ -108,6 +108,11 @@
 				 		this.historyList=res.data
 				 })
 			 },
+			 gocarDetail(e){
+				 uni.navigateTo({
+				 	url:'/pages/index/byItem?nLevelID='+e.nLevelID+'&logo='+e.logo+'&value='+e.title+'&id='+e.groupID
+				 })
+			 },
              gohistory(){
 				 uni.navigateTo({
 				 	url:'/pages/index/history'
@@ -120,7 +125,7 @@
 			 },
 			 stBtn(){
 				 var that = this;
-				 uni.showLoading({ title: '加载中'});
+				
 				 uni.chooseImage({
 				 	sourceType: ['album','camera'],
 				 	count:1, 
@@ -128,7 +133,7 @@
 				 		console.log(chooseImageRes)
 				 		const tempFilePaths = chooseImageRes.tempFilePaths;
 				 		this.fileURl=tempFilePaths[0]
-				 		
+				 		 uni.showLoading({ title: '加载中'});
 				 		 uni.uploadFile({
 				 	            url: that.$baseURL+'scanner?action=/vinByOpenApi/scanner', //仅为示例,非真实的接口地址
 				 	            filePath: tempFilePaths[0],

+ 58 - 6
utils/request.js

@@ -1,11 +1,11 @@
  //测试地址
-// const baseURL = 'http://192.168.0.149:7782/' 
- /*const burl2='http://api.dms.66km.com.cn/' */
+ //const baseURL = 'http://192.168.0.122:8002/' 
+const baseURL='http://oil.66km.com.cn/' 
 //66正式
 /* const baseURL = 'https://apidms.66km.com/' 
  const burl2='https://apidms.66km.com/' */
 //欧洲维修
- const baseURL = 'http://oil.66km.com.cn/' 
+ //const baseURL = 'http://oil.66km.com.cn/' 
 // const burl2='http://edms.eurorepar.cn/ ' 
 // import md5 from './MD5.js'
 
@@ -40,7 +40,14 @@ const http = (url = '', date = {}, type = 'POST', header = {
 }) => {
     return new Promise((resolve, reject) => {
 		header={};
-		const openId = uni.getStorageSync("openId");
+		
+		if(uni.getStorageSync("wxdata")){
+			//console.log(uni.getStorageSync("wxdata"))
+			var openId = uni.getStorageSync("wxdata").openid;
+		}else{
+			var openId = '';
+		}
+		
 		//console.log(that.$store)
 		//header['token']='98A9FED8814B457288166BDF623F33D1';
 		header['openId']=openId; 
@@ -55,6 +62,52 @@ const http = (url = '', date = {}, type = 'POST', header = {
         }).then((response) => {
             //console.log(response)
             //let [error, res] = response;
+			if(response.data.code!=0){
+				//console.log('??')
+				uni.showToast({
+				    title: response.data.msg,
+					 icon:'none',
+				     duration: 4000,
+				});
+			}
+		 resolve(response.data);
+           // resolve(res.data);
+        }).catch(error => {
+            let [err, res] = error;
+            reject(err)
+        }) 
+    });
+}
+const http2 = (url = '', date = {}, type = 'POST', header = {
+}) => {
+    return new Promise((resolve, reject) => {
+		header={};
+		if(uni.getStorageSync("wxdata")){
+			//console.log(uni.getStorageSync("wxdata"))
+			var openId = uni.getStorageSync("wxdata").openid;
+		}else{
+			var openId = '';
+		}
+		header['openId']=openId; 
+		header['Content-Type']='application/x-www-form-urlencoded';
+		//console.log(baseURL + url)
+        uni.request({
+            method: type,
+            url: baseURL + url,
+            data: date,
+            header: header,
+            dataType: 'json',         
+        }).then((response) => {
+            //console.log(response)
+            //let [error, res] = response;
+			if(response.data.code!=0){
+				//console.log('??')
+				uni.showToast({
+				    title: response.data.msg,
+					 icon:'none',
+				     duration: 4000,
+				});
+			}
 		 resolve(response.data);
            // resolve(res.data);
         }).catch(error => {
@@ -63,7 +116,6 @@ const http = (url = '', date = {}, type = 'POST', header = {
         }) 
     });
 }
-
 
 
 function refresh(url,date,type,header){
@@ -95,5 +147,5 @@ function refresh(url,date,type,header){
 }
 
 export default {
-	http,baseURL,ajax
+	http,baseURL,ajax,http2
 }