tianhui 3 years ago
parent
commit
9295d1fcb7
3 changed files with 21 additions and 18 deletions
  1. 3 0
      common/http.interceptor.js
  2. 17 17
      pages/getin/getin.vue
  3. 1 1
      pages/getout/getout.vue

+ 3 - 0
common/http.interceptor.js

@@ -55,6 +55,9 @@ const install = (Vue, vm) => {
 			// console.log('location.href',location);
 			alert('还未登录,即将跳转登录');
 			setTimeout(()=>{location.href = location.origin+'/#/pages/login/login';});
+			// uni.reLaunch({
+			//     url: location.origin+'/#/pages/login/login'
+			// });
 		}else return false;
 	}
 }

+ 17 - 17
pages/getin/getin.vue

@@ -83,7 +83,7 @@
 	export default {
 		data() {
 			return {
-				carImg:'/static/img/default-car.png',
+				carImg:'',
 				uploadAction:config.baseUrl+'/file/tencent/upload',
 				spaceId:'',
 				spaceName:'',
@@ -210,22 +210,22 @@
 				});
 			},
 			getPic(){
-				// let that = this;
-				// ocr.ocrVehicleNo((ret) => {
-				// 	if (ret.success){
-				// 		that.vehicleNo = ret.vehicleNo;
-				// 		that.carImg = 'data:image/png;base64,' + ret.imageBase64;
-				// 		this.$u.api.tencentBase64Upload({
-				// 			base64: ret.imageBase64,
-				// 			suffix: 'png'
-				// 		})
-				// 		.then(res=>{
-				// 				that.vehicleImage =  res.data.url;
-				// 		}).catch(err=>{});
-				// 	}else {
-				// 		plus.nativeUI.toast('识别失败');
-				// 	}
-				// });
+				let that = this;
+				ocr.ocrVehicleNo((ret) => {
+					if (ret.success){
+						that.vehicleNo = ret.vehicleNo;
+						that.carImg = 'data:image/png;base64,' + ret.imageBase64;
+						this.$u.api.tencentBase64Upload({
+							base64: ret.imageBase64,
+							suffix: 'png'
+						})
+						.then(res=>{
+								that.vehicleImage =  res.data.url;
+						}).catch(err=>{});
+					}else {
+						plus.nativeUI.toast('识别失败');
+					}
+				});
 				
 				
 				// uni.chooseImage({

+ 1 - 1
pages/getout/getout.vue

@@ -8,7 +8,7 @@
 		 back-icon-color="#CCE8FF" 
 		 :background="{background: 'linear-gradient(145deg, #41AFF9 0%, #2D8CFB 100%)' }"></u-navbar>
 		<u-empty class="u-m-t-80" text="暂无停车" mode="data" v-if="roadspaceList.length == 0"></u-empty>
-		<view class="search"><u-search placeholder="请输入车位名称" v-model="roadspaceList.spaceName" shape="round" @search="spaceSearch()" @custom="spaceSearch()"></u-search></view>
+		<view class="search"><u-search placeholder="请输入车位名称"  v-model="roadspaceList.spaceName" shape="round" @search="spaceSearch()" @custom="spaceSearch()"></u-search></view>
 		<view class="roadspace-list wrap">
 			<view class="roadspace-list-item" :class="{used:item.placeStatus==1}" @click="roadspaceClick(item)" v-for="item in roadspaceList" :key="item.id">
 				<view class="block">