Browse Source

显示修改

aleyds 3 years ago
parent
commit
309c5192ac
3 changed files with 31 additions and 44 deletions
  1. 4 0
      common/http.interceptor.js
  2. 6 6
      pages/getout/getout.vue
  3. 21 38
      pages/getout/getoutpage/getoutpage.vue

+ 4 - 0
common/http.interceptor.js

@@ -20,6 +20,10 @@ const install = (Vue, vm) => {
 		// config.header.token = vm.vuex_token;
 		
 		if(vm.vuex_token){config.header.Authorization = `Bearer ${vm.vuex_token}`;}
+		config.header.timestamp =  new Date().getTime();
+		config.header.nonce =  vm.$u.guid(20);
+		//待签名算法
+		config.header.signature =  vm.$u.guid(20);
 		
 		// 方式二,如果没有使用uView封装的vuex方法,那么需要使用$store.state获取
 		// config.header.token = vm.$store.state.token;

+ 6 - 6
pages/getout/getout.vue

@@ -23,7 +23,7 @@
 				<view class="text">{{item.spaceName}}</view>
 			</view>			
 			<view class="bottom-btn-wrap">
-				<view class="bottom-btn" @click="openPage('pages/index/index')">返回主页</view>
+				<view class="bottom-btn" @click="jumpToMain()">返回主页</view>
 			</view>
 		</view>
 		
@@ -128,15 +128,15 @@
 			
 		},
 		methods:{
-			openPage(path) {
-				console.log('path',path);
-				this.$u.route({ 
-					url: path
+			jumpToMain(){
+				this.$u.route({
+					type: 'redirectTo',
+					url: '/pages/index/index'
 				})
 			},
 			customBack(){
 				this.$u.route({
-					// type:'switchTab',
+					type: 'redirectTo',
 					url: 'pages/index/index'
 				});
 			},

+ 21 - 38
pages/getout/getoutpage/getoutpage.vue

@@ -42,19 +42,16 @@
 			<view class="details-body">
 				<dl><dt>停车时长:</dt> <dd>{{leaveDetail.duration}}</dd></dl>
 				<dl><dt>车辆类型:</dt> <dd>{{leaveDetail.vehicleType|filterCarType}}</dd></dl>
-				<dl><dt>本次应收:</dt> <dd class="u-type-primary">{{leaveDetail.totalAmount}}元</dd></dl>
+				<dl><dt>本次应收:</dt> <dd class="u-type-primary">{{leaveDetail.payAmount}}元</dd></dl>
 				<dl><dt>历史欠费:</dt> <dd class="u-type-warning">{{leaveDetail.oweAmount}}元</dd></dl>
 				<view class="tip">
 					你是否将该车辆出场,如果是请缴费,否则点击取消!
 				</view>
 			</view>
 			<view class="details-footer u-flex u-row-between">
-				<!-- <view  class="details-footer-btn details-footer-btn--blue"  @click="payAll">全部缴费</view>
-				<view class="details-footer-btn details-footer-btn--yellow" @click="payThis">本次缴费</view>
-				 -->
-				<u-button type="primary" :disabled="detailModel.payAllbtn" @click="payAll">全部缴费</u-button>
-				<u-button type="warning" :disabled="detailModel.payOnebtn" @click="payThis">本次缴费</u-button>
-				<view class="details-footer-btn bg-gray" @click="openPage('pages/getout/getout')">取消</view>
+				<u-button type="primary" :disabled="detailModel.payAllbtn" @click="onPayAll">全部缴费</u-button>
+				<u-button type="warning" :disabled="detailModel.payOnebtn" @click="onPayThis">本次缴费</u-button>
+				<view class="details-footer-btn bg-gray" @click="onPayCancel">取消</view>
 			</view>
 		</u-popup>
 		<!-- 支付方式 -->
@@ -146,8 +143,8 @@
 				timer: null, // 定时器
 				detailModel:{
 					show: false,
-					payAllbtn: true,
-					payOnebtn: true
+					payAllbtn: false,
+					payOnebtn: false
 				}
 				
 			}
@@ -159,7 +156,7 @@
 			this.orderSpaceName = page.orderSpaceName;
 			this.orderVehicleNo = page.orderVehicleNo;
 			// #ifdef APP-PLUS
-			this.speaks(this.orderVehicleNo);
+			// this.speaks(this.orderVehicleNo);
 			// #endif
 			
 		},
@@ -167,10 +164,11 @@
 			this.handleEntranceOutDetail();
 		},
 		methods:{
-			openPage(path) {
-				console.log('path',path);
-				this.$u.route({ 
-					url: path
+
+			onPayCancel(){
+				this.$u.route({
+					type: 'redirectTo',
+					url: '/pages/getout/getout'
 				})
 			},
 			speaks(msg){
@@ -190,13 +188,9 @@
 			},
 			handleOut(res){
 				let that = this;
-				// this.showOrderDetails = true;
 				this.$u.api.getOut({spaceId:this.orderID})
 				.then(res=>{
 					//1、当前订单金额和历史缴费金额都为0 --无需缴费--跳转
-					// ALog.info({msg: that.leaveDetail.oweAmount});
-					// ALog.info({msg:  res.data.payAmount});
-					debugger
 					if(that.leaveDetail.oweAmount == 0 && res.data.payAmount == 0){
 						that.$refs.uToast.show({
 							title: '金额为0无需支付',
@@ -205,22 +199,21 @@
 						});
 					}else if (that.leaveDetail.oweAmount == 0 && res.data.payAmount > 0){
 						that.detailModel.show = true;
-						that.detailModel.payAllbtn = false;
-						that.detailModel.payOnebtn = true;
+						that.detailModel.payAllbtn = true;
+						that.detailModel.payOnebtn = false;
 					}else if (that.leaveDetail.oweAmount > 0 && res.data.payAmount == 0){
 						that.detailModel.show = true;
-						that.detailModel.payOnebtn = false;
-						that.detailModel.payAllbtn = true;
+						that.detailModel.payOnebtn = true;
+						that.detailModel.payAllbtn = false;
 					}else {
 						that.detailModel.show = true;
-						that.detailModel.payOnebtn = true;
-						that.detailModel.payAllbtn = true;
+						that.detailModel.payOnebtn = false;
+						that.detailModel.payAllbtn = false;
 					}
 					//#ifdef APP-PLUS
 					that.speaks(res.data.speak);
 					device.print(res.data.print);
 					//#endif
-					console.log('getOut',res)
 				}).catch(err=>{
 					this.$refs.uToast.show({
 						title: err.msg,
@@ -229,15 +222,13 @@
 					console.log('getOut ',err)
 				});
 			},
-			async payThis(){
-				// this.showOrderDetails = false;
+			async onPayThis(){
 				this.detailModel.show = false;
 				this.showPayway = true;
 				this.payParams.orderList.push(this.leaveDetail.orderId);
 				// await this.confirmOut();
 			},
-			async payAll(){
-				// this.showOrderDetails = false;
+			async onPayAll(){
 				this.detailModel.show = false;
 				this.showPayway = true;
 				this.payParams.orderList.push(this.leaveDetail.orderId);
@@ -250,19 +241,13 @@
 				this.showPayway = false;
 			},
 			scanPay(){
-				console.log('this.payParams',this.payParams);
 				uni.scanCode({
 				    onlyFromCamera: true,
+					scanType:['barCode','qrCode'],
 				    success:  (res) => {
-						//#ifdef APP-PLUS
-						ALog.info({msg:'条码内容:' + res.result});
-						//#endif
 						this.payParams.code = res.result;
 						this.$u.api.gzbankSwept(this.payParams)
 						.then(res=>{
-							//#ifdef APP-PLUS
-							// plus.nativeUI.toast(res.msg);
-							//#endif
 							// 启动定时器查询订单状态
 							uni.showLoading({
 								 title: '查询支付状态中'
@@ -277,8 +262,6 @@
 							//#endif
 						});
 						
-				        // console.log('条码类型:' + res.scanType);
-				        // console.log('条码内容:' + res.result);
 				    },
 					fail:function(err){
 						//#ifdef APP-PLUS