Browse Source

auto commit

gcz 4 years ago
parent
commit
3bbd7fea99

+ 4 - 3
common/http.interceptor.js

@@ -47,9 +47,10 @@ const install = (Vue, vm) => {
 		if(res.code == 200) {
 			// 如果把originalData设置为了true,这里return回什么,this.$u.post的then回调中就会得到什么
 			return res;  
-		} else if(res.msg == "令牌不能为空"||res.code == 401){
-			alert('还未登录,即将跳转登录');			
-			setTimeout(()=>{location.href = location.href+'pages/center/phoneLogin/phoneLogin';});
+		} else if(res.msg == "令牌不能为空"||res.code == 401){			
+			// console.log('location.href',location);
+			alert('还未登录,即将跳转登录');
+			setTimeout(()=>{location.href = location.origin+'/#/pages/login/login';});
 		}else return false;
 	}
 }

+ 7 - 0
pages.json

@@ -33,6 +33,13 @@
 				"navigationBarTitleText": "车辆出场"
 			}
 		},
+		{
+			"path": "pages/getout/getoutpage/getoutpage",
+			"style": {
+				// "navigationStyle":"custom",// 隐藏系统导航栏
+				"navigationBarTitleText": "车辆出场"
+			}
+		},
 		{
 			"path": "pages/getcarno/getcarno",
 			"style": {

+ 1 - 1
pages/getout/getout.vue

@@ -43,7 +43,7 @@
 		},
 		onLoad() {
 			let that = this;
-			this.roadNo = this.$store.state.vuex_user.roadList[0].roadNo || '';
+			this.roadNo = this.$store.state.vuex_user?.roadList?.[0].roadNo || '';
 			this.handleGetRoadspace(this.roadNo);
 			
 			setInterval(function () {

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

@@ -0,0 +1,84 @@
+.car-info{
+	margin-top: 20rpx;
+	margin-bottom: 33rpx;
+	.car-info-img{
+		width: 220rpx;
+		height: 287rpx;;
+		padding: 14rpx;
+		margin-right: 35rpx;
+		box-sizing: border-box;
+		background: #FFFFFF;
+		box-shadow: 0px 0px 8rpx 3rpx rgba(166, 166, 166, 0.29);
+		border-radius: 10rpx;
+	}
+	.car-info-text{
+		.text-item{
+			padding-bottom: 10rpx;
+			margin-bottom: 10rpx;
+			border-bottom: 1px solid #EAEAEA;
+			font-size: 30rpx;
+			font-weight: 400;
+			color: #8A8A8A;
+			line-height: 42rpx;
+			letter-spacing: 1px;
+			.car{
+				font-size: 40rpx;
+				font-weight: 500;
+				color: #3D3D3D;
+				line-height: 56rpx;
+			}
+			.balance{
+				font-size: 32rpx;
+				font-weight: 500;
+				color: #FA6400;
+				line-height: 45rpx;
+			}
+			.recharge{
+				padding: 0 22rpx;
+				height: 36rpx;
+				line-height: 36rpx;
+				background: #3397FA;
+				color: #fff;
+				border-radius: 5rpx;
+				font-size: 18rpx;
+			}
+		}
+	}
+}
+.parking-info{
+	background: #EDF6FF;
+	border-radius: 10rpx;
+	padding: 30rpx;
+	.parking-info-item{
+		margin-bottom: 9rpx;
+		font-size: 36rpx;
+		font-weight: 400;
+		color: #63717F;
+		line-height: 50rpx;
+		letter-spacing: 1px;
+	}
+}
+.bottom-btn-box{
+	bottom: 194rpx;
+}
+
+.orderDetails{
+	/deep/ dl{
+		display: flex;
+		font-size: 36rpx;
+		line-height: 60rpx;
+		padding-left: 30rpx;
+		padding-right: 30rpx;
+		dt{
+			color: #5F5F5F;
+		}
+		
+	}
+	/deep/ .tip{
+		margin: 20rpx 30rpx 47rpx;
+		font-size: 36rpx;
+		font-weight: 400;
+		color: #5F5F5F;
+		line-height: 51rpx;
+	}
+}

+ 93 - 0
pages/getout/getoutpage/getoutpage.vue

@@ -0,0 +1,93 @@
+<template>
+	<view class="wrap">
+		<view class="car-info u-flex">
+			<view class="car-info-img">
+				<u-image src="../../../static/img/default-car.png" width="100%" height="100%"></u-image>
+			</view>
+			<view class="car-info-text u-flex-1">
+				<view class="text-item">
+					<view class="car">豫U88888</view>
+					<view class="position">车位:P-03</view>
+				</view>
+				<view class="text-item" style="color: #3192FB;">临时卡</view>
+				<view class="text-item u-flex u-flex u-row-between">
+					<view class="">余额:<span class="balance">100元</span></view>
+					<view class="recharge">充值</view>
+				</view>
+				<view class="text-item">类型:小车(计时)</view>
+			</view>
+		</view>
+		<view class="parking-info">
+			<view class="parking-info-item">进场时间:2021-04-08 17:14:31</view>
+			<view class="parking-info-item">出场时间:2021-04-08 18:40:24</view>
+			<view class="parking-info-item">停车时长:01:50:32</view>
+			<view class="parking-info-item">进场押金:0.0元</view>
+		</view>
+		<view class="bottom-btn-wrap">
+			<view class="bottom-btn-box u-flex">
+				<view class="bottom-btn bg-blue" @click="handleOut">出场</view>
+				<view class="bottom-btn bg-gray">取消</view>
+			</view>
+		</view>
+		
+		<!-- 订单细节 -->
+		<u-modal v-model="showOrderDetails"
+		 title="温馨提示" 
+		 cancel-text="取消" 
+		 confirm-text="确认" 
+		 :show-cancel-button="true"
+		 :title-style="{color: '#404040',fontSize: '46rpx',borderBottom:'1px solid #D5D5D5',margin:'0 30rpx 30rpx',paddingBottom:'30rpx'}">
+			<view class="slot-content">
+				<rich-text class="orderDetails" :nodes="content"></rich-text>
+			</view>
+		</u-modal>
+		<u-toast ref="uToast" />
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				showOrderDetails:false,//是否线上订单细节
+				content:'',
+				
+			}
+		},
+		onLoad() {
+			
+			
+		},
+		methods:{
+			openPage(path) {
+				console.log('path',path);
+				this.$u.route({ 
+					url: path
+				})
+			},
+			handleOut(res){
+				this.showOrderDetails = true;
+				
+				this.content = `
+				   <dl><dt>停车时长:</dt> <dd>` + res?.data?.roadName + `</dd></dl>`
+				+ `<dl><dt>账户类型:</dt><dd>` + res?.data?.roadNo + `</dd></dl>`
+				+ `<dl><dt>账户余额:</dt><dd>` + res?.data?.manager + `</dd></dl>`
+				+ `<dl><dt>车辆类型:</dt><dd>` + res?.data?.telephone + `</dd></dl>`
+				+ `<dl><dt>押金:</dt><dd>` + res?.data?.manager + `</dd></dl>`
+				+ `<dl><dt>应收:</dt><dd>` + res?.data?.manager + `</dd></dl>`
+				+ `<dl><dt>补交:</dt><dd><span class="u-type-warning">` + res?.data?.manager + `<span></dd></dl>`
+				+ `<div class="tip">你是否将该车辆出场,如果是请点击确认,否则点击取消!</div>`;
+				
+			}
+			
+		},
+		filters:{
+			
+		}
+		
+	}
+</script>
+
+<style lang="scss">
+	@import "./getoutpage.scss";
+</style>

+ 2 - 4
pages/index/index.vue

@@ -94,9 +94,7 @@
 		onShow() {
 			if(this.$store.state.vuex_hasLogin){
 				this.userInfo = this.$store.state.vuex_user;
-				if(this.$store.state.vuex_user.roadList){
-					this.theRoad = this.$store.state.vuex_user.roadList[0]||[];
-				};
+				this.theRoad = this.$store.state.vuex_user?.roadList?.[0]||[];
 				if(this.theRoad.roadNo){
 					console.log('this.theRoad.roadNo',this.theRoad.roadNo)
 					this.handleGetIndex(this.theRoad.roadNo);
@@ -110,7 +108,7 @@
 		},
 		methods: {
 			openPage(path) {
-				console.log('path',path);
+				// console.log('path',path);
 				this.$u.route({ 
 					url: path
 				});

+ 2 - 2
pages/login/login.vue

@@ -87,13 +87,13 @@
 						})
 					};
 					this.$u.route('pages/index/index', {});
-					console.log('getMycars',res)
+					console.log('login',res)
 				}).catch(err=>{
 					this.$refs.uToast.show({
 						title: err.msg,
 						type: 'error',
 					});
-					console.log('getMycars ',err)
+					console.log('login ',err)
 				});
 			}
 

BIN
static/img/choose-image.png


BIN
static/img/default-car.png


+ 51 - 0
uni.scss

@@ -4,3 +4,54 @@
  */
 @import 'uview-ui/theme.scss';
 .wrap{margin: 0 40rpx;position: relative;}
+
+.bottom-btn-wrap{
+	height: 155rpx;
+}
+.bottom-btn-box{
+	position: fixed;
+	left: 40rpx;
+	right: 40rpx;
+	bottom: 47rpx;
+	height: 85rpx;
+	line-height: 85rpx;	
+	text-align: center;
+	.bottom-btn{
+		flex: 1;
+		height: 100%;		
+		border-radius: 10rpx;
+		font-size: 28rpx;
+		&.bg-blue{
+			background-color: #008CFF;
+			color: #fff;
+		}
+		&.bg-gray{
+			background-color: #EBF1FF;
+			color: #3397FA;
+		}
+		
+	}
+	.bottom-btn + .bottom-btn{
+		margin-left: 12rpx;
+	}
+}
+.bottom-btn-wrap > .bottom-btn{
+	position: fixed;
+	left: 40rpx;
+	right: 40rpx;
+	bottom: 47rpx;
+	height: 85rpx;
+	line-height: 85rpx;
+	background: #3397FA;
+	box-shadow: 0px 9rpx 9rpx 0px rgba(0, 0, 0, 0.03);
+	border-radius: 10rpx;
+	text-align: center;
+	font-size: 28rpx;
+	font-weight: 500;
+	color: #FFF;
+	letter-spacing: 1px;
+	z-index: 99;
+}
+.bottom-btn.static{
+	position: static;
+}