|
@@ -14,8 +14,8 @@
|
|
|
v-if="data?.state === 0 && payData != {}">立即支付</a-button>
|
|
v-if="data?.state === 0 && payData != {}">立即支付</a-button>
|
|
|
|
|
|
|
|
</a-card>
|
|
</a-card>
|
|
|
- <a-card class="general-card">
|
|
|
|
|
- <a-descriptions style="margin-top: 20px" :data="orderData" size="large" title="订单详情" :column="1"/>
|
|
|
|
|
|
|
+ <a-card class="general-card" title="订单详情">
|
|
|
|
|
+ <a-descriptions :data="orderData" size="large" :column="1" />
|
|
|
</a-card>
|
|
</a-card>
|
|
|
<a-card class="general-card" title="商品详情">
|
|
<a-card class="general-card" title="商品详情">
|
|
|
<div v-html="content"></div>
|
|
<div v-html="content"></div>
|
|
@@ -31,7 +31,7 @@ import { orderDeatil } from '@/api/order'
|
|
|
import { useRoute } from 'vue-router'
|
|
import { useRoute } from 'vue-router'
|
|
|
import { Notification } from '@arco-design/web-vue'
|
|
import { Notification } from '@arco-design/web-vue'
|
|
|
import { Message } from '@arco-design/web-vue'
|
|
import { Message } from '@arco-design/web-vue'
|
|
|
-import { IconQq,IconWechatpay, IconAlipayCircle } from '@arco-design/web-vue/es/icon'
|
|
|
|
|
|
|
+import { IconQq, IconWechatpay, IconAlipayCircle } from '@arco-design/web-vue/es/icon'
|
|
|
|
|
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
|
const { id } = route.params
|
|
const { id } = route.params
|
|
@@ -57,7 +57,7 @@ const stramptoTime = (time) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function getPayType(type) {
|
|
function getPayType(type) {
|
|
|
- switch(type) {
|
|
|
|
|
|
|
+ switch (type) {
|
|
|
case 'alipay':
|
|
case 'alipay':
|
|
|
return [h(IconAlipayCircle), ' 支付宝']
|
|
return [h(IconAlipayCircle), ' 支付宝']
|
|
|
case 'qqpay':
|
|
case 'qqpay':
|
|
@@ -79,20 +79,20 @@ const getOrderDeatil = async () => {
|
|
|
content.value = decodeURI(atob(res.data.content || ''))
|
|
content.value = decodeURI(atob(res.data.content || ''))
|
|
|
|
|
|
|
|
let detail = []
|
|
let detail = []
|
|
|
- if(res.data.name)
|
|
|
|
|
- detail.push({label: '商品名称', value: res.data.name})
|
|
|
|
|
- if(res.data.price)
|
|
|
|
|
- detail.push({label: '支付价格', value: res.data.price})
|
|
|
|
|
- if(res.data.pay_type)
|
|
|
|
|
- detail.push({label: '支付方式', value: getPayType(res.data.pay_type)})
|
|
|
|
|
- if(res.data.orderId)
|
|
|
|
|
- detail.push({label: '平台订单号', value: res.data.orderId})
|
|
|
|
|
- if(res.data.pay_id)
|
|
|
|
|
- detail.push({label: '支付平台订单号', value: res.data.pay_id})
|
|
|
|
|
- if(res.data.create_time)
|
|
|
|
|
- detail.push({label: '下单时间', value: stramptoTime(res.data.create_time)})
|
|
|
|
|
- if(res.data.pay_time)
|
|
|
|
|
- detail.push({label: '支付时间', value: stramptoTime(res.data.pay_time)})
|
|
|
|
|
|
|
+ if (res.data.name)
|
|
|
|
|
+ detail.push({ label: '商品名称', value: res.data.name })
|
|
|
|
|
+ if (res.data.price)
|
|
|
|
|
+ detail.push({ label: '支付价格', value: '¥' + res.data.price })
|
|
|
|
|
+ if (res.data.pay_type)
|
|
|
|
|
+ detail.push({ label: '支付方式', value: getPayType(res.data.pay_type) })
|
|
|
|
|
+ if (res.data.orderId)
|
|
|
|
|
+ detail.push({ label: '平台订单号', value: res.data.orderId })
|
|
|
|
|
+ if (res.data.pay_id)
|
|
|
|
|
+ detail.push({ label: '支付平台订单号', value: res.data.pay_id })
|
|
|
|
|
+ if (res.data.create_time)
|
|
|
|
|
+ detail.push({ label: '下单时间', value: stramptoTime(res.data.create_time) })
|
|
|
|
|
+ if (res.data.pay_time)
|
|
|
|
|
+ detail.push({ label: '支付时间', value: stramptoTime(res.data.pay_time) })
|
|
|
|
|
|
|
|
orderData.value = detail
|
|
orderData.value = detail
|
|
|
|
|
|
|
@@ -142,7 +142,7 @@ onUnmounted(() => {
|
|
|
|
|
|
|
|
function getOrderState() {
|
|
function getOrderState() {
|
|
|
if (data.value) {
|
|
if (data.value) {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
switch (data.value.state) {
|
|
switch (data.value.state) {
|
|
|
case 0:
|
|
case 0:
|
|
|
current.value = 1
|
|
current.value = 1
|
|
@@ -181,7 +181,7 @@ function getPaymentStatus(timestamp) {
|
|
|
const diffMs = now - timestamp; // 毫秒差值
|
|
const diffMs = now - timestamp; // 毫秒差值
|
|
|
const diffSeconds = Math.floor(diffMs / 1000); // 秒差值
|
|
const diffSeconds = Math.floor(diffMs / 1000); // 秒差值
|
|
|
|
|
|
|
|
- const timeout = 300;
|
|
|
|
|
|
|
+ const timeout = 300;
|
|
|
|
|
|
|
|
if (diffSeconds > timeout) {
|
|
if (diffSeconds > timeout) {
|
|
|
oneDes.value = "支付超时";
|
|
oneDes.value = "支付超时";
|