twt 1 mês atrás
pai
commit
b8db9e2243

+ 8 - 5
common/request.js

@@ -5,14 +5,17 @@ console.log(getHashQuery('url'))
 if(getHashQuery('url')){
 	var baseUrl =url
 }else{
- var baseUrl = 'http://api.dms.66km.com.cn/'	
- //  var baseUrl = 'http://192.168.1.25:20012/'
+  //var baseUrl = 'http://api.dms.66km.com.cn/'	
+  // var baseUrl = 'http://192.168.1.25:20012/'
+ var baseUrl = 'http://testmanageapi.66km.cn/'
+   
 }
 
 const burl2=url 
 //baseUrl = 'http://crm.eurorepar.cn/'
 import md5 from './MD5.js'
 var token=getHashQuery('token')
+ token = decodeURIComponent(token).replace(/[\r\n]/g, '').trim()
 console.log(token)
 var uid=getHashQuery('uid')
 console.log(uid)
@@ -23,9 +26,9 @@ const http = (url = '', date = {}, type = 'POST', header = {
 		header={};
 		
 		if(token){
-			header['accessToken']=token;
-			//header['token']=token;
-			header['uid']=uid; 
+			//header['accessToken']=token;
+			header['token']=token;
+			//header['uid']=uid; 
 		}else{
 			header['accessToken']='';
 			header['uid']=''; 

+ 7 - 5
pages.json

@@ -35,7 +35,7 @@
 		{
 			"path": "pages/mobile/group",
 			"style": {
-
+               // "navigationBarTitleText": "车型件1"
 				"navigationStyle": "custom"
 			}
 		},
@@ -88,8 +88,9 @@
 		}, {
 			"path": "pages/mobile/SelectCarModel",
 			"style": {
-				"navigationBarTitleText": "选择品牌",
-				"enablePullDownRefresh": false
+				/* "navigationBarTitleText": "选择品牌",
+				"enablePullDownRefresh": false */
+				"navigationStyle": "custom"
 			}
 
 		}, {
@@ -102,8 +103,9 @@
 		}, {
 			"path": "pages/mobile/vinDetail",
 			"style": {
-				"navigationBarTitleText": "车型件",
-				"enablePullDownRefresh": true
+				/* "navigationBarTitleText": "车型件",
+				"enablePullDownRefresh": true */
+				"navigationStyle": "custom"
 			}
 		}
 

+ 81 - 2
pages/mobile/OemSearch.vue

@@ -1,5 +1,22 @@
 <template>
 	<view class="box">
+		<!-- 自定义导航 -->
+		<view class="zdyNavBox">
+			<view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
+			<view class="zdyNav">
+				<view class="zdyNavLeft">
+					<div @click="goback" class="uni-page-head-btn"><i class="uni-btn-icon"
+							style="color: rgb(0, 0, 0); font-size: 27px;"></i></div>
+		            <div class="goHomeBox" @click="goHome">
+		            	<image src="/static/img/home.png" mode="" class="goHomeImg"></image>
+		            </div>
+				</view>
+				<view class="zdyNavTitle"> OEM搜索 </view>
+				
+				<view  style="width: 120rpx;"></view>
+		
+			</view>
+		</view>
 		<view class="brand">当前品牌:{{brand}}</view>
 
 		<!-- <view class="tab">
@@ -61,7 +78,8 @@
 				param: '',
 				access_time: '',
 				page: 1,
-				total_page: 1
+				total_page: 1,
+				iStatusBarHeight: '',
 			}
 		},
 		onLoad(opt) {
@@ -72,9 +90,23 @@
 			this.token = opt.token;
 			this.param = opt.param;
 			this.access_time = opt.access_time;
-
+            this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 		},
 		methods: {
+			goback() {
+				console.log('返回');
+				uni.navigateBack({})
+				//window.history.back()
+			},
+			goHome(){
+				var token= uni.getStorageSync("token")
+				/* var encodedToken= uni.getStorageSync("encodedToken")
+				var token =  decodeURIComponent(encodedToken) */
+				//var token=getHashQuery('token')
+				var url = 'http://byweb.66km.cn/#/home?token='+token
+				//window.history.back()
+				window.location.href =url
+			},
 			search() {
 				if (!this.inputValue) return;
 				//console.log(this.inputValue);
@@ -307,4 +339,51 @@
 		color: #3F90F7;
 		font-size: 24rpx;
 	}
+	.zdyNavBox {
+		width: 100vw;
+		background: #FFFFFF;
+		position: fixed;
+		top: 0;
+		left: 0;
+		z-index: 9999999;
+	
+	}
+	
+	.zdyNav {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 14rpx 6rpx;
+	}
+	
+	.zdyNavLeft{
+			width: 120rpx;
+			display: flex;
+		}
+		.goHomeBox{
+			padding-left: 20rpx;
+			padding-top: 6rpx;
+		}
+	.goHomeImg{
+			width: 20px;
+			height: 20px;
+			
+		}
+	
+	.zdyNavTitle {
+		background: #FFFFFF;
+		text-align: center;
+		/* font-size: 32rpx; */
+		/* font-weight: bold; */
+		font-size: 18px!important;
+		color: #333333!important;
+	}
+	
+	.zdyNavRight {
+		background: #FFFFFF;
+		text-align: center;
+		font-size: 28rpx;
+		color: #3F90F7;
+		width: 120rpx;
+	}
 </style>

+ 72 - 3
pages/mobile/SelectCarModel.vue

@@ -1,6 +1,22 @@
 <template>
 	<view class="box">
+<!-- 自定义导航 -->
+		<view class="zdyNavBox">
+			<view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
+			<view class="zdyNav">
+				<view class="zdyNavLeft">
+					<div @click="goback" class="uni-page-head-btn"><i class="uni-btn-icon"
+							style="color: rgb(0, 0, 0); font-size: 27px;"></i></div>
+
+				</view>
+				<view class="zdyNavTitle">选择品牌</view>
+				
+				<view  style="width: 120rpx;"></view>
 
+			</view>
+		</view>
+		<view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
+		<view style="height: 44px;"></view>
 
 		<scroll-view class="scroll-view" :scroll-into-view="toView" scroll-y="true">
 			<view class="brand-select">
@@ -33,6 +49,7 @@
 
 
 <script>
+	import { getHashQuery } from '../../utils/index.js'
 	export default {
 		components: {
 
@@ -41,16 +58,27 @@
 			return {
 				brandList: [],
 				toView: '',
-				
-				
+				iStatusBarHeight: '',
+				token:'',
 
 			}
 		},
 		onLoad(opt) {
 			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 			this.getItemData();
+			var token=getHashQuery('token')
+			//var encodedToken = encodeURIComponent(token);
+			this.token=token
+			localStorage.setItem('token', token)
+			/* uni.setStorageSync('token',token ) 
+			uni.setStorageSync('encodedToken',encodedToken ) */
 		},
 		methods: {
+			goback() {
+				console.log('返回');
+				//uni.navigateBack({})
+				window.history.back()
+			},
 			//获取品牌
 			getItemData() {
 				let that = this
@@ -100,7 +128,7 @@
 				console.log(item)
 				
 				uni.navigateTo({
-					url:'SelectCarTwo?epc_id=' + item.epc_id + '&brand_name=' + item.brand
+					url:'SelectCarTwo?epc_id=' + item.epc_id + '&brand_name=' + item.brand+'&token='+this.token
 				})
 				
 			},
@@ -427,4 +455,45 @@
 	.brand-select-titleselect {
 		color: #FF4F00 !important;
 	}
+	
+	.zdyNavBox {
+		width: 100vw;
+		background: #FFFFFF;
+		position: fixed;
+		top: 0;
+		left: 0;
+		z-index: 9999999;
+	
+	}
+	
+	.zdyNav {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 14rpx 6rpx;
+	}
+	
+	.zdyNavLeft {
+		width: 120rpx;
+	}
+	
+	.zdyNavTitle {
+		background: #FFFFFF;
+		text-align: center;
+		/* font-size: 32rpx; */
+		/* font-weight: bold; */
+		font-size: 18px!important;
+		color: #333333!important;
+	}
+	
+	.zdyNavRight {
+		background: #FFFFFF;
+		text-align: center;
+		font-size: 28rpx;
+		color: #3F90F7;
+		width: 120rpx;
+	}
+	
+	
+	
 </style>

+ 30 - 5
pages/mobile/SelectCarTwo.vue

@@ -6,7 +6,10 @@
 			<view class="zdyNav">
 				<view class="zdyNavLeft">
 					<div @click="goback" class="uni-page-head-btn"><i class="uni-btn-icon"
-							style="color: rgb(0, 0, 0); font-size: 27px;"></i></div>
+							style="color: rgb(0, 0, 0); font-size: 27px;"></i></div>
+					<div class="goHomeBox" @click="goHome">
+						<image src="/static/img/home.png" mode="" class="goHomeImg"></image>
+					</div>		
 					
 				</view>
 				<view class="zdyNavTitle">车型</view>
@@ -46,6 +49,7 @@
 </template>
 
 <script>
+	import { getHashQuery } from '../../utils/index.js'
 	export default {
 		
 		data() {
@@ -74,6 +78,7 @@
 			this.title = opt.brand_name;
 			this.modelname = opt.brand_name;
 			this.getItemData();
+			
 		},
 		methods: {
 			goNext(item) {
@@ -166,6 +171,15 @@
 				uni.navigateBack({})
 				
 			},
+			goHome(){
+				var token= uni.getStorageSync("token")
+				/* var encodedToken= uni.getStorageSync("encodedToken")
+				var token =  decodeURIComponent(encodedToken) */
+				//var token=getHashQuery('token')
+				var url = 'http://byweb.66km.cn/#/home?token='+token
+				//window.history.back()
+				window.location.href =url
+			}
 		}
 	}
 </script>
@@ -195,14 +209,25 @@
 		padding: 14rpx 6rpx;
 	}
 	.zdyNavLeft{
-		width: 120rpx;
+		width: 120rpx;
+		display: flex;
+	}
+	.goHomeBox{
+		padding-left: 20rpx;
+		padding-top: 6rpx;
+	}
+.goHomeImg{
+		width: 20px;
+		height: 20px;
+		
 	}
-
 	.zdyNavTitle {
 		background: #FFFFFF;
 		text-align: center;
-		font-size: 32rpx;
-		font-weight: bold;
+		/* font-size: 32rpx; */
+		/* font-weight: bold; */
+		font-size: 18px!important;
+		color: #333333!important;
 	}
 
 	.zdyNavRight {

+ 27 - 7
pages/mobile/group.vue

@@ -8,7 +8,9 @@
 				<view class="zdyNavLeft">
 					<div @click="goback" class="uni-page-head-btn"><i class="uni-btn-icon"
 							style="color: rgb(0, 0, 0); font-size: 27px;"></i></div>
-
+                    <div class="goHomeBox" @click="goHome">
+                    	<image src="/static/img/home.png" mode="" class="goHomeImg"></image>
+                    </div>
 				</view>
 				<view class="zdyNavTitle">车型件</view>
 				<view v-if="param.length != 0" class="zdyNavRight" @click="goOemSearch()">OEM搜索</view>
@@ -290,7 +292,13 @@
 			},
 			goback() {
 				console.log('返回');
-				uni.navigateBack({})
+				//uni.navigateBack({})
+				window.history.back()
+			},
+			goHome(){
+				var token= uni.getStorageSync("token")
+				var url = 'http://byweb.66km.cn/#/home?token='+token
+				window.location.href =url
 			},
 			goTwo(item) {
 				var that = this;
@@ -344,15 +352,27 @@
 		padding: 14rpx 6rpx;
 	}
 
-	.zdyNavLeft {
-		width: 120rpx;
-	}
+	.zdyNavLeft{
+			width: 120rpx;
+			display: flex;
+		}
+		.goHomeBox{
+			padding-left: 20rpx;
+			padding-top: 6rpx;
+		}
+	.goHomeImg{
+			width: 20px;
+			height: 20px;
+			
+		}
 
 	.zdyNavTitle {
 		background: #FFFFFF;
 		text-align: center;
-		font-size: 32rpx;
-		font-weight: bold;
+		/* font-size: 32rpx; */
+		/* font-weight: bold; */
+		font-size: 18px!important;
+		color: #333333!important;
 	}
 
 	.zdyNavRight {

+ 5 - 2
pages/mobile/homePage.vue

@@ -71,7 +71,8 @@
 	</view>
 </template>
 
-<script>
+<script>
+	import { getHashQuery } from '../../utils/index.js'
 	import searchBox from '@/components/searchBox/searchBox.vue'
 	export default {
 		components: {
@@ -94,7 +95,9 @@
 				})
 			}
 			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
-
+            var token=getHashQuery('token')
+			console.log(token)
+			uni.setStorageSync('token',token ) 
 		},
 		methods: {
 			search(val) {

+ 25 - 6
pages/mobile/modelTwo.vue

@@ -7,7 +7,9 @@
 				<view class="zdyNavLeft">
 					<div @click="goback" class="uni-page-head-btn"><i class="uni-btn-icon"
 							style="color: rgb(0, 0, 0); font-size: 27px;"></i></div>
-					
+					<div class="goHomeBox" @click="goHome">
+						<image src="/static/img/home.png" mode="" class="goHomeImg"></image>
+					</div>
 				</view>
 				<view class="zdyNavTitle">车型件</view>
 				<view v-if="param.length != 0" class="zdyNavRight" @click="goOemSearch()">OEM搜索</view>
@@ -140,6 +142,11 @@
 				console.log('返回');
 				uni.navigateBack({})
 			},
+			goHome(){
+				var token= uni.getStorageSync("token")
+				var url = 'http://byweb.66km.cn/#/home?token='+token
+				window.location.href =url
+			},
 			restrainClickOne(item) {
 				this.param = item.param;
 				this.token = item.token;
@@ -386,15 +393,27 @@
 		align-items: center;
 		padding: 14rpx 6rpx;
 	}
-	.zdyNavLeft{
-		width: 120rpx;
-	}
+	.zdyNavLeft{
+			width: 120rpx;
+			display: flex;
+		}
+		.goHomeBox{
+			padding-left: 20rpx;
+			padding-top: 6rpx;
+		}
+	.goHomeImg{
+			width: 20px;
+			height: 20px;
+			
+		}
 	
 	.zdyNavTitle {
 		background: #FFFFFF;
 		text-align: center;
-		font-size: 32rpx;
-		font-weight: bold;
+		/* font-size: 32rpx; */
+		/* font-weight: bold; */
+		font-size: 18px!important;
+		color: #333333!important;
 	}
 	
 	.zdyNavRight {

+ 77 - 1
pages/mobile/vinDetail.vue

@@ -1,5 +1,23 @@
 <template>
 	<view class="content">
+		<view class="zdyNavBox">
+			<view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
+			<view class="zdyNav">
+				<view class="zdyNavLeft">
+					<div @click="goback" class="uni-page-head-btn"><i class="uni-btn-icon"
+							style="color: rgb(0, 0, 0); font-size: 27px;"></i></div>
+					<div class="goHomeBox" @click="goHome">
+						<image src="/static/img/home.png" mode="" class="goHomeImg"></image>
+					</div>
+				</view>
+				<view class="zdyNavTitle">车型件</view>
+				<view  style="width: 120rpx;"></view>
+		
+			</view>
+		</view>
+		
+		<view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
+		<view style="height: 44px;"></view>
 		<view class="top">
 			
 			<!-- 轮播图 -->
@@ -77,6 +95,7 @@
 				total_page: 1,
 				epc_id:'',
 				loading:false,
+				iStatusBarHeight:'',
 			}
 		},
 		onLoad(opt) {
@@ -89,10 +108,20 @@
 			this.access_time = opt.access_time;
 			this.epc_id=opt.epc_id
 			this.getItemData();
-
+            this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 
 		},
 		methods: {
+			goback() {
+				console.log('返回');
+				uni.navigateBack({})
+				//window.history.back()
+			},
+			goHome(){
+				var token= uni.getStorageSync("token")
+				var url = 'http://byweb.66km.cn/#/home?token='+token
+				window.location.href =url
+			},
 			upGroup() {
 				this.tabIndex -= 1;
 				if (this.tabIndex <= 0) {
@@ -307,4 +336,51 @@
 		color: #FF4F00;
 		font-weight: bold;
 	}
+	.zdyNavBox {
+		width: 100vw;
+		background: #FFFFFF;
+		position: fixed;
+		top: 0;
+		left: 0;
+		z-index: 9999999;
+	
+	}
+	
+	.zdyNav {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 14rpx 6rpx;
+	}
+	
+	.zdyNavLeft{
+			width: 120rpx;
+			display: flex;
+		}
+		.goHomeBox{
+			padding-left: 20rpx;
+			padding-top: 6rpx;
+		}
+	.goHomeImg{
+			width: 20px;
+			height: 20px;
+			
+		}
+	
+	.zdyNavTitle {
+		background: #FFFFFF;
+		text-align: center;
+		/* font-size: 32rpx; */
+		/* font-weight: bold; */
+		font-size: 18px!important;
+		color: #333333!important;
+	}
+	
+	.zdyNavRight {
+		background: #FFFFFF;
+		text-align: center;
+		font-size: 28rpx;
+		color: #3F90F7;
+		width: 120rpx;
+	}
 </style>

BIN
static/img/home.png


+ 8 - 1
utils/index.js

@@ -154,7 +154,7 @@ export const deepObjectMerge = function(FirstOBJ, SecondOBJ) {
 }
 
 export function getHashQuery (query) {
-  if (location.hash.indexOf(query) > -1) {
+ if (location.hash.indexOf(query) > -1) {
     let cur = location.hash.slice(location.hash.indexOf(query) + query.length + 1, location.hash.length)
     if (cur.indexOf('&') > -1) {
       return cur.slice(0, cur.indexOf('&'))
@@ -163,5 +163,12 @@ export function getHashQuery (query) {
     }
   } else {
     return false
+  } 
+ /* var query = window.location.hash.substring(window.location.hash.indexOf('?') + 1)
+  var vars = query.split('&')
+  for (var i = 0; i < vars.length; i++) {
+    var pair = vars[i].split('=')
+    if (pair[0] == variable) { return pair[1] }
   }
+  return (false) */
 }