소스 검색

无需证书

y595705120 2 주 전
부모
커밋
3b44156ea3

+ 1 - 1
src/App.vue

@@ -7,7 +7,7 @@
     <div class="p-wrap-full">
       <div class="footer ng-scope" style="z-index: 10">
         <div class="footer-bd">
-          <p>技术支持:{{config.title}}【{{config.contact}}】</p>
+          <p>技术支持:{{config.title}}</p>
           <p>
               <span> ©2021 </span>
               <!-- <a href="http://beian.miit.gov.cn/" target="_blank">闽ICP备19021760号-1</a> -->

+ 2 - 2
src/components/httpServer/httpServer.js

@@ -18,7 +18,7 @@ export function httpServer(method, data) {
   let sigureStr = "hall_" + version + token + body + method + mtime + secret
 
   let sign = md5( sigureStr )
-  let url = `/rental/${method}?t=${mtime}&u=${uid}&v=${version}&s=${sign}`
+  let url = `https://ndapi.hqedust.com:18443/rental/${method}?t=${mtime}&u=${uid}&v=${version}&s=${sign}`
   return request({
     url: url,
     method: 'post',
@@ -34,7 +34,7 @@ export function uploadImg( rand, formData ) {
   if( !token || !uid ) return;
   let sign = "hall_" + version + token + rand  + mtime + secret;
   return request({
-    url:`upload?t=${mtime}&u=${uid}&v=${version}&s=${sign}&r=${rand}`,
+    url:`https://ndapi.hqedust.com:18443/upload?t=${mtime}&u=${uid}&v=${version}&s=${sign}&r=${rand}`,
     method: 'post',
     data:formData,
     dataType:"multipart/form-data"

+ 94 - 116
src/containers/center/market/index.vue

@@ -141,77 +141,38 @@
 
     </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">
-        <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>
           <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>
         </el-row>
 
@@ -221,47 +182,11 @@
             <el-button @click="buyCourse" type="primary">确 定</el-button>
           </el-form-item>
         </el-row>
-
       </el-form>
 
     </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;"
       :width="width">
       <img :src="imgUrl" @load="onLoad" alt="" />
@@ -332,6 +257,7 @@
           3: '委 托 书'
         },
         buyForm: {
+          payType:'wx',
           marks: '',
           rzCode: '',
           payNo: '',
@@ -340,7 +266,9 @@
           buyImg: '',
           name: '',
           courseName: '',
-          list: []
+          list: [],
+          fee: 0,
+          course_id: ''
         },
         promise: {
           status: 0,
@@ -351,6 +279,8 @@
         },
         imgUrl: '',
         qrcodeUrl: "",
+        wxPayUrl:"",
+        aliPayUrl:"",
         outTradeNo: "",
         courseFee: 0,
         title: '',
@@ -443,6 +373,11 @@
         this.imgUrl = url;
         this.showImgDialog = true;
       },
+      onPayTypeChange() {
+        if (this.buyCourseDialog && this.buyForm.course_id) {
+          this.generatePayQrcode();
+        }
+      },
       closeDialog() {
         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() {
         let param = {
           size: 1000,
@@ -508,6 +490,7 @@
         }
       },
       cancelBuyCourse() {
+        if (this.timer) window.clearInterval(this.timer);
         this.$refs["elForm"].resetFields();
         this.buyCourseDialog = false
         this.commitmentDialog = false;
@@ -594,12 +577,10 @@
         this.buyForm.company = this.userInfo.company;
         this.buyForm.temp = item;
         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.testBuyOK(item)
-        // return;
         // 检查
-        item.payErr = true;
         httpServer("weixin.docheckpay", {
           courseId: item.course_id
         }).then((res) => {
@@ -608,16 +589,13 @@
             this.isCompanyPay = 0;
             this.isCommitment = ''
             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 {
-            console.log("payErr")
-            item.payErr = true;
+            this.$message.error(res.msg || "无法购买该课程");
           }
         });
       },

+ 4 - 8
src/containers/login/components/friendlink/friendlink.vue

@@ -42,13 +42,9 @@ export default {
     return {
       // 三明市建设从业人员综合服务平台
       links:[
-        // {name:'三明市建设从业人员', name2:"综合服务平台", type:'primary', link:'http://110.83.229.16:8123/gaia/peelLogin.html'},
-        {name:'建设行业机构信息', name2:"全国联网查询", type:'primary', link:'https://rcgz.mohurd.gov.cn/Login/TrainDepartMentSearchResult'},
-
-        {name:'住房城乡建设行业人员', name2:"培训管理信息系统", type:'success', link:'http://rcgz.mohurd.gov.cn'},
-        {name:'福建省建设从业人员',   name2:"综合服务平台", type:'danger', link:'http://220.160.52.118:9084/portalWeb/webPortal/toIndexPage'},
-        // {name:'三明市住房和城乡', name2:"建设局", type:'warning', link:'http://zjj.sm.gov.cn/'},
-        // {name:'施工现场专业人员培训测试', name2:"管理信息系统", type:'primary', link:'http://csjs.snjsrc.com/'},
+        {name:'宁德市建筑业协会网', name2:"", type:'warning', link:'http://www.ndsjx.com'},
+        {name:'住房城乡建设行业人员培训管理信息系统', type:'success', link:'http://rcgz.mohurd.gov.cn'},
+        {name:'福建省建设从业人员综合服务平台',   name2:"", type:'danger', link:'http://220.160.52.118:9084/portalWeb/webPortal/toIndexPage'},
       ]
     }
   },
@@ -70,7 +66,7 @@ export default {
   justify-content: space-between;
 }
 .friendship-a {
-  width: 220px;
+  width: 360px;
   line-height: 20px;
   font-weight: 900;
   font-size: 16px;

+ 1 - 1
src/containers/login/login.vue

@@ -186,7 +186,7 @@ export default {
     },
     getPostList(){
       let {page,size} = this;
-      let param = {page,size,type:'操作指南'}
+      let param = {page,size}
       httpServer("course.getPostList", param).then( res=>{
         if( res.code == 200){
           this.postList = res.data.list

+ 1 - 1
static/config.js

@@ -2,7 +2,7 @@ window.baseConfig = {
     title: '宁德市建筑业协会建设行业从业人员继续教育网络培训平台',
     userSeatTitle:'福建省建设行业从业人员岗位考核考试',
     it:'福建鸿锵教育科技有限公司',
-    beian:'闽ICP备2121760号-1',
+    beian:'闽ICP备2121760号',
     contact:'0598-5157296',
     educationList: ["博士研究生", "硕士研究生", "大学本科", "大学专科", "中专", "高中", "初中及以下", "其他"]
 }