|
@@ -141,77 +141,38 @@
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <el-dialog title="申请开通课程" :visible.sync="buyCourseDialog" width="850px" top="20px" align="center">
|
|
|
|
|
- <el-form label-width="80px" label-position="right" :inline="true" :model="buyForm" status-icon :rules="rules"
|
|
|
|
|
|
|
+ <el-dialog title="申请开通课程" :visible.sync="buyCourseDialog" width="550px" top="100px" align="center">
|
|
|
|
|
+ <el-form label-width="100px" :inline="false" :model="buyForm" :rules="rules"
|
|
|
ref="elForm">
|
|
ref="elForm">
|
|
|
- <el-row align="left">
|
|
|
|
|
- <el-col :lg="12" class="pl20 pr20">
|
|
|
|
|
- <el-form-item lable="报考岗位" prop="courseName">
|
|
|
|
|
- <label slot="label">报考岗位</label>
|
|
|
|
|
- <el-input v-model="buyForm.courseName" type="text" placeholder="报考岗位" style="width: 260px;"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
-
|
|
|
|
|
- <el-col :lg="12" class="pl20 pr20">
|
|
|
|
|
- <el-form-item lable="证书编号" prop="rzCode">
|
|
|
|
|
- <label slot="label">证书编号</label>
|
|
|
|
|
- <el-input v-model="buyForm.rzCode" type="text" style="width: 260px;">
|
|
|
|
|
- <template #suffix>
|
|
|
|
|
- <el-button @click="openShowAllRzcodeDialog" type="text">修改</el-button>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
-
|
|
|
|
|
- <!-- <el-row>
|
|
|
|
|
- <span style="color: red;padding:10px"> 请认真核实报考岗位与证书编号,本课程不支持退款</span>
|
|
|
|
|
- </el-row> -->
|
|
|
|
|
-
|
|
|
|
|
- <el-col :lg="12" class="pl20 pr20">
|
|
|
|
|
- <el-form-item lable="邮箱地址" prop="email">
|
|
|
|
|
- <label slot="label">邮箱地址</label>
|
|
|
|
|
- <el-input v-model="buyForm.email" type="textarea" placeholder="邮箱地址" style="width: 260px;"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- <el-col :span="12" class="pl20 pr20">
|
|
|
|
|
- <el-form-item lable="订单号" prop="payNo">
|
|
|
|
|
- <label slot="label">订单编号</label>
|
|
|
|
|
- <el-input v-model="buyForm.payNo" placeholder="输入订单编号后6位" style="width: 260px;" :minlength="6"
|
|
|
|
|
- :maxlength="6" show-word-limit></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- <el-row>
|
|
|
|
|
- <el-col :span="12" class="pl20 pr20">
|
|
|
|
|
- <el-form-item lable="工作单位" prop="company">
|
|
|
|
|
- <label slot="label">工作单位</label>
|
|
|
|
|
- <el-input v-model="buyForm.company" type="textarea" placeholder="工作单位" style="width: 260px;"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12" class="pl20 pr20">
|
|
|
|
|
- <el-form-item lable="备注信息" prop="marks">
|
|
|
|
|
- <label slot="label">备注信息</label>
|
|
|
|
|
- <el-input v-model="buyForm.marks" type="textarea" placeholder="姓名+工种名称,例:张三+土建施工员"
|
|
|
|
|
- style="width: 260px;"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- <el-row v-if="typeInfo.needPromise==1">
|
|
|
|
|
- <div style="width: 700px;margin: 0 auto;text-align: left;color: red;">
|
|
|
|
|
- 提示:继续教育承诺函企业名称应与个人报名系统企业名称一致,如已变更单位的,
|
|
|
|
|
- 请先在个人系统帐号设置进入额外信息栏进行修改工作单位与报名承诺函工作单位相符后方可上传承诺函确认
|
|
|
|
|
- </div>
|
|
|
|
|
- <img :src="buyForm.buyImg" :onerror="errorImg" style="width: 160px;text-align: center;">
|
|
|
|
|
- <do-upload @onFinish="(url)=>{buyForm.buyImg=url}" placeholder="上传承诺书" width="160px"> </do-upload>
|
|
|
|
|
- </el-row>
|
|
|
|
|
|
|
|
|
|
|
|
+ <el-form-item label="报考岗位" prop="courseName">
|
|
|
|
|
+ <el-input type="text" placeholder="报考岗位" v-model="buyForm.courseName+'-'+buyForm.nd"
|
|
|
|
|
+ style="width: 360px;" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item label="证书编号" prop="rzCode">
|
|
|
|
|
+ <el-input v-model="buyForm.rzCode" type="text" style="width: 360px;">
|
|
|
|
|
+ <template #suffix>
|
|
|
|
|
+ <el-button @click="openShowAllRzcodeDialog" type="text" style="margin-right: 10px;">修改</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item label="支付类型" prop="payType" >
|
|
|
|
|
+ <el-select v-model="buyForm.payType" style="width: 360px;" @change="onPayTypeChange">
|
|
|
|
|
+ <el-option value="" label="请选择支付类型" />
|
|
|
|
|
+ <el-option value="wx" label="微信" />
|
|
|
|
|
+ <el-option value="ali" label="支付宝" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<h2 class="tc"> 本课程费用: <strong style="color: red;"> {{buyForm.fee/100}} 元 </strong> </h2>
|
|
<h2 class="tc"> 本课程费用: <strong style="color: red;"> {{buyForm.fee/100}} 元 </strong> </h2>
|
|
|
- <div style="width: 300px; margin: 0px auto;">
|
|
|
|
|
- <img src="/static/images/wxpay.jpg" width="300px" @click="showImg(buyForm.buyImg)">
|
|
|
|
|
|
|
+ <div style="width: 300px; margin: 0px auto;" v-if="buyForm.payType">
|
|
|
|
|
+ <img :src="wxPayUrl" width="300px" @click="showImg(wxPayUrl)">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style="width: 300px; margin: 0px auto;" v-else>
|
|
|
|
|
+ <img :src="aliPayUrl" width="300px" @click="showImg(aliPayUrl)">
|
|
|
</div>
|
|
</div>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
|
@@ -221,47 +182,11 @@
|
|
|
<el-button @click="buyCourse" type="primary">确 定</el-button>
|
|
<el-button @click="buyCourse" type="primary">确 定</el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
-
|
|
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
- <el-dialog :title="promiseType[promise.showType]" class="fc tc" :visible.sync="commitmentDialog">
|
|
|
|
|
- <div>
|
|
|
|
|
- <div>
|
|
|
|
|
- <div class="commitment-header"> {{promise.title}} </div>
|
|
|
|
|
- <div class="tl commitment">
|
|
|
|
|
- {{promise.content}}
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="commitment-footer">
|
|
|
|
|
- {{promise.footer}}
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="tl commitment-content mt20" v-if="promise.showType==2">
|
|
|
|
|
- <el-radio-group v-model="isCommitment">
|
|
|
|
|
- <el-row class="mt10">
|
|
|
|
|
- <el-radio :label="true">本人作出上述承诺</el-radio>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- <el-row class="mt10">
|
|
|
|
|
- <el-radio :label="false">本人不作出上述承诺</el-radio>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- </el-radio-group>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <span slot="footer" class="dialog-footer" v-if="promise.showType==2">
|
|
|
|
|
- <el-button @click="commitmentDialog = false">取 消</el-button>
|
|
|
|
|
- <el-button type="primary" :disabled="isCommitment?false:true" @click="buyCourseDialog=true">确 定</el-button>
|
|
|
|
|
- </span>
|
|
|
|
|
-
|
|
|
|
|
- <div slot="footer" class="dialog-footer mt20" v-else>
|
|
|
|
|
- <el-button @click="commitmentDialog = false">取 消</el-button>
|
|
|
|
|
- <el-button type="primary" @click="buyCourseDialog=true">继续购买</el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-dialog>
|
|
|
|
|
-
|
|
|
|
|
<el-dialog append-to-body close-on-click-modal :visible.sync="showImgDialog" style="margin-top: 0px;"
|
|
<el-dialog append-to-body close-on-click-modal :visible.sync="showImgDialog" style="margin-top: 0px;"
|
|
|
:width="width">
|
|
:width="width">
|
|
|
<img :src="imgUrl" @load="onLoad" alt="" />
|
|
<img :src="imgUrl" @load="onLoad" alt="" />
|
|
@@ -332,6 +257,7 @@
|
|
|
3: '委 托 书'
|
|
3: '委 托 书'
|
|
|
},
|
|
},
|
|
|
buyForm: {
|
|
buyForm: {
|
|
|
|
|
+ payType:'wx',
|
|
|
marks: '',
|
|
marks: '',
|
|
|
rzCode: '',
|
|
rzCode: '',
|
|
|
payNo: '',
|
|
payNo: '',
|
|
@@ -340,7 +266,9 @@
|
|
|
buyImg: '',
|
|
buyImg: '',
|
|
|
name: '',
|
|
name: '',
|
|
|
courseName: '',
|
|
courseName: '',
|
|
|
- list: []
|
|
|
|
|
|
|
+ list: [],
|
|
|
|
|
+ fee: 0,
|
|
|
|
|
+ course_id: ''
|
|
|
},
|
|
},
|
|
|
promise: {
|
|
promise: {
|
|
|
status: 0,
|
|
status: 0,
|
|
@@ -351,6 +279,8 @@
|
|
|
},
|
|
},
|
|
|
imgUrl: '',
|
|
imgUrl: '',
|
|
|
qrcodeUrl: "",
|
|
qrcodeUrl: "",
|
|
|
|
|
+ wxPayUrl:"",
|
|
|
|
|
+ aliPayUrl:"",
|
|
|
outTradeNo: "",
|
|
outTradeNo: "",
|
|
|
courseFee: 0,
|
|
courseFee: 0,
|
|
|
title: '',
|
|
title: '',
|
|
@@ -443,6 +373,11 @@
|
|
|
this.imgUrl = url;
|
|
this.imgUrl = url;
|
|
|
this.showImgDialog = true;
|
|
this.showImgDialog = true;
|
|
|
},
|
|
},
|
|
|
|
|
+ onPayTypeChange() {
|
|
|
|
|
+ if (this.buyCourseDialog && this.buyForm.course_id) {
|
|
|
|
|
+ this.generatePayQrcode();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
closeDialog() {
|
|
closeDialog() {
|
|
|
if (this.timer) window.clearInterval(this.timer);
|
|
if (this.timer) window.clearInterval(this.timer);
|
|
|
},
|
|
},
|
|
@@ -477,6 +412,53 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ initTimer() {
|
|
|
|
|
+ if (this.timer) window.clearInterval(this.timer);
|
|
|
|
|
+ this.tickCount = 0;
|
|
|
|
|
+ this.timer = window.setInterval(() => {
|
|
|
|
|
+ this.tickCount++;
|
|
|
|
|
+ this.tickTimer();
|
|
|
|
|
+ }, 2000);
|
|
|
|
|
+ },
|
|
|
|
|
+ tickTimer() {
|
|
|
|
|
+ if (this.tickCount > 150) {
|
|
|
|
|
+ if (this.timer) window.clearInterval(this.timer);
|
|
|
|
|
+ this.$message.warning("支付超时,请重新支付");
|
|
|
|
|
+ this.buyCourseDialog = false;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ let outTradeNo = this.outTradeNo;
|
|
|
|
|
+ httpServer("weixin.isPayOk", { outTradeNo }).then((res) => {
|
|
|
|
|
+ if (res.code == 200 && !!res.data) {
|
|
|
|
|
+ if (this.timer) window.clearInterval(this.timer);
|
|
|
|
|
+ this.$message.success("支付成功");
|
|
|
|
|
+ this.buyCourseDialog = false;
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ generatePayQrcode() {
|
|
|
|
|
+ let payType = this.buyForm.payType;
|
|
|
|
|
+ let apiName = payType === 'wx' ? "weixin.DoWxpay" : "weixin.DoaliPay";
|
|
|
|
|
+ let param = {
|
|
|
|
|
+ courseId: this.buyForm.course_id,
|
|
|
|
|
+ rzCode: this.buyForm.rzCode
|
|
|
|
|
+ };
|
|
|
|
|
+ httpServer(apiName, param).then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ let { outTradeNo, showUrl } = res.data;
|
|
|
|
|
+ this.outTradeNo = outTradeNo;
|
|
|
|
|
+ if (payType === 'wx') {
|
|
|
|
|
+ this.wxPayUrl = showUrl;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.aliPayUrl = showUrl;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.initTimer();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(res.msg || "获取支付二维码失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
getData() {
|
|
getData() {
|
|
|
let param = {
|
|
let param = {
|
|
|
size: 1000,
|
|
size: 1000,
|
|
@@ -508,6 +490,7 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
cancelBuyCourse() {
|
|
cancelBuyCourse() {
|
|
|
|
|
+ if (this.timer) window.clearInterval(this.timer);
|
|
|
this.$refs["elForm"].resetFields();
|
|
this.$refs["elForm"].resetFields();
|
|
|
this.buyCourseDialog = false
|
|
this.buyCourseDialog = false
|
|
|
this.commitmentDialog = false;
|
|
this.commitmentDialog = false;
|
|
@@ -594,12 +577,10 @@
|
|
|
this.buyForm.company = this.userInfo.company;
|
|
this.buyForm.company = this.userInfo.company;
|
|
|
this.buyForm.temp = item;
|
|
this.buyForm.temp = item;
|
|
|
this.buyForm.courseName = item.name;
|
|
this.buyForm.courseName = item.name;
|
|
|
- this.matchPromise(item);
|
|
|
|
|
|
|
+ this.buyForm.course_id = item.course_id;
|
|
|
|
|
+ this.buyForm.fee = item.fee;
|
|
|
this.matchType(item.type)
|
|
this.matchType(item.type)
|
|
|
- // this.testBuyOK(item)
|
|
|
|
|
- // return;
|
|
|
|
|
// 检查
|
|
// 检查
|
|
|
- item.payErr = true;
|
|
|
|
|
httpServer("weixin.docheckpay", {
|
|
httpServer("weixin.docheckpay", {
|
|
|
courseId: item.course_id
|
|
courseId: item.course_id
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
@@ -608,16 +589,13 @@
|
|
|
this.isCompanyPay = 0;
|
|
this.isCompanyPay = 0;
|
|
|
this.isCommitment = ''
|
|
this.isCommitment = ''
|
|
|
Object.assign(this.buyForm, res.data);
|
|
Object.assign(this.buyForm, res.data);
|
|
|
- if (this.promise.status == 1) {
|
|
|
|
|
- this.commitmentDialog = true;
|
|
|
|
|
- this.buyCourseDialog = false;
|
|
|
|
|
- } else {
|
|
|
|
|
- this.buyCourseDialog = true;
|
|
|
|
|
- this.commitmentDialog = false;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.buyCourseDialog = true;
|
|
|
|
|
+ this.commitmentDialog = false;
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.generatePayQrcode();
|
|
|
|
|
+ });
|
|
|
} else {
|
|
} else {
|
|
|
- console.log("payErr")
|
|
|
|
|
- item.payErr = true;
|
|
|
|
|
|
|
+ this.$message.error(res.msg || "无法购买该课程");
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|