Tang пре 2 година
родитељ
комит
68fd8790e1

+ 54 - 0
src/components/countDown/index.vue

@@ -0,0 +1,54 @@
+<template>
+  <div id="">
+    <el-dialog
+      width="400px"
+      class="take-photo"
+      :visible.sync="Modal"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      :show-close="false"
+    >
+      <div class="size">
+        视频学习时长不达标,请等待<br /><br />倒计时
+        <span style="color: red;font-weight: bold;font-size: 24px;">{{
+          time
+        }}</span>
+        秒
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      Modal: false,
+      time: 0 //倒计时
+    };
+  },
+  methods: {
+    //拍照
+    openBoxs(time) {
+      this.time = time;
+      this.Modal = true;
+      let times = setInterval(() => {
+        if (this.time <= 0) {
+          clearInterval(times);
+          this.Modal = false;
+          this.$emit("againSubmit"); //重新提交
+        } else {
+          this.time--;
+        }
+      }, 1000);
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.size {
+  font-size: 24px;
+  text-align: center;
+}
+</style>

+ 8 - 4
src/components/videoCy/index.vue

@@ -8,7 +8,7 @@
     <div id="player"></div>
     <div class="recordStyle" v-if="showRecordStatus">
       您上次看{{
-        $tools.secondToTime(this.activeSection.videoCurrentTime)
+        $tools.secondToTime(this.activeSection.videoCurrentTime || 0)
       }},正在自动续播
       <span class="videoCurrentTime_style">|</span>
       <span class="btn_sty" @click="seekVideo0">从头播放</span>
@@ -17,13 +17,15 @@
       ref="takePicture"
       @returnParameter="returnParameter"
     ></takePicture>
+    <count-down ref="countDown" @againSubmit="postStudyRecord(1)"></count-down>
   </div>
 </template>
 
 <script>
 import takePicture from "@/components/takePicture/index.vue";
+import countDown from "@/components/countDown/index.vue";
 export default {
-  components: { takePicture },
+  components: { takePicture, countDown },
   inject: ["getGoodsData"],
   props: {
     activeSection: {
@@ -79,8 +81,8 @@ export default {
         this.player.destroy(); //初始化播放器
       }
       this.initData(); //初始化参数
-      await this.getRecordLast(); //获取播放记录
       await this.getRecordHistoryPhoto(); //获取拍照历史记录
+      await this.getRecordLast(); //获取播放记录
       await this.loadPlayer(); //加载播放内容
       this.player.on("s2j_onPlayerInitOver", () => {
         this.player.on("s2j_onPlayStart", this.onPlayStatus); //视频初次播放时触发
@@ -316,7 +318,7 @@ export default {
               : true;
             const isAllowSeek = self.goodsData.goodsPlayConfig
               ? self.goodsData.goodsPlayConfig.isAllowSeek
-              : "off";
+              : "on";
             const playbackRate = self.goodsData.goodsPlayConfig
               ? self.goodsData.goodsPlayConfig.playbackRate
               : false;
@@ -624,6 +626,8 @@ export default {
               setTimeout(() => {
                 this.openPhoto();
               }, 1500);
+            } else if (err.code === 558) {
+              this.$refs.countDown.openBoxs(parseInt(err.msg.split(",")[1]));
             } else {
               this.$message.error(err.msg || "未知错误");
             }

+ 3 - 1
src/pages/course-detail/components/CourseTree.vue

@@ -806,8 +806,10 @@ export default {
     //播放视频节
     watchSection(item) {
       if (this.isActive(item)) return;
-      this.$bus.$emit("toPlay", item);
       this.$emit("update:activeSection", item);
+      setTimeout(() => {
+        this.$bus.$emit("toPlay", item);
+      }, 100);
       let query = {
         gradeId: this.goodsData.gradeId,
         orderGoodsId: this.goodsData.orderGoodsId,

+ 1 - 1
src/pages/course-detail/components/coreContent.vue

@@ -286,7 +286,7 @@ export default {
     //判断开通信息推送是否成功
     confirmInfoDetail() {
       return new Promise(async (resolve, reject) => {
-        if (this.goodsData.erJianErZao) {
+        if (this.goodsData.erJianErZao || this.goodsData.jjShiGongYuan) {
           let info = await this.$request.userConfirmInfoDetail({
             orderGoodsId: this.goodsData.orderGoodsId
           });

+ 2 - 2
src/pages/living-room/index.vue

@@ -275,7 +275,7 @@ export default {
     this.goodsId = goodsId
     this.courseId = courseId
     this.orderGoodsId = orderGoodsId
-    this.gradeId = +gradeId
+    this.gradeId = gradeId
     this.chapterId = chapterId
     this.moduleId = moduleId
     // this.channelId = this.$route.params.channelId;
@@ -359,7 +359,7 @@ export default {
           this.sectionId = sectionId
           this.courseId = courseId
           this.orderGoodsId = orderGoodsId
-          this.gradeId = +gradeId || 0
+          this.gradeId = gradeId || 0
           this.chapterId = chapterId
           this.moduleId = moduleId
           this.buyCourse = buyCourse

+ 97 - 38
src/pages/payment/index.vue

@@ -115,7 +115,7 @@ export default {
       loading: null,
       countTimer: null,
       checkGoodsList: [],
-      isBK: "",
+      isBK: ""
     };
   },
   computed: {},
@@ -130,7 +130,7 @@ export default {
     if (!this.$tools.isLogin()) {
       this.setCurrentRouter(this.$route);
       this.$router.push({
-        path: "/login",
+        path: "/login"
       });
       return;
     }
@@ -156,7 +156,7 @@ export default {
       }
       this.$request
         .orderResumePCOrder({ orderSn: this.orderSn })
-        .then((res) => {
+        .then(res => {
           this.loading.close();
           this.urlBase64 = res.data.urlBase64;
           this.orderSn = res.data.orderSn;
@@ -173,7 +173,7 @@ export default {
             this.lastTime--;
           }, 1000);
         })
-        .catch((err) => {
+        .catch(err => {
           // this.loading.close();
         });
     },
@@ -181,31 +181,90 @@ export default {
       console.log(999);
       this.$confirm("确定离开支付页面吗", "提示", {
         confirmButtonText: "确定",
-        cancelButtonText: "取消",
+        cancelButtonText: "取消"
       })
-        .then((_) => {
+        .then(_ => {
           this.qrCodeShow = false;
           this.$router.back(-1);
         })
-        .catch((_) => {});
+        .catch(_ => {});
     },
     caculate() {
       this.total = 0;
-      this.checkGoodsList.forEach((item) => {
+      this.checkGoodsList.forEach(item => {
         this.total += item.standPrice;
       });
     },
     orderGoodsList() {
       this.$request
         .orderGoodsList({
-          orderSn: this.orderSn,
+          orderSn: this.orderSn
         })
-        .then((res) => {
+        .then(res => {
           this.checkGoodsList = res.rows;
         });
     },
-
-    pay() {
+    verify() {
+      return new Promise((resolve, reject) => {
+        for (let i = 0; i < this.checkGoodsList.length; i++) {
+          if (
+            this.checkGoodsList[i].educationName == "继续教育" &&
+            (this.checkGoodsList[i].projectName == "建造师" ||
+              this.checkGoodsList[i].projectName == "造价师") &&
+            this.checkGoodsList[i].businessName == "二级" &&
+            (!this.$store.state.userInfo.realname ||
+              !this.$store.state.userInfo.idCard)
+          ) {
+            this.$confirm("请完善学员姓名、身份证", "提示", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            })
+              .then(() => {
+                this.$router.push({
+                  path: "/person-center/my-info"
+                });
+              })
+              .catch(() => {});
+            reject();
+          }
+          if (
+            this.checkGoodsList[i].educationName == "继续教育" &&
+            this.checkGoodsList[i].projectName == "施工现场专业人员" &&
+            this.checkGoodsList[i].businessName == "七大员" &&
+            (!this.$store.state.userInfo.realname ||
+              !this.$store.state.userInfo.idCard ||
+              !this.$store.state.userInfo.companyName ||
+              !this.$store.state.userInfo.eduLevel ||
+              !this.$store.state.userInfo.sex)
+          ) {
+            this.$confirm(
+              "请完善学员姓名、身份证、性别、公司名称、教育层次",
+              "提示",
+              {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+              }
+            )
+              .then(() => {
+                this.$router.push({
+                  path: "/person-center/my-info"
+                });
+              })
+              .catch(() => {});
+            reject();
+          }
+        }
+        resolve();
+      });
+    },
+    async pay() {
+      try {
+        await this.verify();
+      } catch (_) {
+        return;
+      }
       if (this.radio == 1) {
         //微信
 
@@ -214,7 +273,7 @@ export default {
           text: "支付中",
           spinner: "el-icon-loading",
           background: "rgba(0, 0, 0, 0)",
-          target: document.querySelector(".section__body"),
+          target: document.querySelector(".section__body")
         });
         if (this.orderSn) {
           //订单继续支付
@@ -231,7 +290,7 @@ export default {
     orderPlacePcOrder() {
       this.$request
         .orderPlacePcOrder({ goodsList: this.checkGoodsList })
-        .then((res) => {
+        .then(res => {
           this.loading.close();
           localStorage.removeItem("checkGoodsList");
           console.log(res);
@@ -249,15 +308,15 @@ export default {
                   isBK: this.isBK,
                   goodsId: this.checkGoodsList[0].learnGoodsId,
                   gradeId: this.checkGoodsList[0].learnGradeId,
-                  orderGoodsId: this.checkGoodsList[0].learnOrderGoodsId,
+                  orderGoodsId: this.checkGoodsList[0].learnOrderGoodsId
                 },
                 query: {
                   orderSn: this.orderSn,
                   isBK: this.isBK,
                   goodsId: this.checkGoodsList[0].learnGoodsId,
                   gradeId: this.checkGoodsList[0].learnGradeId,
-                  orderGoodsId: this.checkGoodsList[0].learnOrderGoodsId,
-                },
+                  orderGoodsId: this.checkGoodsList[0].learnOrderGoodsId
+                }
               });
             } else {
               this.$router.replace({
@@ -268,14 +327,14 @@ export default {
                   gradeId: this.checkGoodsList[0].gradeId,
                   orderGoodsId: this.checkGoodsList[0].orderGoodsId,
                   orderSn: this.orderSn,
-                  total: this.total,
+                  total: this.total
                 },
                 query: {
                   goodsId: this.checkGoodsList[0].goodsId,
                   gradeId: this.checkGoodsList[0].gradeId,
                   orderGoodsId: this.checkGoodsList[0].orderGoodsId,
-                  orderSn: this.orderSn,
-                },
+                  orderSn: this.orderSn
+                }
               });
             }
             return;
@@ -297,26 +356,26 @@ export default {
             }, 1000);
           }
         })
-        .catch((err) => {
+        .catch(err => {
           this.loading.close();
 
           setTimeout(() => {
             if (err.code == 510) {
               this.$confirm(err.msg + "。点击确定跳转待支付订单列表", "提示", {
                 confirmButtonText: "确定",
-                cancelButtonText: "取消",
+                cancelButtonText: "取消"
               })
-                .then((_) => {
+                .then(_ => {
                   this.$router.push({
-                    path: "/person-center/my-order",
+                    path: "/person-center/my-order"
                   });
                 })
-                .catch((_) => {});
+                .catch(_ => {});
               // this.qrCodeShow = true;
             } else {
               this.$message({
                 type: "warning",
-                message: err.msg,
+                message: err.msg
               });
             }
           }, 500);
@@ -326,7 +385,7 @@ export default {
     orderResumePCOrder() {
       this.$request
         .orderResumePCOrder({ orderSn: this.orderSn })
-        .then((res) => {
+        .then(res => {
           this.loading.close();
           this.urlBase64 = res.data.urlBase64;
           this.orderSn = res.data.orderSn;
@@ -344,7 +403,7 @@ export default {
             this.lastTime--;
           }, 1000);
         })
-        .catch((err) => {
+        .catch(err => {
           // this.loading.close();
         });
     },
@@ -352,7 +411,7 @@ export default {
     orderPayStatus() {
       this.$request
         .orderPayStatus(this.orderSn)
-        .then((res) => {
+        .then(res => {
           if (res.data) {
             clearInterval(this.checkOrderTimer);
             console.log(1);
@@ -367,15 +426,15 @@ export default {
                   isBK: this.isBK,
                   goodsId: this.checkGoodsList[0].learnGoodsId,
                   gradeId: this.checkGoodsList[0].learnGradeId,
-                  orderGoodsId: this.checkGoodsList[0].learnOrderGoodsId,
+                  orderGoodsId: this.checkGoodsList[0].learnOrderGoodsId
                 },
                 query: {
                   orderSn: this.orderSn,
                   isBK: this.isBK,
                   goodsId: this.checkGoodsList[0].learnGoodsId,
                   gradeId: this.checkGoodsList[0].learnGradeId,
-                  orderGoodsId: this.checkGoodsList[0].learnOrderGoodsId,
-                },
+                  orderGoodsId: this.checkGoodsList[0].learnOrderGoodsId
+                }
               });
             } else {
               console.log(3);
@@ -387,25 +446,25 @@ export default {
                   gradeId: this.checkGoodsList[0].gradeId,
                   orderGoodsId: this.checkGoodsList[0].orderGoodsId,
                   orderSn: this.orderSn,
-                  total: this.total,
+                  total: this.total
                 },
                 query: {
                   goodsId: this.checkGoodsList[0].goodsId,
                   gradeId: this.checkGoodsList[0].gradeId,
                   orderGoodsId: this.checkGoodsList[0].orderGoodsId,
-                  orderSn: this.orderSn,
-                },
+                  orderSn: this.orderSn
+                }
               });
             }
 
             console.log(this.checkGoodsList);
           }
         })
-        .catch((err) => {
+        .catch(err => {
           console.log(err, "err");
         });
-    },
-  },
+    }
+  }
 };
 </script>
 

+ 36 - 13
src/pages/person-center/my-course/components/AppointTest.vue

@@ -3,7 +3,7 @@
     <el-dialog
       title="预约考试"
       :visible.sync="appointModal"
-      width="800px"
+      width="1000px"
       class="appoint-modal"
       :close-on-click-modal="false"
       :close-on-press-escape="false"
@@ -52,13 +52,18 @@
           <template
             v-for="(item, index) in getDayData(appointItem.examApplyGoodsList)"
           >
-            <p
+            <div
               v-if="item.applyTime == new Date(date).getTime() / 1000"
               class="liTime"
               @click="confirmAppoint(item)"
             >
-              {{ item.applyMoment }}
-            </p>
+              <p class="first_li">{{ item.applyMoment }}</p>
+              <p class="second_li">
+                {{
+                  `已预约人数:${item.subscribeNum || 0}/${item.applyNum || 0}`
+                }}
+              </p>
+            </div>
           </template>
         </template>
       </el-calendar>
@@ -97,7 +102,7 @@ export default {
       applyId: "",
       getTimes: "",
       dialogInfo: {},
-      dialogList:{},
+      dialogList: {},
       dialogVisible: false
     };
   },
@@ -130,7 +135,7 @@ export default {
           if (res.data.applyStatus) {
             res.data.applyStatus = res.data.applyStatus.split(",");
           }
-          this.dialogList = res.data
+          this.dialogList = res.data;
           this.dialogInfo = data;
           this.dialogVisible = true;
         })
@@ -212,19 +217,37 @@ export default {
   }
 }
 .liTime {
-  color: #fff;
-  background: deepskyblue;
-  padding: 2px;
-  text-align: center;
+  padding-top: 2px;
   margin-bottom: 4px;
+  background-color: #e6a23c;
   cursor: pointer;
-  &:last-child {
-    margin-bottom: 0px;
+  transition: all 0.3s;
+  border-radius: 4px;
+  overflow: hidden;
+  & > .first_li {
+    margin: 2px 4px;
+    color: #fff;
+    background: #409eff;
+    padding: 2px;
+    text-align: center;
+
+    &:last-child {
+      margin-bottom: 0px;
+    }
+  }
+  & > .second_li {
+    padding-bottom: 2px;
+    text-align: center;
+    font-size: 12px !important;
+    color: #fff;
+  }
+  &:hover {
+    transform: scale(1.06);
   }
 }
 /deep/ .el-calendar-day {
   min-height: 85px;
-  height: auto!important;
+  height: auto !important;
 }
 /deep/ .el-calendar-table .el-calendar-day:hover {
   background-color: transparent;

+ 9 - 3
src/pages/person-center/my-course/index.vue

@@ -418,8 +418,8 @@
                     type="primary"
                     class="btn"
                     @click="appointment(item)"
-                    >预约考试</el-button
-                  >
+                    >{{ item.subscribeSign == 4 ? "预约记录" : "预约考试" }}
+                  </el-button>
                   <el-button
                     v-if="item.openQuestion == 1"
                     type="primary"
@@ -1152,7 +1152,7 @@ export default {
       } else {
         param.studyStatus = this.activeStudyStatus;
       }
-      param.querySign = 1
+      param.querySign = 1;
       this.$request
         .courseGoodsList(param)
         .then(res => {
@@ -1193,6 +1193,12 @@ export default {
       );
     },
     appointment(item) {
+      if (item.subscribeSign == 4) {
+        this.$router.push({
+          path: "/person-center/my-examination/index"
+        });
+        return;
+      }
       this.appointItem = item;
       this.$request.applybeforeknow().then(res => {
         if (res.data.type == "Y") {

+ 63 - 25
src/pages/person-center/my-info/index.vue

@@ -52,17 +52,40 @@
         <el-form-item label="关联姓名">
           <el-input
             placeholder="请填写你的姓名"
-            readonly
+            :readonly="realname ? true : false"
             v-model="listData.realname"
           ></el-input>
         </el-form-item>
         <el-form-item label="关联身份证">
           <el-input
-            readonly
+            :readonly="idCard ? true : false"
             placeholder="请输入你的身份证"
             v-model="listData.idCard"
           ></el-input>
         </el-form-item>
+        <el-form-item label="公司名称">
+          <el-input
+            :readonly="companyName ? true : false"
+            v-model="listData.companyName"
+            placeholder="请输入公司名称"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="教育层次">
+          <el-select
+            v-model="listData.eduLevel"
+            placeholder="请选择教育层次"
+            :disabled="eduLevel ? true : false"
+          >
+            <el-option
+              v-for="(items, indexs) in $store.state.dictList['edu_level']"
+              :key="indexs"
+              :label="items"
+              :value="items"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+
         <el-form-item label="所在城市">
           <v-distpicker
             @province="onProvince"
@@ -74,7 +97,6 @@
             :city="listData.city"
             :area="listData.district"
           ></v-distpicker>
-          <!-- <el-input placeholder="请选择你的城市"></el-input> -->
         </el-form-item>
         <el-button type="primary" style="margin-left: 300px" @click="submit"
           >保存</el-button
@@ -171,13 +193,13 @@ export default {
         oldPwd: [{ required: true, message: "请输入旧密码", trigger: "blur" }],
         userPwd: [{ required: true, message: "请输入新密码", trigger: "blur" }],
         reUsePwd: [
-          { required: true, message: "请再次输入新密码", trigger: "blur" },
-        ],
+          { required: true, message: "请再次输入新密码", trigger: "blur" }
+        ]
       },
       placeholders: {
         province: "------- 省 --------",
         city: "--- 市 ---",
-        area: "--- 区 ---",
+        area: "--- 区 ---"
       },
       form: {
         resource: "",
@@ -186,7 +208,7 @@ export default {
         reUsePwd: "",
         phone: "",
         oldPwd: "",
-        code: "",
+        code: ""
       },
       pwdType: "password",
       rePwdType: "password",
@@ -195,7 +217,11 @@ export default {
       listData: {},
       setTimeStatus: null,
       getCodeStatus: true,
-      num: 60, //倒计时
+      realname: "",
+      idCard: "",
+      companyName: "",
+      eduLevel: "",
+      num: 60 //倒计时
     };
   },
   mounted() {
@@ -207,7 +233,7 @@ export default {
       if (testPhone.test(this.form.phone)) {
         this.$request
           .appcommonsmsbindNew({ tel: this.form.phone })
-          .then((res) => {
+          .then(res => {
             this.getCodeStatus = false;
             this.setTimeStatus = setInterval(() => {
               if (this.num <= 1) {
@@ -241,9 +267,9 @@ export default {
         .appuserbindNewTel({
           userId: this.listData.userId,
           tel: this.form.phone,
-          code: this.form.code,
+          code: this.form.code
         })
-        .then((res) => {
+        .then(res => {
           this.$message.success("绑定成功");
         });
     },
@@ -251,7 +277,7 @@ export default {
      * 验证
      */
     resultForm(formName) {
-      this.$refs[formName].validate((valid) => {
+      this.$refs[formName].validate(valid => {
         if (valid) {
           this.submitPwd();
         } else {
@@ -279,13 +305,16 @@ export default {
       let data = {
         userId: this.listData.userId,
         oldPwd: this.form.oldPwd,
-        newPwd: this.form.userPwd,
+        newPwd: this.form.userPwd
       };
-      this.$request.appuserupdatePwd(data).then((res) => {
-        this.$message.success("修改成功,请重新登录");
-      }).catch(err => {
-        this.$message.warning(err.msg)
-      })
+      this.$request
+        .appuserupdatePwd(data)
+        .then(res => {
+          this.$message.success("修改成功,请重新登录");
+        })
+        .catch(err => {
+          this.$message.warning(err.msg);
+        });
     },
     /**
      * 更新头像
@@ -301,7 +330,10 @@ export default {
         self.$message.error("图片不得大于300kb");
         return;
       }
-      var type = self.$refs.file.value.toLowerCase().split(".").splice(-1);
+      var type = self.$refs.file.value
+        .toLowerCase()
+        .split(".")
+        .splice(-1);
       if (
         type[0] != "jpg" &&
         type[0] != "png" &&
@@ -312,7 +344,7 @@ export default {
         self.$refs.file.value = "";
         return;
       }
-      this.$upload.upload(file, 0).then((res) => {
+      this.$upload.upload(file, 0).then(res => {
         self.listData.avatar = res;
       });
     },
@@ -339,7 +371,11 @@ export default {
     },
     getUserInfo() {
       this.$store.dispatch("getUserInfo").then(() => {
-        this.listData = this.$store.getters.userInfo;
+        this.listData = Object.assign({}, this.$store.getters.userInfo);
+        this.realname = this.listData.realname;
+        this.idCard = this.listData.idCard;
+        this.companyName = this.listData.companyName;
+        this.eduLevel = this.listData.eduLevel;
       });
     },
     /**
@@ -367,11 +403,13 @@ export default {
         userBirth: this.listData.userBirth,
         realname: this.listData.realname,
         idCard: this.listData.idCard,
+        companyName: this.listData.companyName,
+        eduLevel: this.listData.eduLevel,
         province: this.listData.province,
         city: this.listData.city,
-        district: this.listData.district,
+        district: this.listData.district
       };
-      this.$request.editAppUser(data).then((res) => {
+      this.$request.editAppUser(data).then(res => {
         if (res.code === 200) {
           this.$store.dispatch("getUserInfo");
           this.$message.success("保存成功");
@@ -391,8 +429,8 @@ export default {
       } else {
         this.pwdType = "password";
       }
-    },
-  },
+    }
+  }
 };
 </script>