12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256 |
- <template>
- <div class="my-course">
- <div>
- <h4 class="headerTitle">
- <span v-if="goodsData.subjectNames" style="font-size: 20px"
- >【{{ goodsData.subjectNames }}】</span
- >{{ goodsData.goodsName
- }}<el-button
- size="mini"
- type="primary"
- plain
- icon="el-icon-sort"
- style="margin-left: 14px"
- @click="changeCourse"
- >切换科目</el-button
- >
- <el-button size="mini" type="warning" plain style="margin-left: 14px" @click="changeTest()">预约考试
- </el-button>
- </h4>
- <div v-for="(item, index) in courseList" :key="index">
- <p class="firstTop hoverStyle" @click="changeStatus(item)">
- <span class="iconStyle">课</span
- ><span class="titles">{{ item.courseName }}</span
- ><span class="showHide"
- ><span v-if="item.showStatus">收起∧</span
- ><span v-else>展开∨</span></span
- >
- </p>
- <div
- v-if="item.children && item.children.length > 0 && item.showStatus"
- >
- <template v-for="(items, indexs) in item.children">
- <div v-if="items.type === 1" :key="indexs">
- <p
- class="moduleStyle hoverStyle"
- @click="changeModuleStatus(items, index, indexs)"
- >
- {{ items.menuName }}
- <span class="showHide"
- ><i v-if="items.showStatus" class="el-icon-arrow-up"></i>
- <i v-else class="el-icon-arrow-down"></i
- ></span>
- </p>
- <template
- v-if="
- items.showStatus &&
- items.children &&
- items.children.length > 0
- "
- >
- <div
- v-for="(i, k) in items.children"
- :key="k"
- style="padding-left: 20px"
- >
- <div
- class="chapterStyle hoverStyle"
- @click="changeChapterStatus(2, i, index, indexs, k)"
- >
- <!-- <span class="iconStyle">章</span> -->
- {{ i.name }}
- <span class="showHide"
- ><i v-if="i.showStatus" class="el-icon-arrow-up"></i>
- <i v-else class="el-icon-arrow-down"></i
- ></span>
- </div>
- <template v-if="i.showStatus && i.children.length > 0">
- <div
- v-for="(is, ks) in i.children"
- class="sectionStyle hoverStyleSection"
- :key="ks"
- style="padding-left: 20px"
- >
- <el-row style="display: flex; align-items: center">
- <el-col :span="12">
- <span class="iconStyles">•</span>
- <span class="upStudyStyle sizeStyle">{{
- is.sectionType === 1
- ? "录播"
- : is.sectionType === 2
- ? "直播"
- : is.sectionType === 3
- ? "回放"
- : "练习"
- }}</span>
- <span class="span_style">{{ is.name }}</span>
- <span v-if="is.recordStatus" class="upStudyStyle"
- >上次学到</span
- >
- </el-col>
- <el-col :span="4">
- <span v-show="is.teacherName"
- >已选讲师:{{ is.teacherName }}</span
- >
- </el-col>
- <el-col :span="3">
- <el-progress
- v-if="is.studyDuration && is.durationTime"
- :show-text="false"
- :percentage="
- (is.studyDuration / is.durationTime) * 100 > 100
- ? 100
- : (is.studyDuration / is.durationTime) * 100
- "
- ></el-progress>
- </el-col>
- <el-col :span="2">
- <span v-show="is.studyDuration">
- {{
- $tools.secondToDate(is.studyDuration) +
- "/" +
- $tools.secondToDate(is.durationTime)
- }}
- </span>
- </el-col>
- <el-col
- :span="2"
- :offset="1"
- v-if="is.sectionType != 2"
- >
- <el-button
- size="mini"
- type="text"
- style="width: 90px !important"
- v-if="
- is.studyDuration > 0 &&
- is.durationTime > 0 &&
- is.studyDuration == is.durationTime
- "
- @click="studyFunc(item, is)"
- >再次学习</el-button
- >
- <el-button
- type="primary"
- size="mini"
- style="width: 90px !important"
- v-else-if="
- is.studyDuration > 0 &&
- is.durationTime > 0 &&
- is.studyDuration != is.durationTime
- "
- @click="studyFunc(item, is)"
- >继续学习</el-button
- >
- <el-button
- size="mini"
- type="primary"
- style="width: 90px !important"
- plain
- v-else-if="
- is.studyDuration == 0 && is.durationTime > 0
- "
- @click="studyFunc(item, is)"
- >未开始</el-button
- > </el-col
- ><el-col :span="2" :offset="1" v-else>
- <el-button
- size="mini"
- plain
- disabled
- type="success"
- style="width: 90px !important"
- v-if="is.liveStartTime > sysTime"
- @click="studyFunc(item, is)"
- >未开播</el-button
- >
- <el-button
- size="mini"
- plain
- disabled
- type="danger"
- style="width: 90px !important"
- v-else-if="is.liveEndTime < sysTime"
- @click="studyFunc(item, is)"
- >已结束</el-button
- >
- <el-button
- size="mini"
- plain
- type="primary"
- style="width: 90px !important; text-align: center"
- v-else-if="
- is.liveEndTime > sysTime &&
- is.liveStartTime < sysTime
- "
- @click="studyFunc(item, is)"
- >进入直播间</el-button
- >
- </el-col>
- </el-row>
- </div>
- </template>
- </div>
- </template>
- </div>
- <div v-if="items.type === 2" :key="indexs">
- <div
- class="chapterStyle hoverStyle"
- @click="changeChapterStatus(1, items, index, indexs)"
- >
- <!-- <span class="iconStyle">章</span> -->
- {{ items.menuName }}
- <span class="showHide"
- ><i v-if="items.showStatus" class="el-icon-arrow-up"></i>
- <i v-else class="el-icon-arrow-down"></i
- ></span>
- </div>
- <template v-if="items.showStatus && items.children.length > 0">
- <div
- v-for="(i, k) in items.children"
- class="sectionStyle hoverStyleSection"
- :key="k"
- style="padding-left: 20px"
- >
- <el-row style="display: flex; align-items: center">
- <el-col :span="12">
- <span class="iconStyles">•</span>
- <span class="upStudyStyle sizeStyle">{{
- i.sectionType === 1
- ? "录播"
- : i.sectionType === 2
- ? "直播"
- : i.sectionType === 3
- ? "回放"
- : "练习"
- }}</span>
- <span class="span_style">
- {{ i.name }}
- </span>
- <span v-if="i.recordStatus" class="upStudyStyle"
- >上次学到</span
- >
- </el-col>
- <el-col :span="4">
- <span v-show="i.teacherName"
- >已选讲师:{{ i.teacherName }}</span
- >
- </el-col>
- <el-col :span="3">
- <el-progress
- v-if="i.studyDuration && i.durationTime"
- :show-text="false"
- :percentage="
- (i.studyDuration / i.durationTime) * 100 > 100
- ? 100
- : (i.studyDuration / i.durationTime) * 100
- "
- ></el-progress>
- </el-col>
- <el-col :span="2">
- <span v-show="i.studyDuration">
- {{
- $tools.secondToDate(i.studyDuration) +
- "/" +
- $tools.secondToDate(i.durationTime)
- }}
- </span>
- </el-col>
- <el-col :span="2" :offset="1" v-if="i.sectionType != 2">
- <el-button
- size="mini"
- type="text"
- style="width: 90px !important"
- v-if="
- i.studyDuration > 0 &&
- i.durationTime > 0 &&
- i.studyDuration == i.durationTime
- "
- @click="studyFunc(item, i)"
- >再次学习</el-button
- >
- <el-button
- type="primary"
- size="mini"
- style="width: 90px !important"
- v-else-if="
- i.studyDuration > 0 &&
- i.durationTime > 0 &&
- i.studyDuration != i.durationTime
- "
- @click="studyFunc(item, i)"
- >继续学习</el-button
- >
- <el-button
- size="mini"
- plain
- type="primary"
- style="width: 90px !important"
- v-else-if="i.studyDuration == 0 && i.durationTime > 0"
- @click="studyFunc(item, i)"
- >未开始</el-button
- >
- </el-col>
- <el-col :span="2" :offset="1" v-else>
- <el-button
- size="mini"
- style="width: 90px !important"
- plain
- disabled
- type="success"
- v-if="i.liveStartTime > sysTime"
- @click="studyFunc(item, i)"
- >未开播</el-button
- >
- <el-button
- size="mini"
- style="width: 90px !important"
- plain
- disabled
- type="danger"
- v-else-if="i.liveEndTime < sysTime"
- @click="studyFunc(item, i)"
- >已结束</el-button
- >
- <el-button
- size="mini"
- style="width: 90px !important; text-align: center"
- plain
- type="primary"
- v-else-if="
- i.liveEndTime > sysTime && i.liveStartTime < sysTime
- "
- @click="studyFunc(item, i)"
- >进入直播间</el-button
- >
- </el-col>
- </el-row>
- </div>
- </template>
- </div>
- <div
- v-if="items.type === 3"
- :key="indexs"
- class="sectionStyle hoverStyle"
- >
- <el-row style="display: flex; align-items: center">
- <el-col :span="12">
- <span class="iconStyles">•</span>
- <span class="upStudyStyle sizeStyle">{{
- items.sectionType === 1
- ? "录播"
- : items.sectionType === 2
- ? "直播"
- : items.sectionType === 3
- ? "回放"
- : "练习"
- }}</span>
- <span class="span_style">
- {{ items.menuName }}
- </span>
- <span v-if="items.recordStatus" class="upStudyStyle"
- >上次学到</span
- >
- </el-col>
- <el-col :span="4">
- <span v-show="items.teacherName"
- >已选讲师:{{ items.teacherName }}</span
- >
- </el-col>
- <el-col :span="3">
- <el-progress
- v-if="items.studyDuration && items.durationTime"
- :show-text="false"
- :percentage="
- (items.studyDuration / items.durationTime) * 100 > 100
- ? 100
- : (items.studyDuration / items.durationTime) * 100
- "
- ></el-progress>
- </el-col>
- <el-col :span="2">
- <span v-show="items.studyDuration">
- {{
- $tools.secondToDate(items.studyDuration) +
- "/" +
- $tools.secondToDate(items.durationTime)
- }}
- </span>
- </el-col>
- <el-col :span="2" :offset="1" v-if="items.sectionType != 2">
- <el-button
- size="mini"
- style="width: 90px !important"
- type="text"
- v-if="
- items.studyDuration > 0 &&
- items.durationTime > 0 &&
- items.studyDuration == items.durationTime
- "
- @click="studyFunc(item, items)"
- >再次学习</el-button
- >
- <el-button
- type="primary"
- style="width: 90px !important"
- size="mini"
- v-else-if="
- items.studyDuration > 0 &&
- items.durationTime > 0 &&
- items.studyDuration != items.durationTime
- "
- @click="studyFunc(item, items)"
- >继续学习</el-button
- >
- <el-button
- style="width: 90px !important"
- plain
- size="mini"
- type="primary"
- v-else-if="
- items.studyDuration == 0 && items.durationTime > 0
- "
- @click="studyFunc(item, items)"
- >未开始</el-button
- >
- </el-col>
- <el-col :span="2" :offset="1" v-else>
- <el-button
- size="mini"
- style="width: 90px !important"
- plain
- disabled
- type="success"
- v-if="items.liveStartTime > sysTime"
- @click="studyFunc(item, items)"
- >未开播</el-button
- >
- <el-button
- size="mini"
- style="width: 90px !important"
- plain
- disabled
- type="danger"
- v-else-if="items.liveEndTime < sysTime"
- @click="studyFunc(item, items)"
- >已结束</el-button
- >
- <el-button
- size="mini"
- style="width: 90px !important; text-align: center"
- plain
- type="primary"
- v-else-if="
- items.liveEndTime > sysTime &&
- items.liveStartTime < sysTime
- "
- @click="studyFunc(item, items)"
- >进入直播间</el-button
- >
- </el-col>
- </el-row>
- </div>
- </template>
- </div>
- </div>
- </div>
- <courseData ref="courseData" @backData="backData" />
- <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>
- <RebuildModal
- ref="rebuildModal"
- @rebuildSubmit="rebuildSubmit($event)"
- ></RebuildModal>
- <!-- 预约考试弹窗 -->
- <appoint-test :appointModal.sync="appointModal" :appointItem='goodsData'></appoint-test>
- </div>
- </template>
- <script>
- import { mapGetters, mapActions } from "vuex";
- import courseData from "./courseData.vue";
- import RebuildModal from "@/components/rebuildModal";
- import AppointTest from './components/AppointTest.vue'
- export default {
- name: "MyCourse",
- components: { courseData, RebuildModal, AppointTest },
- data() {
- return {
- goodsData: {},
- courseList: [],
- sysTime: 0,
- showConfirm: false,
- confirmCount: 10,
- confirmChecked: false,
- confirmTimer: null,
- confirmLoading: false,
- appointModal: false, // 预约考试弹窗
- };
- },
- computed: {
- ...mapGetters(["userInfo"]),
- },
- mounted() {
- this.getRecord();
- this.sysTime = this.$tools.timest();
- },
- methods: {
- comeStyle(courseItem, item) {
- console.log(item, "itemitem");
- this.$router.push({
- path: `/my-course-detail/${this.goodsData.goodsId}`,
- query: {
- gradeId: courseItem.gradeId,
- orderGoodsId: this.goodsData.orderGoodsId,
- courseId: courseItem.courseId,
- chapterId: item.chapterId,
- moduleId: item.moduleId,
- sectionId: item.sectionId || item.menuId,
- recordingUrl: item.recordingUrl,
- liveUrl: item.liveUrl,
- sectionType: item.sectionType,
- liveStartTime: item.liveStartTime,
- liveEndTime: item.liveEndTime,
- },
- });
- },
- changeCourse() {
- this.$refs.courseData.openBoxs(this.goodsData);
- },
- changeTest() {
- this.appointModal = true
- },
- backData(item) {
- this.goodsData = item;
- this.getGoodsCourseList(item);
- },
- /**
- * 获取课程列表
- */
- getGoodsCourseList(item) {
- return new Promise((resolve, reject) => {
- this.$request
- .courseCourseList({
- goodsId: item.goodsId,
- gradeId: item.gradeId,
- })
- .then((res) => {
- res.rows.forEach((element) => {
- element.showStatus = false;
- element.children = [];
- });
- this.courseList = res.rows;
- resolve();
- // if (res.rows && res.rows.length > 0) {
- // this.getRecord(res.rows[0]);
- // }
- });
- });
- },
- getGoodsData(res) {
- return new Promise((resolve, reject) => {
- this.$request
- .courseGoodsList({ orderGoodsId: res.data.orderGoodsId })
- .then(async (result) => {
- if (result.rows.length == 0) {
- this.resultCourseGoodsList();
- } else {
- let array = result.rows[0];
- array.orderGoodsId = res.data.orderGoodsId;
- this.goodsData = array;
- await this.getGoodsCourseList(array);
- resolve();
- }
- });
- });
- },
- /**
- * 获取学习记录
- */
- getRecord(item) {
- this.$request.studyrecordgetUserWatchLast().then(async (res) => {
- if (res.data && res.data.sectionId) {
- await this.getGoodsData(res);
- var stop = false;
- for (let i = 0; i < this.courseList.length; i++) {
- if (stop) {
- break;
- }
- if (this.courseList[i].courseId == res.data.courseId) {
- await this.changeStatus(this.courseList[i]);
- for (let k = 0; k < this.courseList[i].children.length; k++) {
- if (res.data.moduleId) {
- console.log(1);
- if (
- this.courseList[i].children[k].menuId == res.data.moduleId
- ) {
- await this.changeModuleStatus(
- this.courseList[i].children[k],
- i,
- k
- );
- for (
- let j = 0;
- j < this.courseList[i].children[k].children.length;
- j++
- ) {
- if (
- this.courseList[i].children[k].children[j].chapterId ==
- res.data.chapterId
- ) {
- await this.changeChapterStatus(
- 2,
- this.courseList[i].children[k].children[j],
- i,
- k,
- j
- );
- for (
- let m = 0;
- m <
- this.courseList[i].children[k].children[j].children
- .length;
- m++
- ) {
- if (
- this.courseList[i].children[k].children[j].children[
- m
- ].sectionId == res.data.sectionId
- ) {
- this.$set(
- this.courseList[i].children[k].children[j]
- .children[m],
- "recordStatus",
- true
- );
- stop = true;
- break;
- }
- }
- }
- }
- }
- } else if (res.data.chapterId) {
- console.log(2);
- if (
- this.courseList[i].children[k].menuId == res.data.chapterId
- ) {
- await this.changeChapterStatus(
- 1,
- this.courseList[i].children[k],
- i,
- k
- );
- for (
- let j = 0;
- j < this.courseList[i].children[k].children.length;
- j++
- ) {
- if (
- this.courseList[i].children[k].children[j].sectionId ==
- res.data.sectionId
- ) {
- this.$set(
- this.courseList[i].children[k].children[j],
- "recordStatus",
- true
- );
- stop = true;
- break;
- }
- }
- }
- } else {
- console.log(3);
- if (
- this.courseList[i].children[k].menuId == res.data.sectionId
- ) {
- this.$set(
- this.courseList[i].children[k],
- "recordStatus",
- true
- );
- stop = true;
- break;
- }
- }
- }
- }
- }
- } else {
- this.resultCourseGoodsList();
- }
- });
- },
- resultCourseGoodsList() {
- this.$request.courseGoodsList({ pageNum: 1, pageSize: 1 }).then((res) => {
- if (res.rows && res.rows.length > 0) {
- this.backData(res.rows[0]);
- }
- });
- },
- /**
- * 展开获取课程详情列表
- */
- changeStatus(item) {
- return new Promise((resolve, reject) => {
- console.log(item);
- if (item.children.length > 0) {
- item.showStatus = !item.showStatus;
- return;
- }
- this.$request
- .reMenuList({
- courseId: item.courseId,
- gradeId: item.gradeId,
- orderGoodsId: this.goodsData.orderGoodsId,
- })
- .then((res) => {
- res.rows.forEach((items) => {
- if (items.type != 3) {
- items.showStatus = false;
- items.children = [];
- }
- });
- for (let i = 0; i < this.courseList.length; i++) {
- if (this.courseList[i].courseId == item.courseId) {
- this.$set(this.courseList[i], "children", res.rows);
- this.$set(
- this.courseList[i],
- "showStatus",
- !this.courseList[i].showStatus
- );
- break;
- }
- }
- resolve();
- });
- });
- },
- /**
- * 模块详情列表
- */
- changeModuleStatus(item, index, indexs) {
- return new Promise((resolve, reject) => {
- if (item.children && item.children.length > 0) {
- item.showStatus = !item.showStatus;
- return;
- }
- this.$request
- .reChapterList({
- moduleId: item.menuId,
- gradeId: item.gradeId,
- courseId: item.courseId,
- })
- .then((res) => {
- res.data.forEach((items) => {
- items.children = [];
- items.showStatus = false;
- });
- this.$set(
- this.courseList[index].children[indexs],
- "children",
- res.data
- );
- item.showStatus = !item.showStatus;
- resolve();
- });
- });
- },
- /**
- * 章详情列表 type = 1 父级章 type = 2 父级模块
- */
- changeChapterStatus(type, item, courseIndex, index, indexs) {
- return new Promise((resolve, reject) => {
- console.log("rrr");
- if (item.children && item.children.length > 0) {
- item.showStatus = !item.showStatus;
- return;
- }
- this.$request
- .reSectionList({
- chapterId: type === 1 ? item.menuId : item.chapterId,
- gradeId: item.gradeId,
- courseId: item.courseId,
- moduleId: item.moduleId,
- orderGoodsId: this.goodsData.orderGoodsId,
- })
- .then((res) => {
- if (type === 1) {
- this.$set(
- this.courseList[courseIndex].children[index],
- "children",
- res.data
- );
- }
- if (type === 2) {
- this.$set(
- this.courseList[courseIndex].children[index].children[indexs],
- "children",
- res.data
- );
- }
- item.showStatus = !item.showStatus;
- resolve();
- });
- });
- },
- async studyFunc(courseItem, items) {
- this.sysTime = this.$tools.timest();
- let item = this.goodsData;
- console.log(item, "学习服务期");
- if (item.interfaceAccountId > 0) {
- //学习账号已开通
- if (item.learnStatus == 1) {
- //跳转第三方h5
- this.$router.push({
- path: `/my-course-detail/${item.goodsId}`,
- query: {
- gradeId: item.gradeId,
- orderGoodsId: item.orderGoodsId,
- isOther: 1,
- },
- });
- return;
- } else {
- this.$message({
- type: "warning",
- message:
- "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!",
- });
- return;
- }
- }
- if (
- (item.serviceStartTime && this.sysTime <= item.serviceStartTime) ||
- (item.serviceEndTime && this.sysTime >= item.serviceEndTime)
- ) {
- this.$message({
- type: "warning",
- message: "不在学习服务期,不能进入学习",
- });
- return;
- }
- if (
- (item.classStartTime && this.sysTime <= item.classStartTime) ||
- (item.classEndTime && this.sysTime >= item.classEndTime)
- ) {
- this.$message({
- type: "warning",
- message: "不在班级有效期,不能进入学习",
- });
- return;
- }
- if (item.learningStatus == 2) {
- this.$message({
- type: "warning",
- message: "开放学习时间待定,不能进入学习",
- });
- return;
- }
- if (item.classStatus == 0) {
- this.$message({
- type: "warning",
- message: "尚未开班,不能进入学习",
- });
- return;
- }
- if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
- this.$message({
- type: "warning",
- message: "不在开放学习时间,不能进入学习",
- });
- return;
- }
- var confirmDetail = true;
- if (item.educationName == "继续教育") {
- if (
- item.officialName &&
- item.businessName == "二级" &&
- item.projectName == "建造师"
- ) {
- confirmDetail = await this.userConfirmInfoDetail();
- }
- }
- // //内部系统
- // if (item.interfacePushId > 0 && item.officialStatus != 1) {
- // this.$message({
- // type: "warning",
- // message: "机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!",
- // });
- // return;
- // }
- if (!confirmDetail) {
- return;
- }
- let rebuildStatus = await this.courseGoodsRebuildStatus(
- item.goodsId,
- item.gradeId
- );
- if (rebuildStatus == 0) {
- this.$refs.rebuildModal.showModal(item);
- return;
- }
- // if (item.educationName == "继续教育") {
- this.$request
- .lockLockStatus({
- action: "jxjy",
- uuid: sessionStorage.getItem("uuid"),
- })
- .then((res) => {
- //有其他端在操作,不能学习
- this.$message({
- type: "warning",
- message: res.msg,
- });
- })
- .catch((err) => {
- //可以学习
- this.$request
- .courseCourseList({
- pageNum: 1,
- pageSize: 1,
- goodsId: item.goodsId,
- gradeId: item.gradeId,
- })
- .then(async (res) => {
- //学习次数是否上限---start
- let learnNum = await this.goodsTodayStudySectionNum(courseItem);
- let hasLearn = await this.gradeCheckGoodsStudy(courseItem, items);
- console.log(learnNum, hasLearn);
- if (this.goodsData.sectionMaxNum > 0) {
- if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
- this.clickLock = false;
- this.$message({
- type: "warning",
- message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
- });
- return;
- }
- }
- //学习次数是否上限---end
- if (res.rows.length) {
- // this.$emit("backData", item);
- // this.dialogVisible = false;
- this.comeStyle(courseItem, items);
- // this.$router.push({
- // path: `/my-course-detail/${item.goodsId}`,
- // query: {
- // gradeId: item.gradeId,
- // orderGoodsId: item.orderGoodsId,
- // courseId: res.rows[0].courseId || "",
- // },
- // });
- // }
- } else {
- this.$message({
- type: "warning",
- message: "课程内暂无可以学习的科目",
- });
- }
- });
- });
- },
- gradeCheckGoodsStudy(courseItem, option) {
- return new Promise((resolve) => {
- this.$request
- .gradeCheckGoodsStudy({
- goodsId: this.goodsData.goodsId,
- gradeId: courseItem.gradeId,
- moduleId: option.moduleId || 0,
- chapterId: option.chapterId || 0,
- sectionId: option.sectionId || option.menuId,
- })
- .then((res) => {
- resolve(res.data);
- });
- });
- },
- goodsTodayStudySectionNum(option) {
- return new Promise((resolve) => {
- this.$request
- .goodsTodayStudySectionNum({
- goodsId: this.goodsData.goodsId,
- gradeId: option.gradeId,
- })
- .then((res) => {
- resolve(res.data);
- });
- });
- },
- userConfirmInfoDetail() {
- return new Promise((resolve) => {
- this.$request
- .userConfirmInfoDetail({
- orderGoodsId: this.goodsData.orderGoodsId,
- })
- .then((res) => {
- if (!res.data) {
- clearInterval(this.confirmTimer);
- this.confirmCount = 10;
- this.showConfirm = true;
- this.confirmTimer = setInterval(() => {
- if (this.confirmCount > 0) {
- this.confirmCount--;
- } else {
- clearInterval(this.confirmTimer);
- }
- }, 1000);
- } 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);
- }
- }
- });
- });
- },
- 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.goodsData.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;
- });
- },
- /**
- * @param {Object} goodsId 商品id
- * 查询商品重修状态
- */
- courseGoodsRebuildStatus(goodsId, gradeId) {
- return new Promise((resolve) => {
- this.$request
- .courseGoodsRebuildStatus({
- goodsId: goodsId,
- gradeId: gradeId,
- })
- .then((res) => {
- resolve(res.data);
- });
- });
- },
- rebuildSubmit(item) {
- this.$router.push({
- path: `/my-course-detail/${item.goodsId}`,
- query: {
- gradeId: item.gradeId,
- orderGoodsId: item.orderGoodsId,
- rebuild: 1,
- },
- });
- },
- },
- };
- </script>
- <!-- Add "scoped" attribute to limit CSS to this component only -->
- <style scoped lang="scss">
- .headerTitle {
- color: #222;
- font-weight: bold;
- font-size: 24px;
- padding: 28px 0px;
- border-bottom: 1px solid #eee;
- }
- .firstTop {
- padding: 24px 0px;
- // margin: 24px 0px;
- .iconStyle {
- background-color: #3f8dfd;
- color: #fff;
- margin-right: 8px;
- padding: 0px 4px;
- border-radius: 4px;
- font-size: 12px;
- vertical-align: text-top;
- }
- .titles {
- font-weight: bold;
- color: #333;
- font-size: 18px;
- }
- .showHide {
- cursor: pointer;
- user-select: none;
- float: right;
- color: #99a0a7;
- }
- }
- .moduleStyle {
- padding: 17px;
- background-color: #f8f8f9;
- font-weight: bold;
- color: #222;
- margin-bottom: 16px;
- .showHide {
- cursor: pointer;
- user-select: none;
- float: right;
- color: #99a0a7;
- }
- }
- .chapterStyle {
- font-weight: 400;
- .iconStyle {
- background-color: #fff;
- color: #3f8dfd;
- margin-right: 8px;
- padding: 0px 2px;
- border-radius: 2px;
- border: 1px solid #3f8dfd;
- font-size: 10px;
- vertical-align: text-top;
- }
- .showHide {
- cursor: pointer;
- user-select: none;
- float: right;
- color: #99a0a7;
- }
- margin-bottom: 16px;
- padding: 17px;
- border-bottom: 1px solid #eee;
- }
- .sectionStyle {
- color: #99a0a7;
- padding: 10px;
- .iconStyles {
- color: #99a0a7;
- margin-right: 8px;
- padding: 0px 2px;
- }
- }
- .upStudyStyle {
- background-color: #f2f7ff;
- border: 1px solid #3f8dfd;
- color: #3f8dfd;
- padding: 3px 4px;
- border-radius: 4px;
- }
- .sizeStyle {
- background-color: #fff !important;
- border-color: #979ea5 !important;
- color: #979ea5 !important;
- padding: 2px 3px !important;
- }
- .hoverStyle {
- cursor: pointer;
- transition: all 0.2s;
- &:hover {
- background-color: #eaf3ff;
- }
- }
- .hoverStyleSection {
- transition: all 0.2s;
- &:hover {
- background-color: #eaf3ff;
- }
- }
- .span_style {
- max-width: 400px;
- display: inline-block;
- vertical-align: middle;
- }
- </style>
|