<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>
|
|
<div class="offerpay" v-if="showOffpayInstruct || showUploadBox">
|
<OffpayInstruct
|
v-if="showOffpayInstruct"
|
@close="showOffpayInstruct = false"
|
:offerData="{ username: username, sum: sum, orderId: orderId }"
|
@confirm="confirmOrder"
|
></OffpayInstruct>
|
<UploadBox
|
:orderId="orderId"
|
@close="showUploadBox = false"
|
@back="back"
|
v-if="showUploadBox"
|
>
|
</UploadBox>
|
</div>
|
|
<div class="mask" v-if="showOffpayInstruct || showUploadBox"></div>
|
</div>
|
</template>
|
|
<script>
|
import { getOrderById } from "@/api/product";
|
import { resumePay } from "@/api/order";
|
import OffpayInstruct from "@/views/productDetail/components/OffpayInstruct";
|
import UploadBox from "@/views/productDetail/components/UploadBox";
|
|
export default {
|
props: {
|
orderId: {},
|
},
|
components: {
|
OffpayInstruct,
|
UploadBox,
|
},
|
data() {
|
return {
|
activeNum: 1,
|
orders: [],
|
orderInfo: {},
|
policyChecked: false,
|
payWay: "ali",
|
username: "",
|
offPayInstruVisible: false,
|
onlinePayVisible: false,
|
showOffpayInstruct: false,
|
showUploadBox: 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() {
|
if (!this.policyChecked) {
|
this.$notify({
|
type: "error",
|
message: "请确认用户条款",
|
});
|
return;
|
}
|
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.push("/trialCenter");
|
this.$notify({
|
type: "success",
|
message: "成功试用",
|
duration: 2500,
|
offset: 57,
|
});
|
}
|
});
|
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.showOffpayInstruct = 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");
|
},
|
confirmOrder() {
|
this.showOffpayInstruct = false;
|
this.showUploadBox = true;
|
},
|
back() {
|
this.showOffpayInstruct = true;
|
this.showUploadBox = false;
|
},
|
},
|
};
|
</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;
|
}
|
}
|
}
|
}
|
|
.btns {
|
position: absolute;
|
right: 20px;
|
bottom: 20px;
|
display: flex;
|
justify-content: end;
|
text-align: center;
|
line-height: 40px;
|
|
.confirm {
|
margin-left: 10px;
|
width: 104px;
|
height: 40px;
|
background: #0065ff;
|
color: #fff;
|
}
|
|
.cancel {
|
width: 104px;
|
height: 40px;
|
border: 1px solid #0065ff;
|
color: #0065ff;
|
}
|
}
|
|
.offerpay {
|
position: fixed;
|
top: 50%;
|
left: 50%;
|
margin-top: -331px;
|
margin-left: -223px;
|
width: 446px;
|
height: 662px;
|
background: #ffffff;
|
z-index: 2;
|
}
|
|
.mask {
|
position: fixed;
|
top: 0;
|
left: 0;
|
right: 0;
|
bottom: 0;
|
background: #000000;
|
opacity: 0.2;
|
z-index: 1;
|
}
|
}
|
</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>
|