gcz 4 lat temu
rodzic
commit
2865df2221

+ 3 - 0
common/apiurl.js

@@ -9,6 +9,9 @@ const apiurl = {
 	entranceUrl:'/orderinfo/entranceIn',
 	//车辆出场
 	getOutUrl:'/orderinfo/entranceOut',
+	
+	//车辆出场
+	baiduOcrUrl:'/file/baidu/ocr',
 
 }
 

+ 3 - 1
common/config.js

@@ -1,7 +1,9 @@
+const host = 'http://172.16.90.64:7000';
 const config = {
 	wxAppid:'wxbe90cc7c5233dd84',// wxAppid 
 	// baseUrl:'http://wx.hw.hongweisoft.com/parking/client',//64
-	baseUrl:'http://172.16.90.64:7000/payee',//殷登顺
+	baseUrl:`${host}/payee`,//殷登顺
+	fileUrl:`${host}/file`,
 	
 	
 	//登录链接

+ 4 - 1
common/http.api.js

@@ -15,13 +15,16 @@ const install = (Vue, vm) => {
 	
 	let getIndex = (params = {}) => vm.$u.post(apiurl.getIndexUrl, params);	
 	
+	let baiduOcr = (params = {}) => vm.$u.post(apiurl.baiduOcrUrl, params);	
+	
 	// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
 	vm.$u.api = {
 		login,
 		getRoadspace,
 		entrance,
 		getOut,
-		getIndex
+		getIndex,
+		baiduOcr
 	};
 }
 

+ 51 - 1
pages/getcarno/getcarno.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<view class="taking-pictures">
+		<view class="taking-pictures" @click="getPic">
 			
 		</view>
 		<view class="wrap">
@@ -26,6 +26,7 @@
 				keyboardshow:false,
 				newPlateNumber:'',
 				spaceId:'',
+				vehicleClor:''
 			}
 		},
 		onLoad(){
@@ -35,6 +36,55 @@
 			
 		},
 		methods:{
+			getPic(){
+				let that = this;
+				uni.chooseImage({
+					count: 1, //默认9
+					sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
+					sourceType: ['camera'], //
+					success: function (res) {
+						// console.log('img',res)
+						uni.showLoading({});
+						const tempFilePaths = res.tempFilePaths;
+						// 若多选,需循环调用uni.uploadFile ,因微信小程序只支持单文件上传
+						uni.uploadFile({
+							url: `${that.config.fileUrl}/baidu/ocr`,
+							filePath: tempFilePaths[0],
+							name: 'file',
+							formData: {
+								'test': 'test'  // 上传附带参数
+							},
+							success: (res) => {
+								// 根据接口具体返回格式   赋值具体对应url
+								// alert(uploadFileRes.data);
+								let resobj=eval("("+res.data+")");
+								uni.hideLoading();
+								if(resobj.code==200){
+									console.log(resobj);
+									that.newPlateNumber = resobj.data.vehicleNo;
+									that.vehicleClor = resobj.data.vehicleClor;
+								}else{
+									that.$refs.uToast.show({
+										title: resobj.msg,
+										type: 'error'
+									});
+								}
+								
+								console.log(res);
+							},
+							fail: (err) => {
+								that.$refs.uToast.show({
+									title:err.msg,
+									type: 'error'
+								});
+								uni.hideLoading();
+							}
+						});
+					}
+				});
+					
+				
+			},
 			messageInputClick(){
 				this.keyboardshow = true;
 			},

+ 2 - 2
pages/getout/getout.vue

@@ -110,8 +110,8 @@
 			
 		},
 		filters:{			
-			timeago(val,currentTime){
-				var time_start = new Date(val);
+			timeago(inTime,currentTime){
+				var time_start = new Date(inTime.replace(/-/g,'/'));
 				var clock_start = time_start.getTime();
 				// console.log('currentTime',this.currentTime)
 				

+ 16 - 14
pages/index/index.scss

@@ -22,20 +22,22 @@
 	box-shadow: 0px 9rpx 8rpx 0px rgba(0, 0, 0, 0.07);
 	border-radius: 15rpx;
 }
-
-.feature-list .feature-item{
-	width: 30%;
-	margin-bottom: 34rpx;
-	display: flex;
-	justify-content: center;
-	flex-wrap: wrap;
-	.feature-item-text{
-		margin-top: 8rpx;
-		width: 100%;
-		text-align: center;
-		font-size: 30rpx;
-		line-height: 42rpx;
-		color: #444;
+.feature-list{
+	margin-top: 50rpx;
+	.feature-item{
+		width: 30%;
+		margin-bottom: 34rpx;
+		display: flex;
+		justify-content: center;
+		flex-wrap: wrap;
+		.feature-item-text{
+			margin-top: 8rpx;
+			width: 100%;
+			text-align: center;
+			font-size: 30rpx;
+			line-height: 42rpx;
+			color: #444;
+		}
 	}
 }
 

+ 2 - 0
pages/index/index.vue

@@ -127,6 +127,8 @@
 				this.$u.vuex('vuex_user', null);
 				this.$u.vuex('vuex_hasLogin', false);
 				this.userInfo = [];
+				this.theRoad = [];
+				// this.$u.route(-1);
 			},
 			handleGetIndex(roadNo){
 				this.$u.api.getIndex({roadNo:roadNo})

+ 2 - 2
pages/login/login.vue

@@ -29,8 +29,8 @@
 				pic:'https://uviewui.com/common/logo.png',
 				userInfo:[],
 				form:{
-					name:'',
-					password:'',
+					name:'13567532565',
+					password:'000000',
 					passCheck:false
 				},
 				

+ 1 - 0
uview-ui/components/u-bottom/u-bottom.vue

@@ -28,6 +28,7 @@
 <style lang="scss" >
 	.bottom-wrap{
 		text-align: center;
+		height: 200rpx;
 		.bottom{
 			position: fixed;
 			left: 0;