Browse Source

auto commit

gcz 3 years ago
parent
commit
7e8b300f09

+ 12 - 0
README.md

@@ -3,6 +3,18 @@
 `npm i tki-qrcode`
 [https://github.com/q310550690/uni-app-qrcode](https://github.com/q310550690/uni-app-qrcode)
 
+#### 语音播报使用
+ 1. `import speak from '@/utils/speaks.js';`
+ 2. `speak(this.orderVehicleNo);`
+
+#### 打印
+ 1. `let device = uni.requireNativePlugin("DeviceInfo");`
+ 2. `device.print(res.data.print);`
+
+#### ALog
+ 1. `let ALog = uni.requireNativePlugin("AndroidLog");`
+ 2. `ALog.info(res.data.msg);`
+
 #### H5调试,因为没有app方法,有些数据是写死的
 
 #### 安卓打包

+ 2 - 0
common/apiurl.js

@@ -35,6 +35,8 @@ const apiurl = {
 	parkInConfirmUrl:'/payee/orderinfo/parkIn/confirm',
 	//车辆入场信息
 	parkInInfoUrl:'/payee/memberinfo/parkIn/info',
+	//车主信息订单列表
+	vehicleListUrl:'/payee/orderinfo/vehicleList',
 	
 	//现金支付
 	cashPayUrl:'/payee/pay/cash',

+ 4 - 1
common/http.api.js

@@ -44,6 +44,8 @@ const install = (Vue, vm) => {
 	
 	let modifyRoad = (params = {}) => vm.$u.put(apiurl.modifyRoadUrl+params.roadId);
 	
+	let vehicleList = (params = {}) => vm.$u.get(apiurl.vehicleListUrl,params);
+	
 	// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
 	vm.$u.api = {
 		login,
@@ -65,7 +67,8 @@ const install = (Vue, vm) => {
 		printIn,
 		gzbankSwept,
 		gzbankPolypay,
-		modifyRoad
+		modifyRoad,
+		vehicleList
 	};
 }
 

+ 15 - 0
pages/getin/getin.vue

@@ -60,6 +60,11 @@
 
 <script>
 	import { config } from '@/common/config.js';
+	//#ifdef APP-PLUS
+	import speak from '@/utils/speaks.js';
+	let ALog = uni.requireNativePlugin("AndroidLog");
+	let device = uni.requireNativePlugin("DeviceInfo");
+	//#endif
 	export default {
 		data() {
 			return {
@@ -145,6 +150,10 @@
 						type: 'success',
 						url:'pages/getout/getout'
 					});
+					//#ifdef APP-PLUS
+					device.print(res.data.print);
+					speak(res.data.speak);
+					//#endif
 					console.log('entrance',res)
 				}).catch(err=>{
 					this.$refs.uToast.show({
@@ -167,6 +176,9 @@
 						type: 'success',
 						// url:'pages/getout/getout'
 					});
+					//#ifdef APP-PLUS
+					speak(this.vehicleNo);
+					//#endif
 					this.vehicleType = res?.data?.vehicleType??"0";
 					this.balance = res?.data?.balance;
 					console.log('parkInInfo',res);
@@ -206,6 +218,9 @@
 								uni.hideLoading();
 								if(resobj.code==200){
 									console.log(resobj);
+									//#ifdef APP-PLUS
+									speak(resobj.data.vehicleNo);
+									//#endif
 									that.vehicleNo = resobj.data.vehicleNo;
 									that.vehicleClor = resobj.data.vehicleClor;
 									that.vehicleImage =  resobj.data.url;

+ 9 - 7
pages/getout/getoutpage/getoutpage.vue

@@ -190,18 +190,20 @@
 			handleOut(res){
 				this.showOrderDetails = true;
 			},
-			payThis(){
+			async payThis(){
 				this.showOrderDetails = false;
 				this.showPayway = true;
 				this.payParams.orderList.push(this.leaveDetail.orderId);
+				await this.confirmOut();
 			},
-			payAll(){
+			async payAll(){
 				this.showOrderDetails = false;
 				this.showPayway = true;
 				this.payParams.orderList.push(this.leaveDetail.orderId);
 				this.leaveDetail.oweList.forEach(item=>{
 					this.payParams.orderList.push(item.orderId);
 				});
+				await this.confirmOut();
 			},
 			closePayway(){
 				this.showPayway = false;
@@ -280,11 +282,11 @@
 			confirmOut(){
 				this.$u.api.getOut({spaceId:this.orderID})
 				.then(res=>{
-					this.$refs.uToast.show({
-						title: res.msg,
-						type: 'success',
-						url:'pages/getout/getout'
-					});
+					// this.$refs.uToast.show({
+					// 	title: res.msg,
+					// 	type: 'success',
+					// 	url:'pages/getout/getout'
+					// });
 					console.log('getOut',res)
 				}).catch(err=>{
 					this.$refs.uToast.show({

+ 12 - 38
pages/ownersquery/ownersinfo/ownersinfo.vue

@@ -23,7 +23,9 @@
 				<view class="info-item">进场时间:{{item.inTime}}</view>
 				<view class="info-item">出场时间:{{item.outTime}}</view>
 				<view class="info-item">停车时长:{{item.duration}}</view>
-				<view class="info-item">欠费金额:<span class="amount">{{item.payAmount}}元</span></view>
+				<view class="info-item">收费员:{{item.payeeName}}</view>
+				<view class="info-item">支付金额:<span class="amount">{{item.payAmount}}元</span></view>
+				<view class="info-item">订单状态:{{item.orderStatus|filterOrderStatus}}</view>
 		 	</view>
 		 </view>
 		 </mescroll-body>
@@ -37,23 +39,21 @@
 		mixins: [MescrollMixin], // 使用mixin
 		data(){
 			return{
-				orderID:'',
+				vehicleNo:'',
 				listEmpty:false,
 				owelist:[],
 				pagination:Object.assign({}, {pageNo: 1,pageSize: 10}),
 			}
 		},
 		onLoad(page){
-			this.orderID = page.orderID;
-			console.log('this.orderID',this.orderID)
+			this.vehicleNo = page.vehicleNo;
+			console.log('this.vehicleNo',this.vehicleNo)
 		},
 		onShow(){
 			// this.owelist = [];
-			// this.handleEntranceOutDetail();
 		},
 		onReachBottom() {
 			// this.getData();
-			console.log('111')
 		},
 		methods:{
 			customBack(){
@@ -62,32 +62,6 @@
 					url: 'pages/index/index'
 				});
 			},
-			handleEntranceOutDetail(){
-				uni.showLoading({});
-				this.$u.api.entranceOutDetail({spaceId:this.orderID})
-				.then(res=>{
-					uni.hideLoading();
-					// this.$refs.uToast.show({
-					// 	title: res.msg,
-					// 	type: 'success',
-					// });
-					this.leaveDetail = res.data;
-					for (let item of res.data.oweList) {
-						this.owelist.push(item)
-					}
-					if(this.owelist.length<=0){this.listEmpty = true};
-				
-					console.log('entranceOutDetail',res)
-				}).catch(err=>{
-					uni.hideLoading();
-					this.$refs.uToast.show({
-						title: err.msg,
-						type: 'error',
-					});
-					console.log('entranceOutDetail ',err)
-				});
-				
-			},
 			downCallback(){
 				this.mescroll.resetUpScroll();
 			},
@@ -95,7 +69,7 @@
 				console.log('upCallback ',page);
 				let pageNum = page.num; // 页码, 默认从1开始
 				let pageSize = page.size; // 页长, 默认每页10条
-				this.$u.api.entranceOutDetail({spaceId:this.orderID})
+				this.$u.api.vehicleList({vehicleNo:this.vehicleNo,pageNum:pageNum,pageSize:pageSize})
 				.then(res=>{
 					// uni.hideLoading();
 					// this.$refs.uToast.show({
@@ -103,10 +77,10 @@
 					// 	type: 'success',
 					// });
 					//设置列表数据
-					let curPageData = res.data.oweList; 
+					let curPageData = res.data.rows; 
 					// 接口返回的当前页数据长度 (如列表有26个数据,当前页返回8个,则curPageLen=8)
 					let curPageLen = curPageData.length; 
-					let totalPage = res.data.totalPage; 
+					let totalPage = res.data.pages; 
 					
 					if(page.num == 1) this.owelist = []; //如果是第一页需手动置空列表
 					this.owelist = this.owelist.concat(curPageData); //追加新数据
@@ -116,19 +90,19 @@
 					this.mescroll.endByPage(curPageLen, totalPage);
 					
 					this.leaveDetail = res.data;
-					for (let item of res.data.oweList) {
+					for (let item of res.data.rows) {
 						this.owelist.push(item)
 					}
 					if(this.owelist.length<=0){this.listEmpty = true};
 				
-					console.log('entranceOutDetail',res)
+					console.log('vehicleList',res)
 				}).catch(err=>{
 					// uni.hideLoading();
 					this.$refs.uToast.show({
 						title: err.msg,
 						type: 'error',
 					});
-					console.log('entranceOutDetail ',err)
+					console.log('vehicleList ',err)
 				});
 				
 			}

+ 1 - 24
pages/ownersquery/ownersquery.vue

@@ -29,12 +29,10 @@
 			return{
 				keyboardshow:false,
 				newPlateNumber:'',
-				spaceId:'',
 				vehicleClor:''
 			}
 		},
 		onLoad(page){
-			this.spaceId = page.spaceId;
 			
 		},
 		methods:{
@@ -112,30 +110,9 @@
 				this.$u.route({
 					url: 'pages/ownersquery/ownersinfo/ownersinfo',
 					params: {
-						orderID: '1384702003287953409'
+						vehicleNo: this.newPlateNumber
 					}
 				});
-				return;
-				let param ={
-					spaceId:this.spaceId,
-					vehicleNo:this.newPlateNumber,
-				};
-				this.$u.api.parkInInfo(param)
-				.then(res=>{
-					this.$refs.uToast.show({
-						title: res.msg,
-						type: 'success',
-						// url:'pages/getout/getout'
-					});
-					console.log('parkInInfo',res)
-				}).catch(err=>{
-					this.$refs.uToast.show({
-						title: err.msg,
-						type: 'error',
-						// url:'pages/parking/parking'
-					});
-					console.log('parkInInfo ',err)
-				});
 			}
 			
 		}

+ 23 - 0
utils/filter.js

@@ -78,5 +78,28 @@ Vue.filter("filterCarType",function(item){
 	
 });
 
+Vue.filter("filterOrderStatus",function(status){
+	status = Number(status);
+	switch (status){
+		case 1:
+			return '停放中'
+			break;
+		case 2:
+			return '出场中'
+			break;
+		case 3:
+			return '欠费'
+			break;
+		case 4:
+			return '完成'
+			break;
+		default:
+			return '未知'
+			break;
+	}
+	
+});
+
+
 
 

+ 9 - 0
utils/speaks.js

@@ -0,0 +1,9 @@
+/*
+app 下才能使用
+speaks(this.orderVehicleNo);
+*/
+let speaker = uni.requireNativePlugin("SpeechPlug");
+function speak(msg){
+	speaker?.speakAction(msg)
+}
+export default speak