|
@@ -137,16 +137,23 @@
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <el-dialog title="申请开通课程" :visible.sync="buyCourseDialog" width="550px" top="100px" align="center">
|
|
|
|
|
|
|
+ <el-dialog title="申请开通课程" :visible.sync="buyCourseDialog" width="550px" top="100px" align="left">
|
|
|
<template v-if="!showPay">
|
|
<template v-if="!showPay">
|
|
|
<el-form label-width="100px" :inline="false" :model="buyForm" :rules="rules"
|
|
<el-form label-width="100px" :inline="false" :model="buyForm" :rules="rules"
|
|
|
ref="elForm">
|
|
ref="elForm">
|
|
|
|
|
+ <el-form-item label="账户余额" prop="balance" >
|
|
|
|
|
+ <p style="margin-left: 20px;font-size: 16px;">
|
|
|
|
|
+ <span v-if="userInfo.balance>=buyForm.fee" style="color: green;"> ¥{{userInfo.balance/100}}元</span>
|
|
|
|
|
+ <span v-else style="color: red;"> ¥{{userInfo.balance/100}}元</span>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="报考岗位" prop="courseName">
|
|
<el-form-item label="报考岗位" prop="courseName">
|
|
|
<el-input type="text" placeholder="报考岗位" v-model="buyForm.courseName+'-'+buyForm.nd"
|
|
<el-input type="text" placeholder="报考岗位" v-model="buyForm.courseName+'-'+buyForm.nd"
|
|
|
style="width: 360px;" />
|
|
style="width: 360px;" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
<el-form-item label="证书编号" prop="rzCode">
|
|
<el-form-item label="证书编号" prop="rzCode">
|
|
|
<el-input v-model="buyForm.rzCode" type="text" style="width: 360px;">
|
|
<el-input v-model="buyForm.rzCode" type="text" style="width: 360px;">
|
|
|
<template #suffix>
|
|
<template #suffix>
|
|
@@ -184,9 +191,10 @@
|
|
|
<el-divider></el-divider>
|
|
<el-divider></el-divider>
|
|
|
<h2 class="tc"> 本课程费用: <strong style="color: red;"> {{buyForm.fee/100}} 元 </strong> </h2>
|
|
<h2 class="tc"> 本课程费用: <strong style="color: red;"> {{buyForm.fee/100}} 元 </strong> </h2>
|
|
|
|
|
|
|
|
- <el-form-item label-width="0" style="margin-top: 30px;">
|
|
|
|
|
|
|
+ <el-form-item label-width="0" style="margin: 30px auto;text-align: center;">
|
|
|
<el-button @click="cancelBuyCourse">取 消</el-button>
|
|
<el-button @click="cancelBuyCourse">取 消</el-button>
|
|
|
<el-button @click="generatePayQrcode" type="primary">提交订单</el-button>
|
|
<el-button @click="generatePayQrcode" type="primary">提交订单</el-button>
|
|
|
|
|
+ <el-button v-if="userInfo.balance >= buyForm.fee" @click="doAccountPay" type="success">余额付款</el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-form>
|
|
</el-form>
|
|
@@ -416,12 +424,21 @@
|
|
|
httpServer("weixin.isPayOk", { outTradeNo }).then((res) => {
|
|
httpServer("weixin.isPayOk", { outTradeNo }).then((res) => {
|
|
|
if (res.code == 200 && !!res.data) {
|
|
if (res.code == 200 && !!res.data) {
|
|
|
if (this.timer) window.clearInterval(this.timer);
|
|
if (this.timer) window.clearInterval(this.timer);
|
|
|
- this.$message.success("支付成功");
|
|
|
|
|
|
|
+ this.$message.successMsg("支付成功", 2);
|
|
|
this.buyCourseDialog = false;
|
|
this.buyCourseDialog = false;
|
|
|
this.getData();
|
|
this.getData();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ doAccountPay(){
|
|
|
|
|
+ let param = Object.assign({}, this.buyForm);
|
|
|
|
|
+ httpServer("weixin.doAccountPay", {courseId}).then((res) => {
|
|
|
|
|
+ if (res.code != 200) return;
|
|
|
|
|
+ this.$message.successMsg("支付成功", 2);
|
|
|
|
|
+ this.buyCourseDialog = false;
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
generatePayQrcode() {
|
|
generatePayQrcode() {
|
|
|
console.log('generatePayQrcode')
|
|
console.log('generatePayQrcode')
|
|
|
let payType = this.buyForm.payType;
|
|
let payType = this.buyForm.payType;
|