|
@@ -14,7 +14,7 @@
|
|
|
</u-cell-item>
|
|
|
</u-cell-group>
|
|
|
<!-- 路段显示 -->
|
|
|
- <u-cell-group v-if="openFlag == 'road'">
|
|
|
+ <u-cell-group v-if="orderType == '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">
|
|
@@ -63,7 +63,7 @@
|
|
|
:border-top="false" :value="orderInfo.paySource | verifyPaySource"></u-cell-item>
|
|
|
</u-cell-group>
|
|
|
<!-- 停车场时长 -->
|
|
|
- <u-cell-group v-if="openFlag == 'park'">
|
|
|
+ <u-cell-group v-if="orderType == '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">
|
|
@@ -105,11 +105,13 @@
|
|
|
提示:可寻找附近的收费员打印小票并扫码出场
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="bottom-btn-wrap"
|
|
|
- v-if="(orderInfo.payStatus == 0 || orderInfo.payStatus == 2 || orderInfo.payStatus == 3) && openFlag !== 'open'&& (orderInfo.deviceType != 1 && orderInfo.payAmount != 0)">
|
|
|
+ <!-- 显示支付按钮 -->
|
|
|
+ <view class="bottom-btn-wrap" v-if="(orderInfo.payStatus == 0 || orderInfo.payStatus == 2 || orderInfo.payStatus == 3)
|
|
|
+ && openFlag !== 'open'
|
|
|
+ && (orderInfo.deviceType != 1 && orderInfo.payAmount != 0)">
|
|
|
<view class="bottom-btn" @click="goPay(orderId)">去支付</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="bottom-btn-wrap" v-if="openFlag === 'open' && orderInfo.payStatus == 1">
|
|
|
<view class="bottom-btn" @click="jumpOrderList()">返回订单页</view>
|
|
|
</view>
|
|
@@ -142,6 +144,7 @@
|
|
|
data() {
|
|
|
return {
|
|
|
orderId: null,
|
|
|
+ // 用来区分是支付完成返回的标识
|
|
|
openFlag: null,
|
|
|
polyOrderId: null,
|
|
|
// 订单信息
|
|
@@ -154,6 +157,8 @@
|
|
|
jumpUrl: location.href + '&type=open',
|
|
|
loadingMask: false,
|
|
|
exportFlag: false,
|
|
|
+ // 订单类型 road 路段 park 停车场
|
|
|
+ orderType: 'road'
|
|
|
}
|
|
|
},
|
|
|
onLoad(page) {
|
|
@@ -161,6 +166,7 @@
|
|
|
this.orderId = page?.orderId
|
|
|
// 该标识判断是否是从支付完成页面回调回来
|
|
|
this.openFlag = page?.type
|
|
|
+ this.orderType = page?.orderType
|
|
|
this.polyOrderId = page?.polyOrderId
|
|
|
if (this.orderId) {
|
|
|
// 如果type标识和支付订单id同时存在,证明需要执行轮询判断支付状态,否则直接查询
|
|
@@ -170,14 +176,14 @@
|
|
|
let time = 0
|
|
|
this.timer = setInterval(() => {
|
|
|
time++
|
|
|
- this.handlePayStatus(this.polyOrderId, this.openFlag)
|
|
|
+ this.handlePayStatus(this.polyOrderId)
|
|
|
// 超过60s直接清除轮询
|
|
|
if (time === 60) {
|
|
|
clearInterval(this.timer)
|
|
|
}
|
|
|
}, 1000)
|
|
|
} else {
|
|
|
- this.handleGetOrderinfo(this.orderId, this.openFlag)
|
|
|
+ this.handleGetOrderinfo(this.orderId, this.orderType)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -190,15 +196,14 @@
|
|
|
/**
|
|
|
* 通过订单id去获取订单信息
|
|
|
* */
|
|
|
- handleGetOrderinfo(orderId, openFlag) {
|
|
|
- if (openFlag == 'road') {
|
|
|
+ handleGetOrderinfo(orderId, orderType) {
|
|
|
+ if (orderType == 'road') {
|
|
|
this.$u.api.getOrderDetail({
|
|
|
id: orderId
|
|
|
})
|
|
|
.then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.orderInfo = res.data
|
|
|
- console.log(this.orderInfo)
|
|
|
} else {
|
|
|
this.$refs.uToast.show({
|
|
|
title: res.msg,
|
|
@@ -213,7 +218,6 @@
|
|
|
.then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.orderInfo = res.data
|
|
|
- console.log(this.orderInfo)
|
|
|
} else {
|
|
|
this.$refs.uToast.show({
|
|
|
title: res.msg,
|
|
@@ -236,7 +240,7 @@
|
|
|
if (res.data.payStatus === 1 || res.data.payStatus === 3) {
|
|
|
this.loadingMask = false
|
|
|
clearInterval(this.timer);
|
|
|
- this.handleGetOrderinfo(this.orderId, this.openFlag)
|
|
|
+ this.handleGetOrderinfo(this.orderId, this.orderType)
|
|
|
}
|
|
|
} else {
|
|
|
this.$refs.uToast.show({
|
|
@@ -255,7 +259,7 @@
|
|
|
|
|
|
this.orderList = []
|
|
|
this.orderList.push(orderId)
|
|
|
- if (this.openFlag == 'park') {
|
|
|
+ if (this.orderType == 'park') {
|
|
|
this.exportFlag = true
|
|
|
} else {
|
|
|
this.exportFlag = false
|