|
@@ -2,7 +2,6 @@ import OHeader from '@/components/o-header'
|
|
|
import { defineComponent, onMounted, reactive } from 'vue'
|
|
|
import { Button, Cell, CellGroup, Image, showConfirmDialog, Tag } from 'vant'
|
|
|
import styles from './index.module.less'
|
|
|
-import iconRefunded from './images/icon_refunded.png'
|
|
|
import iconRefunding from './images/icon_refunding.png'
|
|
|
import icon_success from './images/icon_success.png'
|
|
|
import iconClose from './images/icon_close.png'
|
|
@@ -30,6 +29,7 @@ export default defineComponent({
|
|
|
)
|
|
|
|
|
|
state.orders = data || {}
|
|
|
+ // state.orders.status = 'REFUNDED'
|
|
|
const tempGoods = data.goodsInfos || []
|
|
|
tempGoods.forEach((item: any) => {
|
|
|
const img = item.goodsUrl ? item.goodsUrl.split(',')[0] : ''
|
|
@@ -63,11 +63,25 @@ export default defineComponent({
|
|
|
FAIL: iconClose,
|
|
|
CLOSED: iconClose,
|
|
|
REFUNDING: iconRefunding,
|
|
|
- REFUNDED: iconRefunded
|
|
|
+ REFUNDED: icon_success
|
|
|
}
|
|
|
return template[type] || icon_success
|
|
|
}
|
|
|
|
|
|
+ const formatOrderStatus = (status: string) => {
|
|
|
+ const temp = {
|
|
|
+ WAIT_PAY: '支付中',
|
|
|
+ PAYING: '支付中',
|
|
|
+ PAID: '支付成功',
|
|
|
+ TIMEOUT: '订单超时',
|
|
|
+ FAIL: '支付失败',
|
|
|
+ CLOSED: '订单关闭',
|
|
|
+ REFUNDING: '退款中',
|
|
|
+ REFUNDED: '已退款'
|
|
|
+ }
|
|
|
+ return temp[status]
|
|
|
+ }
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
getDetails()
|
|
|
useEventListener(document, 'scroll', () => {
|
|
@@ -88,17 +102,28 @@ export default defineComponent({
|
|
|
<>
|
|
|
<div class={styles.orderType}>
|
|
|
<Image class={styles.img} src={formatImg(state.orders.status)} />
|
|
|
- <span>{orderStatus[state.orders.status]}</span>
|
|
|
- </div>
|
|
|
- <div class={styles.orderPrice}>
|
|
|
- <span>¥</span>
|
|
|
- {moneyFormat(state.orders.paymentCashAmount)}
|
|
|
+ <div class={styles.orderInfo}>
|
|
|
+ <span>{formatOrderStatus(state.orders.status)}</span>
|
|
|
+ {state.orders.status === 'PAID' || state.orders.status === 'REFUNDING' ? (
|
|
|
+ <div class={styles.orderPrice}>
|
|
|
+ 实付金额:¥{moneyFormat(state.orders.paymentCashAmount)}
|
|
|
+ </div>
|
|
|
+ ) : (
|
|
|
+ ''
|
|
|
+ )}
|
|
|
+
|
|
|
+ {state.orders.status === 'REFUNDED' && (
|
|
|
+ <div class={styles.orderPrice}>
|
|
|
+ 退款金额:¥{moneyFormat(state.orders.paymentCashAmount)}
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</>
|
|
|
)}
|
|
|
</div>
|
|
|
|
|
|
- <CellGroup inset class={styles.cellGroup}>
|
|
|
+ <CellGroup inset class={[styles.cellGroup, styles.mTop]}>
|
|
|
<Cell>
|
|
|
{{ title: () => '付款时间', value: () => <span>{state.orders.payTime || '--'}</span> }}
|
|
|
</Cell>
|
|
@@ -112,13 +137,17 @@ export default defineComponent({
|
|
|
<i></i> 购买详情
|
|
|
</div>
|
|
|
{state.goodsInfos.map((goods: any) => (
|
|
|
- <Cell center>
|
|
|
+ <Cell>
|
|
|
{{
|
|
|
icon: () => <Image class={styles.buyImg} src={goods.goodsUrl} />,
|
|
|
title: () => (
|
|
|
<div class={styles.buyContent}>
|
|
|
<p class={styles.goodsTitle}>{goods.goodsName}</p>
|
|
|
- <Tag color="#EEEEEE" textColor="#666666">
|
|
|
+ <Tag
|
|
|
+ color="linear-gradient(135deg, #FF8C4A 0%, #FF531C 100%)"
|
|
|
+ textColor="#fff"
|
|
|
+ class={styles.brandName}
|
|
|
+ >
|
|
|
{goods.brandName}
|
|
|
</Tag>
|
|
|
</div>
|