Browse Source

现金支付,出入场小票界面

tianhui 3 years ago
parent
commit
f1cbd3d422

+ 2 - 2
common/config.js

@@ -1,5 +1,5 @@
-// const host = 'https://wx.hw.hongweisoft.com/parking';//本地
-const host = 'https://parking.pdzhtc.com';//正式
+const host = 'https://wx.hw.hongweisoft.com/parking';//本地
+// const host = 'https://parking.pdzhtc.com';//正式
 // const host = 'http://172.16.90.64:7000';
 const config = {
 	wxAppid:'wxbe90cc7c5233dd84',// wxAppid 

+ 2 - 1
common/http.api.js

@@ -91,7 +91,8 @@ const install = (Vue, vm) => {
 		appveriosn,
 		lockControl,
 		lockList,
-		bindRoads
+		bindRoads,
+		cashPay
 	};
 }
 

+ 14 - 0
pages.json

@@ -109,6 +109,20 @@
 				"navigationStyle":"custom",// 隐藏系统导航栏
 				"navigationBarTitleText": "历史欠费"
 			}
+		},
+		{
+			"path": "pages/receipts/receiptsIn",
+			"style": {
+				"navigationStyle":"custom",// 隐藏系统导航栏
+				"navigationBarTitleText": "入场小票"
+			}
+		},
+		{
+			"path": "pages/receipts/receiptsOut",
+			"style": {
+				"navigationStyle":"custom",// 隐藏系统导航栏
+				"navigationBarTitleText": "出场小票"
+			}
 		}
 	],
 	"globalStyle": {

+ 1 - 1
pages/getout/getout.vue

@@ -28,7 +28,7 @@
 			<!-- <view class="bottom-btn" @click="jumpToMain()">返回主页</view> -->
 			<u-button class="bt1"  @click="last(list.pageNum)"><</u-button>
 			<view class="pagesInput">
-				<view class="pagesInput-left">第</view><u-input v-model="pageNum" type="text" :border="true" :clearable="false" /><view class="pagesInput-right">页</view></view>
+				<view class="pagesInput-left">第</view><u-input v-model="pageNum" type="text" :border="true" :clearable="false" placeholder=""/><view class="pagesInput-right">页</view></view>
 			<view class="num">
 			<u-button @click="jump(list.pageNum)" size="mini">跳转</u-button>
 			</view>

+ 6 - 0
pages/getout/getoutpage/getoutpage.scss

@@ -165,4 +165,10 @@
 		font-weight: 500;
 		color: #FFFFFF;
 	}
+}
+.popup-btn1{
+	padding: 68rpx 0rpx 0px 40rpx;
+}
+.popup-btn2{
+	padding: 68rpx 0rpx 0px 250rpx;
 }

+ 48 - 2
pages/getout/getoutpage/getoutpage.vue

@@ -58,7 +58,7 @@
 		<u-popup class="popup payway-popup" v-model="showPayway" :mask-close-able="false" mode="center" border-radius="20" width="90%">
 			<view class="popup-title">支付方式</view>
 			<view class="popup-body u-flex u-row-between">
-				<view class="payway-item"  @click="$refs.uToast.show({title: '暂不支持'})">
+				<view class="payway-item"  @click="cashPay()">
 					<u-image src="/static/img/payway-xj.png" width="143" height="143"></u-image>
 					<!-- <view class="icon-wrap">
 						<u-icon name="rmb-circle-fill" color="#FFC02D" size="66"></u-icon>
@@ -103,6 +103,16 @@
 			     />
 			<view class="qrcode-popup-btn" @click="hideQrcode">关闭</view>
 		</u-popup>
+		<u-popup class="popup cashPay-popup" v-model="showCash" :mask-close-able="false" mode="center" border-radius="20" width="90%">
+			<view class="popup-title">本次收到缴费</view>
+			<view class="popup-body">
+				<u-input v-model="payParams.cashMoney" type="number" :border="true" :clearable="false" placeholder="请输入本次收到的金额(元)" />
+			</view>
+			<view class="popup-footer u-flex">
+				<view class="popup-btn1" ><u-button type="primary" @click="consfimPayway">确认</u-button> </view>
+				<view class="popup-btn2" ><u-button type="primary" :plain="true"@click="closecashPayway">关闭</u-button> </view>
+			</view>
+		</u-popup>
 		<u-toast ref="uToast" />
 	</view>
 </template>
@@ -120,6 +130,8 @@
 		},
 		data() {
 			return {
+				// cashMoney:'',
+				showCash:false,
 				speakParkOut:'',
 				vehicleImage:'/static/img/default-car.png',
 				showOrderDetails:false,//是否线上订单细节
@@ -137,7 +149,8 @@
 				showPayway:false,
 				payParams:{
 					orderList:[],
-					code:''
+					code:'',
+					cashMoney:'',
 				},
 				showQrcode:false,
 				qrcontent:'',
@@ -172,6 +185,39 @@
 			this.handleEntranceOutDetail();
 		},
 		methods:{
+			closecashPayway(){
+				this.showCash = false;
+			},
+			cashPay(){
+				this.showCash = true;
+			},
+			consfimPayway(){
+				if(this.payParams.cashMoney==this.payTipsItem.price){
+					this.$u.api.cashPay(this.payParams)
+				.then(res=>{
+					uni.showLoading({
+						 title: '查询支付状态中'
+					});
+					this.timer = setInterval(() => {
+					  this.handlePayQuery(res.data.polyOrderId)
+					}, 3000);
+					this.$u.route({
+						url: 'pages/getout/getout',
+					});
+				}).catch(err=>{
+					this.$refs.uToast.show({
+						title: err.msg,
+						type: 'error',
+					});
+				});
+				}else{
+					this.$refs.uToast.show({
+						title: '缴费金额小于需支付金额,不能支付',
+						type: 'error',
+					});
+				}
+				
+			},
 			onCancel(){
 				// this.$u.route({
 				// 	type: 'redirectTo',

+ 82 - 0
pages/ownersquery/ownersinfo/ownersinfo.scss

@@ -48,4 +48,86 @@ page{
 			}
 		}
 	}
+}
+.button-wrap{
+	height: 120rpx;
+	.button{
+		position: fixed;
+		left: 20rpx;
+		bottom: 40rpx;
+		right: 20rpx;
+		z-index: 999;
+	}
+}
+.pay-tips {
+	width: calc(100% - 34rpx);
+	margin: 23rpx auto;
+	border-top: solid 1px #979797;
+	padding: 38rpx 0;
+	color: #5F5F5F;
+	text {
+		color: #3397FA;
+		padding: 0 10rpx;
+	}
+}
+.pay-way {
+	display: flex;
+	justify-content: space-between;
+	width: calc(100% - 34rpx);
+	border-top: solid 1px #979797;
+	margin: 23rpx auto;
+	padding: 38rpx 26rpx;
+	.pay-way-item {
+		text-align: center;
+		font-size: 30rpx;
+		color: #5F5F5F;
+		image {
+			width: 143rpx;
+			height: 143rpx;
+		}
+	}
+}
+.pay-way-close-btn {
+	width: calc(100% - 34rpx);
+	margin: 0 auto 68rpx;
+	border: none;
+	background-color: #3397FA;
+	color: #fff;
+	border-radius: 10rpx;
+}
+.qrcode-popup{
+	text-align: center;
+	.qrcode-popup-btn{
+		margin-top: 42rpx;
+		height: 85rpx;
+		line-height: 85rpx;
+		background: #3397FA;
+		box-shadow: 0px 9rpx 9rpx 0px rgba(0, 0, 0, 0.03);
+		text-align: center;
+		border-radius: 10rpx;
+		font-size: 30rpx;
+		font-weight: 500;
+		color: #FFFFFF;
+	}
+}
+.popup-btn1{
+	padding: 68rpx 0rpx 0px 40rpx;
+}
+.popup-btn2{
+	padding: 68rpx 0rpx 0px 250rpx;
+}
+.popup{
+	/deep/ .uni-scroll-view-content{
+		padding: 39rpx 34rpx 77rpx;
+		box-sizing: border-box;
+	}
+	.popup-title{
+		font-size: 46rpx;
+		color: #404040;
+		line-height: 65rpx;
+		text-align: center;
+		border-bottom: 1px solid #D5D5D5;
+		padding-bottom: 23rpx;
+		margin-bottom: 33rpx;
+	}
 }

+ 284 - 22
pages/ownersquery/ownersinfo/ownersinfo.vue

@@ -34,6 +34,82 @@
 		 	</view>
 		 </view>
 		 </mescroll-body>
+		 <view class="button-wrap" v-if="owelist.length&&owelist.length>=1">
+		 	<!-- <button class="button" type="primary" @click="all()">全部缴费</button> -->
+		 	<button class="button" type="primary" @click="confirmPrice()">全部缴费</button>
+		 </view>
+		 <!-- 缴费提示-->
+		 <u-modal
+		 v-model="payTipsPop"
+		 :title-style="{color: '#404040'}"
+		 title="缴费提示"
+		 :show-confirm-button="true"
+		 confirm-text="立即缴费"
+		 :confirm-style="{backgroundColor: '#3397FA', color: '#fff'}"
+		 :show-cancel-button="true"
+		 cancel-text="取消"
+		 :cancel-style="{backgroundColor: '#EBF1FF', color: '#3397FA'}"
+		 @confirm="payTipsPopConfirm">
+		 	<view class="slot-content">
+		 		<view class="pay-tips">
+		 			<text>{{payTipsItem.num}}</text>场停车欠费,共
+		 			<text>{{payTipsItem.price}}</text>元
+		 		</view>
+		 	</view>
+		 </u-modal>
+		 <u-modal
+		 v-model="payWayPop"
+		 :title-style="{color: '#404040'}"
+		 title="缴费方式"
+		 :show-confirm-button="false"
+		 :show-cancel-button="false">
+		 	<view class="slot-content">
+		 		<view class="pay-way">
+		 			<view class="pay-way-item" @click="scanPay">
+		 				<image src="/static/img/payway-scan.png" mode=""></image>
+		 				<view>扫码收费</view>
+		 			</view>
+		 			<view class="pay-way-item" @click="cashPay">
+		 				<image src="/static/img/payway-xj.png" mode=""></image>
+		 				<view>现金支付</view>
+		 			</view>
+					<view class="pay-way-item" @click="qrPay">
+						<image src="/static/img/payway-qr.png" mode=""></image>
+						<view>收款码</view>
+					</view>
+		 		</view>
+		 		<button class="pay-way-close-btn" @click="payWayPop = false">关闭</button>
+		 	</view>
+		 </u-modal>
+		 <u-popup class="popup cashPay-popup" v-model="showCash" :mask-close-able="false" mode="center" border-radius="20" width="90%">
+		 	<view class="popup-title">本次收到缴费</view>
+		 	<view class="popup-body">
+		 		<u-input v-model="payParams.cashMoney" type="number" :border="true" :clearable="false" placeholder="请输入本次收到的金额(元)" />
+		 	</view>
+		 	<view class="popup-footer u-flex">
+		 		<view class="popup-btn1" ><u-button type="primary" @click="consfimPayway">确认</u-button> </view>
+		 		<view class="popup-btn2" ><u-button type="primary" :plain="true"@click="closecashPayway">关闭</u-button> </view>
+		 	</view>
+		 </u-popup>
+		 <u-popup class="popup qrcode-popup" v-model="showQrcode" :mask-close-able="false" mode="center" border-radius="20" width="90%">
+		 	<tki-qrcode
+		 	    ref="qrcode"
+		 	    cid="tki-qrcode-canvas"
+		 	    :val="qrcontent"
+		 	    :size="200"
+		 	    unit="px"
+		 	    background="#000000"
+		 	    foreground="#ffffff"
+		 	    pdground="#ffffff"
+		 	    :iconSize="40"
+		 	    :onval="true"
+		 	    :loadMake="false"
+		 	    :usingComponents="true"
+		 	    :showLoading="false"
+		 	    loadingText="loadingText"
+		 	     />
+		 	<view class="qrcode-popup-btn" @click="hideQrcode">关闭</view>
+		 </u-popup>
 		 <u-toast ref="uToast" />
 	</view>
 </template>
@@ -43,10 +119,27 @@
 	//#ifdef APP-PLUS
 	let device = uni.requireNativePlugin("DeviceInfo");
 	//#endif
+	import tkiQrcode from "tki-qrcode";
 	export default{
 		mixins: [MescrollMixin], // 使用mixin
 		data(){
 			return{
+				// cashMoney:'',
+				showCash:false,
+				qrcontent:'',
+				showQrcode:false,
+				payParams:{
+					orderList:[],
+					code:'',
+					cashMoney:'',
+				},
+				currentItem: [],
+				payWayPop: false,
+				payTipsItem: {
+					num: '',
+					price: ''
+				},
+				payTipsPop: false,
 				vehicleNo:'',
 				listEmpty:false,
 				owelist:[],
@@ -64,6 +157,163 @@
 			// this.getData();
 		},
 		methods:{
+			cashPay(){
+				this.showCash = true;
+			},
+			closecashPayway(){
+				this.showCash = false;
+			},
+			consfimPayway(){
+				if(this.payParams.cashMoney==this.payTipsItem.price){
+					this.$u.api.cashPay(this.payParams)
+				.then(res=>{
+					uni.showLoading({
+						 title: '查询支付状态中'
+					});
+					this.timer = setInterval(() => {
+					  this.handlePayQuery(res.data.polyOrderId)
+					}, 3000);
+				}).catch(err=>{
+					this.$refs.uToast.show({
+						title: err.msg,
+						type: 'error',
+					});
+				});
+				}else{
+					this.$refs.uToast.show({
+						title: '支付金额小于欠费金额,不能支付',
+						type: 'error',
+					});
+				}
+				
+			},
+			qrPay(){
+				console.log('this.payParams',this.payParams);
+				this.$u.api.gzbankPolypay(this.payParams)
+				.then(res=>{
+					// this.$refs.uToast.show({
+					// 	title: res.msg,
+					// 	type: 'success',
+					// });
+					this.showPayway = false;
+					this.showQrcode = true;
+					setTimeout(()=>{
+						this.qrcontent = res.data.qrCodeUrl;
+					},500)
+					
+					// 启动定时器查询订单状态
+					uni.showLoading({
+						 title: '等待支付中'
+					});
+					this.timer = setInterval(() => {
+					  this.handlePayQuery(res.data.polyOrderId)
+					}, 3000);
+					console.log('gzbankPolypay',res)
+				}).catch(err=>{
+					this.$refs.uToast.show({
+						title: err.msg,
+						type: 'error',
+					});
+					console.log('gzbankPolypay ',err)
+				});
+				
+			},
+			hideQrcode(){
+				this.showQrcode = false;
+			},
+			scanPay(){
+				setTimeout(() =>{
+					uni.scanCode({
+					    onlyFromCamera: true,
+						scanType:['barCode','qrCode'],
+					    success:  (res) => {
+							console.log(res)
+							this.payParams.code = res.result;
+							this.$u.api.gzbankSwept(this.payParams)
+							.then(res=>{
+								// 启动定时器查询订单状态
+								uni.showLoading({
+									 title: '查询支付状态中'
+								});
+								this.timer = setInterval(() => {
+								  this.handlePayQuery(res.data.polyOrderId)
+								}, 3000);
+					
+							}).catch(err=>{
+								//#ifdef APP-PLUS
+								plus.nativeUI.toast(err.msg);
+								//#endif
+							});
+							
+					    },
+						fail:function(err){
+							//#ifdef APP-PLUS
+							plus.nativeUI.toast('扫码失败');
+							ALog.info({msg:'条码类型:err' + err});
+							//#endif
+						}
+					});
+				},2000)
+			},
+			handlePayQuery(polyOrderId){
+				this.$u.api.payQuery({polyOrderId:polyOrderId})
+				.then(res=>{
+					// this.$refs.uToast.show({
+					// 	title: res.msg,
+					// 	type: 'success',
+					// });
+					// 支付成功后的页面跳转
+					if (res.data.payStatus==1) {
+						uni.hideLoading();
+					  clearInterval(this.timer)
+					  this.$refs.uToast.show({
+					  	title:'支付成功',
+					  	type: 'success',
+					  	url:'pages/index/index',
+						// params: {
+						// 	vehicleNo:this.orderVehicleNo,
+						// },
+						duration:10000
+					  });
+					};
+					console.log('handlePayQuery',res)
+				}).catch(err=>{
+					this.$refs.uToast.show({
+						title: err.msg,
+						type: 'error',
+					});
+					console.log('handlePayQuery ',err)
+				});
+				
+			},
+			// 缴费提示弹框确认
+			payTipsPopConfirm() {
+				this.payWayPop = true
+			},
+			// 全部缴费确认
+			confirmPrice(){
+				let orderNum = 0, price = 0
+				this.currentItem = []
+				this.owelist.forEach(item => {
+					console.log(item)
+					if ((item.orderStatus == 2||item.orderStatus == 3) && item.payStatus !== 1 ) {
+						price += item.payAmount
+						orderNum ++
+						this.currentItem.push(item.orderId);
+						this.payParams.orderList.push(item.orderId);
+					}
+				})
+				this.payTipsItem.num = orderNum
+				this.payTipsItem.price = price
+				if (orderNum !== 0 && price !== 0) {
+					this.payTipsPop = true
+				} else {
+					this.$refs.uToast.show({
+						title: '没有需要支付的订单',
+						type: 'warning'
+					})
+				}
+			},
 			customBack(){
 				uni.reLaunch({
 				    url: '/pages/index/index'
@@ -113,33 +363,45 @@
 				
 			},
 			onParkIn(item){
-				this.$u.api.printIn({orderId:item.orderId})
-				.then(res => {
-					if(res.code == 200){
-						//#ifdef APP-PLUS
-						device.print(res.data);
-						//#endif
-						plus.nativeUI.toast('打印成功');
-					}
-				})
-				.catch(err=>{
-					plus.nativeUI.toast('打印失败');
+				this.$u.route({
+					url:'pages/receipts/receiptsIn',
+					params: {
+							orderId:item.orderId
+						}
 				});
+				// this.$u.api.printIn({orderId:item.orderId})
+				// .then(res => {
+				// 	if(res.code == 200){
+				// 		//#ifdef APP-PLUS
+				// 		device.print(res.data);
+				// 		//#endif
+				// 		plus.nativeUI.toast('打印成功');
+				// 	}
+				// })
+				// .catch(err=>{
+				// 	plus.nativeUI.toast('打印失败');
+				// });
 				
 			},
 			onParkLeave(item){
-				this.$u.api.printLeave({orderId:item.orderId})
-				.then(res => {
-					if(res.code == 200){
-						//#ifdef APP-PLUS
-						device.print(res.data);
-						//#endif
-						plus.nativeUI.toast('打印成功');
-					}
-				})
-				.catch(err=>{
-					plus.nativeUI.toast('打印失败');
+				this.$u.route({
+					url:'pages/receipts/receiptsOut',
+					params: {
+							orderId:item.orderId
+						}
 				});
+				// this.$u.api.printLeave({orderId:item.orderId})
+				// .then(res => {
+				// 	if(res.code == 200){
+				// 		//#ifdef APP-PLUS
+				// 		device.print(res.data);
+				// 		//#endif
+				// 		plus.nativeUI.toast('打印成功');
+				// 	}
+				// })
+				// .catch(err=>{
+				// 	plus.nativeUI.toast('打印失败');
+				// });
 			}
 			
 		}

+ 1 - 1
pages/parking/parking.vue

@@ -25,7 +25,7 @@
 		<view class="bottom-btn-wrap">
 			<u-button class="bt1" @click="last(list.pageNum)"><</u-button>
 			<view class="pagesInput">
-				<view class="pagesInput-left">第</view><u-input v-model="pageNum" type="text" :border="true" :clearable="false" /><view class="pagesInput-right">页</view></view>
+				<view class="pagesInput-left">第</view><u-input v-model="pageNum" type="text" :border="true" :clearable="false" placeholder="" /><view class="pagesInput-right">页</view></view>
 			<view class="num">
 			<u-button @click="jump(list.pageNum)" size="mini">跳转</u-button>
 			</view>

+ 10 - 0
pages/receipts/receiptsIn.scss

@@ -0,0 +1,10 @@
+.receipts{
+	margin-top: 30rpx;
+    padding-left: 40rpx;
+	.receipts-list{
+		line-height: 50rpx;
+	}
+}	
+.footer{
+	margin: 40rpx;
+}

+ 125 - 0
pages/receipts/receiptsIn.vue

@@ -0,0 +1,125 @@
+<template>
+	<view>
+		<u-navbar
+		 title="入场小票详情" 
+		 title-color="#fff" 
+		 :custom-back="customBack" 
+		 :border-bottom="false" 
+		 back-icon-color="#CCE8FF" 
+		 :background="{background: 'linear-gradient(145deg, #41AFF9 0%, #2D8CFB 100%)' }"></u-navbar>
+		 <view class="receipts">
+			<view class="receipts-list" v-for="(item,index) in itemList">
+				 <view v-if="item.itemType==1">{{item.itemContent}}</view>
+				 <view v-if="item.itemType==2">
+					 <tki-qrcode
+						 ref="qrcode"
+						 cid="tki-qrcode-canvas"
+						 :val="content"
+						 :size="200"
+						 unit="px"
+						 background="#000000"
+						 foreground="#ffffff"
+						 pdground="#ffffff"
+						 :iconSize="40"
+						 :onval="Onval"
+						 :loadMake="false"
+						 :usingComponents="true"
+						 :showLoading="false"
+						 loadingText="loadingText"
+						  />
+				 </view>
+			</view> 
+		 </view>
+		 <view class="footer">
+			 <u-button class="btn" @click="print" type="primary">打印小票</u-button>
+		 </view>
+		 <u-toast ref="uToast" />
+	</view>
+</template>
+
+<script>
+	import tkiQrcode from "tki-qrcode";
+	//#ifdef APP-PLUS
+	let device = uni.requireNativePlugin("DeviceInfo");
+	//#endif
+	export default{
+		components: {
+			tkiQrcode
+		},
+		data(){
+			return {
+				Onval:false,
+				content:'',
+				itemList:[],
+				orederId:'',
+				list:[]
+			}
+		},
+		onLoad(page){
+			console.log(page)
+			this.orderId=page.orderId;
+			this.getContentList();
+		},
+		methods:{
+			getContentList(){
+				this.$u.api.printIn({orderId:this.orderId})
+				.then(res=>{
+					this.list = [];
+					let content = ''
+					res.data.itemList.forEach(item=>{
+						const obj={
+							itemType:item.itemType,
+						}
+						this.list.push(obj);
+						console.log(obj)
+						if (item.itemType == 2) {
+							content = item.itemContent
+						}
+					})
+					console.log('list',this.list)
+					this.itemList = res.data.itemList;
+					setTimeout(() => {  
+						this.Onval = true;
+						this.content = content
+					}, 300);  
+					console.log(res)
+				}).catch(err=>{
+					if(err.errMsg){
+						this.$refs.uToast.show({
+							title: '请检查网络',
+							type: 'error',
+						});
+						return false;
+					};
+					this.$refs.uToast.show({
+						title: err.msg,
+						type: 'error',
+					});
+				});
+			},
+			customBack(){
+				uni.navigateBack({
+				    delta: 1
+				});
+			},
+			print(){
+				this.$u.api.printIn({orderId:this.orderId})
+				.then(res => {
+					if(res.code == 200){
+						//#ifdef APP-PLUS
+						device.print(res.data);
+						//#endif
+						plus.nativeUI.toast('打印成功');
+					}
+				})
+				.catch(err=>{
+					plus.nativeUI.toast('打印失败');
+				});
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	@import "./receiptsIn.scss";
+</style>

+ 10 - 0
pages/receipts/receiptsOut.scss

@@ -0,0 +1,10 @@
+.receipts{
+	margin-top: 30rpx;
+    padding-left: 40rpx;
+	.receipts-list{
+		line-height: 50rpx;
+	}
+}	
+.footer{
+	margin: 40rpx;
+}

+ 125 - 0
pages/receipts/receiptsOut.vue

@@ -0,0 +1,125 @@
+<template>
+	<view>
+		<u-navbar
+		 title="出场小票详情" 
+		 title-color="#fff" 
+		 :custom-back="customBack" 
+		 :border-bottom="false" 
+		 back-icon-color="#CCE8FF" 
+		 :background="{background: 'linear-gradient(145deg, #41AFF9 0%, #2D8CFB 100%)' }"></u-navbar>
+		 <view class="receipts">
+			<view class="receipts-list" v-for="(item,index) in itemList">
+				 <view v-if="item.itemType==1">{{item.itemContent}}</view>
+				 <view v-if="item.itemType==2">
+					 <tki-qrcode
+						 ref="qrcode"
+						 cid="tki-qrcode-canvas"
+						 :val="content"
+						 :size="200"
+						 unit="px"
+						 background="#000000"
+						 foreground="#ffffff"
+						 pdground="#ffffff"
+						 :iconSize="40"
+						 :onval="Onval"
+						 :loadMake="false"
+						 :usingComponents="true"
+						 :showLoading="false"
+						 loadingText="loadingText"
+						  />
+				 </view>
+			</view> 
+		 </view>
+		 <view class="footer">
+			 <u-button class="btn" @click="print" type="primary">打印小票</u-button>
+		 </view>
+		 <u-toast ref="uToast" />
+	</view>
+</template>
+
+<script>
+	import tkiQrcode from "tki-qrcode";
+	//#ifdef APP-PLUS
+	let device = uni.requireNativePlugin("DeviceInfo");
+	//#endif
+	export default{
+		components: {
+			tkiQrcode
+		},
+		data(){
+			return {
+				Onval:false,
+				content:'',
+				itemList:[],
+				orederId:'',
+				list:[]
+			}
+		},
+		onLoad(page){
+			console.log(page)
+			this.orderId=page.orderId;
+			this.getContentList();
+		},
+		methods:{
+			getContentList(){
+				this.$u.api.printLeave({orderId:this.orderId})
+				.then(res=>{
+					this.list = [];
+					let content = ''
+					res.data.itemList.forEach(item=>{
+						const obj={
+							itemType:item.itemType,
+						}
+						this.list.push(obj);
+						console.log(obj)
+						if (item.itemType == 2) {
+							content = item.itemContent
+						}
+					})
+					console.log('list',this.list)
+					this.itemList = res.data.itemList;
+					setTimeout(() => {  
+						this.Onval = true;
+						this.content = content
+					}, 300);  
+					console.log(res)
+				}).catch(err=>{
+					if(err.errMsg){
+						this.$refs.uToast.show({
+							title: '请检查网络',
+							type: 'error',
+						});
+						return false;
+					};
+					this.$refs.uToast.show({
+						title: err.msg,
+						type: 'error',
+					});
+				});
+			},
+			customBack(){
+				uni.navigateBack({
+				    delta: 1
+				});
+			},
+			print(){
+				this.$u.api.printLeave({orderId:this.orderId})
+				.then(res => {
+					if(res.code == 200){
+						//#ifdef APP-PLUS
+						device.print(res.data);
+						//#endif
+						plus.nativeUI.toast('打印成功');
+					}
+				})
+				.catch(err=>{
+					plus.nativeUI.toast('打印失败');
+				});
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	@import "./receiptsIn.scss";
+</style>