Skip to content

Commit 668d8ec

Browse files
committed
增加支付收银台的前端界面
1 parent f734d7d commit 668d8ec

File tree

10 files changed

+152
-0
lines changed

10 files changed

+152
-0
lines changed
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 2 additions & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

src/assets/images/pay/icon/mock.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/images/pay/icon/wx_app.svg

Lines changed: 2 additions & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

src/assets/images/pay/icon/wx_pub.svg

Lines changed: 2 additions & 0 deletions
Loading

src/router/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,18 @@ export const constantRoutes = [
221221
component: (resolve) => require(['@/views/mall/trade/order/detail'], resolve)
222222
}
223223
]
224+
},
225+
{
226+
path: '/pay',
227+
component: Layout,
228+
hidden: true,
229+
children: [{
230+
path: 'order/submit',
231+
name: '收银台',
232+
hidden: true,
233+
meta: { title: '收银台' },
234+
component: (resolve) => require(['@/views/pay/order/submit'], resolve)
235+
}]
224236
}
225237
]
226238

src/views/pay/order/submit.vue

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<template>
2+
<div class="app-container">
3+
<!-- 支付信息 -->
4+
<el-card v-loading="loading">
5+
<el-descriptions title="支付信息" :column="3" border>
6+
<el-descriptions-item label="支付单号">kooriookami</el-descriptions-item>
7+
<el-descriptions-item label="商品标题">苏州市</el-descriptions-item>
8+
<el-descriptions-item label="商品内容">苏州市</el-descriptions-item>
9+
<el-descriptions-item label="支付金额">18100000000</el-descriptions-item>
10+
<el-descriptions-item label="创建时间">苏州市</el-descriptions-item>
11+
<el-descriptions-item label="过期时间">苏州市</el-descriptions-item>
12+
</el-descriptions>
13+
</el-card>
14+
15+
<!-- 微信支付 -->
16+
<el-card style="margin-top: 10px">
17+
<!-- 支付宝 -->
18+
<el-descriptions title="选择支付宝支付">
19+
</el-descriptions>
20+
<div class="pay-channel-container">
21+
<div class="box" v-for="channel in aliPayChannels" :key="channel.code">
22+
<img :src="icons[channel.code]">
23+
<div class="title">{{ channel.name }}</div>
24+
</div>
25+
</div>
26+
<!-- 微信支付 -->
27+
<el-descriptions title="选择微信支付" style="margin-top: 20px;" />
28+
<div class="pay-channel-container">
29+
<div class="box" v-for="channel in wxPayChannels" :key="channel.code">
30+
<img :src="icons[channel.code]">
31+
<div class="title">{{ channel.name }}</div>
32+
</div>
33+
</div>
34+
<!-- 其它支付 -->
35+
<el-descriptions title="选择其它支付" style="margin-top: 20px;" />
36+
<div class="pay-channel-container">
37+
<div class="box" v-for="channel in otherPayChannels" :key="channel.code">
38+
<img :src="icons[channel.code]">
39+
<div class="title">{{ channel.name }}</div>
40+
</div>
41+
</div>
42+
</el-card>
43+
</div>
44+
</template>
45+
<script>
46+
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
47+
48+
export default {
49+
name: "PayOrderSubmit",
50+
components: {
51+
},
52+
data() {
53+
return {
54+
id: undefined, // 请假编号
55+
loading: false, // 支付信息的 loading
56+
payOrder: {}, // 支付信息
57+
aliPayChannels: [], // 阿里支付的渠道
58+
wxPayChannels: [], // 微信支付的渠道
59+
otherPayChannels: [], // 其它的支付渠道
60+
icons: {
61+
alipay_qr: require("@/assets/images/pay/icon/alipay_qr.svg"),
62+
alipay_app: require("@/assets/images/pay/icon/alipay_app.svg"),
63+
alipay_wap: require("@/assets/images/pay/icon/alipay_wap.svg"),
64+
alipay_pc: require("@/assets/images/pay/icon/alipay_pc.svg"),
65+
wx_app: require("@/assets/images/pay/icon/wx_app.svg"),
66+
wx_lite: require("@/assets/images/pay/icon/wx_lite.svg"),
67+
wx_pub: require("@/assets/images/pay/icon/wx_pub.svg"),
68+
mock: require("@/assets/images/pay/icon/mock.svg"),
69+
},
70+
};
71+
},
72+
created() {
73+
this.id = this.$route.query.id;
74+
// if (!this.id) {
75+
// this.$message.error('未传递 id 参数,无法查看 OA 请假信息');
76+
// return;
77+
// }
78+
// this.getDetail();
79+
this.initPayChannels();
80+
},
81+
methods: {
82+
/** 初始化支付渠道 */
83+
initPayChannels() {
84+
// 微信支付
85+
for (const dict of getDictDatas(DICT_TYPE.PAY_CHANNEL_CODE_TYPE)) {
86+
const payChannel = {
87+
name: dict.label,
88+
code: dict.value
89+
}
90+
if (dict.value.indexOf('wx_') === 0) {
91+
this.wxPayChannels.push(payChannel);
92+
} else if (dict.value.indexOf('alipay_') === 0) {
93+
this.aliPayChannels.push(payChannel);
94+
} else {
95+
this.otherPayChannels.push(payChannel);
96+
}
97+
}
98+
},
99+
/** 获得请假信息 */
100+
getDetail() {
101+
getLeave(this.id).then(response => {
102+
this.form = response.data;
103+
});
104+
},
105+
}
106+
};
107+
</script>
108+
<style lang="scss" scoped>
109+
.pay-channel-container {
110+
display: flex;
111+
margin-top: -10px;
112+
.box {
113+
width: 130px;
114+
border: 1px solid #e6ebf5;
115+
cursor: pointer;
116+
text-align: center;
117+
padding-top: 10px;
118+
padding-bottom: 5px;
119+
margin-right: 10px;
120+
img {
121+
width: 40px;
122+
height: 40px;
123+
}
124+
.title {
125+
padding-top: 5px
126+
}
127+
}
128+
}
129+
</style>

0 commit comments

Comments
 (0)