fix:缺少div结束标签

This commit is contained in:
joshen
2025-11-27 15:20:29 +08:00
parent 35375880f2
commit d62499edef

View File

@@ -26,8 +26,7 @@
<!-- <!--
<span class="bcourse-score" v-if="courseInfo.score>0">{{toScore(courseInfo.score)}} </span> <span class="bcourse-score" v-if="courseInfo.score>0">{{toScore(courseInfo.score)}} </span>
<span class="bcourse-score" v-else>无评分</span> <span class="bcourse-score" v-else>无评分</span>
--> --></div>
</div>
</div> </div>
</div> </div>
<div class="course-content xcontent"> <div class="course-content xcontent">
@@ -70,7 +69,9 @@
<img <img
class="icon-small" class="icon-small"
v-if="isPraise" v-if="isPraise"
:src="require('@/assets/images/icon/praise-active.png')" :src="
require('@/assets/images/icon/praise-active.png')
"
/> />
<img <img
class="icon-small" class="icon-small"
@@ -254,22 +255,40 @@
<div class="score" style="display: flex"> <div class="score" style="display: flex">
<div <div
v-if="!scoreInfo.has" v-if="!scoreInfo.has"
style="margin-left: 10px; cursor: pointer; padding-top: 10px;display: flex;align-items: center;" style="
margin-left: 10px;
cursor: pointer;
padding-top: 10px;
display: flex;
align-items: center;
"
> >
<!-- <el-popover placement="top" width="300" trigger="hover"> --> <!-- <el-popover placement="top" width="300" trigger="hover"> -->
<!-- <div style="text-align:center;line-height:50px;padding:20px 0px"> <!-- <div style="text-align:center;line-height:50px;padding:20px 0px">
<div style="padding-top:30px"><el-button @click="addScore">提交评分</el-button></div> <div style="padding-top:30px"><el-button @click="addScore">提交评分</el-button></div>
</div> --> </div> -->
<p style="margin-right:10px">告诉我们您的喜欢程度</p> <p style="margin-right: 10px">告诉我们您的喜欢程度</p>
<el-rate <el-rate
v-model="scoreInfo.score" v-model="scoreInfo.score"
@change="showConfirmScore" :allow-half="true" @change="showConfirmScore"
></el-rate><div v-if="isShowScoreConfirm"> :allow-half="true"
<span class="score-text">{{ toScore(scoreInfo.score) }}</span> ></el-rate>
<span style="font-size: 18px;"></span> <div v-if="isShowScoreConfirm">
<el-button style="margin-left:10px" type="primary" size="mini" @click="addScore" >确定</el-button> <span class="score-text">{{
<el-button size="mini" @click="handleCancelScore">取消</el-button> toScore(scoreInfo.score)
}}</span>
<span style="font-size: 18px"></span>
<el-button
style="margin-left: 10px"
type="primary"
size="mini"
@click="addScore"
>确定</el-button
>
<el-button size="mini" @click="handleCancelScore"
>取消</el-button
>
</div> </div>
<!-- <el-tag class="ref-score" slot="reference">去评分</el-tag> --> <!-- <el-tag class="ref-score" slot="reference">去评分</el-tag> -->
<!-- </el-popover> --> <!-- </el-popover> -->
@@ -335,7 +354,9 @@
<img <img
class="icon-small" class="icon-small"
v-if="isTrample" v-if="isTrample"
:src="require('@/assets/images/icon/trample-active.png')" :src="
require('@/assets/images/icon/trample-active.png')
"
/> />
<img <img
class="icon-small" class="icon-small"
@@ -388,7 +409,9 @@
</div> </div>
<!-- 课程单元 --> <!-- 课程单元 -->
<div class="course-units" v-if="tab == 1"> <div class="course-units" v-if="tab == 1">
<div style="min-height: 350px; max-height: 650px; overflow-y: auto"> <div
style="min-height: 350px; max-height: 650px; overflow-y: auto"
>
<div class="catalog" v-if="courseInfo.type == 20"> <div class="catalog" v-if="courseInfo.type == 20">
<div <div
v-for="(item, index) in catalogTree" v-for="(item, index) in catalogTree"
@@ -404,10 +427,16 @@
@open="handleOpen" @open="handleOpen"
@close="handleClose" @close="handleClose"
> >
<el-submenu :index="item.section.id" v-if="catalogTree.length > 1"> <el-submenu
:index="item.section.id"
v-if="catalogTree.length > 1"
>
<template slot="title"> <template slot="title">
<div <div
style="display: flex; justify-content: space-between" style="
display: flex;
justify-content: space-between;
"
> >
<div <div
style=" style="
@@ -442,7 +471,9 @@
> >
<div <div
class="units-info" class="units-info"
:class="{ 'units-active': contentData.id == ele.id }" :class="{
'units-active': contentData.id == ele.id,
}"
@click="showRes(ele, i, index, item)" @click="showRes(ele, i, index, item)"
> >
<el-menu-item <el-menu-item
@@ -480,7 +511,8 @@
<!-- <img v-if="contentData.id == ele.id" :src="`${webBaseUrl}/images/playicon.png`" alt=""> --> <!-- <img v-if="contentData.id == ele.id" :src="`${webBaseUrl}/images/playicon.png`" alt=""> -->
<img <img
v-if=" v-if="
contentData.id == ele.id && ele.status == 9 contentData.id == ele.id &&
ele.status == 9
" "
style="width: 16px; height: 16px" style="width: 16px; height: 16px"
src="@/assets/images/over.png" src="@/assets/images/over.png"
@@ -488,7 +520,8 @@
/> />
<img <img
v-if=" v-if="
contentData.id == ele.id && ele.status == 0 contentData.id == ele.id &&
ele.status == 0
" "
style="width: 16px; height: 16px" style="width: 16px; height: 16px"
src="@/assets/images/nowNot.png" src="@/assets/images/nowNot.png"
@@ -506,7 +539,8 @@
/> />
<img <img
v-if=" v-if="
contentData.id != ele.id && ele.status == 9 contentData.id != ele.id &&
ele.status == 9
" "
style="width: 16px; height: 16px" style="width: 16px; height: 16px"
src="@/assets/images/notNew.png" src="@/assets/images/notNew.png"
@@ -514,7 +548,8 @@
/> />
<img <img
v-if=" v-if="
contentData.id != ele.id && ele.status == 0 contentData.id != ele.id &&
ele.status == 0
" "
style="width: 16px; height: 16px" style="width: 16px; height: 16px"
src="@/assets/images/not.png" src="@/assets/images/not.png"
@@ -537,20 +572,106 @@
</el-menu-item-group> </el-menu-item-group>
</el-submenu> </el-submenu>
<div v-else> <div v-else>
<el-menu-item-group v-for="(ele, i) in item.children" :key="i"> <el-menu-item-group
<div class="units-info" :class="{'units-active':contentData.id == ele.id}" @click="showRes(ele,i,index,item)"> v-for="(ele, i) in item.children"
<el-menu-item :index="ele.id" style="padding: 0;padding-left: 10px;"> :key="i"
<div style="display: flex;justify-content: space-between;"> >
<div style="width: 200px;font-size: 16px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;" :title="ele.contentName">{{i+1}}. {{ ele.contentName }}</div> <div
class="units-info"
:class="{
'units-active': contentData.id == ele.id,
}"
@click="showRes(ele, i, index, item)"
>
<el-menu-item
:index="ele.id"
style="padding: 0; padding-left: 10px"
>
<div
style="
display: flex;
justify-content: space-between;
"
>
<div
style="
width: 200px;
font-size: 16px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
"
:title="ele.contentName"
>
{{ i + 1 }}. {{ ele.contentName }}
</div>
<div> <div>
<span v-if="contentData.id == ele.id" style="color: #387DF7;font-size: 14px;margin-right: 4px;">学习中</span> <span
v-if="contentData.id == ele.id"
style="
color: #387df7;
font-size: 14px;
margin-right: 4px;
"
>学习中</span
>
<!-- <img v-if="contentData.id == ele.id" :src="`${webBaseUrl}/images/playicon.png`" alt=""> --> <!-- <img v-if="contentData.id == ele.id" :src="`${webBaseUrl}/images/playicon.png`" alt=""> -->
<img v-if="contentData.id == ele.id && ele.status == 9" style="width: 16px;height: 16px;" src="@/assets/images/over.png" alt=""> <img
<img v-if="contentData.id == ele.id && ele.status == 0" style="width: 16px;height: 16px;" src="@/assets/images/nowNot.png" alt=""> v-if="
<img v-if="contentData.id == ele.id && (ele.status != 9&&ele.status != 0)" style="width: 16px;height: 16px;" src="@/assets/images/ban1.png" alt=""> contentData.id == ele.id &&
<img v-if="contentData.id != ele.id && ele.status == 9" style="width: 16px;height: 16px;" src="@/assets/images/notNew.png" alt=""> ele.status == 9
<img v-if="contentData.id != ele.id && ele.status == 0" style="width: 16px;height: 16px;" src="@/assets/images/not.png" alt=""> "
<img v-if="contentData.id != ele.id && (ele.status != 9&&ele.status != 0)" style="width: 16px;height: 16px;" src="@/assets/images/newBan.png" alt=""> style="width: 16px; height: 16px"
src="@/assets/images/over.png"
alt=""
/>
<img
v-if="
contentData.id == ele.id &&
ele.status == 0
"
style="width: 16px; height: 16px"
src="@/assets/images/nowNot.png"
alt=""
/>
<img
v-if="
contentData.id == ele.id &&
ele.status != 9 &&
ele.status != 0
"
style="width: 16px; height: 16px"
src="@/assets/images/ban1.png"
alt=""
/>
<img
v-if="
contentData.id != ele.id &&
ele.status == 9
"
style="width: 16px; height: 16px"
src="@/assets/images/notNew.png"
alt=""
/>
<img
v-if="
contentData.id != ele.id &&
ele.status == 0
"
style="width: 16px; height: 16px"
src="@/assets/images/not.png"
alt=""
/>
<img
v-if="
contentData.id != ele.id &&
ele.status != 9 &&
ele.status != 0
"
style="width: 16px; height: 16px"
src="@/assets/images/newBan.png"
alt=""
/>
</div> </div>
</div> </div>
</el-menu-item> </el-menu-item>
@@ -593,7 +714,11 @@
<div style="margin-left: 5px"> <div style="margin-left: 5px">
<span <span
v-if="contentData.id == list.id" v-if="contentData.id == list.id"
style="color: #387df7; font-size: 14px; margin-right: 4px" style="
color: #387df7;
font-size: 14px;
margin-right: 4px;
"
>学习中</span >学习中</span
> >
<img <img
@@ -695,7 +820,9 @@
srcset="" srcset=""
/> />
目标人群: 目标人群:
<div class="course-info-text">{{ courseInfo.forUsers }}</div> <div class="course-info-text">
{{ courseInfo.forUsers }}
</div>
</div> </div>
<div class="course-info-row"> <div class="course-info-row">
<img <img
@@ -765,14 +892,29 @@
title="点击进入他的主页" title="点击进入他的主页"
> >
<div v-if="item.authorInfo && item.authorInfo.avatar"> <div v-if="item.authorInfo && item.authorInfo.avatar">
<el-avatar :src="fileBaseUrl + item.authorInfo.avatar" shape="circle" :size="50"></el-avatar> <el-avatar
:src="fileBaseUrl + item.authorInfo.avatar"
shape="circle"
:size="50"
></el-avatar>
</div> </div>
<div v-else-if="item.photo"> <div v-else-if="item.photo">
<el-avatar :src="item.photo" shape="circle" :size="50"></el-avatar> <el-avatar
:src="item.photo"
shape="circle"
:size="50"
></el-avatar>
</div> </div>
<div v-else class="teacher-text"> <div v-else class="teacher-text">
<div v-if="item.authorInfo && item.authorInfo.sex === 1"><img src="../../../public/images/Avatarwoman.png" alt=""></div> <div v-if="item.authorInfo && item.authorInfo.sex === 1">
<div v-else><img src="../../../public/images/Avatarman.png" alt=""></div> <img
src="../../../public/images/Avatarwoman.png"
alt=""
/>
</div>
<div v-else>
<img src="../../../public/images/Avatarman.png" alt="" />
</div>
</div> </div>
</div> </div>
<div class="teacher-info"> <div class="teacher-info">
@@ -816,50 +958,51 @@
</el-dialog> </el-dialog>
<!-- <div><portal-footer></portal-footer></div> --> <!-- <div><portal-footer></portal-footer></div> -->
</div> </div>
</div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from "vuex";
import followButton from "@/components/Follow/button.vue"; import followButton from "@/components/Follow/button.vue";
import portalHeader from "@/components/PortalHeader.vue"; import portalHeader from "@/components/PortalHeader.vue";
import portalFooter from "@/components/PortalFooter.vue"; import portalFooter from "@/components/PortalFooter.vue";
import comments from "@/components/Portal/comments.vue"; import comments from "@/components/Portal/comments.vue";
import noteComments from "@/components/Portal/noteComment.vue"; import noteComments from "@/components/Portal/noteComment.vue";
import interactBar from "@/components/Portal/interactBar.vue"; import interactBar from "@/components/Portal/interactBar.vue";
import audioPlayer from '@/components/AudioPlayer/index.vue'; import audioPlayer from "@/components/AudioPlayer/index.vue";
import videoPlayer from '@/components/VideoPlayer/index.vue'; import videoPlayer from "@/components/VideoPlayer/index.vue";
import hyperLink from '@/components/Course/hyperLink.vue'; import hyperLink from "@/components/Course/hyperLink.vue";
import studyUtil from '@/utils/study.js'; import studyUtil from "@/utils/study.js";
import { encrypt } from '@/utils/jsencrypt.js'; import { encrypt } from "@/utils/jsencrypt.js";
import cookies from 'vue-cookies'; import cookies from "vue-cookies";
import apiStat from '@/api/phase2/stat.js'; import apiStat from "@/api/phase2/stat.js";
import apiStudy from '@/api/modules/courseStudy.js'; import apiStudy from "@/api/modules/courseStudy.js";
import apiVideoStudy from "@/api/modules/videoStudy.js"; import apiVideoStudy from "@/api/modules/videoStudy.js";
import apiCourseGrade from '@/api/modules/courseGrade.js'; import apiCourseGrade from "@/api/modules/courseGrade.js";
import apiPraises from '@/api/modules/praises.js'; import apiPraises from "@/api/modules/praises.js";
import apiTrample from '@/api/modules/trample.js'; import apiTrample from "@/api/modules/trample.js";
import apiCoursePortal from '@/api/modules/coursePortal.js'; import apiCoursePortal from "@/api/modules/coursePortal.js";
import apiUser from '@/api/system/user.js'; import apiUser from "@/api/system/user.js";
import apiCourseFile from '@/api/modules/courseFile.js'; import apiCourseFile from "@/api/modules/courseFile.js";
import { import {
resListMap, resListMap,
resOwnerListMap, resOwnerListMap,
courseType, courseType,
getType, getType,
toScore, toScore,
cutOrgNamePath, cutOrgNamePath,
userAvatarText userAvatarText,
} from '@/utils/tools.js'; } from "@/utils/tools.js";
import pdfPreview from '@/components/PdfPreview/index.vue'; import pdfPreview from "@/components/PdfPreview/index.vue";
import courseImage from '@/components/Course/courseImage.vue'; import courseImage from "@/components/Course/courseImage.vue";
import exam from '@/components/Course/exam'; import exam from "@/components/Course/exam";
import homework from '@/components/Course/homework'; import homework from "@/components/Course/homework";
import assess from '@/components/Course/assess'; import assess from "@/components/Course/assess";
import myNote from '../../components/Course/myNote.vue'; import myNote from "../../components/Course/myNote.vue";
import apiFollow from "@/api/phase2/userfollow.js"; import apiFollow from "@/api/phase2/userfollow.js";
import apiMessage from '@/api/system/message.js' import apiMessage from "@/api/system/message.js";
// import Vue from 'vue'; // import Vue from 'vue';
// Vue.forceUpdate(); // Vue.forceUpdate();
export default { export default {
name: "atticle", name: "atticle",
components: { components: {
courseImage, courseImage,
@@ -876,7 +1019,7 @@
myNote, myNote,
noteComments, noteComments,
portalFooter, portalFooter,
followButton followButton,
}, },
data() { data() {
return { return {
@@ -885,122 +1028,122 @@
tentative: false, tentative: false,
isContentTypeTwo: null, isContentTypeTwo: null,
isContentType: null, isContentType: null,
activeId: '', activeId: "",
isFalse: false, isFalse: false,
defaultOpeneds: [], defaultOpeneds: [],
sendEventProgress: 0, sendEventProgress: 0,
trueFalse: true, trueFalse: true,
audiences:'', audiences: "",
isCrowd:false, isCrowd: false,
cutOrgNamePath, cutOrgNamePath,
scormUrl:'',//当前播放的scormUrl scormUrl: "", //当前播放的scormUrl
loading:false, loading: false,
controlHeight:400,//左边控制区域的内容高度 controlHeight: 400, //左边控制区域的内容高度
timer: '', timer: "",
notePlay: null, notePlay: null,
intTimeNote: '', intTimeNote: "",
courestab: 2,//默认是课程评论 courestab: 2, //默认是课程评论
curCFile: { curCFile: {
converStatus: 4, converStatus: 4,
}, },
Internet: 3,//1是成功 2是是失败 3是检测中 Internet: 3, //1是成功 2是是失败 3是检测中
radio: '', radio: "",
interactRuning: false, interactRuning: false,
playerBoxShow: false, playerBoxShow: false,
userAvatarText, userAvatarText,
publicPath: process.env.VUE_APP_PUBLIC_PATH, publicPath: process.env.VUE_APP_PUBLIC_PATH,
showiframe: false, showiframe: false,
toScore, toScore,
courseId: '', //当前课程的id courseId: "", //当前课程的id
studyId: '', //当前学习的id studyId: "", //当前学习的id
initContentId: '', //初始化当前学习的内容节 initContentId: "", //初始化当前学习的内容节
blobUrl: '', //播放的文件地址新添加采用blob方式 blobUrl: "", //播放的文件地址新添加采用blob方式
contentData: { contentData: {
studyItemId: '', studyItemId: "",
status: 1 status: 1,
}, //当前的显示的内容 }, //当前的显示的内容
conLink: { conLink: {
openType: 1, openType: 1,
url: '' url: "",
}, //对于超连接的内容 }, //对于超连接的内容
curriculumData: { curriculumData: {
url: '', url: "",
isDrag: true, isDrag: true,
completeSetup: 0, completeSetup: 0,
setupTage: 0, setupTage: 0,
second: 0 second: 0,
}, // 课件内容 }, // 课件内容
courseInfo: { courseInfo: {
id: '', id: "",
name: '' name: "",
}, //课程信息 }, //课程信息
totalContent: 0, //课程内容数量 totalContent: 0, //课程内容数量
pageCount: 0, pageCount: 0,
currentPage: 0, currentPage: 0,
fileBaseUrl: this.$xpage.constants.fileBaseUrl,//使用动态的路径 不使用配置的路径了process.env.VUE_APP_FILE_BASE_URL, fileBaseUrl: this.$xpage.constants.fileBaseUrl, //使用动态的路径 不使用配置的路径了process.env.VUE_APP_FILE_BASE_URL,
contentList: [], contentList: [],
sectionList: [], sectionList: [],
teachers: [], teachers: [],
toUsers: [], //对于@教师的处理 toUsers: [], //对于@教师的处理
getType: getType, getType: getType,
ctabName: 'catalog', ctabName: "catalog",
resType: null, resType: null,
renderCourse: true, renderCourse: true,
activeNames: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], activeNames: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
scoreInfo: { scoreInfo: {
dlgShow: false, dlgShow: false,
score: 5, score: 5,
has: false has: false,
}, },
isPraise: false, isPraise: false,
isTrample: false, isTrample: false,
appendStartTime: null, //记录追加的开始时间 appendStartTime: null, //记录追加的开始时间
appendHandle: null, //追加学习时长的timeout句柄 appendHandle: null, //追加学习时长的timeout句柄
isAppendTime: false, //是否追加学习时长 isAppendTime: false, //是否追加学习时长
appentId: '', //当前追加的学习时长的id,此字段已经不再使用 appentId: "", //当前追加的学习时长的id,此字段已经不再使用
appentInterval: 15, //追加学习时间的间隔 5秒加一次 appentInterval: 15, //追加学习时间的间隔 5秒加一次
handleTimeout: null, handleTimeout: null,
completed: [], completed: [],
tab: 1, tab: 1,
notetab: 1, notetab: 1,
localTimeKey:'boeu-study-time' ,//本地存储的学习时长的key json格式 localTimeKey: "boeu-study-time", //本地存储的学习时长的key json格式
localTimeValue:0,//计算的时间 localTimeValue: 0, //计算的时间
appendStudyOtherHandle:null, appendStudyOtherHandle: null,
cumulativeDuration:0, //非音频累计时长 cumulativeDuration: 0, //非音频累计时长
maxDuration:0, //非音频最大时长 maxDuration: 0, //非音频最大时长
defaultMaxTime:1800, //非音频默认最大时间 defaultMaxTime: 1800, //非音频默认最大时间
warn:"测试内容", warn: "测试内容",
warnTitle:"测试标题", warnTitle: "测试标题",
isFinishingStudyItem: false, // 防止重复调用完成状态更新接口 isFinishingStudyItem: false, // 防止重复调用完成状态更新接口
} };
}, },
mounted() { mounted() {
this.getInternet(); this.getInternet();
// 增加的用户受众id // 增加的用户受众id
let localKey = "user_" + this.userInfo.sysId + "_gids"; let localKey = "user_" + this.userInfo.sysId + "_gids";
let hasIds = sessionStorage.getItem(localKey); let hasIds = sessionStorage.getItem(localKey);
this.audiences = hasIds ?? '' this.audiences = hasIds ?? "";
this.$watermark.set(this.userInfo.name + this.userInfo.loginName); this.$watermark.set(this.userInfo.name + this.userInfo.loginName);
this.courseId = this.$route.query.id; this.courseId = this.$route.query.id;
this.initContentId = this.$route.query.contentId; this.initContentId = this.$route.query.contentId;
this.stopStudyTime();//先关闭 this.stopStudyTime(); //先关闭
this.cleanAppendTime();// this.cleanAppendTime(); //
this.loadData(); this.loadData();
}, },
computed: { computed: {
...mapGetters(['userInfo']), ...mapGetters(["userInfo"]),
catalogTree(){ catalogTree() {
let treeList = []; let treeList = [];
this.completed = []; this.completed = [];
let $this = this; let $this = this;
$this.sectionList.forEach(sec => { $this.sectionList.forEach((sec) => {
let treeNode = { let treeNode = {
section: sec, section: sec,
children: [] children: [],
}; };
sec.status = 1; sec.status = 1;
let finishCount = 0; let finishCount = 0;
$this.contentList.forEach(c => { $this.contentList.forEach((c) => {
if (c.csectionId == sec.id) { if (c.csectionId == sec.id) {
if (c.status > 1) { if (c.status > 1) {
sec.status = 2; sec.status = 2;
@@ -1021,41 +1164,40 @@
}); });
// console.log(treeList,'treeList') // console.log(treeList,'treeList')
return treeList; return treeList;
} },
}, },
methods: { methods: {
handleCancelScore() { handleCancelScore() {
this.isShowScoreConfirm = false; this.isShowScoreConfirm = false;
this.scoreInfo.score = 5 this.scoreInfo.score = 5;
}, },
showConfirmScore() { showConfirmScore() {
this.isShowScoreConfirm = true; this.isShowScoreConfirm = true;
}, },
handleOpen(key,path){ handleOpen(key, path) {
if(this.isFalse){ if (this.isFalse) {
this.defaultOpeneds = [key] this.defaultOpeneds = [key];
} }
this.isFalse = false this.isFalse = false;
}, },
handleClose(key,path){ handleClose(key, path) {},
toUserHome(tea) {
this.$router.push({ path: this.$xpage.getHomePath(tea.teacherId) });
}, },
toUserHome(tea){ noteChange() {
this.$router.push({path:this.$xpage.getHomePath(tea.teacherId)})
},
noteChange(){
//视频点定位,直接到播放的视频位置 //视频点定位,直接到播放的视频位置
this.timer = new Date().getTime() this.timer = new Date().getTime();
}, },
//清空追加学习时长事件 //清空追加学习时长事件
cleanAppendTime(){ cleanAppendTime() {
if(this.appendStudyOtherHandle){ if (this.appendStudyOtherHandle) {
window.clearTimeout(this.appendStudyOtherHandle); window.clearTimeout(this.appendStudyOtherHandle);
} }
}, },
//非音视频课学习时长的增加,每一分钟保存一次 //非音视频课学习时长的增加,每一分钟保存一次
appendStudyOtherTime() { appendStudyOtherTime() {
//console.log('开始追加学习时长',this.isAppendTime); //console.log('开始追加学习时长',this.isAppendTime);
if (this.studyId == '') { if (this.studyId == "") {
return; return;
} }
if (!this.contentData.id) { if (!this.contentData.id) {
@@ -1063,41 +1205,42 @@
} }
//每一分钟保存一次 //每一分钟保存一次
// 取消阅读的每分钟六十秒的计时,最多是设置的时间或默认时间 // 取消阅读的每分钟六十秒的计时,最多是设置的时间或默认时间
let $this=this; let $this = this;
let startTime = new Date().getTime(); let startTime = new Date().getTime();
this.appendStudyOtherHandle = setTimeout(function() { this.appendStudyOtherHandle = setTimeout(function () {
let endTime = new Date().getTime(); let endTime = new Date().getTime();
let totalTime = Math.round((endTime - startTime) / 1000); let totalTime = Math.round((endTime - startTime) / 1000);
$this.cumulativeDuration += totalTime; $this.cumulativeDuration += totalTime;
if($this.cumulativeDuration <= $this.maxDuration){ if ($this.cumulativeDuration <= $this.maxDuration) {
//发送时长 //发送时长
$this.sendStudyOtherTime(totalTime); $this.sendStudyOtherTime(totalTime);
//递归调用 //递归调用
$this.appendStudyOtherTime(); $this.appendStudyOtherTime();
}else{ } else {
clearTimeout(this.appendStudyOtherHandle); clearTimeout(this.appendStudyOtherHandle);
$this.cumulativeDuration = 0; $this.cumulativeDuration = 0;
$this.maxDuration = 0; $this.maxDuration = 0;
} }
}, 1000*60); }, 1000 * 60);
}, },
sendStudyOtherTime(totalTime){ sendStudyOtherTime(totalTime) {
//静默处理 //静默处理
apiStat.sendEvent({ apiStat
"key": "StudyCourseOther",//课程学习的key .sendEvent({
"title": "非音视频课内容",//事件的标题 key: "StudyCourseOther", //课程学习的key
"parameters":"second:" + totalTime,//second:value 本次的学习时长 title: "非音视频课内容", //事件的标题
"content": "学习课程",//事件的内容 parameters: "second:" + totalTime, //second:value 本次的学习时长
"objId": this.courseInfo.id,//课程的id content: "学习课程", //事件的内容
"objType": "1",//类型 objId: this.courseInfo.id, //课程的id
"source":"page", objType: "1", //类型
"objInfo": ""+this.courseInfo.name, source: "page",
"aid":this.userInfo.aid, //当前登录人的id objInfo: "" + this.courseInfo.name,
"aname":this.userInfo.name,//当前人的姓名 aid: this.userInfo.aid, //当前登录人的id
"status": 1 //状态 aname: this.userInfo.name, //当前人的姓名
}).then(rs=>{ status: 1, //状态
if(rs.status != 200) { })
.then((rs) => {
if (rs.status != 200) {
console.log(rs.message); console.log(rs.message);
} }
}); });