Merge remote-tracking branch '104/master-0626' into 104-master-0626

# Conflicts:
#	unpackage/dist/build/h5/index.html
#	unpackage/dist/build/h5/static/js/index.d5f4f3da.js
#	unpackage/dist/build/h5/static/js/pages-exam-answer.129c642f.js
#	unpackage/dist/build/h5/static/js/pages-exam-exam.7101a1c5.js
#	unpackage/dist/build/h5/static/js/pages-lecturer-certification-info.4d0409d9.js
#	unpackage/dist/build/h5/static/js/pages-my-myFavorites.73e87f04.js
#	unpackage/dist/build/h5/static/js/pages-my-myShares.5a4b3182.js
#	unpackage/dist/build/h5/static/js/pages-my-setting.f3fd1a2c.js
#	unpackage/dist/build/h5/static/js/pages-my-toMeComments.fc4c37d2.js
#	unpackage/dist/build/h5/static/js/pages-plus-addArticle.f238a6a3.js
#	unpackage/dist/build/h5/static/js/pages-plus-addQuestion.11f24f27.js
#	unpackage/dist/build/h5/static/js/pages-plus-editArticle.0a2d966e.js
#	unpackage/dist/build/h5/static/js/pages-study-exam.200a0f1f.js
#	unpackage/dist/build/h5/static/js/pages-study-index.cfbcee0a.js
#	unpackage/dist/build/h5/static/js/pages-study-studydetail.34590491.js
This commit is contained in:
joshen
2025-08-25 19:00:50 +08:00
23 changed files with 230 additions and 110 deletions

View File

@@ -6,115 +6,122 @@
<u-toast ref="messager"></u-toast>
<!-- <page-title :showBack="true"></page-title> -->
<view class="playbox" v-if="isShowPdt"><!--内容播放区域-->
<view style="min-height: 440upx;" >
<view v-if="curContent.contentType==10" style="background-color: #000000;">
<!--视频-->
<view style="position: relative;">
<video-player
:url="blobUrl"
:blobId="blobId"
controls
:enable-play-gesture="true"
:inittime="curContent.lastStudyTime"
@play="onPlayerPlay"
@pause="onPlayerPause"
@ended="onPlayerEnded"
@timeupdate="onPlayerPlaying"
@fullscreenchange="onFullScreen"
:drag="curriculumData.isDrag"
style="width: 100%; object-fit: fill">
></video-player>
<view class="player-box" v-if="playerBoxShow">
<view class="player-praise">
<view @click="praiseContent" style="cursor: pointer;">
<image class="icon-small" v-if="isPraise" src="/static/images/icon/praise-active.png" />
<image class="icon-small" v-else src="/static/images/icon/praise1.png" />
<!-- {{ courseInfo.praises }} -->
<view style="color:#fff;cursor: pointer;"></view>
</view>
<view style="margin-left: 15px;cursor: pointer;" @click="treadContent">
<image class="icon-small" v-if="isTrample" src="/static/images/icon/trample-active.png" />
<image class="icon-small" v-else src="/static/images/icon/trample.png" />
<!-- {{ courseInfo.trampleCount }} -->
<view style="color:#fff;cursor: pointer;"></view>
</view>
</view>
<!--以下部分已经移到下面了-->
<!-- <view v-if="!scoreInfo.has" class="player-rate">
<u-rate v-model="scoreInfo.score" active-color="#f7ba2a" text-color="#ff9900" score-template="{value}" void-color="#fff" @change="addScore"></u-rate>
</view>
<view v-if="scoreInfo.has" style="padding-top: 5px;display: flex;">
<view class="player-rate" style="padding-left: 5px;">
<u-rate readonly :count="5" active-color="#f7ba2a" v-model="scoreInfo.score"></u-rate>
</view>
<view class="score-text" style="margin-top:20px">
<text style="color:#ffb30f;">{{ toScore(scoreInfo.score) }}</text>
<text style="font-size: 12px;color: #fff"></text>
</view>
</view> -->
</view>
</view>
</view>
<!---->
<view v-if="curContent.contentType==20">
<!--音频播放-->
<view style="text-align: center;padding-top: 40px;background-color: #FFFFFF;">
<audio-player
:src="blobUrl"
:name="curContent.contentName"
:drag="curriculumData.isDrag"
@onPlay="audioPlay"
@onPause="audioPause"
@onPlaying="audioPlaying"
@onEnded="audioEnd">
</audio-player>
</view>
</view>
<view v-if="curContent.contentType==30">
<image :src="fileBaseUrl+curContent.content" style="width: 100%;"></image>
</view>
<view v-if="curContent.contentType==40">
<!--pdf文档-->
<view style="min-height: 500px;padding-top: 200upx;position: relative;">
<pdf-preview v-if="curContent.content && curContent.content!=''" :src="curContent.content ? fileBaseUrl+curContent.content : ''"></pdf-preview>
</view>
</view>
<view v-if="curContent.contentType==41">
<view class="about-gongsi-info" :style="{height:articleMore? '500upx':'auto'}" style="padding: 15px;text-indent:40px;line-height: 28px;position: relative;">
<u-parse :content="curContent.content"></u-parse>
</view>
<view v-if="articleMore" @click="showMore" style="text-align: center;color: #387DF7;"><text>查看更多</text> </view>
</view>
<div v-if="curContent.contentType == 50" style="min-height: 500px;">
<!--因为web-view 动态切换地址不好用所以这里先使用iframe-->
<iframe id="iframe-scorm" v-if="scormUrl" :src="scormUrl" @load="iframeScormLoad()" frameborder="0" scrolling="no" border="0px" style="width:100%;min-height:500px;border:0px;"></iframe>
</div>
<view v-if="curContent.contentType==52">
<!--外连接-->
<view v-if="conLink.openType == 1">
<view v-if="conLink.url!=''" style="min-height: 400px;position: relative;">
<web-view :src="conLink.url"></web-view>
</view>
</view>
<view v-else>
<div style="text-align: center;padding: 20px;">{{ curContent.contentName }}</div>
<div style="text-align: center;padding: 20px;">{{ conLink.url }}</div>
</view>
</view>
<!--作业-->
<view v-if="curContent.contentType==60">
<course-homework :content="curContent" :studyId="studyId"></course-homework>
</view>
<!--考试-->
<view v-if="curContent.contentType==61">
<course-exam :courseType="courseInfo.type" :content="curContent" :studyId="studyId"></course-exam>
</view>
<!--评估-->
<view v-if="curContent.contentType==62">
<course-assess :content="curContent" :studyId="studyId"></course-assess>
</view>
</view>
</view>
<view v-if="renderCourse">
<view style="min-height: 440upx;" >
<view v-if="curContent.contentType==10" style="background-color: #000000;">
<!--视频-->
<view style="position: relative;">
<video-player
:url="blobUrl"
:blobId="blobId"
controls
:enable-play-gesture="true"
:inittime="curContent.lastStudyTime"
@play="onPlayerPlay"
@pause="onPlayerPause"
@ended="onPlayerEnded"
@timeupdate="onPlayerPlaying"
@fullscreenchange="onFullScreen"
:drag="curriculumData.isDrag"
style="width: 100%; object-fit: fill">
></video-player>
<view class="player-box" v-if="playerBoxShow">
<view class="player-praise">
<view @click="praiseContent" style="cursor: pointer;">
<image class="icon-small" v-if="isPraise" src="/static/images/icon/praise-active.png" />
<image class="icon-small" v-else src="/static/images/icon/praise1.png" />
<!-- {{ courseInfo.praises }} -->
<view style="color:#fff;cursor: pointer;"></view>
</view>
<view style="margin-left: 15px;cursor: pointer;" @click="treadContent">
<image class="icon-small" v-if="isTrample" src="/static/images/icon/trample-active.png" />
<image class="icon-small" v-else src="/static/images/icon/trample.png" />
<!-- {{ courseInfo.trampleCount }} -->
<view style="color:#fff;cursor: pointer;"></view>
</view>
</view>
<!--以下部分已经移到下面了-->
<!-- <view v-if="!scoreInfo.has" class="player-rate">
<u-rate v-model="scoreInfo.score" active-color="#f7ba2a" text-color="#ff9900" score-template="{value}" void-color="#fff" @change="addScore"></u-rate>
</view>
<view v-if="scoreInfo.has" style="padding-top: 5px;display: flex;">
<view class="player-rate" style="padding-left: 5px;">
<u-rate readonly :count="5" active-color="#f7ba2a" v-model="scoreInfo.score"></u-rate>
</view>
<view class="score-text" style="margin-top:20px">
<text style="color:#ffb30f;">{{ toScore(scoreInfo.score) }}</text>
<text style="font-size: 12px;color: #fff"></text>
</view>
</view> -->
</view>
</view>
</view>
<!---->
<view v-if="curContent.contentType==20">
<!--音频播放-->
<view style="text-align: center;padding-top: 40px;background-color: #FFFFFF;">
<audio-player
:src="blobUrl"
:name="curContent.contentName"
:drag="curriculumData.isDrag"
@onPlay="audioPlay"
@onPause="audioPause"
@onPlaying="audioPlaying"
@onEnded="audioEnd">
</audio-player>
</view>
</view>
<view v-if="curContent.contentType==30">
<image :src="fileBaseUrl+curContent.content" style="width: 100%;"></image>
</view>
<view v-if="curContent.contentType==40">
<!--pdf文档-->
<view style="min-height: 500px;padding-top: 200upx;position: relative;">
<pdf-preview v-if="curContent.content && curContent.content!=''" :src="curContent.content ? fileBaseUrl+curContent.content : ''"></pdf-preview>
</view>
</view>
<view v-if="curContent.contentType==41">
<view class="about-gongsi-info" :style="{height:articleMore? '500upx':'auto'}" style="padding: 15px;text-indent:40px;line-height: 28px;position: relative;">
<u-parse :content="curContent.content"></u-parse>
</view>
<view v-if="articleMore" @click="showMore" style="text-align: center;color: #387DF7;"><text>查看更多</text> </view>
</view>
<div v-if="curContent.contentType == 50" style="min-height: 500px;">
<!--因为web-view 动态切换地址不好用所以这里先使用iframe-->
<iframe id="iframe-scorm" v-if="scormUrl" :src="scormUrl" @load="iframeScormLoad()" frameborder="0" scrolling="no" border="0px" style="width:100%;min-height:500px;border:0px;"></iframe>
</div>
<view v-if="curContent.contentType==52">
<!--外连接-->
<view v-if="conLink.openType == 1">
<view v-if="conLink.url!=''" style="min-height: 400px;position: relative;">
<web-view :src="conLink.url"></web-view>
</view>
</view>
<view v-else>
<div style="text-align: center;padding: 20px;">{{ curContent.contentName }}</div>
<div style="text-align: center;padding: 20px;">{{ conLink.url }}</div>
</view>
</view>
<!--作业-->
<view v-if="curContent.contentType==60">
<course-homework :content="curContent" :studyId="studyId"></course-homework>
</view>
<!--考试-->
<view v-if="curContent.contentType==61">
<course-exam :courseType="courseInfo.type" :content="curContent" :studyId="studyId"></course-exam>
</view>
<!--评估-->
<view v-if="curContent.contentType==62">
<course-assess :content="curContent" :studyId="studyId"></course-assess>
</view>
</view>
</view>
<view v-if="!renderCourse && Internet ==2">
<div style="margin-top:40px">
<span style="font-size: large">十分抱歉您当前的网络环境不符合观看要求为了保障课程信息的安全您需要接入公司内网才能观看</span>
</div>
</view>
</view>
<view class="contentbox" v-if="courseInfo.name">
<view v-if="!catalogShow">
<view class="tabrow">
@@ -406,6 +413,20 @@
</u-popup>
<interact-share ref="comShare" :data="courseInfo":type="1"></interact-share>
</view>
<!-- <u-popup :show="protocolDialogVisible" mode="center" :closeable="false" :closeOnClickOverlay="false" :round="14" @close="closeDialog">-->
<!-- <view class="dlgscore">-->
<!-- <view class="dlgscore-top">-->
<!-- <view class="dlgscore-title">{{warnTitle}}</view>-->
<!-- <view class="dlgscore-desc">{{warn}}</view>-->
<!-- </view>-->
<!-- <view class="dlgscore-btns">-->
<!-- <view class="dlgscore-submit">-->
<!-- <text @click="addScore()">确认</text>-->
<!-- </view>-->
<!-- &lt;!&ndash; <u-button type="primary" @click="addScore()" text="提交评分"></u-button> &ndash;&gt;-->
<!-- </view>-->
<!-- </view>-->
<!-- </u-popup>-->
</template>
<script>
@@ -498,7 +519,12 @@
scormUrl:'',
maxDuration:0, //非音频最大时长
cumulativeDuration:0, //非音频累计时长
defaultMaxTime:1800 //非音频默认最大时间
defaultMaxTime:1800, //非音频默认最大时间
Internet: 3,//1是成功 2是是失败 3是检测中
protocolDialogVisible:false,
warn:"测试内容",
warnTitle:"测试提示",
renderCourse:true
}
},
computed: {
@@ -545,6 +571,7 @@
},
},
onLoad(options) {
this.getInternet();
//this.$watermark.set(this.userInfo.name+ this.userInfo.loginName);
this.scrollItemWidth=(this.$width-100)/2;//横向滚动的内容块宽度
this.treePopupWidth=(this.$width-100)+'px'; //右边出来的抽屉宽度控制
@@ -605,6 +632,42 @@
window.clearTimeout(this.handleTimeout);
}
},
getXmlHttpRequest() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
}
else if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
}
},
// 检测是否为内网
getInternet() {
this.Internet = 3;
let $this = this;
let xmlhttp = this.getXmlHttpRequest();
let timedOut = false;
let timer = setTimeout(function () {
timedOut = true;
xmlhttp.abort();
}, 1000);
xmlhttp.open("HEAD", window.location.protocol + "//uapi.boe.com.cn/500.html", true);
xmlhttp.send();
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
clearTimeout(timer);
$this.Internet = 1;
} else {
clearTimeout(timer);
// $this.protocolDialogVisible=true
$this.Internet = 2;
}
} else {
if (timedOut) return;//忽略中止请求
clearTimeout(timer);//取消等待的超时
}
}
},
iframeScormLoad(){
setTimeout(function(){
var scormIframe=document.getElementById('iframe-scorm');
@@ -637,6 +700,7 @@
let $this=this;
uni.showLoading({title:'加载中...'})
apiCourseStudy.studyIndex(this.courseId).then(rs=>{
console.log("是这个")
if(rs.status != 200) {
uni.hideLoading();
uni.showToast({title:rs.message,type:'fail'});
@@ -653,6 +717,14 @@
//$this.$refs.messager.show({message:'十分抱歉,此课程已停用,如需使用,请联系管理员。',type:'error'});
return;
}
if (!rs.result.isPermission || (rs.result.isPermission && this.Internet==1)){
// this.getInternet()
this.renderCourse = true
}else{
// this.Internet=1;
this.renderCourse = false
// this.protocolDialogVisible=true
}
$this.courseInfo=rs.result.course;
//$this.scoreInfo.score=rs.result.course.score;
//处理老师数据
@@ -1100,6 +1172,9 @@
closeScore(){
this.scoreInfo.dlgShow=false;
},
closeDialog(){
this.protocolDialogVisible=false;
},
addScore(){
if(this.scoreInfo.has){
this.$refs.messager.show({message:'您已评过分',type:'error'});