123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559 |
- <template>
- <div id="coreContent">
- <div class="left_box">
- <video-cy
- :class="video_iframe == 'video' ? 'smallView' : ''"
- v-show="video_iframe == 'video' && !viewStatus ? false : true"
- ref="video_cy"
- @videoScript="videoScript"
- :activeSection.sync="activeSection"
- ></video-cy>
- <div
- class="office_style"
- :class="video_iframe == 'iframe' ? 'smallView' : ''"
- v-show="video_iframe == 'iframe' && !viewStatus ? false : true"
- v-if="SwitchOfficeData.url"
- >
- <iframe
- width="100%"
- height="100%"
- :src="
- 'https://preview.xyyxt.net?src=' +
- $tools.splitImgHost(SwitchOfficeData.url)
- "
- ></iframe>
- </div>
- <div v-if="SwitchOfficeData.url && viewStatus" class="floatView">
- <el-button size="small" type="primary" @click="switchView"
- >切换</el-button
- >
- <el-button size="small" type="warning" @click="viewStatus = !viewStatus"
- >隐藏</el-button
- >
- </div>
- <el-button
- v-if="!viewStatus"
- size="small"
- class="showOK"
- @click="viewStatus = !viewStatus"
- >显示</el-button
- >
- </div>
- <div class="right_box">
- <el-tabs stretch v-model="courseTabIndex">
- <el-tab-pane
- lazy
- :name="tab.name"
- v-for="(tab, index) in menuTab"
- :key="index"
- >
- <div slot="label">
- <span class="label">{{ tab.label }}</span>
- </div>
- <!-- 章节目录 -->
- <template v-if="tab.name == '1'">
- <course-tree ref="courseTree" :activeSection.sync="activeSection">
- </course-tree>
- </template>
- <!-- 重修目录 -->
- <template v-if="tab.name == '2'">
- <course-tree :activeSection.sync="activeSection" :rebuild="1">
- </course-tree>
- </template>
- <template v-if="tab.name == '3'">
- <answer-questions
- ref="answerQuestions"
- :activeSection.sync="activeSection"
- ></answer-questions>
- </template>
- <template v-if="tab.name == '4'">
- <Notes ref="notes"></Notes>
- </template>
- <template v-if="tab.name == '5'">
- <hand-out
- ref="handOut"
- @backSwitchOfficeData="backSwitchOfficeData"
- ></hand-out>
- </template>
- </el-tab-pane>
- </el-tabs>
- </div>
- <dataReview ref="dataReview" @callbackDataReview="callbackDataReview" />
- <preference ref="preference" />
- </div>
- </template>
- <script>
- import preference from "@/components/preference";
- import dataReview from "@/components/dataReview";
- import CourseTree from "./CourseTree.vue";
- import AnswerQuestions from "./AnswerQuestions.vue";
- import HandOut from "./HandOut.vue";
- import Notes from "./Notes.vue";
- export default {
- components: {
- videoCy: () => import("@/components/videoCy/index.vue"),
- Notes,
- HandOut,
- AnswerQuestions,
- CourseTree,
- dataReview,
- preference,
- },
- inject: ["getGoodsData"],
- provide() {
- return {
- getPlayer: () => this.player,
- getActiveSection: () => this.activeSection,
- };
- },
- data() {
- return {
- video_iframe: "iframe", //当前缩小视图层
- viewStatus: true, //开关隐藏
- courseTabIndex: "",
- menuTab: [
- {
- name: "1",
- label: "章节目录",
- },
- {
- name: "3",
- label: "答疑",
- },
- {
- name: "4",
- label: "笔记",
- },
- {
- name: "5",
- label: "讲义",
- },
- ],
- gradeDetail: {}, //班级详情
- player: null, //视频播放器实例
- SwitchOfficeData: {}, //当前选中讲义数据
- activeSection: {}, //当前选中节数据
- };
- },
- computed: {
- goodsData() {
- return this.getGoodsData();
- },
- },
- watch: {
- //因为刚开始获取不到goodsData的数据 所以需要监听
- goodsData: function (newVal, oldVal) {
- if (newVal) {
- this.getBeforeWork(); //处理前置任务
- }
- },
- },
- methods: {
- //切换视图
- switchView() {
- this.video_iframe == "iframe"
- ? (this.video_iframe = "video")
- : (this.video_iframe = "iframe");
- },
- //处理前置任务
- getBeforeWork() {
- //商品优选操作
- if (this.goodsData.firstChoiceStatus) {
- this.$refs.preference.openBoxs(this.goodsData);
- } else {
- this.$refs.dataReview.init({
- goodsId: this.goodsData.goodsId,
- orderGoodsId: this.goodsData.orderGoodsId,
- gradeId: this.goodsData.gradeId,
- goodsName: this.goodsData.goodsName,
- educationName: this.goodsData.educationName,
- projectName: this.goodsData.projectName,
- businessName: this.goodsData.businessName,
- categoryName: this.goodsData.categoryName,
- });
- }
- },
- //资料填写回调
- async callbackDataReview() {
- await this.RequiredCourse(); //检测必修
- await this.orderstudycheckFunc(); //七大员是否允许学习
- await this.confirmInfoDetail(); //判断开通信息推送是否成功
- if (this.goodsData.gradeId > 0 && this.goodsData.jjShiGongYuan) {
- await this.getGradeInfo(); //提交完资料返回判断是否已开班
- //继教七大员公共课程同步
- const res = await this.$request.ordersevenyear(
- this.goodsData.orderGoodsId
- );
- if (res.data) {
- this.goodsData.orderYears = res.data;
- await this.sevenCommonCourse();
- }
- }
- await this.getRebuildCourse(); //获取重修列表
- this.courseTabIndex = "1";
- },
- //七大员是否允许学习
- orderstudycheckFunc() {
- return new Promise((resolve, reject) => {
- this.$request
- .orderstudycheck(this.goodsData.orderGoodsId)
- .then((res) => {
- resolve();
- })
- .catch((err) => {
- this.$confirm(err.msg, "提示", {
- confirmButtonText: "确定",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- showCancelButton: false,
- distinguishCancelAndClose: false,
- showClose: false,
- })
- .then((_) => {
- this.$router.back(-1);
- })
- .catch((_) => {});
- reject();
- });
- });
- },
- //检测必修
- RequiredCourse() {
- return new Promise((resolve, reject) => {
- if (
- this.goodsData.educationName == "继续教育" &&
- this.goodsData.businessName == "二级" &&
- (this.goodsData.projectName == "建造师" ||
- this.goodsData.projectName == "造价师")
- ) {
- this.$request
- .goodsGradeCheckFinishRequiredCourse({
- businessId: this.goodsData.businessId,
- goodsId: this.goodsData.goodsId,
- })
- .then((res) => {
- if (res.data > 0) {
- this.$confirm(`请先学习必修商品`, "提示", {
- confirmButtonText: "确定",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- showCancelButton: false,
- distinguishCancelAndClose: false,
- showClose: false,
- })
- .then((_) => {
- this.$router.back(-1);
- })
- .catch((_) => {});
- reject();
- } else {
- resolve();
- }
- })
- .catch((err) => {
- this.$confirm(err.msg, "提示", {
- confirmButtonText: "确定",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- showCancelButton: false,
- distinguishCancelAndClose: false,
- showClose: false,
- })
- .then((_) => {
- this.$router.back(-1);
- })
- .catch((_) => {});
- reject();
- });
- } else {
- resolve();
- }
- });
- },
- //提交完资料返回判断是否已开班
- getGradeInfo() {
- return new Promise((resolve, reject) => {
- this.$request.goodsGradeInfo(this.goodsData.gradeId).then((res) => {
- if (res.code == 200) {
- this.gradeDetail = res.data;
- let nowTime = parseInt(new Date().getTime() / 1000);
- if (this.goodsData.erJianErZao || this.goodsData.jjShiGongYuan) {
- if (res.data.classEndTime && res.data.classEndTime < nowTime) {
- this.$confirm(
- `当前课程所属班级有效期已过期,无法继续学习!`,
- "提示",
- {
- confirmButtonText: "确定",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- showCancelButton: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }
- )
- .then((_) => {
- this.$router.back(-1);
- })
- .catch((_) => {});
- return;
- }
- }
- if (res.data.interfaceAccountId > 0 && res.data.learnStatus > 0) {
- const confirmText = [
- "您的学习账号已经开通,请按照步骤操作,进行学习。",
- "1.点击【跳转学习网址】按钮",
- "2.打开学习网址后,选择【个人用户】进行登录",
- "(1)账号:您个人的身份证号码",
- "(2)密码:身份证号码,再加111111",
- ];
- const newDatas = [];
- const h = this.$createElement;
- for (const i in confirmText) {
- newDatas.push(h("p", null, confirmText[i]));
- }
- this.$confirm(h("div", null, newDatas), "温馨提示", {
- beforeClose: (type, y, done) => {
- if (type == "confirm") {
- window.open("http://admin.zhujianpeixun.com/", "_blank");
- } else if (type == "cancel") {
- this.$router.back(-1);
- }
- },
- confirmButtonText: "跳转学习网址",
- cancelButtonText: "关闭",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- distinguishCancelAndClose: false,
- showClose: false,
- });
- return;
- }
- if (res.data.learningStatus == 2) {
- this.$confirm(
- `当前课程正在申请中,正式开班后方可进行学习,请耐心等候!`,
- "提示",
- {
- confirmButtonText: "确定",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- showCancelButton: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }
- )
- .then((_) => {
- this.$router.back(-1);
- })
- .catch((_) => {});
- return;
- }
- if (
- res.data.learningStatus == 3 &&
- Number(res.data.learningTimeStart) > Number(new Date() / 1000)
- ) {
- this.$confirm(
- `当前课程正在申请中,正式开班后方可进行学习,请耐心等候!`,
- "提示",
- {
- confirmButtonText: "返回",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- showCancelButton: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }
- )
- .then((_) => {
- this.$router.back(-1);
- })
- .catch((_) => {});
- return;
- }
- if (
- (res.data.interfaceAccountId > 0 && res.data.learnStatus > 0) ||
- res.data.learningStatus == 2 ||
- (res.data.learningStatus == 3 &&
- Number(res.data.learningTimeStart) > Number(new Date() / 1000))
- ) {
- reject();
- } else {
- resolve();
- }
- }
- });
- });
- },
- //继教七大员公共课程同步
- sevenCommonCourse() {
- return new Promise((resolve, reject) => {
- this.$request
- .syncSevenPublicClass({ orderGoodsId: this.goodsData.orderGoodsId })
- .then((res) => {
- if (res.code == 200) {
- resolve();
- } else {
- reject();
- }
- })
- .catch((err) => {
- if(err.msg=='课程定位错误')
- {
- resolve();
- }
- else{
- this.$alert(err.msg, "提示", {
- confirmButtonText: "返回",
- showClose: false,
- callback: (action) => {
- this.$router.go(-1);
- },
- });
- reject();
- }
- });
- });
- },
- //判断开通信息推送是否成功
- confirmInfoDetail() {
- return new Promise(async (resolve, reject) => {
- if (this.goodsData.erJianErZao || this.goodsData.jjShiGongYuan) {
- let info = await this.$request.userConfirmInfoDetail({
- orderGoodsId: this.goodsData.orderGoodsId,
- });
- if (!info.data || info.data.pushInfo !== 1) {
- this.$confirm(`您的信息正在推送中,请稍后再进入学习!`, "提示", {
- confirmButtonText: "确定",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- distinguishCancelAndClose: false,
- showCancelButton: false,
- showClose: false,
- })
- .then((_) => {
- //停止执行-退出页面
- this.$router.back(-1);
- })
- .catch((_) => {
- //停止执行-退出页面
- this.$router.back(-1);
- });
- reject();
- } else {
- resolve();
- }
- } else {
- resolve();
- }
- });
- },
- //获取重修列表
- getRebuildCourse() {
- return new Promise((resolve, reject) => {
- this.$request
- .getRebuildCourse({
- goodsId: this.goodsData.goodsId,
- rebuild: 1,
- gradeId: this.goodsData.gradeId,
- orderGoodsId: this.goodsData.orderGoodsId,
- })
- .then(async (res) => {
- if (res.data.length > 0) {
- console.log(res.data, "resda");
- this.menuTab.splice(1, 0, {
- name: "2",
- label: "重修目录",
- });
- }
- resolve();
- })
- .catch((err) => {
- this.$message.error(err + "、重修列表获取失败");
- reject();
- });
- });
- },
- //讲义模块返回
- backSwitchOfficeData(item) {
- this.SwitchOfficeData = Object.assign({}, item);
- },
- //视频播放实例
- videoScript(player) {
- this.player = player;
- this.video_iframe = "iframe"; //当前缩小视图层
- this.viewStatus = true; //开关隐藏
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- #coreContent {
- // background-color: skyblue;
- display: flex;
- width: 100%;
- height: 455px;
- & > .left_box {
- width: 810px;
- flex-shrink: 0;
- position: relative;
- & > .office_style {
- width: 810px;
- height: 455px;
- }
- & > .smallView {
- position: absolute;
- z-index: 123;
- right: 4px;
- bottom: 60px;
- transform: scale(0.2);
- transform-origin: 100% 100%;
- }
- & > .floatView {
- position: absolute;
- z-index: 124;
- right: 4px;
- bottom: 60px;
- width: 162px;
- height: 91px;
- background-color: rgba(225, 225, 225, 0.8);
- display: flex;
- align-items: center;
- justify-content: space-around;
- }
- & > .showOK {
- position: absolute;
- z-index: 124;
- right: 10px;
- bottom: 87px;
- opacity: 0.3;
- &:hover {
- opacity: 0.8;
- }
- }
- }
- & > .right_box {
- width: 1px;
- flex: 1;
- & > .el-tabs {
- height: 100%;
- background-color: #3f4449;
- display: flex;
- flex-direction: column;
- /deep/ .el-tabs__header {
- background-color: #3f4449 !important;
- margin: 0px !important;
- .label {
- color: #fff;
- }
- }
- /deep/ .el-tabs__content {
- flex: 1;
- height: 1px;
- overflow: auto;
- background-color: #3f4449 !important;
- }
- }
- }
- }
- </style>
|