18 Commits

Author SHA1 Message Date
@fawn-nine
66e7d2c8e6 1 2024-10-18 09:24:45 +08:00
@fawn-nine
236771ec11 添加课程加载提示 2024-10-17 09:41:25 +08:00
@fawn-nine
011872da9c 合并后 2024-10-16 17:21:24 +08:00
@fawn-nine
c316123157 合并主分支前 2024-10-16 16:50:25 +08:00
@fawn-nine
3cb0b4c990 跳转登陆页bug 2024-10-16 15:16:51 +08:00
@fawn-nine
18e1cc0c83 更新 2024-10-16 13:07:04 +08:00
@fawn-nine
9e5fc93acf 播放器微调 2024-10-16 11:52:33 +08:00
@fawn-nine
2b43488ee9 提交 2024-10-16 11:10:03 +08:00
@fawn-nine
bc7656e5ed 提交 2024-10-15 16:50:47 +08:00
@fawn-nine
b085aafbf3 修复视频播放bug 2024-10-15 09:50:59 +08:00
@fawn-nine
42da449031 提交 2024-10-14 17:06:09 +08:00
@fawn-nine
827e5171e1 Merge branch 'master' into selfStudy 2024-10-14 09:38:32 +08:00
@fawn-nine
49611093c3 1 2024-10-14 09:37:50 +08:00
f8ca3fd8c3 班级作业-2增加提示 2024-10-14 09:37:13 +08:00
@fawn-nine
8e6d6d125f 66 2024-09-30 15:43:35 +08:00
@fawn-nine
c5fe4732df 修复 2024-09-30 10:01:38 +08:00
@fawn-nine
c1b4f2b02d 2024-09-29 18:00:33 +08:00
@fawn-nine
e36d3962aa 首页检测版本 2024-09-29 16:35:21 +08:00
25 changed files with 4592 additions and 2562 deletions

View File

@@ -26,7 +26,7 @@
onLaunch: function(e) { onLaunch: function(e) {
// 检测自动更新 // 检测自动更新
// #ifdef APP-PLUS // #ifdef APP-PLUS
updata(); // updata();
// #endif // #endif
uni.getSystemInfo({ uni.getSystemInfo({

View File

@@ -19,7 +19,8 @@ if (process.env.NODE_ENV === 'development') {
// baseUrl = "http://59.110.212.44:9100/pb/"; // baseUrl = "http://59.110.212.44:9100/pb/";
// baseUrl = "https://testapi.nuttyreading.com/"; // baseUrl = "https://testapi.nuttyreading.com/";
// baseUrl = "http://192.168.110.110:9200/pb/";//磊哥 // baseUrl = "http://192.168.110.110:9200/pb/";//磊哥
baseUrl = "https://api.nuttyreading.com/"; //1 // baseUrl = "https://api.nuttyreading.com/"; //1
baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑
// baseUrl = "ws://twin-ui.com:6001/"; // baseUrl = "ws://twin-ui.com:6001/";
// socketUrl = "ws://twin-ui.com:6001/"; // socketUrl = "ws://twin-ui.com:6001/";
} }

View File

@@ -40,7 +40,7 @@ let $http = new request({
'Content-Type': 'application/x-www-form-urlencoded', 'Content-Type': 'application/x-www-form-urlencoded',
// 'project_token': base.projectToken, //项目token可删除 // 'project_token': base.projectToken, //项目token可删除
}, },
// timeout:'360000' timeout:'15000' // 15秒
}); });
// 添加获取七牛云token的方法 // 添加获取七牛云token的方法

View File

@@ -12,8 +12,8 @@
"src" : "图片路径" "src" : "图片路径"
} }
], ],
"versionName" : "1.0.20", "versionName" : "1.0.28",
"versionCode" : 1020, "versionCode" : 1028,
"app-plus" : { "app-plus" : {
"nvueCompiler" : "weex", "nvueCompiler" : "weex",
"compatible" : { "compatible" : {

View File

@@ -741,6 +741,13 @@
{ {
"navigationBarTitleText" : "我的证书" "navigationBarTitleText" : "我的证书"
} }
},
{
"path" : "pages/selfStudy/selfStudy",
"style" :
{
"navigationBarTitleText" : "自考考试"
}
} }
], ],
"globalStyle": { "globalStyle": {

View File

@@ -10,13 +10,14 @@
<view class="item" v-for="(item,index) in certificateList" :key="index"> <view class="item" v-for="(item,index) in certificateList" :key="index">
<view class="flex_box flex_between align-items_box"> <view class="flex_box flex_between align-items_box">
<h3 style="font-size: 28rpx;">编号{{item.certificateNo}}</h3> <h3 style="font-size: 28rpx;">编号{{item.certificateNo}}</h3>
<text style="font-size: 26rpx; color: #999;">获得时间{{item.createTime.substring(0, 10)}}</text>
</view>
<view class="flex_box flex_center" v-if="item.certificateUrlList.length <= 0" >
<text class="small_btn border_radius_10" <text class="small_btn border_radius_10"
style="display: block;font-size: 28rpx; color: #55aaff; border:1px solid #55aaff" style="display: block;font-size: 28rpx; color: #55aaff; border:1px solid #55aaff"
v-if="item.certificateUrlList.length <= 0"
@click="showSubmit(item.id)">立即获取证书</text> @click="showSubmit(item.id)">立即获取证书</text>
</view> </view>
<view class="imgBox flex_box flex_between" v-if="item.certificateUrlList.length > 0"> <view class="imgBox flex_box flex_between" v-if="item.certificateUrlList.length > 0">
<view class="img" v-for="(item1,index1) in item.certificateUrlList" :key="index1"> <view class="img" v-for="(item1,index1) in item.certificateUrlList" :key="index1">
<image @click="preveImg(item1)" :src="item1" mode="heightFix"></image> <image @click="preveImg(item1)" :src="item1" mode="heightFix"></image>
@@ -243,7 +244,10 @@
$http.request({ $http.request({
url: "common/userCertificate/getUserCertificateList", url: "common/userCertificate/getUserCertificateList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档 method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {}, data: {
"type":"", //证书类型A a证 B b证 ZK自考
"courseId":"" //课程id
},
header: { //默认 无 说明:请求头 header: { //默认 无 说明:请求头
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },

View File

@@ -1,6 +1,6 @@
<template> <template>
<view class="container commonPageBox commonDetailPage" style="height: auto !important;padding-bottom: 0 !important;"> <view class="container commonPageBox commonDetailPage" style="height: auto !important;padding-bottom: 0 !important;">
<u-popup :show="show" mode="bottom" @close="close" class="popup_box"> <u-popup :show="show" v-if="show" mode="bottom" @close="close" class="popup_box">
<view class="popup_top"> <view class="popup_top">
<!-- @click="previewImage(selectGoodsData.productImages)" --> <!-- @click="previewImage(selectGoodsData.productImages)" -->
<view class="product_image"> <view class="product_image">

View File

@@ -334,13 +334,14 @@
}, },
}) })
.then(async (res) => { .then(async (res) => {
console.log('获取播放凭证666', res.video);
this.reaquestFlag = false this.reaquestFlag = false
if (this.$platform == 'ios') { if (this.$platform == 'ios') {
if (this.currentVideo.type == 1 && res.video.m3u8Url == null || this.currentVideo if (res.video.type == 1 && res.video.m3u8Url == null || res.video
.type == 1 && res.video.m3u8Url == '') { .type == 1 && res.video.m3u8Url == '') {
// 只存在私有加密 // 只存在私有加密
this.show = true this.show = true
this.UnlockChangeVideo() // 解锁按钮
uni.showModal({ uni.showModal({
content: '抱歉,苹果手机不支持此加密视频格式,您可以在安卓端观看本视频', content: '抱歉,苹果手机不支持此加密视频格式,您可以在安卓端观看本视频',
confirmText: '知道了', confirmText: '知道了',
@@ -578,7 +579,7 @@
}, },
// renderjs阿里云播放器引入与配置 // renderjs阿里云播放器引入与配置
getLive() { getLive() {
console.log('这是这只只是666666:', this.firstTime, this.videoData) console.log('阿里云播放器引入与配置:', this.firstTime, videoData)
$('#url-player-test').empty(); $('#url-player-test').empty();
@@ -714,18 +715,17 @@
} }
if (this.videoData.type == 1) { if (videoData.type == 1) {
if (this.videoData.m3u8Url == null || this.videoData.m3u8Url == '') { if (videoData.m3u8Url == null || videoData.m3u8Url == '') {
console.log('这是私有加密的视频'); console.log('这是私有加密的视频');
if (this.$platform == 'ios') { if (this.$platform == 'ios') {
this.$refs.videoContent5.click() this.$refs.videoContent5.click()
} else { } else {
playerOptions = { playerOptions = {
...playerOptions, ...playerOptions,
"vid": this.videoData "vid": videoData.videoId, // 必选参数,可以通过点播控制台(路径:媒资库>音/视频查询。示例1e067a2831b641db90d570b6480f****。
.videoId, // 必选参数,可以通过点播控制台(路径:媒资库>音/视频查询。示例1e067a2831b641db90d570b6480f****。
"playauth": this.videoData.playAuth, // 必选参数参数值可通过调用GetVideoPlayAuth接口获取。 "playauth": videoData.playAuth, // 必选参数参数值可通过调用GetVideoPlayAuth接口获取。
"encryptType": 1, // 必选参数当播放私有加密流时需要设置本参数值为1。其它情况无需设置。 "encryptType": 1, // 必选参数当播放私有加密流时需要设置本参数值为1。其它情况无需设置。
"playConfig": { "playConfig": {
"EncryptType": 'AliyunVoDEncryption' "EncryptType": 'AliyunVoDEncryption'
@@ -733,19 +733,19 @@
} }
console.log('这是私有加密的视频'); console.log('这是私有加密的视频');
} }
} else if (this.videoData.m3u8Url != null || this.videoData.m3u8Url != '') { } else if (videoData.m3u8Url != null || videoData.m3u8Url != '') {
playerOptions = { playerOptions = {
...playerOptions, ...playerOptions,
source: this.videoData.m3u8Url, source: videoData.m3u8Url,
// "playConfig": {"EncryptType": "HLSEncryption"} // "playConfig": {"EncryptType": "HLSEncryption"}
} }
console.log('这是标准加密的视频', this.videoData.id, this.videoData.m3u8Url); console.log('这是标准加密的视频', videoData.id, videoData.m3u8Url);
} }
} else { } else {
playerOptions = { playerOptions = {
...playerOptions, ...playerOptions,
source: this.videoData.videoUrl source: videoData.videoUrl
} }
console.log('这是没有加密的视频'); console.log('这是没有加密的视频');
} }
@@ -874,24 +874,7 @@
receiveMsg(newValue, oldValue, ownerVm, vm) { receiveMsg(newValue, oldValue, ownerVm, vm) {
//数据变化 //数据变化
videoData = newValue videoData = newValue
if (videoData) {
return
console.log('切换后的播放数据videoData', videoData.type);
if (videoData.type == 1) {
if (videoData.m3u8Url != '' && videoData.m3u8Url != null) {
// myplayer.source(videoData.m3u8Url)
myplayer.loadByUrl(videoData.m3u8Url)
console.log('切换走了吗m3u8');
} else {
myplayer.replayByVidAndPlayAuth(videoData.videoId, videoData.playAuth)
console.log('切换走了吗?私有加密');
}
} else {
myplayer.loadByUrl(videoData.videoUrl)
console.log('切换常规视频');
}
}
// console.log('可能是切换视频', videoData, );
}, },
receiveWinWidth(newValue, oldValue, ownerVm, vm) { receiveWinWidth(newValue, oldValue, ownerVm, vm) {
//数据变化 //数据变化
@@ -903,8 +886,8 @@
}, },
// 检测是否传入播放参数 // 检测是否传入播放参数
checkValue() { checkValue() {
console.log(this.videoId, this.authId, this.videoData, "1111888888") console.log(this.videoId, this.authId, videoData, "1111888888")
if ((!this.videoData.playAuth || !this.currentVideoList)) { if ((!videoData.playAuth || !this.currentVideoList)) {
setTimeout(() => { setTimeout(() => {
this.checkValue(); this.checkValue();
}, 1000); }, 1000);

View File

@@ -3,12 +3,7 @@
<!-- 公共组件-每个页面必须引入 --> <!-- 公共组件-每个页面必须引入 -->
<public-module></public-module> <public-module></public-module>
<!-- <z-nav-bar :title="pageTitle ? pageTitle : '课程详情'"> --> <!-- <z-nav-bar :title="pageTitle ? pageTitle : '课程详情'"> -->
<z-nav-bar title="课程介绍"> <z-nav-bar title="课程介绍"></z-nav-bar>
<!-- <view class="curseSet" slot="right" @click="newOnShare">
<uni-icons type="redo" size="26"></uni-icons><text style="font-size: 26rpx;"></text> 分享课程
</view> -->
</z-nav-bar>
<view class="contentBox commonPageContentBox"> <view class="contentBox commonPageContentBox">
<u-alert v-if="goBuyTitle && isAndorid" style=" <u-alert v-if="goBuyTitle && isAndorid" style="
background: linear-gradient(90deg, #258feb 0%, #00e1ec 100%); background: linear-gradient(90deg, #258feb 0%, #00e1ec 100%);
@@ -56,15 +51,13 @@
<view :class="`${isHideCourseInfo ? 'hidden2' : ''}`" <view :class="`${isHideCourseInfo ? 'hidden2' : ''}`"
style="font-size: 30rpx; text-align: justify;" v-html="course.content"> style="font-size: 30rpx; text-align: justify;" v-html="course.content">
</view> </view>
<text @click="isHideCourseInfo = !isHideCourseInfo" <text @click="isHideCourseInfo = !isHideCourseInfo" style="
style="
position: absolute; position: absolute;
background-color: #f2f8ff; padding: 4rpx ; background-color: #f2f8ff; padding: 4rpx ;
bottom: 0; bottom: 0;
right: 0; right: 0;
color: #838588; color: #838588;
" ">
>
{{ isHideCourseInfo ? "展开" : "收起" }} {{ isHideCourseInfo ? "展开" : "收起" }}
</text> </text>
</view> </view>
@@ -73,24 +66,118 @@
</view> </view>
</view> </view>
</view> </view>
<!-- {{selfStudyCertificate.length}}-{{classInfo.id}}-{{classInfo.state}}- -->
<!-- 自考入口 没有加入班级的时候暴漏入口-->
<view class="selfStudyBox"
v-if="course.canzk == '1' && librayList[curIndex] && (!classInfo.id || classInfo.state == '2' || selfStudyCertificate.length >= 0)">
<view style="padding: 20rpx;"
v-if="selfStudyCertificate.length > 0 || selfStudyPaperList.length > 0 || selfStudyCertificate.length == 0 && (!classInfo.id || classInfo.state == '2')">
<view class="">
<view class="" style="line-height: 40rpx; font-size: 28rpx;"
v-if="selfStudyCertificate.length == 0">
<text>课程学习进度大于等于70%您可以参与本门课程的自考考试考试成绩大于60分即可获得本门课程的自考证书如您想获得本门课程的A级或B级证书可参加小班教学</text>
</view>
<view :class="['testRecode',!zhedieTestRecode?'zhedie':'']"
v-if="selfStudyPaperList.length > 0 && !testingPaper.id">
<view class="item flex_box flex_between align-items_box"
v-for="(item, index) in selfStudyPaperList" :key="index">
<text style="color: #999; font-size: 26rpx;">{{index + 1}}次自考成绩</text>
<text class="score PM_font">{{item.score}}</text>
<view class="seePaper" @click.stop="seePaper(item.id)">
<!-- <image
src="../../static/icon/testPaperIcon.png"
mode="widthFix"
></image> -->
查看试卷
</view>
</view>
<view class="opbutn" v-if="selfStudyPaperList.length >= 3"
@click="zhedieTestRecode = !zhedieTestRecode">
{{zhedieTestRecode ? '收起' : '展开'}}
</view>
</view>
<view class="" v-if="selfStudyCertificate.length > 0"
style="font-size: 30rpx; text-align: center; margin: 20rpx 0;">
<view class="congritulations">
<image src="../../static/icon/xunzhang.png" mode="widthFix"></image>
</view>
<view class="">
<text>恭喜您已通过自考考试获得本门课程的自考证书,如您想获得本门课程的A级或B级证书可参加小班教学</text>
</view>
</view>
</view>
<view class=" " style="margin-top: 20rpx; text-align: center;">
<!-- <view class=""> -->
<!-- {{canJoinTestTime}} -->
<!-- {{selfStudyPaperList.length % 2}} -->
<template v-if="selfStudyCertificate.length <= 0 && (!classInfo.id || classInfo.state == '2')">
<template v-if="!testingPaper.id">
<button @click="onPageJump('/pages/selfStudy/selfStudy',courseId)"
style="padding: 0 20rpx" type="primary"
v-if="canJoinTestTime && selfStudyPaperList.length % 2 == 0"
:disabled="courseCompletion < 70 ">参加自考考试</button>
<button v-if="selfStudyPaperList.length % 2 != 0 && canJoinTestTime"
@click="onPageJump('/pages/selfStudy/selfStudy',courseId)" style="padding: 0 20rpx"
type="primary" :disabled="courseCompletion < 70">再考一次</button>
<button v-if="!canJoinTestTime && showNextTestDate"
@click="onPageJump('/pages/selfStudy/selfStudy',courseId)" style="padding: 0 20rpx"
type="primary" :disabled="!canJoinTestTime">{{showNextTestDate.nextZKTime}}
后可参与自考</button>
</template>
<button v-else @click="onPageJump('/pages/miniClass/continueTest',testingPaper.id)"
style="padding: 0 20rpx" type="primary" :disabled="courseCompletion < 70">
继续自考考试
<template v-if="showCountDown" style="font-size: 26rpx;"> (剩余时间
<uni-countdown style="display: inline-block; " @timeup="timeup" :font-size="20"
:show-day="false" :hour="timeDif.hour" :minute="timeDif.minutes"
:second="timeDif.second" color="#fff" splitorColor="#fff" />)
</template>
</button>
</template>
<button style="padding: 0 20rpx" v-if="selfStudyCertificate.length > 0" type="primary"
@click="onPageJump('/pages/certificate/certificate')">查看证书</button>
<!-- </view> -->
<!-- <view class="" v-if="!classInfo.id">
<button style="background-color: #00e1ec;" type="primary" size="mini">查看可加入的小班</button>
</view> -->
</view>
</view>
</view>
<!-- 小班入口 --> <!-- 小班入口 -->
<view class="classEntrance" style="text-align: center;" v-if="classCertificate.length > 0 ">
<view class="congritulations">
<image src="../../static/icon/xunzhang.png" mode="widthFix"></image>
</view>
<view style="margin: 10rpx 0;"><text>恭喜您在小班学习中取得了本课程的{{classCertificate[0].type}}级证书</text></view>
<button type="primary" style="background-color: #ffaa7f;"
@click="onPageJump('/pages/certificate/certificate')">前往查看</button>
</view>
<template v-else>
<view class="classEntrance" v-if="linkClassList.length > 0 "> <view class="classEntrance" v-if="linkClassList.length > 0 ">
<view class="flex_box" style="justify-content: space-between;"> <view class="flex_box" style="justify-content: space-between;">
<view class="flex_box classTitleBox"> <view class="flex_box classTitleBox">
<image src="../../static/icon/class.png" mode="" style="width: 64rpx; height: 64rpx;"></image> <image src="../../static/icon/class.png" mode="" style="width: 64rpx; height: 64rpx;">
</image>
<text class="mainTxt"> <text class="mainTxt">
<span style="font-weight: bold; padding: 0 16rpx;"></span> <span style="font-weight: bold; padding: 0 16rpx;"></span>
加入班级开始更加系统的学习</text> 加入班级开始更加系统的学习</text>
</view> </view>
<view class="btntext"> <view class="btntext">
<text @click="goClassLIst('/pages/miniClass/courseClassList', course.id,course.title)">前往查看 >></text> <text @click="goClassLIst('/pages/miniClass/courseClassList', course.id,course.title)">前往查看
>></text>
</view> </view>
</view> </view>
</view> </view>
<view class="classEntrance" v-if="classInfo.id"> <view class="classEntrance" v-if="classInfo.id">
<view class="flex_box" style="justify-content: space-between;"> <view class="flex_box" style="justify-content: space-between;">
<view class="flex_box classTitleBox"> <view class="flex_box classTitleBox">
<image src="../../static/icon/class.png" mode="" style="width: 64rpx; height: 64rpx;"></image> <image src="../../static/icon/class.png" mode="" style="width: 64rpx; height: 64rpx;">
</image>
<text class="mainTxt"> <text class="mainTxt">
<span style="font-weight: bold; padding: 0 16rpx;"></span> <span style="font-weight: bold; padding: 0 16rpx;"></span>
班级{{classInfo.title}}</text> 班级{{classInfo.title}}</text>
@@ -100,6 +187,18 @@
</view> </view>
</view> </view>
</view> </view>
<view class="classEntrance" v-if="linkClassList.length == 0 && !classInfo.id">
<view class="flex_box" style="justify-content: space-between;">
<view class="flex_box classTitleBox">
<image src="../../static/icon/class.png" mode="" style="width: 64rpx; height: 64rpx;">
</image>
<text class="mainTxt">
<span style="font-weight: bold; padding: 0 16rpx;"></span>
暂无可加入的小班</text>
</view>
</view>
</view>
</template>
<view class="containerBg2"> <view class="containerBg2">
<!-- 目录 --> <!-- 目录 -->
<view :class="['coursePart','flexbox', (userMsg.vip == 1 || userMsg.vip == 2) ? 'vipBgColor':'']" <view :class="['coursePart','flexbox', (userMsg.vip == 1 || userMsg.vip == 2) ? 'vipBgColor':'']"
@@ -153,7 +252,8 @@
</template> </template>
<view class="shiting_content"> <view class="shiting_content">
<view :class="['chapter_content', (userMsg.vip == 1 || userMsg.vip == 2) ? 'vipchapter_content' : '']" <view
:class="['chapter_content', (userMsg.vip == 1 || userMsg.vip == 2) ? 'vipchapter_content' : '']"
v-if="chapterList.length > 0"> v-if="chapterList.length > 0">
<view class="vipSee" v-if="userMsg && (userMsg.vip == 1 || userMsg.vip == 2)"> <view class="vipSee" v-if="userMsg && (userMsg.vip == 1 || userMsg.vip == 2)">
<text>VIP畅学权益生效中</text> <text>VIP畅学权益生效中</text>
@@ -198,8 +298,9 @@
</view> </view>
<!-- <uni-section class="mb-10" style="padding: 0 20rpx" title="" type="line" <!-- <uni-section class="mb-10" style="padding: 0 20rpx" title="" type="line"
v-if="librayList.length > 0 && librayList[curIndex].completion > 0"> --> v-if="librayList.length > 0 && librayList[curIndex].completion > 0"> -->
<!-- {{librayList[curIndex]}} -->
<view class="progress-box"> <view class="progress-box">
<progress :percent="librayList[curIndex].completion" show-info stroke-width="3" /> <progress v-if="course.id" :percent="courseCompletion" show-info stroke-width="3" />
</view> </view>
<!-- </uni-section> --> <!-- </uni-section> -->
</view> </view>
@@ -255,8 +356,8 @@
</view> </view>
</view> </view>
<u-popup key="1" :show="pricespop" :round="10" @close="closePup"> <!-- <u-popup key="1" v-if="pricespop" :show="true" :round="10" @close="closePup">
<view class="proListPrice" v-if="proPriceList.length > 0"> <view class="proListPrice" v-if="proPriceList.length > 0" style="background-color: #fff;">
<view class="title"> 请选择 </view> <view class="title"> 请选择 </view>
<view class="list"> <view class="list">
<view :class="['item', curProId == item.productId ? 'active' : '']" <view :class="['item', curProId == item.productId ? 'active' : '']"
@@ -275,7 +376,7 @@
</view> </view>
</view> </view>
</view> </view>
</u-popup> </u-popup> -->
<view> <view>
<u-back-top :scroll-top="scrollTop" bottom="150" :customStyle="bgiStyle" <u-back-top :scroll-top="scrollTop" bottom="150" :customStyle="bgiStyle"
:iconStyle="iconStyle"></u-back-top> :iconStyle="iconStyle"></u-back-top>
@@ -354,7 +455,8 @@
</view> </view>
<view class="sbmitBox"> <view class="sbmitBox">
<button class="submit" @click="submitSay" type="default"> </button> <button class="submit" @click="submitSay" type="default"> </button>
<button style="background-color: #fff !important; color: ; " @click="sayclose" type="default"> </button> <button style="background-color: #fff !important; color: ; " @click="sayclose" type="default">
</button>
</view> </view>
</view> </view>
</u-popup> </u-popup>
@@ -367,7 +469,7 @@
$refs.commonSelectGoods.close(); $refs.commonSelectGoods.close();
protocolShow = true; protocolShow = true;
"></common-select-goods> "></common-select-goods>
<u-popup :show="protocolShow" mode="center" round="6"> <u-popup :show="protocolShow" mode="center" round="6" v-if="protocolShow">
<view class="popup_box"> <view class="popup_box">
<view class="title">温馨提示</view> <view class="title">温馨提示</view>
<view class="content"> <view class="content">
@@ -417,6 +519,7 @@
export default { export default {
data() { data() {
return { return {
zhedieTestRecode: false, // 是否折叠自考的记录
goodsList: [], goodsList: [],
currentCateIndex: 0, currentCateIndex: 0,
protocolShow: false, protocolShow: false,
@@ -524,7 +627,17 @@
isAndorid: true, isAndorid: true,
oprateOsName: '', oprateOsName: '',
linkClassList: [], // 可加入关联班级数组 linkClassList: [], // 可加入关联班级数组
classInfo:[] // 所在班级信息 classInfo: [], // 所在班级信息
selfStudyCertificate: [], // 自考证书
classCertificate: [], // 小班学习证书
testingPaper: {}, // 当前课程正在考试信息
timeDif: {},
showCountDown: false,
showSecondTestBtn: false, // 先否显示二次考试按钮
selfStudyPaperList: [], ///自考考试记录
showNextTestDate: undefined,
canJoinTestTime: false, //时间上是否可以参加自考考试
courseCompletion: undefined, // 课程学习进度
}; };
}, },
//第一次加载 //第一次加载
@@ -540,8 +653,6 @@
// await this.getData(e.id); // await this.getData(e.id);
this.getSayList(); this.getSayList();
this.getOS() this.getOS()
}, },
onPageScroll(e) { onPageScroll(e) {
this.scrollTop = e.scrollTop; this.scrollTop = e.scrollTop;
@@ -559,12 +670,14 @@
// 隐藏原生的tabbar // 隐藏原生的tabbar
uni.hideTabBar(); uni.hideTabBar();
console.log('this.courseId', this.courseId); console.log('this.courseId', this.courseId);
this.canJoinTestTime = false
await this.getData(this.courseId); await this.getData(this.courseId);
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.screen.unlockOrientation(); plus.screen.unlockOrientation();
plus.screen.lockOrientation("portrait-primary"); plus.screen.lockOrientation("portrait-primary");
// #endif // #endif
this.getLinkClassList() await this.request()
}, },
onUnload() { onUnload() {
this.selectGoodsData = {}; this.selectGoodsData = {};
@@ -581,7 +694,9 @@
// this.showSearchList = false // this.showSearchList = false
// this.searchList = [] // this.searchList = []
}, },
onPullDownRefresh() { async onPullDownRefresh() {
await this.getData(this.courseId);
await this.request()
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}, },
onReachBottom() { onReachBottom() {
@@ -597,6 +712,227 @@
}, },
//方法 //方法
methods: { methods: {
async request(){
var newCertificate = await this.getCertificateInfo()
console.log('5555555证书资料', newCertificate);
this.selfStudyCertificate = []
this.classCertificate = []
if (newCertificate && newCertificate.length > 0) {
newCertificate.forEach(item => {
if (item.classId != '' && item.classId > 0) {
this.classCertificate.push(item)
} else {
this.selfStudyCertificate.push(item)
}
})
}
if(this.classCertificate.length <= 0){ // 已经在班级内获得证书就不再检查班级的情况了
this.getLinkClassList()
}
var historyPaper = await this.getingPaper()
console.log('historyPaper正在考试的信息', historyPaper);
if (historyPaper && historyPaper.id && historyPaper.type == '2' && historyPaper.relationId == this
.courseId) {
// this.testingPaper = historyPaper
this.testingPaper = historyPaper
var paperEndTime = historyPaper.planEndTime
var severNowTime = await this.getServerTime()
if (severNowTime > -1 && paperEndTime - severNowTime > 0) {
var secondTimeDif = paperEndTime - severNowTime
this.timeDif.hour = parseInt((secondTimeDif % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
this.timeDif.minutes = parseInt((secondTimeDif % (1000 * 60 * 60)) / (1000 * 60));
this.timeDif.second = (secondTimeDif % (1000 * 60)) / 1000
this.showCountDown = true
console.log('时间符合吗?', this.showCountDown, secondTimeDif);
} else {
this.showCountDown = false
}
}else{
this.testingPaper = {}
this.showCountDown = false
}
if(this.course.canzk == '0'){ // 如果没有开启自考,就不走自考相关的逻辑
console.log('没有打开自考开关');
return
}
var selfStudyPaperList = await this.getSelfStudyPaperList()
this.selfStudyPaperList = selfStudyPaperList
console.log('selfStudyPaperList', selfStudyPaperList);
if (this.selfStudyCertificate.length <= 0) { // 没有获得自考证书时查询下次可以自考的时间
if (selfStudyPaperList && selfStudyPaperList.length <= 2) {
this.canJoinTestTime = true
}
if (selfStudyPaperList && selfStudyPaperList.length >= 2) {
if(selfStudyPaperList.length % 2 != 0){
this.canJoinTestTime = true
return
}
this.showNextTestDate = await this.getNextTestDate()
console.log('下次考试时间', this.showNextTestDate);
if (this.showNextTestDate.nextLongTime == null || this.showNextTestDate.nextLongTime == null) {
this.canJoinTestTime = false
}
var now = new Date()
if (this.showNextTestDate.nextLongTime < now) {
this.canJoinTestTime = true
} else {
this.canJoinTestTime = false
}
}
if (selfStudyPaperList && selfStudyPaperList.length > 0) {
selfStudyPaperList.forEach((item, index) => {
if (item.score < 60 && index % 2 != 0) {
this.showSecondTestBtn = true
} else {
this.showSecondTestBtn = false
}
})
}
}
},
// 查询下次可以考试的时间
async getNextTestDate() {
var time = {
nextLongTime: 0,
nextZKTime: ''
}
await $http.request({
url: "common/classExam/getNextZKTime",
method: "POST",
data: {
"courseId": parseInt(this.courseId)
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(async (res) => {
if (res.code != 0) {
uni.showToast({
title: res.errMsg,
icon: 'none'
})
return
}
if (res.code == 0) {
console.log('res', res);
time.nextZKTime = res.nextZKTime
time.nextLongTime = res.nextLongTime
}
}).catch(e => {
uni.showToast({
title: e.errMsg,
icon: 'none'
})
});
return time
},
seePaper(val) {
// console.log('点击了');
uni.navigateTo({
url: `/pages/miniClass/paperBack?id=${val}`,
});
},
async timeup() {
this.showCountDown = false
setTimeout(async () => {
var selfStudyPaperList = await this.getSelfStudyPaperList()
this.selfStudyPaperList = selfStudyPaperList
console.log('selfStudyPaperList', selfStudyPaperList);
if (selfStudyPaperList && selfStudyPaperList.length > 0) {
selfStudyPaperList.forEach((item, index) => {
if (item.score < 60 && index < 2) {
this.showSecondTestBtn = true
} else {
this.showSecondTestBtn = false
}
})
}
}, 3000)
},
// 获取自考试卷列表
async getSelfStudyPaperList() {
var list = undefined
await $http.request({
url: "common/classExam/getZKExamPaperList",
method: "POST",
data: {
"courseId": parseInt(this.courseId)
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(async (res) => {
if (res.code != 0) {
uni.showToast({
title: res.errMsg,
icon: 'none'
})
return
}
if (res.code == 0) {
console.log('res', res);
list = res.ZKExamUserList
}
}).catch(e => {
uni.showToast({
title: e.errMsg,
icon: 'none'
})
});
return list
},
// 获取服务器时间
async getServerTime() {
var time = 0
await $http.request({
url: "common/classExam/getServerTime",
method: "POST",
data: {},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(async (res) => {
if (res.code == 0) {
time = res.serverTime
} else {
time = -1
}
}).catch(e => {
time = -1
});
return time
},
// 获取进行中的考试
async getingPaper() {
var obj = undefined
await $http.request({
url: "common/classExam/examingPaper",
method: "POST",
data: {},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(async (res) => {
console.log('考试中', res);
if (res.code == 0 && res.classExamUser != null) {
obj = {
...res.classExamUser,
planEndTime: res.planEndTime
}
} else {
obj = undefined
}
}).catch(e => {
obj = undefined
});
return obj
},
// 获得课程关联的班级 // 获得课程关联的班级
getLinkClassList() { getLinkClassList() {
this.$http this.$http
@@ -616,6 +952,7 @@
.then(async (res) => { .then(async (res) => {
if (res.code == 0 && res.result.length > 0) { if (res.code == 0 && res.result.length > 0) {
this.linkClassList = res.result this.linkClassList = res.result
this.classInfo = {}
} else { } else {
this.linkClassList = [] this.linkClassList = []
// 查询是否有所在的班级 // 查询是否有所在的班级
@@ -1256,7 +1593,9 @@
this.courseList = []; this.courseList = [];
// console.log("at line 1167:", "调用了几次"); // console.log("at line 1167:", "调用了几次");
var that = this; var that = this;
uni.showLoading({
title:'获取课程信息'
})
await $http await $http
.request({ .request({
url: "sociology/course/getCourseDetail", url: "sociology/course/getCourseDetail",
@@ -1270,6 +1609,14 @@
}, },
}) })
.then(async (res) => { .then(async (res) => {
uni.hideLoading()
if(res.code != 0) {
uni.showToast({
title:res.errMsg,
icon:'none'
})
return
}
if (res.code == 0) { if (res.code == 0) {
this.course = res.data.course; this.course = res.data.course;
//0 购买 1 续费 2 升级 //0 购买 1 续费 2 升级
@@ -1306,6 +1653,22 @@
this.pageTitle = this.course.title; this.pageTitle = this.course.title;
this.librayList = [...res.data.catalogues]; this.librayList = [...res.data.catalogues];
console.log('获取课程详情=》', res.data); console.log('获取课程详情=》', res.data);
if (this.librayList.length > 0) {
var ll = this.librayList.map(item => item.completion)
var sums = 0
ll.forEach(item => {
sums += item
})
if (sums > 0) {
this.courseCompletion = (sums / ll.length).toFixed(2)
} else {
this.courseCompletion = 0
}
} else {
this.courseCompletion = 0
}
console.log('lllllll', this.courseCompletion);
that.$forceUpdate(); that.$forceUpdate();
if (this.librayList.length > 0) { if (this.librayList.length > 0) {
if (this.catalogueId) { if (this.catalogueId) {
@@ -1338,7 +1701,8 @@
} }
}) })
.catch((e) => { .catch((e) => {
console.log(e, "获取目录数据报错"); uni.hideLoading()
console.log(e, "获取课程数据报错666");
}); });
}, },
goBuy() { goBuy() {
@@ -1447,7 +1811,6 @@
}) })
.then(async (res) => { .then(async (res) => {
if (res.code == 0 && res.chapterList.length > 0) { if (res.code == 0 && res.chapterList.length > 0) {
list = res.chapterList; list = res.chapterList;
// console.log("方法里面得到的章节列表:", list); // console.log("方法里面得到的章节列表:", list);
} else { } else {
@@ -1464,6 +1827,49 @@
url: `${url}?id=${id}`, url: `${url}?id=${id}`,
}); });
}, },
// 查询证书情况
async getCertificateInfo() {
var list = undefined
await $http.request({
url: "common/userCertificate/getUserCertificateList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"type": '', //证书类型A a证 B b证 ZK自考
"courseId": this.courseId //课程id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code != 0) {
uni.showToast({
title: res.errMsg,
icon: 'none'
})
return
}
if (res.code == 0) {
res.certificateList.forEach(item => {
item.certificateUrl && item.certificateUrl != '' ? item
.certificateUrlList = item.certificateUrl.split(',') : item
.certificateUrlList = []
})
list = res.certificateList
}
console.log('证书接口请求结果', res);
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: e.errMsg,
icon: 'none'
})
});
return list
},
goClassLIst(url, id, title) { goClassLIst(url, id, title) {
uni.navigateTo({ uni.navigateTo({
url: `${url}?courseId=${id}&courseTitle=${title}`, url: `${url}?courseId=${id}&courseTitle=${title}`,
@@ -1474,26 +1880,65 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/style/mixin.scss"; @import "@/style/mixin.scss";
.classEntrance{background-color: #d0ecc1; padding:20rpx; .congritulations {
width: 80rpx;
height: 80rpx;
text-align: center;
margin: 10rpx auto;
display: block;
image {
width: 80rpx;
height: 80rpx;
}
}
.selfStudyBox {
position: relative;
background-color: #fff0e7;
}
.classEntrance {
background-color: #d0ecc1;
padding: 20rpx;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
.flex_box{align-items: center;}
.flex_box {
align-items: center;
} }
.btntext{color: $themeColor; }
.classTitleBox{font-size: 28rpx; flex: 1;
.mainTxt{font-size: 30rpx; flex: 1; padding-left: 10rpx;}
} }
.completionBg { padding: 10rpx 0;
background-color: #fff; border-bottom: 1px solid #eee; .btntext {
color: $themeColor;
} }
.classTitleBox {
font-size: 28rpx;
flex: 1;
.mainTxt {
font-size: 30rpx;
flex: 1;
padding-left: 10rpx;
}
}
.completionBg {
padding: 10rpx 0;
background-color: #fff;
border-bottom: 1px solid #eee;
}
.endBox { .endBox {
// @include theme("vipbtnbg"); // @include theme("vipbtnbg");
color: #333; color: #333;
font-size: 26rpx; font-size: 26rpx;
// margin: 20rpx 0; // margin: 20rpx 0;
padding: 10rpx 20rpx; padding: 10rpx 20rpx;
.box { .box {
// background-color: #258feb; // background-color: #258feb;
} }
.flexbox { .flexbox {
justify-content: space-between; justify-content: space-between;
} }
@@ -1549,9 +1994,15 @@
// height: 100rpx !important;} // height: 100rpx !important;}
} }
.img{ width: 60rpx; .img {
width: 60rpx;
height: 60rpx; height: 60rpx;
image{width:60rpx; height: 60rpx; border-radius: 100%;}
image {
width: 60rpx;
height: 60rpx;
border-radius: 100%;
}
} }
} }
@@ -1592,7 +2043,9 @@
} }
.xufeiBtn { .xufeiBtn {
display: block; line-height: 50rpx; height: 50rpx; display: block;
line-height: 50rpx;
height: 50rpx;
padding: 0 10rpx; padding: 0 10rpx;
border: 1px solid #333; border: 1px solid #333;
border-radius: 10rpx; border-radius: 10rpx;
@@ -2182,7 +2635,12 @@
// margin-bottom: 10rpx; // margin-bottom: 10rpx;
} }
::v-deep .prof img{ width: 100px; height: 100px;}
::v-deep .prof img {
width: 100px;
height: 100px;
}
.catalogueTitle { .catalogueTitle {
justify-content: space-between; justify-content: space-between;
overflow: hidden; overflow: hidden;
@@ -2307,7 +2765,11 @@
/deep/.u-icon__icon--warning { /deep/.u-icon__icon--warning {
color: #fff !important; color: #fff !important;
} }
/deep/.uni-tag{border-width: 2rpx !important;}
/deep/.uni-tag {
border-width: 2rpx !important;
}
/deep/.uni-section { /deep/.uni-section {
background: transparent !important; background: transparent !important;
} }
@@ -2462,7 +2924,12 @@
} }
} }
} }
.hidden2{line-height: 50rpx; height: 100rpx;}
.hidden2 {
line-height: 50rpx;
height: 100rpx;
}
.subLine { .subLine {
* { * {
display: inline !important; display: inline !important;
@@ -2609,4 +3076,57 @@
padding: 20rpx; padding: 20rpx;
} }
} }
.testRecode {
position: relative;
margin-top: 20rpx;
background-color: rgba(255, 255, 255, .8);
padding: 20rpx;
// padding-bottom: 30rpx;
.item {
margin-bottom: 20rpx;
border-bottom: 1px solid #e1e1e1;
line-height: 60rpx;
}
.item:last-child {
border-bottom: none;
margin-bottom: 0;
}
.score {
color: #35a6ff;
font-size: 46rpx;
}
}
.opbutn {
position: absolute;
padding-bottom: 0;
width: 100rpx;
text-align: center;
font-size: 26rpx; border-radius: 10rpx 10rpx 0 0;
color: #fff; background-color: #aaaaff;
bottom: 0;
left: calc(50vw - 50rpx);
z-index: 1;
}
.testRecode.zhedie {
max-height: 280rpx;
// padding-bottom: 30rpx;
overflow: hidden;
}
.seePaper {
color: #35a6ff;
font-size: 32rpx;
// width: 50rpx;
// height: 50rpx;
// image {
// width: 100%;
// height: 100%;
// }
}
</style> </style>

View File

@@ -21,7 +21,7 @@
<uni-collapse-item v-for="(item,index) in courseList" :key="index" :title="item.courseMedicine.title" <uni-collapse-item v-for="(item,index) in courseList" :key="index" :title="item.courseMedicine.title"
:thumb="item.courseMedicine.icon"> :thumb="item.courseMedicine.icon">
<view class="content" v-show="item.courseList.length > 1" style="padding:20rpx;"> <view class="content" v-show="item.courseList.length > 1" style="padding:20rpx;">
<view :class="['courseItemleve1',userMsg.vip != 0 ? 'isVip' :'']" <view :class="['courseItemleve1',(userMsg.vip != 0 && userMsg.vip != 3) ? 'isVip' :'']"
v-for="(item1, index1) in item.courseList" :key="index1" v-for="(item1, index1) in item.courseList" :key="index1"
@click="onPageJump('/pages/course/courseDetail',item1.id)"> @click="onPageJump('/pages/course/courseDetail',item1.id)">
<view class="vipSee" v-if="userMsg.vip != 0 && userMsg.vip != 3"> <view class="vipSee" v-if="userMsg.vip != 0 && userMsg.vip != 3">
@@ -31,8 +31,9 @@
size="24"></u-icon><text style="font-size: 32rpx;">{{item1.title}}</text> size="24"></u-icon><text style="font-size: 32rpx;">{{item1.title}}</text>
</view> </view>
<template v-if="item1.courseCatalogueEntityList && item1.courseCatalogueEntityList.length > 0"> <template v-if="item1.courseCatalogueEntityList && item1.courseCatalogueEntityList.length > 0">
<view class="" v-for="(item2, index2) in item1.courseCatalogueEntityList" :key="index2"> <view class="" v-for="(item2, index2) in item1.courseCatalogueEntityList" :key="index2">
<view :class="['priceItem', item2.isBuy == 1 && userMsg.vip == 0 ? 'isBuy' : '']"> <view :class="['priceItem', item2.isBuy == 1 && (userMsg.vip == 0 || userMsg.vip == 3) ? 'isBuy' : '']">
<text class="text mname" v-if="item1.courseCatalogueEntityList.length > 1" <text class="text mname" v-if="item1.courseCatalogueEntityList.length > 1"
style="font-weight: bold; margin-right: 10rpx;">{{item2.title}}</text> style="font-weight: bold; margin-right: 10rpx;">{{item2.title}}</text>
<view class="pbox flexbox"> <view class="pbox flexbox">
@@ -40,11 +41,13 @@
height: 40rpx; text-align: center; line-height: 40rpx; color: #ffb861;">V</text> height: 40rpx; text-align: center; line-height: 40rpx; color: #ffb861;">V</text>
<text class="text">半年{{item2.halfFee}} </text><text class="text" <text class="text">半年{{item2.halfFee}} </text><text class="text"
style="margin-left: 20rpx;">整年{{item2.fee}} </text> style="margin-left: 20rpx;">整年{{item2.fee}} </text>
<!-- <pre>
{{userMsg}}-{{item2.isBuy}}
</pre> -->
<text class="buybtns" @click.stop="goBuy(item2)" <text class="buybtns" @click.stop="goBuy(item2)"
v-if="item2.isBuy == 0 && userMsg.vip == 0">立即购买</text> v-if="item2.isBuy == 0 && (userMsg.vip == 0 || userMsg.vip == 3)">立即购买</text>
</view> </view>
<i class="haveBuy" v-if="item2.isBuy == 1 && userMsg.vip == 0">已购买</i> <i class="haveBuy" v-if="item2.isBuy == 1 && (userMsg.vip == 0 || userMsg.vip == 3)">已购买</i>
</view> </view>
</view> </view>
</template> </template>

View File

@@ -301,7 +301,7 @@
<view v-if="taskList.length > 0 "> <view v-if="taskList.length > 0 ">
<view class="submitRecode"> <view class="submitRecode">
<view class="newBox"> <view class="newBox">
<view class="item " v-for="(item, index) in taskList" @click="clickTask(item)"> <view class="item " v-for="(item, index) in taskList" @click="clickTask(item,index)">
<view class="leve1 flex_box flex_between"> <view class="leve1 flex_box flex_between">
<text style="flex: 1;">{{item.title}}</text> <text style="flex: 1;">{{item.title}}</text>
<view class="btn1" @click.stop="changeZheDie(item, index)"> <view class="btn1" @click.stop="changeZheDie(item, index)">
@@ -343,7 +343,8 @@
</template> </template>
<template <template
v-if="!item.reply && thisClass.state == '1'"> v-if="!item.reply && thisClass.state == '1'">
<text class="no">未提交答案 点击开始答题</text> <text class="no" v-if="index+1<=currentStudyNumber">未提交答案 点击开始答题</text>
<text class="no" v-else style="color: #a0a1a7;">暂未开始学习</text>
</template> </template>
<template <template
v-if="!item.reply && (thisClass.state == '2' || thisClass.state == '3')"> v-if="!item.reply && (thisClass.state == '2' || thisClass.state == '3')">
@@ -563,6 +564,7 @@
export default { export default {
data() { data() {
return { return {
currentStudyNumber:0,
courseActiveStyle:{ courseActiveStyle:{
background:'#fff', background:'#fff',
color:'#666', color:'#666',
@@ -1480,7 +1482,7 @@
}, },
// 点击作业或者医案,进入详细介绍 // 点击作业或者医案,进入详细介绍
clickTask(item) { clickTask(item,index) {
// var options = JSON.stringify(item) // var options = JSON.stringify(item)
if (this.tijiaoTitleId == 2) { if (this.tijiaoTitleId == 2) {
// 进入的是心得 // 进入的是心得
@@ -1489,9 +1491,12 @@
}) })
return return
} }
if(index+1<=this.currentStudyNumber){
uni.navigateTo({ uni.navigateTo({
url: `/pages/miniClass/taskDetail?id=${item.id}&classState=${this.thisClass.state}` url: `/pages/miniClass/taskDetail?id=${item.id}&classState=${this.thisClass.state}`
}) })
}
}, },
delClass() { delClass() {
var that = this var that = this
@@ -1939,6 +1944,17 @@
if (res.code == 0) { if (res.code == 0) {
this.isHave = res.result.isJoin this.isHave = res.result.isJoin
this.thisClass = res.result.class this.thisClass = res.result.class
const nowTime = new Date().getTime();
console.log("nowTime at line 107:", nowTime, this.thisClass.startTime);
var studyTime =
Number(nowTime - new Date(this.thisClass.startTime).getTime()) / (1000 * 60 * 60 * 24) / 7;
console.log("studyTime at line 108:", Math.ceil(studyTime));
this.currentStudyNumber = Math.ceil(studyTime);
// if (this.thisClass.state == '0') { // if (this.thisClass.state == '0') {
// this.tabId = '0' // this.tabId = '0'

File diff suppressed because it is too large Load Diff

View File

@@ -11,9 +11,31 @@
<view class="scoreBox"> <view class="scoreBox">
本次考试卷面成绩为<text class="score PM_font">{{exameResult.score}} </text> 本次考试卷面成绩为<text class="score PM_font">{{exameResult.score}} </text>
</view> </view>
<view class="" v-if="testPaper.type == '2'" style="margin: 20rpx 0; text-align: center;" >
<template v-if="exameResult.score >= 60 && selfStudyCertificate.length > 0">
<view class="">
<view class="congritulations">
<image src="../../static/icon/xunzhang.png" mode="widthFix"></image>
</view>
<view class="">
<text>恭喜您本次考试获得了自考证书请前往 我的->我的证书查看</text>
<<view class="" style="text-align: center;">
<text class="small_btn border_radius_10"
style="display: inline-block;font-size: 28rpx; color: #55aaff; border:1px solid #55aaff"
@click="onPageJump('/pages/certificate/certificate')">查看证书</text>
</view>
</view>
</view>
</template>
<template v-else>
<text>很遗憾本次考试您没有获得自考证书,祝您下次考试旗开得胜!!</text>
</template>
</view>
<view class="flex_box flex_between"> <view class="flex_box flex_between">
<button type="primary" size="mini" @click="goToClass">返回班级</button> <button size="mini" type="primary" v-if="testPaper.type == '2'" @click="goToCourse">返回课程</button>
<button type="warn" size="mini" @click="goToPaper">查看试卷</button> <button size="mini" type="primary" v-else @click="goToClass">返回班级</button>
<button size="mini" type="warn" @click="goToPaper">查看试卷</button>
</view> </view>
<view class="result_imgBox"> <view class="result_imgBox">
<image src="../../static/jiesuan_Icon.jpg" mode="widthFix"></image> <image src="../../static/jiesuan_Icon.jpg" mode="widthFix"></image>
@@ -32,7 +54,7 @@
</view> </view>
<view class="flex_box align-items_box" v-if="secondTimeDif > 0"> <view class="flex_box align-items_box" v-if="secondTimeDif > 0">
<view class="" style="font-size: 26rpx;"> <view class="" style="font-size: 26rpx;">
剩余时间 剩余时间:
</view> </view>
<view class=""> <view class="">
<uni-countdown @timeup="timeup" :font-size="20" :show-day="false" <uni-countdown @timeup="timeup" :font-size="20" :show-day="false"
@@ -86,10 +108,15 @@
<u-popup key="1" :show="showPopup" :round="10" @close="hidePopup"> <u-popup key="1" :show="showPopup" :round="10" @close="hidePopup">
<view class="guanli"> <view class="guanli">
<h3>考试说明</h3> <h3>考试说明</h3>
<view class="tips border_radius_10"> <view class="tips border_radius_10" v-if="testPaper.type == '1'">
<text>每位学员共有两次考试的机会考试成绩以两次成绩的最高分作为最终的卷面成绩请认真对待每次考试;<br /> <text>每位学员共有两次考试的机会考试成绩以两次成绩的最高分作为最终的卷面成绩请认真对待每次考试;<br />
请在倒计时结束前完成答题倒计时结束后将自动交卷</text> 请在倒计时结束前完成答题倒计时结束后将自动交卷</text>
</view> </view>
<view class="tips border_radius_10" v-if="testPaper.type == '2'">
<text>每位学员共有两次考试的机会如第一次考试成绩达标则不用进行第二次的考试请认真对待每次考试;<br />
请在倒计时结束前完成答题倒计时结束后将自动交卷;<br/>
考试时间为 45 分钟</text>
</view>
</view> </view>
</u-popup> </u-popup>
<u-popup key="2" :show="showQuestIndex" :round="10" @close="hidePopup"> <u-popup key="2" :show="showQuestIndex" :round="10" @close="hidePopup">
@@ -125,6 +152,7 @@
showPopup: false, showPopup: false,
code: 0, // 英文code code: 0, // 英文code
classId: undefined, classId: undefined,
courseId:undefined,
testPaper: {}, testPaper: {},
curQuestion: { curQuestion: {
answerIds: [] answerIds: []
@@ -139,7 +167,7 @@
step: 8, /// 步长 step: 8, /// 步长
// questIndexList: [], // questIndexList: [],
nowPart: 1, nowPart: 1,
selfStudyCertificate:[],
maxNumber: 0, maxNumber: 0,
minNumber: 0, minNumber: 0,
noAnswerList: [], noAnswerList: [],
@@ -150,12 +178,12 @@
questionList:[], questionList:[],
answerIdsList:[], answerIdsList:[],
wantSubmit:false, // 想要提交 wantSubmit:false, // 想要提交
flag : false,
} }
}, },
async onLoad(e) { async onLoad(e) {
console.log('收到得值',e); console.log('收到得值',e);
this.classId = e.classId // this.classId = e.classId
this.examId = e.id this.examId = e.id
this.wantSubmit = false this.wantSubmit = false
this.getTestPage() this.getTestPage()
@@ -180,6 +208,49 @@
}, },
methods: { methods: {
...mapMutations(['setPaperEndTime']), ...mapMutations(['setPaperEndTime']),
// 查询证书情况
async getCertificateInfo() {
var list = undefined
await $http.request({
url: "common/userCertificate/getUserCertificateList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"type": '', //证书类型A a证 B b证 ZK自考
"courseId": this.courseId //课程id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code != 0) {
uni.showToast({
title: res.errMsg,
icon: 'none'
})
return
}
if (res.code == 0) {
res.certificateList.forEach(item => {
item.certificateUrl && item.certificateUrl != '' ? item
.certificateUrlList = item.certificateUrl.split(',') : item
.certificateUrlList = []
})
list = res.certificateList
}
console.log('证书接口请求结果', res);
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: e.errMsg,
icon: 'none'
})
});
return list
},
async getServerTime() { async getServerTime() {
var time = 0 var time = 0
await $http.request({ await $http.request({
@@ -279,15 +350,21 @@
this.isOvertime = true this.isOvertime = true
this.sumbitPaper() this.sumbitPaper()
let that = this let that = this
var urll = ''
if(that.testPaper.type == '1'){
urll = `/pages/miniClass/classInfo?id=${that.classId}`
}else if(that.testPaper.type == '2'){
urll = `/pages/course/courseDetail?id=${that.courseId}`
}
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: "考试结束,系统已为您自动交卷,点击按钮返回所在班级", content: "考试结束,系统已为您自动交卷,点击按钮返回",
confirmText: '知道了', confirmText: '知道了',
showCancel: false, showCancel: false,
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/miniClass/classInfo?id=${that.classId}` url: urll
}) })
} }
} }
@@ -324,49 +401,60 @@
},300) },300)
}, },
// q请求提交试卷 // q请求提交试卷
sumbitPaper(ids) { async sumbitPaper(ids) {
let that = this
if(that.flag){
return
}
that.flag = true
uni.showLoading({ uni.showLoading({
title:'正在交卷' title:'正在交卷'
}) })
let that = this await $http.request({
$http.request({
url: "common/classExam/submitExamPaper", url: "common/classExam/submitExamPaper",
method: "POST", method: "POST",
data: { data: {
id: that.examId id: that.examId
}, },
header: { //默认 无 说明:请求头 header: { //默认 无 说明:请求头1
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
}) })
.then(res => { .then(async res => {
uni.hideLoading() uni.hideLoading()
if (res.code == 0) { if (res.code == 0) {
console.log('交卷结果',res); console.log('交卷结果',res);
uni.showToast({ uni.showToast({
title: '交卷成功', title: '交卷成功',
icon: 'success' icon: 'success'
}) })
setTimeout( ()=>{ setTimeout(async ()=>{
that.exameResult = res.examPaper that.exameResult = res.examPaper
// this.timeup() // this.timeup()
that.showQuestIndex = false that.showQuestIndex = false
that.secondTimeDif = 0 that.secondTimeDif = 0
that.isOvertime = true that.isOvertime = true
uni.setStorage({ if(that.testPaper.type == '2' && that.exameResult.score >= 60) {
key:'paperEndTime', // if(that.exameResult.score >= 60){
data:{ var newCertificate = await that.getCertificateInfo()
time: 0, console.log('5555555证书资料', newCertificate);
examId: undefined that.selfStudyCertificate = []
}, if (newCertificate && newCertificate.length > 0) {
success: function () { newCertificate.forEach(item => {
console.log('时间存储成功'); if (item.classId != '' && item.classId > 0) {
// this.classCertificate.push(item)
} else {
that.selfStudyCertificate.push(item)
} }
}) })
}
// }
}
},300) },300)
}else{ }else{
that.flag = false
uni.showToast({ uni.showToast({
title: e.errMsg, title: e.errMsg,
icon: 'error' icon: 'error'
@@ -374,6 +462,7 @@
} }
}).catch(e => { }).catch(e => {
that.flag = true
uni.hideLoading() uni.hideLoading()
console.log(e, '数据报错') console.log(e, '数据报错')
// this.status = 3 // this.status = 3
@@ -493,6 +582,11 @@
this.haveAnswerList = this.gethaveAnswerList() this.haveAnswerList = this.gethaveAnswerList()
// console.log('this.answerIdsList', this.answerIdsList); // console.log('this.answerIdsList', this.answerIdsList);
this.testPaper = res.examPaper this.testPaper = res.examPaper
if(this.testPaper.type == '1'){ // 班级考试
this.classId = this.testPaper.relationId
}else if(this.testPaper.type == '2'){
this.courseId = this.testPaper.relationId
}
// var planEndTimeDate = new Date(res.planEndTime) // var planEndTimeDate = new Date(res.planEndTime)
// this.endTime = planEndTimeDate.getTime(); // this.endTime = planEndTimeDate.getTime();
this.endTime = res.planEndTime this.endTime = res.planEndTime
@@ -569,6 +663,12 @@
url: `/pages/miniClass/classInfo?id=${this.classId}` url: `/pages/miniClass/classInfo?id=${this.classId}`
}) })
}, },
goToCourse(){
uni.navigateTo({
// url: `/pages/miniClass/classInfo?id=${this.classId}`
url: `/pages/course/courseDetail?id=${this.courseId}`
})
},
hidePopup() { hidePopup() {
this.showPopup = false this.showPopup = false
this.showQuestIndex = false this.showQuestIndex = false
@@ -602,7 +702,17 @@
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/style/mixin.scss"; @import "@/style/mixin.scss";
.congritulations {
width: 120rpx;
height: 120rpx;
text-align: center;
margin: 10rpx auto;
display: block;
image {
width: 120rpx;
height: 120rpx;
}
}
.questIndx { overflow: hidden; .questIndx { overflow: hidden;
margin-top: 20rpx; margin-top: 20rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;

View File

@@ -2,8 +2,8 @@
<view class="" style="background-color: #d4eaf0; min-height: calc(100vh); padding: 20rpx;"> <view class="" style="background-color: #d4eaf0; min-height: calc(100vh); padding: 20rpx;">
<public-module></public-module> <public-module></public-module>
<z-nav-bar title="试卷答案"> <z-nav-bar title="试卷答案">
<text slot="right" style="padding-right: 20rpx; font-size: 26rpx; color: #666;" <!-- <text slot="right" style="padding-right: 20rpx; font-size: 26rpx; color: #666;"
@click="showPopup = true">考试说明</text> @click="showPopup = true">考试说明</text> -->
</z-nav-bar> </z-nav-bar>
<!-- 有考试结果时候 --> <!-- 有考试结果时候 -->
<template> <template>
@@ -78,6 +78,9 @@
</view> </view>
</view> </view>
</view> </view>
<view class="" style="margin-top: 20rpx;">
<text style="color: #666; font-size: 28rpx;">开始时间{{testPaper.startTime}} <br/> 结束时间{{testPaper.endTime}}</text>
</view>
</view> </view>
</template> </template>
<u-popup key="1" :show="showPopup" :round="10" @close="hidePopup"> <u-popup key="1" :show="showPopup" :round="10" @close="hidePopup">
@@ -223,8 +226,6 @@ checkAnswer(id){
if (res.code == 0) { if (res.code == 0) {
// that.isHave = true // that.isHave = true
var subOptions = JSON.parse(res.examPaper.subject) var subOptions = JSON.parse(res.examPaper.subject)
subOptions.forEach(item => { subOptions.forEach(item => {
var code = 0 var code = 0
item.options.forEach(item1 => { item.options.forEach(item1 => {
@@ -236,6 +237,7 @@ checkAnswer(id){
this.questionList = subOptions this.questionList = subOptions
this.testPaper = res.examPaper this.testPaper = res.examPaper
console.log('试卷信息', this.testPaper);
this.answerIdsList = JSON.parse(res.examPaper.answer) this.answerIdsList = JSON.parse(res.examPaper.answer)
var newList = JSON.parse(res.examPaper.answer) var newList = JSON.parse(res.examPaper.answer)
newList = newList.map(item => { newList = newList.map(item => {

View File

@@ -1,7 +1,20 @@
<template> <template>
<view style="min-height: calc(100vh - 120rpx); background-color: #ebf2f5;"> <view style="min-height: calc(100vh - 120rpx); background-color: #ebf2f5">
<z-nav-bar :title="pageName"> <z-nav-bar :title="pageName">
<uni-icons v-if="pageType == 1 && classState == '1' && (roleCode.includes('1') || roleCode.includes('2'))" type="plus" class="addBtn" color="#258feb" slot="right" @click="addTask()" size="14">添加医案</uni-icons> <uni-icons
v-if="
pageType == 1 &&
classState == '1' &&
(roleCode.includes('1') || roleCode.includes('2'))
"
type="plus"
class="addBtn"
color="#258feb"
slot="right"
@click="addTask()"
size="14"
>添加医案</uni-icons
>
</z-nav-bar> </z-nav-bar>
<view class="pad20"> <view class="pad20">
<view class="" v-if="pageType == 0 && classState == '0'"> <view class="" v-if="pageType == 0 && classState == '0'">
@@ -11,31 +24,65 @@
<view class="addTips border_radius_10"> <view class="addTips border_radius_10">
<view class=""> <view class="">
<view class="flex_box flex_center"> <view class="flex_box flex_center">
<text class="PM_font fangshi">生成方式</text><uni-icons type="help" size="18" @click="clickHelp"></uni-icons> <text class="PM_font fangshi">生成方式</text
><uni-icons type="help" size="18" @click="clickHelp"></uni-icons>
</view> </view>
<view class="btnBox flex_box flex_center"> <view class="btnBox flex_box flex_center">
<text class="zidong border_radius_10" @click="autoCreate()">自动生成</text> <text class="zidong border_radius_10" @click="autoCreate()"
<text class="shoudong border_radius_10" @click="addTask()">逐个添加</text> >自动生成</text
>
<text class="shoudong border_radius_10" @click="addTask()"
>在最上方添加</text
>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view v-if="taskList.length > 0"> <view v-if="taskList.length > 0">
<uni-section class="mb-10 mt-10 nobg" :title="'共'+total+'条数据'" type="line"></uni-section> <uni-section
class="mb-10 mt-10 nobg"
:title="'共' + total + '条数据'"
type="line"
></uni-section>
<view class="submitRecode"> <view class="submitRecode">
<view class="newBox"> <view class="newBox">
<view class="item " v-for="(item, index) in taskList" @click="clickTask(item)"> <view
class="item"
v-for="(item, index) in taskList"
@click="clickTask(item)"
>
<view class="leve1 flex_box flex_between"> <view class="leve1 flex_box flex_between">
<text style="flex: 1;">{{item.title}}</text> <text style="flex: 1">{{ item.title }}</text>
<text class="edit border_radius_10 small_btn" @click.stop="goEdit(item)" v-if="pageType == 0 && classState == 0 || pageType == 1 && classState == 1 && item.otherInfo.setGiveHomeWorkNumber == 0">修改</text>
<text
class="edit border_radius_10 small_btn"
@click.stop="goEdit(item)"
v-if="
(pageType == 0 && classState == 0) ||
(pageType == 1 &&
classState == 1 &&
item.otherInfo.setGiveHomeWorkNumber == 0) ||
(pageType == 0 &&
classState == 1 &&
index + 1 > currentStudyNumber)
"
>修改</text
>
</view> </view>
<view class="leve2"> <view class="leve2">
<view class="jianjie" v-html="item.content"> <view class="jianjie" v-html="item.content"> </view>
</view>
</view> </view>
<view class="leve3" v-if="pageType == 0 && classState == 0"> <view class="leve3" v-if="pageType == 0 && classState == 0">
<text class="border_radius_10 small_btn add" @click.stop="addTask(item)">在本条后面添加一条</text> <text
<text class="border_radius_10 small_btn del" @click.stop="delTask(item)">删除</text> class="border_radius_10 small_btn add"
@click.stop="addTask(item)"
>在本条后面添加一条</text
>
<text
class="border_radius_10 small_btn del"
@click.stop="delTask(item)"
>删除</text
>
</view> </view>
</view> </view>
</view> </view>
@@ -50,191 +97,205 @@
</template> </template>
<script> <script>
import $http from '@/config/requestConfig.js'; import $http from "@/config/requestConfig.js";
// const taskLIst1 = require('@/data/taskList.json') // const taskLIst1 = require('@/data/taskList.json')
export default { export default {
data() { data() {
return { return {
options: {},
classId: undefined, classId: undefined,
pageType: undefined, pageType: undefined,
pPage: 0, pPage: 0,
status: 88, status: 88,
loadFlag: false, loadFlag: false,
pageName: '', pageName: "",
taskList: [], taskList: [],
roleCode:'', roleCode: "",
minNumber: undefined, minNumber: undefined,
classState: undefined, classState: undefined,
total:0 total: 0,
} currentStudyNumber: 0,
};
}, },
onLoad(e) { onLoad(e) {
console.log('e',e); this.options = e;
this.classState = e.classState console.log("e", e);
this.classId = e.classId this.classState = e.classState;
this.minNumber = e.minNumber this.classId = e.classId;
this.pageType = e.type this.minNumber = e.minNumber;
this.roleCode = e.roleCode this.pageType = e.type;
if (e.type == '0') { this.roleCode = e.roleCode;
this.pageName = '作业列表' if (e.type == "0") {
} else if (this.pageName = '医案列表') { this.pageName = "作业列表";
} else if ((this.pageName = "医案列表")) {
} else { } else {
this.pageName = '心得列表' this.pageName = "心得列表";
} }
// this.getList() // this.getList()
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.pPage = 0 this.pPage = 0;
this.taskList = [] this.taskList = [];
this.getList() this.getList();
uni.stopPullDownRefresh() uni.stopPullDownRefresh();
}, },
onReachBottom() { onReachBottom() {
if (this.status != 2 && this.status != 3) { if (this.status != 2 && this.status != 3) {
this.getList() this.getList();
} }
}, },
onShow() { onShow() {
this.pPage = 0 this.pPage = 0;
this.taskList = [] this.taskList = [];
this.getList() if (this.pageType == 0) {
const nowTime = new Date().getTime();
console.log("nowTime at line 107:", nowTime, this.options.startTime);
var studyTime =
Number(nowTime - this.options.startTime) / (1000 * 60 * 60 * 24) / 7;
console.log("studyTime at line 108:", Math.ceil(studyTime));
this.currentStudyNumber = Math.ceil(studyTime);
}
this.getList();
// this.getList() // this.getList()
}, },
methods: { methods: {
delTask(item) { delTask(item) {
console.log('删除'); console.log("删除");
$http.request({ $http
.request({
url: "common/class/delClassTask", url: "common/class/delClassTask",
method: "POST", method: "POST",
data: { data: {
"taskId": item.id taskId: item.id,
}, },
header: { //默认 无 说明:请求头 header: {
'Content-Type': 'application/json' //默认 无 说明:请求头
"Content-Type": "application/json",
}, },
}) })
.then(res => { .then((res) => {
if (res.code == 0) { if (res.code == 0) {
uni.showToast({ uni.showToast({
title:'删除成功', title: "删除成功",
icon:'success' icon: "success",
}) });
setTimeout(() => { setTimeout(() => {
this.pPage = 0 this.pPage = 0;
this.taskList = [] this.taskList = [];
this.getList() this.getList();
},2000) }, 2000);
} else { } else {
uni.showToast({ uni.showToast({
title:'删除失败', title: "删除失败",
icon:'error' icon: "error",
}) });
} }
}) })
.catch(e => { .catch((e) => {
uni.showToast({ uni.showToast({
title:'删除失败', title: "删除失败",
icon:'error' icon: "error",
}) });
}) });
}, },
// 是否继续自动成操作 // 是否继续自动成操作
confirOption() { confirOption() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.showModal({ uni.showModal({
title:'提示', title: "提示",
content:'当前作业列表中存在数据,确定要清空并重新生成新的作业列表吗?', content:
cancelText:'点错了', "当前作业列表中存在数据,确定要清空并重新生成新的作业列表吗?",
confirmText:'确定', cancelText: "点错了",
confirmText: "确定",
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
resolve(true) resolve(true);
} else if (res.cancel) { } else if (res.cancel) {
resolve(false) resolve(false);
} }
} },
}) });
}) });
}, },
goAutoCreate() { goAutoCreate() {
$http
$http.request({ .request({
url: "common/class/generateClassTask", url: "common/class/generateClassTask",
method: "POST", method: "POST",
data: { data: {
"classId": this.classId classId: this.classId,
}, },
header: { //默认 无 说明:请求头 header: {
'Content-Type': 'application/json' //默认 无 说明:请求头
"Content-Type": "application/json",
}, },
}) })
.then(res => { .then((res) => {
if (res.code == 0) { if (res.code == 0) {
uni.showToast({ uni.showToast({
title:'生成成功', title: "生成成功",
icon:'success' icon: "success",
}) });
setTimeout(() => { setTimeout(() => {
this.pPage = 0 this.pPage = 0;
this.taskList = [] this.taskList = [];
this.getList() this.getList();
},2000) }, 2000);
} else { } else {
uni.showToast({ uni.showToast({
title:'生成失败', title: "生成失败",
icon:'error' icon: "error",
}) });
} }
}) })
.catch(e => { .catch((e) => {
uni.showToast({ uni.showToast({
title:'生成失败', title: "生成失败",
icon:'error' icon: "error",
}) });
}) });
}, },
async autoCreate() { async autoCreate() {
console.log('自动创建'); console.log("自动创建");
if (this.taskList.length > 0) { if (this.taskList.length > 0) {
var isContinue = await this.confirOption() var isContinue = await this.confirOption();
if (isContinue) { if (isContinue) {
this.goAutoCreate() this.goAutoCreate();
} }
} else { } else {
this.goAutoCreate() this.goAutoCreate();
} }
}, },
goEdit(item) { goEdit(item) {
uni.navigateTo({ uni.navigateTo({
url:`/pages/miniClass/addHomeWork?id=${item.id}&type=${item.type}` url: `/pages/miniClass/addHomeWork?id=${item.id}&type=${item.type}`,
}) });
}, },
addTask(item) { addTask(item) {
// console.log('type',this.pageType); // console.log('type',this.pageType);
var _sort = undefined var _sort = undefined;
item ? _sort = item.sort : undefined item ? (_sort = item.sort) : undefined;
uni.navigateTo({ uni.navigateTo({
url: `/pages/miniClass/addHomeWork?classId=${this.classId}&sort=${_sort}&type=${this.pageType}` url: `/pages/miniClass/addHomeWork?classId=${this.classId}&sort=${_sort}&type=${this.pageType}`,
}) });
}, },
clickHelp() { clickHelp() {
uni.showModal({ uni.showModal({
title:'说明', title: "说明",
content:"班内作业您可选择自动生成作业列表,或者手动逐一添加的方式来创建作业,其中需要注意的是如选择自动生成作业列表,会覆盖掉之前已经存在的作业内容。", content:
"班内作业您可选择自动生成作业列表,或者手动逐一添加的方式来创建作业,其中需要注意的是如选择自动生成作业列表,会覆盖掉之前已经存在的作业内容。",
showCancel: false, showCancel: false,
confirmText:'好的' confirmText: "好的",
}) });
}, },
// 点击作业或者医案,进入作业提交情况 // 点击作业或者医案,进入作业提交情况
clickTask(item) { clickTask(item) {
// console.log('options',options); // console.log('options',options);
uni.navigateTo({ uni.navigateTo({
url:`/pages/miniClass/taskDetailForMan?id=${item.id}&roleCode=${this.roleCode}&type=${this.pageType}&classState=${this.classState}` url: `/pages/miniClass/taskDetailForMan?id=${item.id}&roleCode=${this.roleCode}&type=${this.pageType}&classState=${this.classState}`,
}) });
}, },
getList() { getList() {
this.status = 1; this.status = 1;
@@ -243,32 +304,34 @@
return; return;
} }
uni.showLoading({ uni.showLoading({
title: '加载中' title: "加载中",
}) });
this.loadFlag = true; this.loadFlag = true;
this.pPage++; this.pPage++;
$http.request({ $http
.request({
url: "common/class/getClassTaskList", url: "common/class/getClassTaskList",
method: "POST", method: "POST",
data: { data: {
"limit": 10, limit: 10,
"page": this.pPage, page: this.pPage,
"classId": this.classId, classId: this.classId,
"type": this.pageType + '', //类型 0班内任务1医案2心得 type: this.pageType + "", //类型 0班内任务1医案2心得
"title": "" title: "",
}, },
header: { //默认 无 说明:请求头 header: {
'Content-Type': 'application/json' //默认 无 说明:请求头
"Content-Type": "application/json",
}, },
}) })
.then(res => { .then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.total = 0 this.total = 0;
if (res.page.records.length > 0) { if (res.page.records.length > 0) {
console.log('数据获取成功', res.page.records); console.log("数据获取成功", res.page.records);
var lis = res.page.records var lis = res.page.records;
this.taskList = this.taskList.concat(lis) this.taskList = this.taskList.concat(lis);
this.total = res.page.total this.total = res.page.total;
// this.taskList = taskLIst1.page.records // 测试数据 // this.taskList = taskLIst1.page.records // 测试数据
if (res.page.pages > this.pPage) { if (res.page.pages > this.pPage) {
this.status = 0; this.status = 0;
@@ -279,34 +342,48 @@
this.status = 3; // 暂无数据 this.status = 3; // 暂无数据
} }
this.loadFlag = false; this.loadFlag = false;
console.log('res', res); console.log("res", res);
uni.hideLoading() uni.hideLoading();
} }
}).catch(e => { })
console.log(e, '数据报错') .catch((e) => {
uni.hideLoading() console.log(e, "数据报错");
uni.hideLoading();
this.loadFlag = false; this.loadFlag = false;
uni.showToast({ uni.showToast({
title: e.msg, title: e.msg,
icon: 'error' icon: "error",
}) });
}); });
}, },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/style/mixin.scss"; @import "@/style/mixin.scss";
.addTips{padding: 20rpx; background-color: #fff; } .addTips {
padding: 20rpx;
background-color: #fff;
}
.btnBox { .btnBox {
text{padding: 16rpx 10rpx; margin: 20rpx; display: block; color: #fff;} text {
padding: 16rpx 10rpx;
margin: 20rpx;
display: block;
color: #fff;
}
.zidong { .zidong {
background-color: #55aa00; background-color: #55aa00;
} }
.shoudong{background-color:$themeColor;} .shoudong {
background-color: $themeColor;
}
}
.fangshi {
font-size: 36rpx;
color: #666;
} }
.fangshi{font-size: 36rpx; color: #666;}
.listTitle { .listTitle {
margin: 20rpx 0; margin: 20rpx 0;
} }
@@ -323,9 +400,11 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
/* #endif */ /* #endif */
flex: 1 flex: 1;
}
.addBtn {
padding-right: 20rpx;
} }
.addBtn{padding-right:20rpx;}
.submitRecode { .submitRecode {
// padding: 20rpx; // padding: 20rpx;
@@ -352,23 +431,54 @@
align-items: center; align-items: center;
// padding-bottom: 20rpx; // padding-bottom: 20rpx;
.edit{border:1px solid $themeColor; color: $themeColor;} .edit {
border: 1px solid $themeColor;
color: $themeColor;
}
// .userName{} // .userName{}
} }
.leve2 { justify-content: center; margin-top: 20rpx; .leve2 {
color: #999; font-size: 24rpx;border-top: 1px dashed #eee; justify-content: center;
.jianjie{@include bov(2); margin-top: 20rpx; font-size: 32rpx;} margin-top: 20rpx;
b{font-size: 34rpx; padding: 0 4rpx; font-weight: normal; color: #333; color: red;} color: #999;
.item{text-align: center; padding-top: 0; padding-bottom: 0; margin-bottom: 0;} font-size: 24rpx;
border-top: 1px dashed #eee;
.jianjie {
@include bov(2);
margin-top: 20rpx;
font-size: 32rpx;
}
b {
font-size: 34rpx;
padding: 0 4rpx;
font-weight: normal;
color: #333;
color: red;
}
.item {
text-align: center;
padding-top: 0;
padding-bottom: 0;
margin-bottom: 0;
}
} }
.leve3 { .leve3 {
color: $themeColor; color: $themeColor;
text-align: center; text-align: center;
padding-top: 10rpx; margin-top: 20rpx; margin-bottom: 10rpx; padding-top: 10rpx;
.add{color: #ffaa7f; border: 1px solid #ffaa7f;} margin-top: 20rpx;
.del{color: #ff557f; border: 1px solid #ff557f; margin-left: 20rpx;} margin-bottom: 10rpx;
.add {
color: #ffaa7f;
border: 1px solid #ffaa7f;
}
.del {
color: #ff557f;
border: 1px solid #ff557f;
margin-left: 20rpx;
}
.tips { .tips {
width: 100%; width: 100%;
justify-content: space-between; justify-content: space-between;
@@ -376,7 +486,8 @@
color: #999; color: #999;
} }
.date {} .date {
}
.btn { .btn {
border: 1px solid $themeColor; border: 1px solid $themeColor;
@@ -396,7 +507,6 @@
} }
} }
.info { .info {
padding: 15px; padding: 15px;
color: #666; color: #666;
@@ -410,5 +520,4 @@
.info-content { .info-content {
padding: 5px 15px; padding: 5px 15px;
} }
</style> </style>

View File

@@ -32,7 +32,7 @@
</view> </view>
<view class="flex_box align-items_box" v-if="secondTimeDif > 0"> <view class="flex_box align-items_box" v-if="secondTimeDif > 0">
<view class=""> <view class="">
剩余时间 剩余时间:
</view> </view>
<view class=""> <view class="">
<uni-countdown @timeup="timeup" :font-size="20" :show-day="false" <uni-countdown @timeup="timeup" :font-size="20" :show-day="false"
@@ -168,6 +168,7 @@
showQuestIndex:false, showQuestIndex:false,
secondTimeDif:undefined, secondTimeDif:undefined,
pagetitle:'', // 页面标题 pagetitle:'', // 页面标题
flag:false,
} }
}, },
async onLoad(e) { async onLoad(e) {
@@ -353,10 +354,15 @@
}, },
// q请求提交试卷 // q请求提交试卷
sumbitPaper(ids) { sumbitPaper(ids) {
let that = this
if(that.flag){
return
}
that.flag = true
uni.showLoading({ uni.showLoading({
title:'正在交卷' title:'正在交卷'
}) })
let that = this
$http.request({ $http.request({
url: "common/classExam/submitExamPaper", url: "common/classExam/submitExamPaper",
method: "POST", method: "POST",
@@ -394,6 +400,7 @@
},300) },300)
}else{ }else{
that.flag = false
uni.showToast({ uni.showToast({
title: e.errMsg, title: e.errMsg,
icon: 'error' icon: 'error'
@@ -401,6 +408,7 @@
} }
}).catch(e => { }).catch(e => {
that.flag = false
uni.hideLoading() uni.hideLoading()
console.log(e, '数据报错') console.log(e, '数据报错')
// this.status = 3 // this.status = 3

View File

@@ -309,6 +309,9 @@
import musicPlay from '@/components/music.vue' import musicPlay from '@/components/music.vue'
import repciptData from '@/static/json/repcipt.json' import repciptData from '@/static/json/repcipt.json'
import $http from '@/config/requestConfig.js'; import $http from '@/config/requestConfig.js';
// #ifdef APP-PLUS
import updata from "@/uni_modules/uni-upgrade-center-app/utils/check-update";
// #endif
import { import {
mapState, mapState,
mapMutations mapMutations
@@ -376,6 +379,7 @@
// #ifdef APP-PLUS // #ifdef APP-PLUS
// plus.screen.unlockOrientation(); // plus.screen.unlockOrientation();
plus.screen.lockOrientation("portrait-primary"); plus.screen.lockOrientation("portrait-primary");
updata(); // 检查更新
// #endif // #endif
this.requestAll() this.requestAll()
this.classList = await this.getClassNoUser() this.classList = await this.getClassNoUser()
@@ -393,9 +397,9 @@
// paperEndTime = planEndTimeDate.getTime(); // 结束的时间戳 // paperEndTime = planEndTimeDate.getTime(); // 结束的时间戳
paperEndTime = historyPaper.planEndTime paperEndTime = historyPaper.planEndTime
this.examId = historyPaper.id this.examId = historyPaper.id
this.classId = historyPaper.relationId // this.classId = historyPaper.relationId
}else{ }else{
this.classId = undefined // this.classId = undefined
this.examId = undefined this.examId = undefined
paperEndTime = 0 paperEndTime = 0
} }
@@ -470,7 +474,8 @@
// 继续考试 // 继续考试
continueTest(id,classId) { continueTest(id,classId) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/miniClass/continueTest?id=${id}&classId=${classId}` // url: `/pages/miniClass/continueTest?id=${id}&classId=${classId}`
url: `/pages/miniClass/continueTest?id=${id}`
}) })
}, },
// 获取考试中的试卷 // 获取考试中的试卷
@@ -531,7 +536,8 @@
}, },
}) })
.then(async res => { .then(async res => {
if (res.code == 0) { console.log(res);
if (res && res.code == 0) {
if (res.result.length > 0) { if (res.result.length > 0) {
_list = res.result _list = res.result
} }
@@ -575,8 +581,8 @@
this.$http this.$http
.post('medical/home/getCourseMedicalTree') .post('medical/home/getCourseMedicalTree')
.then(res => { .then(res => {
// console.log(res) console.log(res)
if (res.code == 0) { if (res && res.code == 0) {
if (res.labels.length > 0) { if (res.labels.length > 0) {
this.curseTagList = res.labels this.curseTagList = res.labels
this.tabsid = res.labels[0].id this.tabsid = res.labels[0].id

View File

@@ -0,0 +1,959 @@
<template style="">
<view class="" style="background-color: #d4eaf0; min-height: calc(100vh); padding: 20rpx;">
<public-module></public-module>
<z-nav-bar :title="pagetitle" backState="2000">
<text slot="right" style="padding-right: 20rpx; font-size: 26rpx; color: #666;"
@click="showPopup = true">考试说明</text>
</z-nav-bar>
<!-- 有考试结果时候 -->
<template v-if="exameResult.id">
<view class="border_radius_10 haveResult">
<view class="scoreBox">
本次考试卷面成绩为<text class="score PM_font">{{exameResult.score}} </text>
</view>
<view class="" style="margin: 20rpx 0; text-align: center;">
<template v-if="exameResult.score >= 60 && selfStudyCertificate.length > 0">
<view class="">
<view class="congritulations">
<image src="../../static/icon/xunzhang.png" mode="widthFix"></image>
</view>
<view class="">
<text>恭喜您本次考试获得了自考证书请前往 我的->我的证书查看</text>
<view class="" style="text-align: center;">
<text class="small_btn border_radius_10"
style="display: inline-block;font-size: 28rpx; color: #55aaff; border:1px solid #55aaff"
@click="onPageJump('/pages/certificate/certificate')">查看证书</text>
</view>
</view>
</view>
</template>
<template v-else>
<text>很遗憾本次考试您没有获得自考证书,祝您下次考试旗开得胜!!</text>
</template>
</view>
<view class="flex_box flex_between">
<button type="primary" size="mini" @click="goToClass">返回课程</button>
<button type="warn" size="mini" @click="goToPaper">查看试卷</button>
</view>
<view class="result_imgBox">
<image src="../../static/jiesuan_Icon.jpg" mode="widthFix"></image>
</view>
</view>
</template>
<!-- 没有考试结果的时候 -->
<template v-else>
<view style="padding: 20rpx; " class="timeBox border_radius_10 flex_box flex_between align-items_box"
v-if="secondTimeDif > 0">
<!-- <view class=""> -->
<view class="">
<text><i style="color: #00aaff; font-style: normal; margin-right: 10rpx;" class="">{{curIndex1+1}}
</i> / {{testPaper.length}}</text>
<text class="checkQuestBtn small_btn border_radius_10" @click="showQuestIndex = true">全部题目</text>
</view>
<view class="flex_box align-items_box" v-if="secondTimeDif > 0">
<view class="">
剩余时间:
</view>
<view class="">
<uni-countdown @timeup="timeup" :font-size="20" :show-day="false"
:hour="timeDif.hour"
:minute="timeDif.minutes"
:second="timeDif.second"
color="#ffaa7f" />
</view>
</view>
<!-- </view> -->
<!-- <pre>{{testPaper}}</pre> -->
</view>
<view class="question border_radius_10" v-if="curQuestion.id">
<view class="">
<text class="questionType">{{curQuestion.type == 0 ? '单选题' : '多选题'}}</text>
<!-- <text class="checkQuestBtn small_btn border_radius_10" @click="showQuestIndex = true">检查</text> -->
<view class="questionItem" v-if="curQuestion.id">
<view class="">
<text>{{curQuestion.content}}</text>
</view>
<view class="optionsBox">
<view
:class="['item','border_radius_10',curQuestion.answerIds.includes(item.id) ? 'choosed' : '']"
@click="clickOption(item, index)" v-for="(item, index) in curQuestion.options"
:key="index">
<text>{{item.content}}</text>
</view>
</view>
</view>
<view class="btnBox " style="overflow: hidden;">
<view class="flex_box flex_between">
<view class="item">
<button @click="showPrevQuestion" type="default" plain="true" :disabled="curIndex1 == 0"
size="mini">上一题</button>
</view>
<view class="item" v-show="curIndex1 == testPaper.length-1 && !isOvertime">
<button @click="sumitAnswer" type="primary" size="mini"> </button>
</view>
<view class="item">
<button @click="showNextQuestion" type="primary"
:disabled="curIndex1 == testPaper.length-1" size="mini">下一题</button>
</view>
</view>
</view>
</view>
</view>
</template>
<u-popup key="1" :show="showPopup" :round="10" @close="hidePopup">
<view class="guanli">
<h3>考试说明</h3>
<view class="tips border_radius_10">
<text>每位学员共有两次考试的机会如第一次考试成绩达标则不用进行第二次的考试请认真对待每次考试;<br />
请在倒计时结束前完成答题倒计时结束后将自动交卷</text>
</view>
</view>
</u-popup>
<u-popup key="2" :show="showQuestIndex" :round="10" @close="hidePopup">
<view class="guanli">
<h3>题目索引</h3>
<view class="" style="text-align: center; font-size: 28rpx; line-height: 50rpx; color: #666;">
<text>红框标识未作答绿色框标识已选定答案灰色框标识您未查看的题目</text>
</view>
<view class="">
<view class="questIndx questIndxPup flex_box">
<!-- <scroll-view class="scroll-view_H" scroll-x="true">
<view class="scroll-view-item_H" v-for="index of getallLIst" :key="index"> -->
<text v-for="index of getallLIst" @click="clickIndex(index)" :key="index"
:class="[ haveAnswerList.includes(index-1) ? 'green' : '', noAnswerList.includes(index-1) ? 'red' : '',(curIndex1+1) == index ? 'cur' :'']">{{index}}</text>
<!-- </view>
</scroll-view> -->
</view>
</view>
</view>
</u-popup>
<u-popup :show="protocolShow" mode="center" round="6" :key="3">
<view class="popup_box">
<view class="title">温馨提示</view>
<view class="content">
<view class="center">
用户您好本次考试时间为 <text style="color: red; font-weight: bold; font-size: 30rpx;">{{testDuration}}</text> 分钟<br />
<view style="color: red; font-weight: bold"> : </view>
<view>
<text>每位学员共有两次考试的机会如第一次考试成绩达标则不用进行第二次的考试请认真对待每次考试;<br />
请在倒计时结束前完成答题倒计时结束后将自动交卷;</text>
</view>
</view>
<view class="bottom">
<view class="button_box">
<u-button size="small" text="稍后再考" @click="cancelClick"></u-button>
<u-button text="开始考试" color="#258feb" size="small" @click="onHandleClickBuy"></u-button>
</view>
</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import $http from '@/config/requestConfig.js';
import debounce from "@/common/debounce.js";
import {
mapState,mapMutations
} from "vuex";
export default {
data() {
return {
testDuration:'45', // 考试时长
protocolShow:false,
flag:false,
showPopup: false,
code: 0, // 英文code
courseId: undefined,
testPaper: [],
curQuestion: {
answerIds: []
},
result: {}, // 考试结果
curIndex1: 0,
paperCreateTime: 0,
examId: undefined,
endTime: undefined, // 结束时间戳
timeDif:{}, // 时间差(结束 - 现在)
isOvertime: false, // 是否超时
step: 8, /// 步长
// questIndexList: [],
nowPart: 1,
maxNumber: 0,
minNumber: 0,
noAnswerList: [],
haveAnswerList:[],
exameResult:{},
showQuestIndex:false,
secondTimeDif:undefined,
pagetitle:'', // 页面标题
selfStudyCertificate:[],
}
},
async onLoad(e) {
console.log('收到得值',e);
this.courseId = e.id
// this.testDuration = e.testDuration
this.protocolShow = true
this.pagetitle = '准备考试'
},
onHide() {
if (!this.isOvertime) {}
},
onShow() {
// this.endTime = this.hourUp(1)
// console.log('this.endTime', this.endTime.getTime());
},
beforeDestroy() {
if (!this.isOvertime) { // 如果中途退出
// this.giveZero()
}
},
computed: {
...mapState(["userInfo"]),
getallLIst() {
const numbers = Array.from(Array(this.testPaper.length).keys(), n => n + 1);
console.log('numbers', numbers);
return numbers
}
},
methods: {
...mapMutations(['setPaperEndTime']),
cancelClick(){
this.protocolShow = false
uni.navigateBack({
delta: 2
});
// uni.navigateTo({
// url: `/pages/course/courseDetail?id=${this.courseId}`
// })
},
onHandleClickBuy(){ // 确定开始考试
debounce(async () => {
this.protocolShow = false
if (this.testPaper.length <= 0) {
this.pagetitle = '获取试卷'
this.getTestPage()
}else{
uni.showToast({
title:'页面发生错误,请退出后重新进入页面或联系客服人员',
icon:'none',
duration:3000
})
}
},300)
},
// 获取服务器时间
async getServerTime() {
var time = 0
await $http.request({
url: "common/classExam/getServerTime",
method: "POST",
data: {},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(async (res) => {
if (res.code == 0) {
time = res.serverTime
} else {
time = -1
}
}).catch(e => {
time = -1
});
return time
},
// 单个题的提交
saveQuestAnswer(paperId,questIndex,ids){
console.log('收到的值',paperId,questIndex,ids);
$http.request({
url: "common/classExam/submitOption",
method: "POST",
data: {
"id": paperId, //试卷id
"no": questIndex, // 提索引 1....
"answer": ids // 答案id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
console.log('提交成功');
}else{
uni.showToast({
title: e.errMsg,
icon: 'error'
})
}
}).catch(e => {
console.log(e, '数据报错')
uni.showToast({
title: e.errMsg,
icon: 'error'
})
});
},
getNoAnswerList() {
var list = []
// if (this.curIndex1 > 0) {
for (var i = 0; i < this.testPaper.length; i++) {
if (this.testPaper[i].answerIds.length == 0 && this.testPaper[i].hadOpend) {
console.log('fuhe?');
list.push(i)
}
}
// }
return list
},
gethaveAnswerList() {
var list = []
// if (this.curIndex1 > 0) {
for (var i = 0; i < this.testPaper.length; i++) {
if (this.testPaper[i].answerIds.length > 0 && this.testPaper[i].hadOpend) {
// console.log('fuhe?');
list.push(i)
}
}
// }
return list
},
// 倒计时结束 (超时)
timeup() {
this.isOvertime = true
this.sumbitPaper()
let that = this
uni.showModal({
title: '提示',
content: "考试结束,系统已为您自动交卷,点击按钮返回课程",
confirmText: '知道了',
showCancel: false,
success: (res) => {
if (res.confirm) {
// that.goToClass()
uni.navigateTo({
url: `/pages/course/courseDetail?id=${that.courseId}`
})
}
}
})
},
goToPaper(){
uni.navigateTo({
url: `/pages/miniClass/paperBack?id=${this.examId}`
})
},
// 获取交卷数据
sumitAnswer() {
debounce(async () => {
let that = this
// this.noAnswerList = await this.getNoAnswerList()
if(this.noAnswerList.length > 0){
this.showQuestIndex = true
uni.showModal({
title:'提示',
content:'您有未作答的题目,是否继续交卷操作?',
cancelText:'点错了',
confirmText:'确定',
success(res) {
if (res.confirm) {
that.sumbitPaper()
}
},
})
}else{
that.sumbitPaper()
}
},300)
},
// q请求提交试卷
async sumbitPaper(ids) {
let that = this
if(that.flag){
return
}
that.flag = true
uni.showLoading({
title:'正在交卷'
})
await $http.request({
url: "common/classExam/submitExamPaper",
method: "POST",
data: {
id: that.examId
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(async res => {
uni.hideLoading()
if (res.code == 0) {
console.log('交卷结果',res);
uni.showToast({
title: '交卷成功',
icon: 'success'
})
setTimeout( async ()=>{
that.exameResult = res.examPaper
// this.timeup()
that.showQuestIndex = false
that.secondTimeDif = 0
that.isOvertime = true
if(that.exameResult.score >= 60){
var newCertificate = await that.getCertificateInfo()
console.log('5555555证书资料', newCertificate);
that.selfStudyCertificate = []
if (newCertificate && newCertificate.length > 0) {
newCertificate.forEach(item => {
if (item.classId != '' && item.classId > 0) {
// this.classCertificate.push(item)
} else {
that.selfStudyCertificate.push(item)
}
})
}
}
},300)
}else{
that.flag = false
uni.showToast({
title: e.errMsg,
icon: 'error'
})
}
}).catch(e => {
that.flag = false
uni.hideLoading()
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: e.errMsg,
icon: 'error'
})
});
},
showPrevQuestion() {
// 上一题
this.curIndex1--
// this.curQuestion.answerIds = []
this.curQuestion = {
...this.testPaper[this.curIndex1]
}
this.testPaper[this.curIndex1].hadOpend = true
console.log('----------------', this.testPaper );
this.noAnswerList = this.getNoAnswerList()
this.haveAnswerList = this.gethaveAnswerList()
},
showNextQuestion() {
debounce(async () => {
// 下一题
this.curIndex1++
// this.curQuestion.answerIds = []
this.curQuestion = {
...this.testPaper[this.curIndex1]
}
this.testPaper[this.curIndex1].hadOpend = true
// console.log('+++++++++++++++', this.testPaper, );
this.noAnswerList = this.getNoAnswerList()
this.haveAnswerList = this.gethaveAnswerList()
},300)
},
clickOption(item, index) {
// debounce(async () => {
console.log('item', item, index, this.curIndex1);
if (this.curQuestion.type == 0) {
this.testPaper[this.curIndex1].answerIds = [item.id]
this.curQuestion.answerIds = [item.id]
// console.log('666666666', this.testPaper, this.curQuestion.answerIds);
this.$forceUpdate()
} else if (this.curQuestion.type == 1) {
console.log('多选');
var isIN = this.curQuestion.answerIds.findIndex(itemss => {
return itemss == item.id
})
if (isIN >= 0) {
console.log('有重复的,删除对应的', isIN);
this.testPaper[this.curIndex1].answerIds.splice(isIN, 1)
this.curQuestion.answerIds.splice(isIN, 1)
} else {
this.testPaper[this.curIndex1].answerIds.push(item.id)
this.curQuestion.answerIds = [...this.testPaper[this.curIndex1].answerIds]
}
}
this.noAnswerList = this.getNoAnswerList()
this.haveAnswerList = this.gethaveAnswerList()
console.log('this.testPaper.',this.testPaper.id);
this.saveQuestAnswer(this.examId,this.curIndex1+1,this.curQuestion.answerIds.join(','))
console.log('noAnswerList', this.noAnswerList)
// },300)
},
onPageJump(url, id) {
uni.navigateTo({
url: `${url}?id=${id}`,
});
},
setDesc() {
const letterArr = []
// 字母A的code值是65但因为已经到字母D了所以直接从69E开始循环
for (let i = 65; i < 91; i++) {
letterArr[i] = String.fromCharCode(i)
}
return letterArr
},
async getTestPage() {
uni.showLoading({
title: '正在生成试卷'
})
console.log('this.courseId',this.courseId);
await $http.request({
url: "common/classExam/generateExamPaper",
method: "POST",
data: {
// "classId":
"type":"2",//考试类型 1小班 2自考
"relationId": parseInt(this.courseId), //小班id、课程id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(async res => {
uni.hideLoading()
if (res.code == 0) {
// that.isHave = true
res.examPaper.forEach(item => {
item.answerIds = []
item.hadOpend = false // 是否呗打开过
var code = 0
item.options.forEach(item1 => {
const randomAbc = this.setDesc().splice(65)
item1.content = randomAbc[code] + '、' + item1.content
code++
})
})
this.testPaper = res.examPaper
this.examId = res.id
this.paperCreateTime = 1
this.endTime = res.planEndTime
var severNowTime = await this.getServerTime()
this.secondTimeDif = this.endTime - severNowTime // 时间差 毫秒
let that = this
if(this.secondTimeDif > 0){
this.timeDif.hour = parseInt((this.secondTimeDif % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
this.timeDif.minutes = parseInt((this.secondTimeDif % (1000 * 60 * 60)) / (1000 * 60))
this.timeDif.second = (this.secondTimeDif % (1000 * 60)) / 1000
console.log('this.endTime',this.timeDif.hour, this.timeDif.minutes, this.timeDif.second);
}else{
uni.showModal({
title:'提示',
content:'您的时间已经结束,即将返回课程页面',
confirmText:'好的',
showCancel:fals,
success: (res) => {
if(res.confirm){
that.goToClass()
}
}
})
}
this.curQuestion = {
...this.testPaper[this.curIndex1]
}
this.testPaper[this.curIndex1].hadOpend = true
uni.showToast({
title: '获取成功',
icon: 'success'
})
console.log(res, '试卷', this.curQuestion)
this.pagetitle = '正在考试'
} else {
uni.showToast({
title: res.errMsg,
icon: 'none',
duration: 3000
})
}
}).catch(e => {
uni.hideLoading()
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: e.errMsg,
icon: 'none',
duration: 3000
})
setTimeout(()=>{
this.goToClass()
},1000)
});
},
// 查询证书情况
async getCertificateInfo() {
var list = undefined
await $http.request({
url: "common/userCertificate/getUserCertificateList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"type": '', //证书类型A a证 B b证 ZK自考
"courseId": this.courseId //课程id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code != 0) {
uni.showToast({
title: res.errMsg,
icon: 'none'
})
return
}
if (res.code == 0) {
res.certificateList.forEach(item => {
item.certificateUrl && item.certificateUrl != '' ? item
.certificateUrlList = item.certificateUrl.split(',') : item
.certificateUrlList = []
})
list = res.certificateList
}
console.log('证书接口请求结果', res);
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: e.errMsg,
icon: 'none'
})
});
return list
},
giveZero() {
// 没有完成完成考试记为0分
},
showElart() {
// uni.showModal({
// title:'提示',
// content:"您还没有完成考试确定要离开吗离开后成绩会记为0分是否继续"
// })
},
goToClass() {
uni.navigateTo({
url: `/pages/course/courseDetail?id=${this.courseId}`
})
},
hidePopup() {
this.showPopup = false
this.showQuestIndex = false
},
clickIndex(val) {
this.curIndex1 = val - 1
console.log('val', val, this.curIndex1, this.testPaper.length);
for (var i = 0; i < this.curIndex1; i++) {
this.testPaper[i].hadOpend = true
}
this.curQuestion = this.testPaper[this.curIndex1]
this.testPaper[this.curIndex1].hadOpend = true
this.hidePopup()
this.noAnswerList = this.getNoAnswerList()
this.haveAnswerList = this.gethaveAnswerList()
},
hourUp(start,e) {
// 比现在多几个小时
// var end = Date.now()
var startTimeDate = new Date(start)
var startTime = startTimeDate.getTime();
var step = 1000 * 60 * 60 * e // 时间间隔
var interval = startTime + step; //开始 + 时长 = 结束的毫秒数
// var a = new Date(interval)
console.log('aaaaaaaaaa结束时间的毫秒数时间戳',interval);
return interval
},
}
}
</script>
<style lang="scss" scoped>
@import "@/style/mixin.scss";
.congritulations {
width: 120rpx;
height: 120rpx;
text-align: center;
margin: 10rpx auto;
display: block;
image {
width: 120rpx;
height: 120rpx;
}
}
.popup_box {
padding-bottom: 20rpx;
width: 85vw;
overflow: hidden;
position: relative;
height: auto;
.title {
font-family: PangMenZhengDaoBiaoTiTiMianFeiBan;
font-weight: normal;
font-size: 46rpx;
color: $themeColor;
background-color: #f5f5f5;
// line-height: 46rpx;
padding: 20rpx;
// border-leradius: 6px;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
.content {
font-size: 26rpx;
letter-spacing: 0.15rpx;
padding: 20rpx;
color: #3f3f3f;
.top {
margin: 30rpx 0;
}
.center {
line-height: 40rpx;
// padding:0 10rpx;
}
.bottom {
width: 100%;
margin-top: 60rpx;
font-size: 24rpx;
line-height: 26rpx;
color: #b0b0b0;
}
}
.button_box {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 20rpx;
.u-button {
margin-left: 40rpx;
}
.u-button:nth-child(1) {
margin-left: 0;
}
}
}
.questIndx { overflow: hidden;
margin-top: 20rpx;
margin-bottom: 20rpx;
span{padding: 20rpx 0; display: inline-block;}
.red{border-color: #f56c6c; color: #f56c6c;}
.green{
border-color: #67c23a; color: #67c23a;
}
text {
font-size: 28rpx;
background-color: #fff;
// padding: 6rpx 10rpx;
display: flex;
// justify-content: center;
border-radius: 10rpx;
// align-items: center;
width: 70rpx;
height: 70rpx;
line-height: 70rpx;
text-align: center;
border: 1px solid #eee;
}
.cur {
background-color: #409eff;
color: #fff;
}
}
.guanli {
padding: 40rpx;
max-height: 60vh;
overflow-y: scroll;
h3 {
text-align: center;
margin-bottom: 20rpx;
color: #333;
}
}
.tips {
background: #fbe8e8;
color: #f56c6c;
line-height: 50rpx;
font-size: 28rpx;
padding: 10rpx 20rpx;
text-align: justify;
}
.questionType {
position: absolute;
left: 0;
top: 20rpx;
background-color: $themeColor;
color: #fff;
padding: 10rpx 20rpx;
border-radius: 0 50rpx 50rpx 0;
}
.checkQuestBtn {
margin-left: 10rpx;
// position: absolute;
// right: 20rpx;
// top: 20rpx;
font-size: 28rpx;
// border: 1px solid $themeColor;
background-color: #409eff;
color: #fff;
// padding: 10rpx 20rpx;
// border-radius: 0 50rpx 50rpx 0;
}
// .checkQuestBtn {
// position: absolute;
// right: 20rpx;
// top: 20rpx;
// border: 1px solid $themeColor;
// color: $themeColor;
// // padding: 10rpx 20rpx;
// // border-radius: 0 50rpx 50rpx 0;
// }
.scroll-Y {
height: 300rpx;
}
.scroll-view_H {
white-space: nowrap;
width: 100%;
}
.scroll-view-item {
// height: 300rpx;
line-height: 300rpx;
text-align: center;
font-size: 36rpx;
}
.scroll-view-item_H {
display: inline-block;
width: 13%;
// height: 300rpx;
overflow: hidden;
// line-height: 300rpx;
text-align: center;
font-size: 36rpx;
}
.haveResult {
background-color: #fff;
padding: 20rpx;
text-align: center;
}
.scoreBox {
margin-top: 100rpx;
color: #333;
margin-bottom: 50rpx;
}
.score {
font-size: 50rpx;
}
.question {
padding: 20rpx;
padding-top: 100rpx;
background-color: #fff;
position: relative;
}
.optionsBox {
margin: 30rpx 0;
.item {
border: 1px solid #eee;
padding: 20rpx 16rpx;
margin-bottom: 16rpx;
}
.choosed {
border-color: #b3d8ff;
color: #409eff;
background-color: #ecf5ff;
}
.right {
border-color: #c2e7b0;
color: #67c23a;
background-color: #f0f9eb;
}
.wrong {
border-color: #fbc4c4;
color: #f56c6c;
background-color: #fef0f0;
}
}
.result_imgBox {
width: 100%;
image {
width: 100%;
height: 100%;
}
}
.timeBox {
background-color: #fff;
margin-bottom: 20rpx;
}
.questIndx {
.cur {
border-color:#409eff ;
background-color: #409eff;
color: #fff;
}
}
.questIndxPup{
justify-content: space-around;
flex-wrap: wrap;
text{
display: inline-block; margin: 10rpx;
}
}
.btnBox {
.item {
width: 40%;
display: flex;
justify-content: center;
}
}
</style>

View File

@@ -267,12 +267,13 @@
}); });
this.getOS() this.getOS()
// #endif // #endif
this.getCountyCode()
this.getSettlement()
}, },
//页面显示 //页面显示
onShow() { onShow() {
// this.closeMusic() // this.closeMusic()
this.getCountyCode()
this.getSettlement()
}, },
//方法 //方法

BIN
static/icon/notbuy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
static/icon/xunzhang.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
static/icon/yesbuy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -36,9 +36,19 @@ export const dispatchRequest = function(requestInfo) {
errMsg: "请求超时,请重新尝试", errMsg: "请求超时,请重新尝试",
statusCode: 0, statusCode: 0,
}); });
uni.navigateTo({ console.log('requestInfo.url',requestInfo.url);
url: "/pages/user/login" if(!requestInfo.url.includes('sociology/course/saveCoursePosition')){
}); uni.showToast({
title:'请求超时,请重新尝试',
icon:'none',
duration: 5000
})
}
// console.log('');
// uni.navigateTo({
// url: "/pages/user/login"
// });
} else { } else {
reject(err); reject(err);
} }

Binary file not shown.

Binary file not shown.