谢杰标 3 tahun lalu
induk
melakukan
bad045496e

+ 179 - 50
src/pages/person-center/learn-center/GoodsItem.vue

@@ -2,58 +2,77 @@
   <div class="goods-item">
     <div class="goods-item-top">
       <img :src="backImg" alt="" />
-      <p v-html="backLearnStatus(goodsInfo)"></p>
+      <p v-html="backLearnStatus()"></p>
       <p class="l_1" style="width: 70%">上次观看:节名称节名称</p>
-      <!-- <p>{{ goodsInfo.studyCount }}学时</p> -->
+      <p v-if="goodsType == 2">{{ goodsInfo.studyCount }}学时</p>
     </div>
     <div class="goods-item-main">
       <h2>{{ goodsInfo.goodsName }}</h2>
-      <div>
-        周期:
-        <p>
-          {{ $tools.timestampToTime(goodsInfo.serviceStartTime) }} -
-          {{ $tools.timestampToTime(goodsInfo.serviceEndTime) }}
-        </p>
-        <p style="margin: 0 8px">|</p>
-        <p>
-          {{ goodsInfo.courseNum }}课程
-          {{ goodsInfo.secAllNum + goodsInfo.examNum }}节
-          {{ goodsInfo.classHours }}学时
-        </p>
-      </div>
-      <div>
-        学习进度:
-        <p style="width: 40px">{{ progressText() }}</p>
-        <el-progress
-          style="width: 65%"
-          :show-text="false"
-          :stroke-width="8"
-          :format="() => {}"
-          :percentage="
-            ((goodsInfo.stuAllNum + goodsInfo.recordNum) /
-              (goodsInfo.secAllNum + goodsInfo.examNum) || 0) * 100
-          "
-        ></el-progress>
-      </div>
-      <div>
-        班级状态:
-        <p>{{ backClassStatus() }}</p>
-      </div>
-      <div>
-        班级有效期:
-        <p>{{ goodsInfo.classStartTime }}-{{ goodsInfo.classEndTime }}</p>
-      </div>
-      <div class="goods-item-main-tips">
-        温馨提示:本课程有效期至{{
-          $tools.timestampToTime(goodsInfo.validityEndTime, true, true)
-        }},超期学时无效,为防审核异常请于{{
-          $tools.timestampToTime(goodsInfo.validityEndTime, true, true)
-        }}
-        00:00:00前完成学习,当前剩余有效学习时间为200天
-      </div>
+      <!-- 视频 -->
+      <template v-if="goodsType == 1">
+        <div>
+          周期:
+          <p>
+            {{ $tools.timestampToTime(goodsInfo.serviceStartTime) }} -
+            {{ $tools.timestampToTime(goodsInfo.serviceEndTime) }}
+          </p>
+          <p style="margin: 0 8px">|</p>
+          <p>
+            {{ goodsInfo.courseNum }}课程
+            {{ goodsInfo.secAllNum + goodsInfo.examNum }}节
+            {{ goodsInfo.classHours }}学时
+          </p>
+        </div>
+        <div>
+          学习进度:
+          <p style="width: 40px">{{ progressText() }}</p>
+          <el-progress
+            style="width: 65%"
+            :show-text="false"
+            :stroke-width="8"
+            :format="() => {}"
+            :percentage="
+              ((goodsInfo.stuAllNum + goodsInfo.recordNum) /
+                (goodsInfo.secAllNum + goodsInfo.examNum) || 0) * 100
+            "
+          ></el-progress>
+        </div>
+        <template v-if="!is2Education">
+          <div>
+            班级状态:
+            <p>{{ backClassStatus() }}</p>
+          </div>
+          <div>
+            班级有效期:
+            <p>{{ goodsInfo.classStartTime }}-{{ goodsInfo.classEndTime }}</p>
+          </div>
+          <div class="goods-item-main-tips">
+            温馨提示:本课程有效期至{{
+              $tools.timestampToTime(goodsInfo.validityEndTime, true, true)
+            }},超期学时无效,为防审核异常请于{{
+              $tools.timestampToTime(goodsInfo.validityEndTime, true, true)
+            }}
+            00:00:00前完成学习,当前剩余有效学习时间为200天
+          </div>
+        </template>
+      </template>
+      <template v-else>
+        <div>
+          直播进度:
+          <p>{{ backClassStatus() }}</p>
+        </div>
+        <div>
+          当前回放:
+          <p>{{ backClassStatus() }}</p>
+        </div>
+        <div>
+          直播时间:
+          <p>{{ backClassStatus() }}</p>
+        </div>
+      </template>
     </div>
     <div class="goods-item-bom">
-      <el-button type="text" :disabled="checkCanLearn != -1">{{
+      <el-button type="text" @click="goto" :disabled="checkCanLearn != -1">{{
         checkCanLearn == -1 ? "进入学习" : "已过期"
       }}</el-button>
     </div>
@@ -85,7 +104,7 @@ export default {
         item.stuAllNum + item.recordNum + "/" + (item.secAllNum + item.examNum)
       );
     },
-    backLearnStatus(data) {
+    backLearnStatus() {
       let {
         stuAllNum,
         recordNum,
@@ -94,7 +113,7 @@ export default {
         rebuild,
         goodsType,
         liveStatus,
-      } = data;
+      } = this.goodsInfo;
       if (goodsType == 1) {
         let stuNum = stuAllNum + recordNum;
         let type = [
@@ -126,6 +145,106 @@ export default {
       }
       return ["未开班", "已开班"][classStatus] || "-";
     },
+    goto() {
+      if (this.goodsType == 1) {
+        this.toCourse();
+      }
+    },
+    async toCourse() {
+      let item = this.goodsInfo;
+      if (!(await this.lockLockStatus())) {
+        return;
+      }
+      // 二建继教
+      if (this.is2Education && !(await this.userConfirmInfoDetail())) {
+        return;
+      }
+      // if (item.rebuild == 0) {
+      //   return this.$emit("openRebuld", item);
+      // }
+      // let rebuildStatus = await this.courseGoodsRebuildStatus(
+      //   item.goodsId,
+      //   item.gradeId
+      // );
+
+      // if (rebuildStatus == 0) {
+      //   this.$refs.rebuildModal.showModal(item);
+      //   return;
+      // }
+      return;
+      this.$router.push({
+        path: `/my-course-detail/${item.goodsId}`,
+        query: {
+          gradeId: item.gradeId,
+          orderGoodsId: item.orderGoodsId,
+          rebuild: item.rebuild,
+        },
+      });
+    },
+    toExam() {
+      this.$router.push({
+        path: "/bank-exam/" + this.goodsId,
+        query: {
+          orderGoodsId: this.orderGoodsId,
+          number: this.activeNum,
+          moduleId: 0,
+          chapterId: 0,
+          examId: 0,
+        },
+      });
+    },
+    userConfirmInfoDetail() {
+      let { orderGoodsId } = this.goodsInfo;
+      return new Promise((resolve) => {
+        this.$request
+          .userConfirmInfoDetail({
+            orderGoodsId,
+          })
+          .then((res) => {
+            if (!res.data) {
+              this.$emit("openRealNameCheck", orderGoodsId);
+            } else {
+              if (res.data.pushInfo) {
+                resolve(true);
+              } else {
+                this.$confirm(
+                  "开通信息推送不成功,无法进入学习,请联系020-87085982!",
+                  "提示",
+                  {
+                    confirmButtonText: "确定",
+                    closeOnClickModal: false,
+                    closeOnPressEscape: false,
+                    distinguishCancelAndClose: false,
+                    showClose: false,
+                    showCancelButton: false,
+                  }
+                )
+                  .then((_) => {})
+                  .catch((_) => {});
+                resolve(false);
+              }
+            }
+          });
+      });
+    },
+    lockLockStatus() {
+      return this.$request
+        .lockLockStatus({
+          action: "jxjy",
+          uuid: sessionStorage.getItem("uuid"),
+        })
+        .then((res) => {
+          //有其他端在操作,不能学习
+          this.$message({
+            type: "warning",
+            message: res.msg,
+          });
+          return Promise.resolve(false);
+        })
+        .catch((err) => {
+          return Promise.resolve(true);
+        });
+    },
   },
   computed: {
     goodsType() {
@@ -156,6 +275,16 @@ export default {
     backImg() {
       return require("@/assets/" + mapImg[this.goodsType]);
     },
+    is2Education() {
+      let { educationName, officialName, businessName, projectName } =
+        this.goodsInfo;
+      return (
+        educationName == "继续教育" &&
+        officialName &&
+        businessName == "二级" &&
+        projectName == "建造师"
+      );
+    },
   },
 };
 </script>
@@ -184,7 +313,7 @@ export default {
     }
   }
   .goods-item-main {
-    padding: 0 16px;
+    padding: 0 16px 26px;
     h2 {
       margin: 10px 0;
       font-size: 16px;
@@ -205,7 +334,7 @@ export default {
       background: #fffaf2;
       padding: 10px;
       color: #494339;
-      margin: 8px 0 24px;
+      margin-top: 8px;
     }
   }
   .goods-item-bom {

+ 134 - 4
src/pages/person-center/learn-center/ListBox.vue

@@ -1,12 +1,65 @@
 <template>
   <el-row :gutter="20">
     <el-col :span="8" v-for="(item, index) in list" :key="index">
-      <GoodsItem :goodsInfo="item"></GoodsItem>
+      <Goods-item
+        :goodsInfo="item"
+        @openRebuld="openRebuld"
+        @openRealNameCheck="openRealNameCheck"
+      ></Goods-item>
     </el-col>
+    <!-- 学时审核不通过提示 -->
+    <Rebuild-modal
+      ref="rebuildModal"
+      @rebuildSubmit="rebuildSubmit($event)"
+    ></Rebuild-modal>
+    <el-dialog
+      title="实名验证确认"
+      :visible.sync="showConfirm"
+      width="600px"
+      class="showconfirm"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      :show-close="false"
+    >
+      <div class="showconfirm__content">
+        <div class="text">
+          为避免个人信息不正确导致您的学习时长无效,请认真核对以下信息是否正确,如信息有误请取消当前操作,立刻联系020-38946666
+        </div>
+        <el-descriptions :column="1">
+          <el-descriptions-item label="姓名">{{
+            userInfo && userInfo.realname
+          }}</el-descriptions-item>
+          <el-descriptions-item label="手机号">{{
+            userInfo && userInfo.telphone
+          }}</el-descriptions-item>
+          <el-descriptions-item label="身份证号">{{
+            userInfo && userInfo.idCard
+          }}</el-descriptions-item>
+        </el-descriptions>
+
+        <div class="">
+          <el-checkbox v-model="confirmChecked">确认个人信息无误</el-checkbox>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="showConfirm = false">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="confirmUser"
+          :disabled="confirmCount > 0"
+          :loading="confirmLoading"
+          >{{
+            confirmCount > 0 ? "确 定(" + confirmCount + ")" : "确 定"
+          }}</el-button
+        >
+      </span>
+    </el-dialog>
   </el-row>
 </template>
 <script>
+import { mapGetters } from "vuex";
 import GoodsItem from "./GoodsItem.vue";
+import RebuildModal from "@/components/rebuildModal";
 export default {
   props: {
     list: {
@@ -17,11 +70,88 @@ export default {
     },
   },
   data() {
-    return {};
+    return {
+      showConfirm: false,
+      confirmLoading: false,
+      confirmCount: 10,
+      confirmTimer: null,
+      confirmChecked: false,
+      orderGoodsId: "",
+    };
+  },
+  methods: {
+    openRebuld(data) {
+      this.$refs.rebuildModal.showModal(data);
+    },
+    openRealNameCheck(orderGoodsId) {
+      this.orderGoodsId = orderGoodsId;
+      clearInterval(this.confirmTimer);
+      this.confirmCount = 10;
+      this.showConfirm = true;
+      this.confirmTimer = setInterval(() => {
+        if (this.confirmCount > 0) {
+          this.confirmCount--;
+        } else {
+          clearInterval(this.confirmTimer);
+        }
+      }, 1000);
+    },
+    rebuildSubmit(item) {
+      this.$router.push({
+        path: `/my-course-detail/${item.goodsId}`,
+        query: {
+          gradeId: item.gradeId,
+          orderGoodsId: item.orderGoodsId,
+          rebuild: 1,
+        },
+      });
+    },
+    confirmUser() {
+      if (!this.confirmChecked) {
+        this.$message.warning("请勾选确认个人信息无误");
+        return;
+      }
+      this.confirmLoading = true;
+      let infoJson = {
+        realname: this.userInfo.realname,
+        idCard: this.userInfo.idCard,
+        telphone: this.userInfo.telphone,
+      };
+      this.$request
+        .userConfirminfo({
+          infoJson: JSON.stringify(infoJson),
+          orderGoodsId: this.orderGoodsId,
+        })
+        .then((res) => {
+          if (res.data.pushInfo) {
+            this.$message.success("提交成功");
+          } else {
+            this.$confirm(
+              "开通信息推送不成功,无法进入学习,请联系020-87085982!",
+              "提示",
+              {
+                confirmButtonText: "确定",
+                closeOnClickModal: false,
+                closeOnPressEscape: false,
+                distinguishCancelAndClose: false,
+                showClose: false,
+                showCancelButton: false,
+              }
+            )
+              .then((_) => {})
+              .catch((_) => {});
+          }
+          this.showConfirm = false;
+          this.confirmLoading = false;
+        });
+    },
   },
   components: {
     GoodsItem,
+    RebuildModal,
+  },
+  computed: {
+    ...mapGetters(["userInfo"]),
   },
 };
-</script>
-     
+</script>

+ 1 - 2
src/pages/person-center/my-course/index.vue

@@ -1391,12 +1391,11 @@ export default {
         item.goodsId,
         item.gradeId
       );
-
+  
       if (rebuildStatus == 0) {
         this.$refs.rebuildModal.showModal(item);
         return;
       }
-
       // if (item.educationName == "继续教育") {
       this.$request
         .lockLockStatus({