<template>
|
<div class="ConfirmOrder">
|
<div class="boxTitle">订单支付</div>
|
<div class="close iconfont" @click="close"></div>
|
|
<div class="orderStatus">
|
<el-steps :active="activeNum" finish-status="success" simple>
|
<el-step title="提交订单"></el-step>
|
<el-step title="确认订单"></el-step>
|
<el-step title="完成支付"></el-step>
|
</el-steps>
|
</div>
|
<div class="noTreeBody">
|
<div class="title">订单详情</div>
|
<div class="table-area">
|
<el-table :data="orders" border :fit="true">
|
<el-table-column
|
prop="productName"
|
label="产品名称"
|
></el-table-column>
|
|
<el-table-column label="配置详情">
|
<template slot-scope="scope">
|
<div style="text-align: left">
|
<p v-if="scope.row.moduleNames.length > 0">
|
模块:
|
<span
|
v-for="item in scope.row.moduleNames"
|
:key="item + 'm'"
|
>{{ item + " " }}</span
|
>
|
</p>
|
<p>
|
通道数量:
|
<span>{{ scope.row.chCount || 0 }}</span>
|
</p>
|
<p>
|
授权数量:
|
<span>{{ scope.row.authCount || 0 }}</span>
|
</p>
|
<p v-if="scope.row.sdkNames.length > 0">
|
算法:
|
<span
|
v-for="item in scope.row.sdkNames"
|
:key="item + 'sdk'"
|
>{{ item + " " }}</span
|
>
|
</p>
|
<p>
|
服务时长:
|
<span>{{ scope.row.serveYear + "年" }}</span>
|
</p>
|
</div>
|
</template>
|
</el-table-column>
|
<el-table-column prop="devCount" label="购买数量"></el-table-column>
|
<el-table-column pro="devIdList" label="绑定设备">
|
<template slot-scope="scope">
|
<div>
|
<p v-for="item in scope.row.devIdList" :key="item">
|
{{ item }}
|
</p>
|
</div>
|
</template>
|
</el-table-column>
|
<el-table-column label="优惠" prop="discount"></el-table-column>
|
<el-table-column label="小计" prop="productPrice"></el-table-column>
|
</el-table>
|
</div>
|
<div class="title">支付方式</div>
|
<div class="payWays">
|
<div
|
class="payway off"
|
:class="{ act: this.payWay === 'offpay' }"
|
@click="checkPayway('offpay')"
|
>
|
<img
|
src="/images/product/汇款灰.png"
|
class="moneyIcon"
|
v-if="this.payWay === 'ali'"
|
alt=""
|
/>
|
<img class="moneyIcon" src="/images/product/汇款.png" v-else alt="" />
|
<span>线下汇款</span>
|
</div>
|
<div
|
class="payway ali"
|
:class="{ act: this.payWay === 'ali' }"
|
@click="checkPayway('ali')"
|
>
|
<img
|
src="/images/product/支付宝.png"
|
v-if="this.payWay === 'ali'"
|
alt=""
|
/>
|
<img src="/images/product/支付宝灰.png" v-else alt="" />
|
</div>
|
</div>
|
|
<div class="total">
|
<div class="money">
|
应付款<span class="number">{{ sum }}元</span>
|
</div>
|
|
<div class="policy">
|
<el-checkbox v-model="policyChecked"> </el-checkbox>
|
<div class="des">同意用户协议条款</div>
|
<div class="link">查看协议内容</div>
|
</div>
|
</div>
|
</div>
|
|
<div class="btns">
|
<div class="button cancel" @click="close">取消</div>
|
<div class="button confirm" @click="forPay">确定</div>
|
</div>
|
|
<el-dialog
|
class="onlinepay-dialog"
|
:visible="onlinePayVisible"
|
:show-close="false"
|
@close="onlinePayVisible = false"
|
>
|
<div class="title">在线支付</div>
|
<p>如果没有弹出新窗口,请解除浏览器对新窗口的屏蔽,并刷新后重启</p>
|
<div class="btns">
|
<el-button @click="onlinePayVisible = false">返回</el-button>
|
<el-button type="primary" @click="assureOnlinePay">完成支付</el-button>
|
</div>
|
</el-dialog>
|
<el-dialog
|
class="offpay-instruct-dialog"
|
:visible="offPayInstruVisible"
|
:show-close="true"
|
@close="offPayInstruVisible = false"
|
>
|
<div slot="title" class="dialog-title">线下汇款说明</div>
|
<div class="offPay-instruct">
|
<h5>请将款项汇入以下银行账户:</h5>
|
<ul>
|
<li><label>开户银行:</label>北京银行太阳宫支行</li>
|
<li><label>账 号:</label>2000 0031 2025 0000 9136 746</li>
|
<li><label>开户行行号:</label>313100001792</li>
|
<li>
|
<label>款项:</label>
|
<span class="main-color">{{ sum }}元</span>
|
</li>
|
</ul>
|
<div class="dash-line"></div>
|
<ul class="userinfo">
|
<li>
|
<label>您的登录用户名:</label>
|
{{ this.username }}
|
</li>
|
<li>
|
<label>您的订单号:</label>
|
{{ orderId }}
|
</li>
|
</ul>
|
<div class="attentions">
|
<p class="title">注意事项:</p>
|
<p>1、请在转账时务必提供用户名和订单编号;</p>
|
<p>
|
2、转账后,请务必点击“支付完成/上传凭证”提交转账信息,以便财务确认,财务确认时间为提交后的1-3个工作日;
|
</p>
|
<p>3、您可以在“我的订单”点击【提交付款凭证】,查看本页中的内容</p>
|
</div>
|
<div class="btns text-center">
|
<el-button
|
class="btn-cancle"
|
@click="offPayInstruVisible = false"
|
style="margin-right: 20px"
|
>取消</el-button
|
>
|
<router-link
|
:to="`/Layout/ManageOrder?confirmOrder=offPay&orderId=${orderId}`"
|
>
|
<el-button class="btn-assure" type="primary"
|
>支付完成/上传凭证</el-button
|
>
|
</router-link>
|
</div>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { getOrderById } from "@/api/product";
|
import { resumePay } from "@/api/order";
|
export default {
|
props: {
|
orderId: {},
|
},
|
data() {
|
return {
|
activeNum: 1,
|
orders: [],
|
orderInfo: {},
|
policyChecked: false,
|
payWay: "ali",
|
username: "",
|
offPayInstruVisible: false,
|
onlinePayVisible: false,
|
};
|
},
|
computed: {
|
sum() {
|
let sum = 0;
|
sum = this.orders.reduce((prev, next) => prev + next.productPrice, 0);
|
return this.numeral(sum).format("0,0.00");
|
},
|
},
|
mounted() {
|
this.getResumeList();
|
this.username = JSON.parse(sessionStorage.getItem("userInfo")).username;
|
},
|
methods: {
|
assureOnlinePay() {
|
this.onlinePayVisible = false;
|
this.$router.replace("/Layout/ManageOrder");
|
},
|
getResumeList() {
|
getOrderById(this.orderId).then((res) => {
|
if (res.success) {
|
this.orderInfo = res.data.orderInfo;
|
this.orders = res.data.orderInfo.products;
|
}
|
});
|
},
|
checkPayway(payway) {
|
this.payWay = payway;
|
},
|
forPay() {
|
let orderId = this.orderId;
|
let payMethod = this.payWay;
|
let _this = this;
|
if (this.orderInfo.orderMoney == 0) {
|
resumePay({ orderId, payMethod: 5 }).then((res) => {
|
if (res.success) {
|
this.$router.replace("/Layout/ManageOrder");
|
}
|
});
|
return;
|
}
|
if (this.payWay == "ali") {
|
resumePay({ orderId, payMethod: 2 }).then((res) => {
|
if (res.success) {
|
//跳转到支付宝支付页面
|
window.open(res.data.result);
|
_this.onlinePayVisible = true;
|
}
|
});
|
} else if (this.payWay == "offpay") {
|
resumePay({ orderId, payMethod: 1 })
|
.then((res) => {
|
if (res.success) {
|
this.offPayInstruVisible = true;
|
}
|
})
|
.catch((e) => {
|
this.$notify({
|
type: "error",
|
message: e.data,
|
duration: 2500,
|
offset: 57,
|
});
|
});
|
} else if (this.payWay == "") {
|
this.$notify({
|
type: "warning",
|
message: "请选择支付方式",
|
duration: 2500,
|
offset: 57,
|
});
|
return;
|
}
|
},
|
close() {
|
this.$emit("close");
|
},
|
},
|
};
|
</script>
|
|
<style lang="scss" scoped >
|
.ConfirmOrder {
|
position: fixed;
|
top: 50%;
|
left: 50%;
|
margin-top: -422px;
|
margin-left: -565px;
|
width: 1130px;
|
height: 844px;
|
box-shadow: 0px 2px 16px 0px rgba(0, 43, 106, 0.25);
|
background-color: #fff;
|
z-index: 2;
|
|
.boxTitle {
|
box-sizing: border-box;
|
padding: 20px;
|
height: 64px;
|
border-bottom: 1px solid #e9ebee;
|
font-size: 18px;
|
font-weight: 700;
|
}
|
|
.close {
|
position: absolute;
|
top: 20px;
|
right: 20px;
|
font-size: 12px;
|
color: #666;
|
cursor: pointer;
|
}
|
|
.noTreeBody {
|
box-sizing: border-box;
|
padding: 0 20px;
|
.title {
|
margin-bottom: 30px;
|
font-size: 16px;
|
color: #666666;
|
}
|
|
.table-area {
|
margin-bottom: 30px;
|
padding-bottom: 30px;
|
border-bottom: 1px dashed #e9ebee;
|
}
|
|
.el-table ::v-deep {
|
thead th {
|
text-align: center;
|
background-color: #f0f3f5;
|
color: #3d3d3d;
|
font-size: 16px;
|
font-weight: 700;
|
}
|
}
|
|
.payWays {
|
display: flex;
|
|
.payway {
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
margin-right: 20px;
|
width: 224px;
|
height: 100px;
|
border-radius: 3px;
|
border: 1px solid #c0c5cc;
|
font-size: 20px;
|
color: #666;
|
|
&.act {
|
border-color: #0065ff;
|
color: #0065ff;
|
}
|
|
.moneyIcon {
|
margin-right: 15px;
|
}
|
}
|
}
|
|
.total {
|
padding: 20px;
|
border-bottom: 1px dashed #e9ebee;
|
border-top: 1px dashed #e9ebee;
|
|
.money {
|
text-align: end;
|
font-size: 20px;
|
|
.number {
|
margin-left: 10px;
|
margin-bottom: 10px;
|
font-size: 36px;
|
color: #ed7e2f;
|
}
|
}
|
|
.policy {
|
margin-top: 10px;
|
display: flex;
|
justify-content: end;
|
align-items: center;
|
font-size: 14px;
|
|
.link {
|
color: #0065ff;
|
}
|
|
.des {
|
margin: 0 5px;
|
}
|
}
|
}
|
}
|
}
|
</style>
|
|
<style lang="scss">
|
.orderStatus {
|
padding: 34px 220px;
|
.el-step.is-simple .el-step__title {
|
font-size: 16px;
|
line-height: 60px;
|
font-weight: 400;
|
}
|
.el-step__title.is-success {
|
color: #3d3d3d;
|
}
|
.el-step.is-simple {
|
align-items: flex-start;
|
}
|
.el-step.is-simple .el-step__head {
|
margin-top: 15px;
|
}
|
.el-step.is-simple .el-step__icon {
|
font-size: 16px;
|
line-height: 15px;
|
text-align: center;
|
}
|
.el-step__title.is-process {
|
color: #0064ff !important;
|
}
|
.el-step__head.is-process .el-step__icon:after {
|
content: "2";
|
position: absolute;
|
font-size: 16px;
|
color: #fff;
|
top: 5px;
|
left: 9px;
|
}
|
.el-step__head.is-wait .el-step__icon:after {
|
content: "3";
|
position: absolute;
|
font-size: 16px;
|
color: #999999;
|
top: 5px;
|
left: 7px;
|
}
|
.el-step.is-simple .el-step__icon {
|
background: #ccc;
|
color: #fff;
|
border: none;
|
width: 26px;
|
height: 26px;
|
font-size: 14px;
|
text-align: center;
|
}
|
.el-step.is-simple .is-success .el-step__icon {
|
background: #fff;
|
border: 1px solid #0064ff;
|
color: #0064ff;
|
}
|
.el-step.is-simple .is-process .el-step__icon {
|
background: #0064ff;
|
}
|
|
.el-step.is-simple .is-wait .el-step__icon {
|
background: #fff;
|
border: 1px solid #999999;
|
color: #999999;
|
}
|
.el-steps--simple {
|
padding-top: 0;
|
padding-bottom: 0;
|
background-color: #fff;
|
}
|
.el-step.is-simple .el-step__arrow::before {
|
display: none;
|
}
|
.el-step.is-simple .el-step__arrow::after {
|
transform: none;
|
width: 150px;
|
height: 1px;
|
}
|
}
|
.el-checkbox__inner:hover {
|
border-color: #0065ff;
|
}
|
|
.el-checkbox__input.is-focus .el-checkbox__inner {
|
border-color: #0065ff;
|
}
|
|
.el-checkbox__input.is-checked .el-checkbox__inner {
|
background-color: #0065ff;
|
border-color: #0065ff;
|
}
|
</style>
|