Browse Source

现金支付优化,修改部分bug,优化界面

tianhui 3 years ago
parent
commit
0b99580ad7

+ 1 - 0
pages/getin/getin.scss

@@ -135,6 +135,7 @@
 	}
 }
 .button-wrap{
+	padding-bottom: 30rpx;
 	display: flex;
 	.btn1{
 		background-color: #3397FA;

+ 8 - 2
pages/getin/getin.vue

@@ -531,8 +531,14 @@
 			// 按键被点击(点击退格键不会触发此事件)
 			keyboardChange(val) {
 				// 将每次按键的值拼接到value变量中,注意+=写法
-				this.vehicleNo += val;
-				console.log(this.newPlateNumber);
+				console.log('val',val);
+				console.log('11',this.vehicleNo);
+				if(this.vehicleNo){
+					this.vehicleNo += val;
+				}else{
+					this.vehicleNo = val
+				}
+				console.log('22',this.vehicleNo);
 			},
 			// 退格键被点击
 			backspace() {

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

@@ -171,4 +171,7 @@
 }
 .popup-btn2{
 	padding: 68rpx 0rpx 0px 250rpx;
+}
+.change{
+	margin-left: 30rpx;
 }

+ 30 - 20
pages/getout/getoutpage/getoutpage.vue

@@ -105,8 +105,9 @@
 		</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 class="popup-body u-flex">
+				<view  class="u-flex-1 "><u-input v-model="payParams.cashMoney" type="number" :border="true" :clearable="false" placeholder="请输入本次收到的金额(元)" /></view> 
+				<view class="u-flex-1 change">找零{{changeMoney}}元</view>
 			</view>
 			<view class="popup-footer u-flex">
 				<view class="popup-btn1" ><u-button type="primary" @click="consfimPayway">确认</u-button> </view>
@@ -130,6 +131,8 @@
 		},
 		data() {
 			return {
+				change:'',
+				price:'',
 				// cashMoney:'',
 				showCash:false,
 				speakParkOut:'',
@@ -184,6 +187,15 @@
 		onShow() {
 			this.handleEntranceOutDetail();
 		},
+		computed:{
+			changeMoney(){
+				if(this.payParams.cashMoney>this.price){
+					return this.payParams.cashMoney-this.price
+				}else{
+					return 0
+				}
+			}
+		},
 		methods:{
 			closecashPayway(){
 				this.showCash = false;
@@ -192,28 +204,25 @@
 				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=>{
+				if(this.payParams.cashMoney<this.price){
 					this.$refs.uToast.show({
-						title: err.msg,
+						title: '缴费金额小于需支付金额,不能支付',
 						type: 'error',
 					});
-				});
 				}else{
-					this.$refs.uToast.show({
-						title: '缴费金额小于需支付金额,不能支付',
-						type: 'error',
+					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',
+						});
 					});
 				}
 				
@@ -243,6 +252,7 @@
 				this.$u.api.entranceOutDetail({spaceId:this.orderID})
 				.then(res=>{
 					this.leaveDetail = res.data;
+					this.price = res.data.payAmount;
 				}).catch(err=>{
 					this.$refs.uToast.show({
 						title: err.msg,

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

@@ -130,4 +130,7 @@ page{
 		padding-bottom: 23rpx;
 		margin-bottom: 33rpx;
 	}
+}
+.change{
+	margin-left: 30rpx;
 }

+ 34 - 21
pages/ownersquery/ownersinfo/ownersinfo.vue

@@ -65,14 +65,14 @@
 		 :show-cancel-button="false">
 		 	<view class="slot-content">
 		 		<view class="pay-way">
+					<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="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>
@@ -83,8 +83,9 @@
 		 </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 class="popup-body u-flex">
+				<view class="u-flex-1 "><u-input v-model="payParams.cashMoney" type="number" :border="true" :clearable="false" placeholder="请输入本次收到的金额(元)" /></view>
+		 		<view class="u-flex-1 change">找零{{changeMoney}}元</view>
 		 	</view>
 		 	<view class="popup-footer u-flex">
 		 		<view class="popup-btn1" ><u-button type="primary" @click="consfimPayway">确认</u-button> </view>
@@ -124,6 +125,7 @@
 		mixins: [MescrollMixin], // 使用mixin
 		data(){
 			return{
+				change:'0',
 				// cashMoney:'',
 				showCash:false,
 				qrcontent:'',
@@ -156,33 +158,44 @@
 		onReachBottom() {
 			// this.getData();
 		},
+		computed:{
+			changeMoney(){
+				if(this.payParams.cashMoney>this.payTipsItem.price){
+					return this.payParams.cashMoney-this.payTipsItem.price
+				}else{
+					return 0
+				}
+			}
+		},
 		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=>{
+				if(this.payParams.cashMoney<this.payTipsItem.price){
 					this.$refs.uToast.show({
-						title: err.msg,
+						title: '支付金额小于欠费金额,不能支付',
 						type: 'error',
 					});
-				});
+					
 				}else{
-					this.$refs.uToast.show({
-						title: '支付金额小于欠费金额,不能支付',
-						type: 'error',
+					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',
+						});
 					});
 				}