mall + pay:

1. 将 amount 统一都修改成 price
2. 将 payed 统一改成 payStatus
This commit is contained in:
YunaiV
2023-07-10 17:35:26 +08:00
parent 5d2d52020e
commit 2485a5ebc9
38 changed files with 225 additions and 286 deletions

View File

@ -227,14 +227,14 @@ export const constantRoutes = [
component: Layout,
hidden: true,
children: [{
path: 'order/submit',
name: 'PayOrderSubmit',
path: 'cashier',
name: 'PayCashier',
hidden: true,
meta: {
title: '收银台',
noCache: true
},
component: (resolve) => require(['@/views/pay/order/submit'], resolve)
component: (resolve) => require(['@/views/pay/cashier'], resolve)
}]
}
]

View File

@ -113,7 +113,7 @@
</template>
</el-table-column>
<!-- TODO @小程这里应该是一个订单下多个商品只展示订单上的总金额就是 order.payPrice -->
<el-table-column label="实付金额(元)" prop="amount" align="center" width="100"/>
<el-table-column label="实付金额(元)" prop="price" align="center" width="100"/>
<!-- TODO @小程这里应该是一个订单下多个商品只展示订单上的收件信息使用 order.receiverXXX 开头的字段 -->
<el-table-column label="买家/收货人" prop="buyer" header-align="center" width="auto" min-width="300">
<template v-slot="{ row }">

View File

@ -6,7 +6,7 @@
<el-descriptions-item label="支付单号">{{ payOrder.id }}</el-descriptions-item>
<el-descriptions-item label="商品标题">{{ payOrder.subject }}</el-descriptions-item>
<el-descriptions-item label="商品内容">{{ payOrder.body }}</el-descriptions-item>
<el-descriptions-item label="支付金额">{{ (payOrder.amount / 100.0).toFixed(2) }}</el-descriptions-item>
<el-descriptions-item label="支付金额">{{ (payOrder.price / 100.0).toFixed(2) }}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{ parseTime(payOrder.createTime) }}</el-descriptions-item>
<el-descriptions-item label="过期时间">{{ parseTime(payOrder.expireTime) }}</el-descriptions-item>
</el-descriptions>
@ -88,16 +88,17 @@
import QrcodeVue from 'qrcode.vue'
import { DICT_TYPE, getDictDatas } from "@/utils/dict";
import { getOrder, submitOrder } from '@/api/pay/order';
import {PayChannelEnum, PayDisplayModeEnum, PayOrderStatusEnum} from "@/utils/constants";
import { PayChannelEnum, PayDisplayModeEnum, PayOrderStatusEnum } from "@/utils/constants";
export default {
name: "PayOrderSubmit",
name: "PayCashier",
components: {
QrcodeVue,
},
data() {
return {
id: undefined, //
returnUrl: undefined, //
loading: false, // loading
payOrder: {}, //
aliPayChannels: [], //
@ -139,6 +140,9 @@ export default {
},
created() {
this.id = this.$route.query.id;
if (this.$route.query.returnUrl) {
this.returnUrl = decodeURIComponent(this.$route.query.returnUrl)
}
this.getDetail();
this.initPayChannels();
},
@ -296,7 +300,8 @@ export default {
},
/** 提交支付后URL 的展示形式 */
displayUrl(channelCode, data) {
window.open(data.displayContent)
// window.open(data.displayContent)window
location.href = data.displayContent
this.submitLoading = false
},
/** 提交支付后Form 的展示形式 */
@ -369,6 +374,10 @@ export default {
goBackToList() {
this.$tab.closePage();
this.$router.go(-1);
// TODO
// this.$router.push({
// path: this.returnUrl
// });
}
}
};

View File

@ -29,9 +29,9 @@
</template>
</el-table-column>
<el-table-column label="支付单号" align="center" prop="payOrderId" />
<el-table-column label="是否支付" align="center" prop="payed">
<el-table-column label="是否支付" align="center" prop="payStatus">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.payed" />
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.payStatus" />
</template>
</el-table-column>
<el-table-column label="支付时间" align="center" prop="payTime" width="180">
@ -47,9 +47,9 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handlePay(scope.row)"
v-if="!scope.row.payed">前往支付</el-button>
v-if="!scope.row.payStatus">前往支付</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleRefund(scope.row)"
v-if="scope.row.payed && !scope.row.payRefundId">发起退款</el-button>
v-if="scope.row.payStatus && !scope.row.payRefundId">发起退款</el-button>
</template>
</el-table-column>
</el-table>
@ -78,12 +78,10 @@
</template>
<script>
import {createDemoOrder, getDemoOrderPage, refundDemoOrder} from "@/api/pay/demo";
import { createDemoOrder, getDemoOrderPage, refundDemoOrder } from "@/api/pay/demo";
export default {
name: "PayDemoOrder",
components: {
},
data() {
return {
// 遮罩层
@ -192,9 +190,10 @@ export default {
/** 支付按钮操作 */
handlePay(row) {
this.$router.push({
name: 'PayOrderSubmit',
name: 'PayCashier',
query:{
id: row.payOrderId
id: row.payOrderId,
returnUrl: encodeURIComponent('/pay/demo-order?id=' + row.id)
}
})
},

View File

@ -81,19 +81,19 @@
</template>
</el-table-column>
<el-table-column label="商品标题" align="center" prop="subject" width="180" :show-overflow-tooltip="true"/>
<el-table-column label="支付金额" align="center" prop="amount" width="100">
<el-table-column label="支付金额" align="center" prop="price" width="100">
<template v-slot="scope">
{{ parseFloat(scope.row.amount / 100).toFixed(2) }}
{{ parseFloat(scope.row.price / 100).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="手续金额" align="center" prop="channelFeeAmount" width="100">
<el-table-column label="手续金额" align="center" prop="channelFeePrice" width="100">
<template v-slot="scope">
{{ parseFloat(scope.row.channelFeeAmount / 100).toFixed(2) }}
{{ parseFloat(scope.row.channelFeePrice / 100).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="退款金额" align="center" prop="refundAmount" width="100">
<el-table-column label="退款金额" align="center" prop="refundPrice" width="100">
<template v-slot="scope">
{{ parseFloat(scope.row.refundAmount / 100).toFixed(2) }}
{{ parseFloat(scope.row.refundPrice / 100).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="支付状态" align="center" prop="status">
@ -154,10 +154,10 @@
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="金额">
<el-tag type="success" size="small">{{ parseFloat(orderDetail.amount / 100, 2) }}</el-tag>
<el-tag type="success" size="small">{{ parseFloat(orderDetail.price / 100, 2) }}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="手续费">
<el-tag type="warning" size="small">{{ parseFloat(orderDetail.channelFeeAmount / 100, 2) }}</el-tag>
<el-tag type="warning" size="small">{{ parseFloat(orderDetail.channelFeePrice / 100, 2) }}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="手续费比例">
{{ parseFloat(orderDetail.channelFeeRate / 100, 2) }}%
@ -184,7 +184,7 @@
<el-descriptions-item label="退款次数">{{ orderDetail.refundTimes }}</el-descriptions-item>
<el-descriptions-item label="退款金额">
<el-tag type="warning">
{{ parseFloat(orderDetail.refundAmount / 100, 2) }}
{{ parseFloat(orderDetail.refundPrice / 100, 2) }}
</el-tag>
</el-descriptions-item>
</el-descriptions>
@ -213,16 +213,16 @@ const defaultOrderDetail = {
merchantOrderId: null,
channelOrderNo: '',
body: '',
amount: null,
price: null,
channelFeeRate: null,
channelFeeAmount: null,
channelFeePrice: null,
userIp: '',
status: null,
notifyUrl: '',
notifyStatus: null,
refundStatus: null,
refundTimes: '',
refundAmount: null,
refundPrice: null,
createTime: '',
successTime: '',
notifyTime: '',
@ -262,15 +262,15 @@ export default {
body: null,
notifyUrl: null,
notifyStatus: null,
amount: null,
price: null,
channelFeeRate: null,
channelFeeAmount: null,
channelFeePrice: null,
status: null,
userIp: null,
successExtensionId: null,
refundStatus: null,
refundTimes: null,
refundAmount: null,
refundPrice: null,
channelUserId: null,
channelOrderNo: null,
expireTime: [],

View File

@ -95,14 +95,14 @@
</p>
</template>
</el-table-column>
<el-table-column label="支付金额(元)" align="center" prop="payAmount" width="100">
<el-table-column label="支付金额(元)" align="center" prop="payPrice" width="100">
<template v-slot="scope" class="">
{{ parseFloat(scope.row.payAmount / 100).toFixed(2) }}
{{ parseFloat(scope.row.payPrice / 100).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="退款金额(元)" align="center" prop="refundAmount" width="100">
<el-table-column label="退款金额(元)" align="center" prop="refundPrice" width="100">
<template v-slot="scope">
{{ parseFloat(scope.row.refundAmount / 100).toFixed(2) }}
{{ parseFloat(scope.row.refundPrice / 100).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="退款类型" align="center" prop="type" width="80">
@ -160,10 +160,10 @@
<el-divider></el-divider>
<el-descriptions :column="2" label-class-name="desc-label">
<el-descriptions-item label="支付金额">
{{ parseFloat(refundDetail.payAmount / 100).toFixed(2) }}
{{ parseFloat(refundDetail.payPrice / 100).toFixed(2) }}
</el-descriptions-item>
<el-descriptions-item label="退款金额" size="mini">
<el-tag class="tag-purple" size="mini">{{ parseFloat(refundDetail.refundAmount / 100).toFixed(2) }}</el-tag>
<el-tag class="tag-purple" size="mini">{{ parseFloat(refundDetail.refundPrice / 100).toFixed(2) }}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="退款类型">
<template v-slot="scope">
@ -234,9 +234,9 @@ const defaultRefundDetail = {
notifyTime: null,
notifyUrl: '',
orderId: null,
payAmount: null,
payPrice: null,
reason: '',
refundAmount: null,
refundPrice: null,
status: null,
subject: '',
successTime: null,
@ -277,8 +277,8 @@ export default {
notifyStatus: null,
status: null,
type: null,
payAmount: null,
refundAmount: null,
payPrice: null,
refundPrice: null,
reason: null,
userIp: null,
channelOrderNo: null,