Skip to content

Commit 4a9e095

Browse files
committed
mall + pay:
1. 将 amount 统一都修改成 price 2. 将 payed 统一改成 payStatus
1 parent 8d724ed commit 4a9e095

File tree

6 files changed

+50
-42
lines changed

6 files changed

+50
-42
lines changed

src/router/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,14 @@ export const constantRoutes = [
227227
component: Layout,
228228
hidden: true,
229229
children: [{
230-
path: 'order/submit',
231-
name: 'PayOrderSubmit',
230+
path: 'cashier',
231+
name: 'PayCashier',
232232
hidden: true,
233233
meta: {
234234
title: '收银台',
235235
noCache: true
236236
},
237-
component: (resolve) => require(['@/views/pay/order/submit'], resolve)
237+
component: (resolve) => require(['@/views/pay/cashier'], resolve)
238238
}]
239239
}
240240
]

src/views/mall/trade/order/index.vue

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

src/views/pay/order/submit.vue renamed to src/views/pay/cashier/index.vue

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<el-descriptions-item label="支付单号">{{ payOrder.id }}</el-descriptions-item>
77
<el-descriptions-item label="商品标题">{{ payOrder.subject }}</el-descriptions-item>
88
<el-descriptions-item label="商品内容">{{ payOrder.body }}</el-descriptions-item>
9-
<el-descriptions-item label="支付金额">¥{{ (payOrder.amount / 100.0).toFixed(2) }}</el-descriptions-item>
9+
<el-descriptions-item label="支付金额">¥{{ (payOrder.price / 100.0).toFixed(2) }}</el-descriptions-item>
1010
<el-descriptions-item label="创建时间">{{ parseTime(payOrder.createTime) }}</el-descriptions-item>
1111
<el-descriptions-item label="过期时间">{{ parseTime(payOrder.expireTime) }}</el-descriptions-item>
1212
</el-descriptions>
@@ -88,16 +88,17 @@
8888
import QrcodeVue from 'qrcode.vue'
8989
import { DICT_TYPE, getDictDatas } from "@/utils/dict";
9090
import { getOrder, submitOrder } from '@/api/pay/order';
91-
import {PayChannelEnum, PayDisplayModeEnum, PayOrderStatusEnum} from "@/utils/constants";
91+
import { PayChannelEnum, PayDisplayModeEnum, PayOrderStatusEnum } from "@/utils/constants";
9292
9393
export default {
94-
name: "PayOrderSubmit",
94+
name: "PayCashier",
9595
components: {
9696
QrcodeVue,
9797
},
9898
data() {
9999
return {
100100
id: undefined, // 请假编号
101+
returnUrl: undefined, // 支付完的回调地址
101102
loading: false, // 支付信息的 loading
102103
payOrder: {}, // 支付信息
103104
aliPayChannels: [], // 阿里支付的渠道
@@ -139,6 +140,9 @@ export default {
139140
},
140141
created() {
141142
this.id = this.$route.query.id;
143+
if (this.$route.query.returnUrl) {
144+
this.returnUrl = decodeURIComponent(this.$route.query.returnUrl)
145+
}
142146
this.getDetail();
143147
this.initPayChannels();
144148
},
@@ -296,7 +300,8 @@ export default {
296300
},
297301
/** 提交支付后,URL 的展示形式 */
298302
displayUrl(channelCode, data) {
299-
window.open(data.displayContent)
303+
// window.open(data.displayContent)window
304+
location.href = data.displayContent
300305
this.submitLoading = false
301306
},
302307
/** 提交支付后,Form 的展示形式 */
@@ -369,6 +374,10 @@ export default {
369374
goBackToList() {
370375
this.$tab.closePage();
371376
this.$router.go(-1);
377+
// TODO 芋艿:需要优化;
378+
// this.$router.push({
379+
// path: this.returnUrl
380+
// });
372381
}
373382
}
374383
};

src/views/pay/demo/index.vue

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
</template>
3030
</el-table-column>
3131
<el-table-column label="支付单号" align="center" prop="payOrderId" />
32-
<el-table-column label="是否支付" align="center" prop="payed">
32+
<el-table-column label="是否支付" align="center" prop="payStatus">
3333
<template v-slot="scope">
34-
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.payed" />
34+
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.payStatus" />
3535
</template>
3636
</el-table-column>
3737
<el-table-column label="支付时间" align="center" prop="payTime" width="180">
@@ -47,9 +47,9 @@
4747
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
4848
<template v-slot="scope">
4949
<el-button size="mini" type="text" icon="el-icon-edit" @click="handlePay(scope.row)"
50-
v-if="!scope.row.payed">前往支付</el-button>
50+
v-if="!scope.row.payStatus">前往支付</el-button>
5151
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleRefund(scope.row)"
52-
v-if="scope.row.payed && !scope.row.payRefundId">发起退款</el-button>
52+
v-if="scope.row.payStatus && !scope.row.payRefundId">发起退款</el-button>
5353
</template>
5454
</el-table-column>
5555
</el-table>
@@ -78,12 +78,10 @@
7878
</template>
7979

8080
<script>
81-
import {createDemoOrder, getDemoOrderPage, refundDemoOrder} from "@/api/pay/demo";
81+
import { createDemoOrder, getDemoOrderPage, refundDemoOrder } from "@/api/pay/demo";
8282
8383
export default {
8484
name: "PayDemoOrder",
85-
components: {
86-
},
8785
data() {
8886
return {
8987
// 遮罩层
@@ -192,9 +190,10 @@ export default {
192190
/** 支付按钮操作 */
193191
handlePay(row) {
194192
this.$router.push({
195-
name: 'PayOrderSubmit',
193+
name: 'PayCashier',
196194
query:{
197-
id: row.payOrderId
195+
id: row.payOrderId,
196+
returnUrl: encodeURIComponent('/pay/demo-order?id=' + row.id)
198197
}
199198
})
200199
},

src/views/pay/order/index.vue

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,19 @@
8181
</template>
8282
</el-table-column>
8383
<el-table-column label="商品标题" align="center" prop="subject" width="180" :show-overflow-tooltip="true"/>
84-
<el-table-column label="支付金额" align="center" prop="amount" width="100">
84+
<el-table-column label="支付金额" align="center" prop="price" width="100">
8585
<template v-slot="scope">
86-
¥{{ parseFloat(scope.row.amount / 100).toFixed(2) }}
86+
¥{{ parseFloat(scope.row.price / 100).toFixed(2) }}
8787
</template>
8888
</el-table-column>
89-
<el-table-column label="手续金额" align="center" prop="channelFeeAmount" width="100">
89+
<el-table-column label="手续金额" align="center" prop="channelFeePrice" width="100">
9090
<template v-slot="scope">
91-
¥{{ parseFloat(scope.row.channelFeeAmount / 100).toFixed(2) }}
91+
¥{{ parseFloat(scope.row.channelFeePrice / 100).toFixed(2) }}
9292
</template>
9393
</el-table-column>
94-
<el-table-column label="退款金额" align="center" prop="refundAmount" width="100">
94+
<el-table-column label="退款金额" align="center" prop="refundPrice" width="100">
9595
<template v-slot="scope">
96-
¥{{ parseFloat(scope.row.refundAmount / 100).toFixed(2) }}
96+
¥{{ parseFloat(scope.row.refundPrice / 100).toFixed(2) }}
9797
</template>
9898
</el-table-column>
9999
<el-table-column label="支付状态" align="center" prop="status">
@@ -154,10 +154,10 @@
154154
</el-tag>
155155
</el-descriptions-item>
156156
<el-descriptions-item label="金额">
157-
<el-tag type="success" size="small">{{ parseFloat(orderDetail.amount / 100, 2) }}</el-tag>
157+
<el-tag type="success" size="small">{{ parseFloat(orderDetail.price / 100, 2) }}</el-tag>
158158
</el-descriptions-item>
159159
<el-descriptions-item label="手续费">
160-
<el-tag type="warning" size="small">{{ parseFloat(orderDetail.channelFeeAmount / 100, 2) }}</el-tag>
160+
<el-tag type="warning" size="small">{{ parseFloat(orderDetail.channelFeePrice / 100, 2) }}</el-tag>
161161
</el-descriptions-item>
162162
<el-descriptions-item label="手续费比例">
163163
{{ parseFloat(orderDetail.channelFeeRate / 100, 2) }}%
@@ -184,7 +184,7 @@
184184
<el-descriptions-item label="退款次数">{{ orderDetail.refundTimes }}</el-descriptions-item>
185185
<el-descriptions-item label="退款金额">
186186
<el-tag type="warning">
187-
{{ parseFloat(orderDetail.refundAmount / 100, 2) }}
187+
{{ parseFloat(orderDetail.refundPrice / 100, 2) }}
188188
</el-tag>
189189
</el-descriptions-item>
190190
</el-descriptions>
@@ -213,16 +213,16 @@ const defaultOrderDetail = {
213213
merchantOrderId: null,
214214
channelOrderNo: '',
215215
body: '',
216-
amount: null,
216+
price: null,
217217
channelFeeRate: null,
218-
channelFeeAmount: null,
218+
channelFeePrice: null,
219219
userIp: '',
220220
status: null,
221221
notifyUrl: '',
222222
notifyStatus: null,
223223
refundStatus: null,
224224
refundTimes: '',
225-
refundAmount: null,
225+
refundPrice: null,
226226
createTime: '',
227227
successTime: '',
228228
notifyTime: '',
@@ -262,15 +262,15 @@ export default {
262262
body: null,
263263
notifyUrl: null,
264264
notifyStatus: null,
265-
amount: null,
265+
price: null,
266266
channelFeeRate: null,
267-
channelFeeAmount: null,
267+
channelFeePrice: null,
268268
status: null,
269269
userIp: null,
270270
successExtensionId: null,
271271
refundStatus: null,
272272
refundTimes: null,
273-
refundAmount: null,
273+
refundPrice: null,
274274
channelUserId: null,
275275
channelOrderNo: null,
276276
expireTime: [],

src/views/pay/refund/index.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@
9595
</p>
9696
</template>
9797
</el-table-column>
98-
<el-table-column label="支付金额(元)" align="center" prop="payAmount" width="100">
98+
<el-table-column label="支付金额(元)" align="center" prop="payPrice" width="100">
9999
<template v-slot="scope" class="">
100-
¥{{ parseFloat(scope.row.payAmount / 100).toFixed(2) }}
100+
¥{{ parseFloat(scope.row.payPrice / 100).toFixed(2) }}
101101
</template>
102102
</el-table-column>
103-
<el-table-column label="退款金额(元)" align="center" prop="refundAmount" width="100">
103+
<el-table-column label="退款金额(元)" align="center" prop="refundPrice" width="100">
104104
<template v-slot="scope">
105-
¥{{ parseFloat(scope.row.refundAmount / 100).toFixed(2) }}
105+
¥{{ parseFloat(scope.row.refundPrice / 100).toFixed(2) }}
106106
</template>
107107
</el-table-column>
108108
<el-table-column label="退款类型" align="center" prop="type" width="80">
@@ -160,10 +160,10 @@
160160
<el-divider></el-divider>
161161
<el-descriptions :column="2" label-class-name="desc-label">
162162
<el-descriptions-item label="支付金额">
163-
{{ parseFloat(refundDetail.payAmount / 100).toFixed(2) }}
163+
{{ parseFloat(refundDetail.payPrice / 100).toFixed(2) }}
164164
</el-descriptions-item>
165165
<el-descriptions-item label="退款金额" size="mini">
166-
<el-tag class="tag-purple" size="mini">{{ parseFloat(refundDetail.refundAmount / 100).toFixed(2) }}</el-tag>
166+
<el-tag class="tag-purple" size="mini">{{ parseFloat(refundDetail.refundPrice / 100).toFixed(2) }}</el-tag>
167167
</el-descriptions-item>
168168
<el-descriptions-item label="退款类型">
169169
<template v-slot="scope">
@@ -234,9 +234,9 @@ const defaultRefundDetail = {
234234
notifyTime: null,
235235
notifyUrl: '',
236236
orderId: null,
237-
payAmount: null,
237+
payPrice: null,
238238
reason: '',
239-
refundAmount: null,
239+
refundPrice: null,
240240
status: null,
241241
subject: '',
242242
successTime: null,
@@ -277,8 +277,8 @@ export default {
277277
notifyStatus: null,
278278
status: null,
279279
type: null,
280-
payAmount: null,
281-
refundAmount: null,
280+
payPrice: null,
281+
refundPrice: null,
282282
reason: null,
283283
userIp: null,
284284
channelOrderNo: null,

0 commit comments

Comments
 (0)