2021-05-13 10:56:04 +08:00
|
|
|
|
<template>
|
|
|
|
|
<div class="wrapper">
|
|
|
|
|
<BaseHeader></BaseHeader>
|
|
|
|
|
<div class="wrapper-head">
|
|
|
|
|
<div class="head-left">
|
|
|
|
|
<div class="left-tips">订单提交成功,请尽快付款!</div>
|
|
|
|
|
<div class="left-tips-time">请您尽快完成支付,否则订单会被自动取消</div>
|
2021-06-25 17:31:12 +08:00
|
|
|
|
<div class="left-tips-count-down">
|
2021-06-25 18:31:55 +08:00
|
|
|
|
<mv-count-down :startTime="startTime" class="count-down"
|
|
|
|
|
:endTime="endTime"
|
|
|
|
|
:endText="endText"
|
|
|
|
|
:dayTxt="'天'"
|
|
|
|
|
:hourTxt="'小时'"
|
|
|
|
|
:minutesTxt="'分钟'"
|
|
|
|
|
:secondsTxt="'秒'"
|
|
|
|
|
:isStart="isStart"></mv-count-down>
|
2021-06-25 17:31:12 +08:00
|
|
|
|
|
|
|
|
|
</div>
|
2021-05-13 10:56:04 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="head-right">
|
2021-06-25 17:31:12 +08:00
|
|
|
|
<div>应付金额 <span class="price">{{ payDetail.price | unitPrice }}</span>元</div>
|
2021-05-13 10:56:04 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="wrapper-box">
|
2021-06-25 18:31:55 +08:00
|
|
|
|
<div v-if="support.includes('ALIPAY')" class="-box-item" @click="handlePay('ALIPAY')">
|
|
|
|
|
<img
|
|
|
|
|
src="https://ss3.bdstatic.com/yrwDcj7w0QhBkMak8IuT_XF5ehU5bvGh7c50/logopic/a9936a369e82e0c6c42112674a5220e8_fullsize.jpg"
|
|
|
|
|
alt="">
|
|
|
|
|
<span>支付宝</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="support.includes('WECHAT')" class="-box-item" @click="handlePay('WECHAT')">
|
|
|
|
|
<img
|
|
|
|
|
src="https://dss1.bdstatic.com/6OF1bjeh1BF3odCf/it/u=3774939867,2826752539&fm=74&app=80&f=JPEG&size=f121,121?sec=1880279984&t=796e842a5ef2d16d9edc872d6f1147ef"
|
|
|
|
|
alt="">
|
|
|
|
|
<span>微信</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="support.includes('WALLET')" class="-box-item" @click="handlePay('WALLET')">
|
|
|
|
|
<Icon custom="icomoon icon-wallet" size="60"/>
|
|
|
|
|
<span>余额支付</span>
|
|
|
|
|
<span>当前剩余({{ walletValue | unitPrice('¥') }})</span>
|
2021-05-13 10:56:04 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<BaseFooter></BaseFooter>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
2021-06-25 17:31:12 +08:00
|
|
|
|
|
2021-06-25 18:31:55 +08:00
|
|
|
|
import {tradeDetail, pay} from '@/api/pay.js';
|
2021-06-25 17:31:12 +08:00
|
|
|
|
import MvCountDown from 'mv-count-down'
|
|
|
|
|
import {Message} from 'view-design';
|
|
|
|
|
|
2021-05-13 10:56:04 +08:00
|
|
|
|
export default {
|
2021-06-25 17:31:12 +08:00
|
|
|
|
components: {
|
|
|
|
|
MvCountDown
|
|
|
|
|
},
|
2021-05-13 10:56:04 +08:00
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
payDetail: {}, // 支付详情
|
2021-06-25 17:31:12 +08:00
|
|
|
|
support: [], // 支持配送方式
|
|
|
|
|
walletValue: 0, // 当前余额
|
|
|
|
|
qrcode: '', // 支付二维码
|
|
|
|
|
startTime: new Date().getTime(), // 开始时间(时间戳)
|
|
|
|
|
endTime: 0, // 完成的时间(时间戳)
|
|
|
|
|
endText: '订单已超时取消', // 倒计时完成的提示文本
|
|
|
|
|
isStart: false // 控制倒计时开始的时机(异步请求完成开启)
|
2021-05-13 10:56:04 +08:00
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getTradeDetail () {
|
|
|
|
|
const params = this.$route.query;
|
|
|
|
|
params.clientType = 'PC'
|
|
|
|
|
tradeDetail(params).then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.payDetail = res.result;
|
2021-06-25 17:31:12 +08:00
|
|
|
|
this.endTime = this.payDetail.autoCancel
|
|
|
|
|
this.isStart = true
|
|
|
|
|
this.support = this.payDetail.support
|
|
|
|
|
this.walletValue = this.payDetail.walletValue
|
2021-05-13 10:56:04 +08:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
2021-06-25 17:31:12 +08:00
|
|
|
|
// 支付
|
2021-05-13 10:56:04 +08:00
|
|
|
|
handlePay (way) {
|
2021-06-25 17:31:12 +08:00
|
|
|
|
// 余额支付则直接跳转
|
|
|
|
|
if (way === 'WALLET') {
|
|
|
|
|
// 如果待支付金额大于余额,则报错
|
|
|
|
|
if (this.payDetail.price > this.walletValue) {
|
|
|
|
|
Message.error('余额不足以支付当前订单,如需充值请前往会员中心');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-05-13 10:56:04 +08:00
|
|
|
|
const params = this.$route.query;
|
|
|
|
|
params.paymentMethod = way;
|
|
|
|
|
params.paymentClient = 'NATIVE';
|
|
|
|
|
params.price = this.payDetail.price;
|
2021-06-25 18:31:55 +08:00
|
|
|
|
if (way === 'WALLET') {
|
|
|
|
|
this.$Modal.confirm({
|
|
|
|
|
title: '支付确认',
|
|
|
|
|
content: '<p>确认使用余额支付吗?</p>',
|
|
|
|
|
onOk: () => {
|
|
|
|
|
pay(params).then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.$Message.warning(res.message)
|
|
|
|
|
this.$router.push('/payDone');
|
|
|
|
|
} else {
|
|
|
|
|
this.$Message.warning(res.message)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.$router.push({path: '/qrpay', query: params});
|
|
|
|
|
}
|
2021-05-13 10:56:04 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted () {
|
|
|
|
|
this.getTradeDetail();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped lang="scss">
|
2021-06-25 17:31:12 +08:00
|
|
|
|
.head-left {
|
|
|
|
|
font-weight: bold;
|
2021-05-13 10:56:04 +08:00
|
|
|
|
}
|
2021-06-25 17:31:12 +08:00
|
|
|
|
|
|
|
|
|
.left-tips {
|
|
|
|
|
font-size: 21px;
|
2021-05-13 10:56:04 +08:00
|
|
|
|
|
|
|
|
|
}
|
2021-06-25 17:31:12 +08:00
|
|
|
|
|
|
|
|
|
.-box-item {
|
|
|
|
|
display: flex;
|
2021-06-25 18:31:55 +08:00
|
|
|
|
font-size: 18px;
|
2021-06-25 17:31:12 +08:00
|
|
|
|
font-weight: bold;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin: 20px 20px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
@include content_color($light_content_color);
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
color: $theme_color;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> span {
|
2021-06-25 18:31:55 +08:00
|
|
|
|
margin-left: 15px;
|
2021-06-25 17:31:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> img {
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
width: 60px;
|
|
|
|
|
height: 60px;
|
|
|
|
|
}
|
2021-05-13 10:56:04 +08:00
|
|
|
|
}
|
2021-06-25 17:31:12 +08:00
|
|
|
|
|
|
|
|
|
.left-tips-time {
|
|
|
|
|
font-size: 16px;
|
2021-05-13 10:56:04 +08:00
|
|
|
|
}
|
2021-06-25 17:31:12 +08:00
|
|
|
|
|
|
|
|
|
.left-tips-count-down {
|
|
|
|
|
font-size: 10px;
|
|
|
|
|
color: red;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.wrapper-head {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
line-height: 1.75;
|
2021-05-13 10:56:04 +08:00
|
|
|
|
}
|
2021-06-25 17:31:12 +08:00
|
|
|
|
|
2021-05-13 10:56:04 +08:00
|
|
|
|
.wrapper-head,
|
|
|
|
|
.wrapper-box {
|
|
|
|
|
padding: 20px 40px;
|
|
|
|
|
width: 1200px;
|
|
|
|
|
margin: 20px auto;
|
|
|
|
|
}
|
2021-06-25 17:31:12 +08:00
|
|
|
|
|
2021-05-13 10:56:04 +08:00
|
|
|
|
.wrapper-box {
|
|
|
|
|
@include white_background_color();
|
|
|
|
|
height: auto;
|
|
|
|
|
}
|
2021-06-25 17:31:12 +08:00
|
|
|
|
|
2021-05-13 10:56:04 +08:00
|
|
|
|
.wrapper {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
2021-06-25 17:31:12 +08:00
|
|
|
|
|
|
|
|
|
.price {
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: $theme_color;
|
2021-05-13 10:56:04 +08:00
|
|
|
|
}
|
2021-06-25 17:31:12 +08:00
|
|
|
|
|
|
|
|
|
.head-right {
|
|
|
|
|
font-weight: bold;
|
2021-06-25 18:31:55 +08:00
|
|
|
|
font-size: 18px;
|
|
|
|
|
}
|
|
|
|
|
.count-down{
|
|
|
|
|
font-size: 16px!important;
|
2021-05-13 10:56:04 +08:00
|
|
|
|
}
|
|
|
|
|
</style>
|