Kaynağa Gözat

1、新增我的停车->室内停车接口,室内停车订单
2、新增停车记录 室内停车页面 接口

qiubo 3 yıl önce
ebeveyn
işleme
039b5c086d

+ 3 - 1
common/apiurl.js

@@ -28,13 +28,15 @@ const apiurl = {
 	mycarsUrl: '/client/membervehicle',
 	// 设置为默认车辆
 	setDefaultCarUrl: '/client/membervehicle/modifyDefault/',
-
+	//室内停车订单列表
+	getRoomparkingList:'/client/parking-orderinfo/pageList',
 	// 获取订单列表
 	getOrderListUrl: '/client/orderinfo',
 	// 获取支付订单详情
 	getOrderinfoUrl: '/client/orderinfo/paydetail/',
 	// 获取订单详情
 	getOrderDetailUrl: '/client/orderinfo/detail/',
+	getRoomOrderDetailUrl:'/client/parking-orderinfo/detail/',
 	//获取信息列表
 	getMessageListUrl: '/client/membernews',
 	//消息已读接口

+ 9 - 1
common/http.api.js

@@ -37,7 +37,12 @@ const install = (Vue, vm) => {
 	let setDefaultCar = (params = {}) => vm.$u.put(apiurl.setDefaultCarUrl + params.id);
 
 	let getOrderList = (params = {}) => vm.$u.get(apiurl.getOrderListUrl, params);
+	//室内停车订单列表api
+	let getRoomParkingApi =(params = {}) => vm.$u.get(apiurl.getRoomparkingList, params)
 	let getOrderinfo = (params = {}) => vm.$u.get(apiurl.getOrderinfoUrl + params.id);
+	let getRoomOrderDetail = (params = {}) => vm.$u.get(apiurl.getRoomOrderDetailUrl + params.id, {
+		showLoading: false
+	});
 	let getOrderDetail = (params = {}) => vm.$u.get(apiurl.getOrderDetailUrl + params.id, {
 		showLoading: false
 	});
@@ -95,6 +100,7 @@ const install = (Vue, vm) => {
 	let getOrderStateExportApi = (params = {}) => vm.$u.post(apiurl.getOrderStateExportUrl, params)
 	let quickPayExportApi = (params = {}) => vm.$u.post(apiurl.quickPayExportUrl, params)
 	let polyPayExportApi = (params = {}) => vm.$u.post(apiurl.polyPayExportUrl, params)
+	
 	// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
 	vm.$u.api = {
 		feedbackAdd,
@@ -145,7 +151,9 @@ const install = (Vue, vm) => {
 		getExportInfoApi,
 		getOrderStateExportApi,
 		quickPayExportApi,
-		polyPayExportApi
+		polyPayExportApi,
+		getRoomParkingApi,
+		getRoomOrderDetail
 	};
 }
 

+ 69 - 27
pages/center/order/order.vue

@@ -96,12 +96,14 @@
 								<view class="order-center" v-if="typeCurrent.value === 'park'">
 									<view class="order-center-item">订单编号:{{ orderItem.orderId }}</view>
 									<view class="order-center-item">
-										入场通道:{{ orderItem.inTime }}</view>
+										入场通道:{{orderItem.roadwayName}}</view>
 									<view class="order-center-item">
 										入场时间:{{ orderItem.inTime }}</view>
-									<view class="order-center-item">
-										出场通道:{{ orderItem.inTime }}</view>
-									<view class="order-center-item">
+									<view class="order-center-item" v-if="orderItem.orderStatus == 1 && orderItem.outTime">
+										出场通道:{{`未出场`}}</view>
+										<view class="order-center-item" v-if="orderItem.orderStatus !== 1">
+											出场通道:{{orderItem.outParkingName}}</view>
+									<view class="order-center-item" v-if="orderItem.orderStatus !== 1">
 										出场时间:{{ orderItem.inTime }}</view>
 									<view class="order-center-item">
 										免费时长:{{ orderItem.freeDuration || 0 }}</view>
@@ -110,10 +112,11 @@
 									<view class="order-center-item">
 										累计停车时长:{{ orderItem.duration || 0 }}</view>
 									<view class="order-center-item">
-										应金额:
+										应金额:
 										<span class="pay-amount">{{ orderItem.payAmount || 0 }}</span>
 									</view>
-									<view class="order-center-item">
+									<view class="order-center-item"
+									v-if="(orderItem.actualAmount || orderItem.actualAmount === 0) && orderItem.orderStatus !== 2 && orderItem.orderStatus !== 1">
 										实缴金额:
 										<span class="pay-amount">{{ orderItem.actualAmount || 0 }}</span>
 									</view>
@@ -210,7 +213,7 @@
 				[],
 				[]
 			]
-			this.getOrderList(this.list[this.current])
+			this.getOrderList(this.list[this.current],this.typeCurrent)
 		},
 		computed: {
 			// 价格小数
@@ -243,41 +246,71 @@
 					return
 				};
 				this.loadStatus.splice(this.list[this.current].index, 1, 'loading')
-				this.getOrderList(this.list[this.current])
+				this.getOrderList(this.list[this.current],this.typeCurrent)
 			},
 			// 页面数据
 
-			getOrderList(orderType) {
+			getOrderList(orderType,typeCurrent) {
+				//初始化订单列表
 				const param = {
 					pageNum: orderType.pageNum,
 					orderStatus: orderType.orderStatus	
 				}
+				
 				// 未出场: orderStatus	 = 1-停放中
 				// 缴费中: orderStatus	 = 2-出场中  && payStatus = 2-支付中
 				// 完成:   orderStatus	 = 4-完成
-				this.$u.api.getOrderList(param)
-					.then(res => {
-						for (const item of res.data.pageInfo.rows) {
-							this.orderList[orderType.index].push(item)
-						}
-						this.list[this.current].total = res.data.pageInfo.total
-						this.list[orderType.index].pageNum++
-						if (this.orderList[this.current].length >= this.list[this.current].total) {
-							this.loadStatus.splice(this.list[orderType.index].index, 1, 'nomore')
-						};
-					}).catch(err => {
-						this.$refs.uToast.show({
-							title: err.msg,
-							type: 'error'
+				if(typeCurrent.value == 'road'){
+					this.$u.api.getOrderList(param)
+						.then(res => {
+							for (const item of res.data.pageInfo.rows) {
+								this.orderList[orderType.index].push(item)
+							}
+							this.list[this.current].total = res.data.pageInfo.total
+							this.list[orderType.index].pageNum++
+							if (this.orderList[this.current].length >= this.list[this.current].total) {
+								this.loadStatus.splice(this.list[orderType.index].index, 1, 'nomore')
+							};
+						}).catch(err => {
+							this.$refs.uToast.show({
+								title: err.msg,
+								type: 'error'
+							})
 						})
-					})
-
+					
+				}else{
+					this.$u.api.getRoomParkingApi(param)
+						.then(res => {
+							for (const item of res.data.pageInfo.rows) {
+								this.orderList[orderType.index].push(item)
+							}
+							this.list[this.current].total = res.data.pageInfo.total
+							this.list[orderType.index].pageNum++
+							if (this.orderList[this.current].length >= this.list[this.current].total) {
+								this.loadStatus.splice(this.list[orderType.index].index, 1, 'nomore')
+							};
+						}).catch(err => {
+							this.$refs.uToast.show({
+								title: err.msg,
+								type: 'error'
+							})
+						})
+				}
+				
 				this.loadStatus.splice(this.current, 1, 'loadmore')
 			},
 			// tab栏切换
 			change(index) {
 				this.swiperCurrent = index
-				this.getOrderList(this.list[index])
+				//重新初始化
+				this.orderList = [
+					[],
+					[],
+					[],
+					[]
+				]
+				this.list[index].pageNum = 1
+				this.getOrderList(this.list[index],this.typeCurrent)
 			},
 			transition({
 				detail: {
@@ -344,7 +377,16 @@
 			 * @param {Object} item
 			 */
 			typeTabClick(item) {
-				// this.typeCurrent = item
+				this.typeCurrent = item
+				//重新初始化
+				this.orderList = [
+					[],
+					[],
+					[],
+					[]
+				]
+				this.list[this.current].pageNum = 1
+				this.getOrderList(this.list[this.current],this.typeCurrent)
 			}
 		},
 		filters: {

+ 75 - 17
pages/center/order/orderDetails/orderDetails.vue

@@ -13,7 +13,8 @@
 					:value="(orderInfo.preferentialAmount ? orderInfo.preferentialAmount.toFixed(2) : 0) + ' 元'">
 				</u-cell-item>
 			</u-cell-group>
-			<u-cell-group>
+		 <!-- 路段显示 -->
+			<u-cell-group v-if="openFlag == 'road'">
 				<u-cell-item title="订单编号 " :arrow="false" :border-bottom="false" :border-top="false"
 					:value="orderInfo.orderId"></u-cell-item>
 				<template v-if="orderInfo.deviceType == 1">
@@ -61,6 +62,45 @@
 				<u-cell-item v-if="orderInfo.payStatus == 1" title="缴费方式 " :arrow="false" :border-bottom="false"
 					:border-top="false" :value="orderInfo.paySource | verifyPaySource"></u-cell-item>
 			</u-cell-group>
+			<!-- 停车场时长 -->
+			<u-cell-group v-if="openFlag == 'park'">
+					<u-cell-item title="订单编号 " :arrow="false" :border-bottom="false" :border-top="false"
+						:value="orderInfo.orderId"></u-cell-item>
+					<template v-if="orderInfo.deviceType == 1">
+						<u-cell-item title="入场通道 " :arrow="false" :border-bottom="false" :border-top="false"
+							value="停车场入口"></u-cell-item>
+						<u-cell-item title="入场时间 " :arrow="false" :border-bottom="false" :border-top="false"
+							:value="orderInfo.inTime"></u-cell-item>
+						<u-cell-item title="出场通道 " :arrow="false" :border-bottom="false" :border-top="false"
+							value="停车场出口"></u-cell-item>
+						<u-cell-item title="出场时间 " :arrow="false" :border-bottom="false" :border-top="false"
+							:value="orderInfo.outTime"></u-cell-item>
+					</template>
+					<template v-else>
+						<u-cell-item title="开始计费 " :arrow="false" :border-bottom="false" :border-top="false"
+							:value="orderInfo.inTime"></u-cell-item>
+						<u-cell-item title="结束计费 " :arrow="false" :border-bottom="false" :border-top="false"
+							:value="orderInfo.outTime"></u-cell-item>
+					</template>
+					<template v-if="orderInfo.deviceType == 1">
+						<u-cell-item title="免费时长 " :arrow="false" :border-bottom="false" :border-top="false"
+							:value="orderInfo.freeDuration"></u-cell-item>
+					</template>
+					<template v-else>
+						<u-cell-item title="免费时长 " :arrow="false" :border-bottom="false" :border-top="false"
+							value="0天0时15分0秒"></u-cell-item>
+					</template>
+					<u-cell-item title="计费时长 " :arrow="false" :border-bottom="false" :border-top="false"
+						:value="orderInfo.calcDuration"></u-cell-item>
+					<u-cell-item title="累计停车时长 " :arrow="false" :border-bottom="false" :border-top="false"
+						:value="orderInfo.duration"></u-cell-item>
+					<u-cell-item v-if="orderInfo.createTime" title="订单创建时间 " :arrow="false" :border-bottom="false"
+						:border-top="false" :value="orderInfo.createTime"></u-cell-item>
+					<u-cell-item v-if="orderInfo.payTime" title="支付时间 " :arrow="false" :border-bottom="false"
+						:border-top="false" :value="orderInfo.payTime"></u-cell-item>
+					<u-cell-item v-if="orderInfo.payStatus == 1" title="缴费方式 " :arrow="false" :border-bottom="false"
+						:border-top="false" :value="orderInfo.paySource | verifyPaySource"></u-cell-item>
+				</u-cell-group>
 		</view>
 		<view class="bottom-btn-wrap"
 			v-if="(orderInfo.payStatus == 0 || orderInfo.payStatus == 2 || orderInfo.payStatus == 3) && openFlag !== 'open'">
@@ -131,7 +171,7 @@
 						}
 					}, 1000)
 				} else {
-					this.handleGetOrderinfo(this.orderId)
+					this.handleGetOrderinfo(this.orderId,this.openFlag)
 				}
 			}
 		},
@@ -144,20 +184,38 @@
 			/**
 			 * 通过订单id去获取订单信息
 			 * */
-			handleGetOrderinfo(orderId) {
-				this.$u.api.getOrderDetail({
-						id: orderId
-					})
-					.then(res => {
-						if (res.code === 200) {
-							this.orderInfo = res.data
-						} else {
-							this.$refs.uToast.show({
-								title: res.msg,
-								type: 'error'
-							})
-						}
-					})
+			handleGetOrderinfo(orderId,openFlag) {
+				if(openFlag == 'road'){
+					this.$u.api.getOrderDetail({
+							id: orderId
+						})
+						.then(res => {
+							if (res.code === 200) {
+								this.orderInfo = res.data
+							} else {
+								this.$refs.uToast.show({
+									title: res.msg,
+									type: 'error'
+								})
+							}
+						})
+				}else{
+					console.log("我是室内")
+					this.$u.api.getRoomOrderDetail({
+							id: orderId
+						})
+						.then(res => {
+							if (res.code === 200) {
+								this.orderInfo = res.data
+							} else {
+								this.$refs.uToast.show({
+									title: res.msg,
+									type: 'error'
+								})
+							}
+						})
+				}
+			
 			},
 			/**
 			 * 查询支付状态
@@ -171,7 +229,7 @@
 						if (res.data.payStatus === 1 || res.data.payStatus === 3) {
 							this.loadingMask = false
 							clearInterval(this.timer);
-							this.handleGetOrderinfo(this.orderId)
+							this.handleGetOrderinfo(this.orderId,this.openFlag)
 						}
 					} else {
 						this.$refs.uToast.show({

+ 1 - 2
pages/searchparking/searchparking.vue

@@ -123,7 +123,7 @@
 			 * 获取停车场我的停车
 			 */
 			getParkingLotParkingList({ num, size }) {
-				this.$u.api.getOrderList({
+				this.$u.api.getRoomParkingApi({
 					orderStatus: 1,
 					pageNum:  num,
 					pageSize: size
@@ -137,7 +137,6 @@
 				
 					if (num == 1) this.parkinglist = []; //如果是第一页需手动置空列表
 					this.parkinglist = this.parkinglist.concat(curPageData); //追加新数据
-				
 					// 请求成功,隐藏加载状态
 					//后台接口有返回列表的总页数 totalPage
 					this.mescroll.endByPage(curPageLen, totalPage);

+ 2 - 1
vue.config.js

@@ -2,7 +2,8 @@ module.exports = {
 	// 配置路径别名
 	configureWebpack: {
 		devServer: {
-			disableHostCheck: true
+			disableHostCheck: true,
+			https:false
 		}
 	},
 	devServer: {