This commit is contained in:
@fawn-nine
2024-09-02 17:15:29 +08:00
parent b3bb29b36a
commit 9f265afa4a
8 changed files with 671 additions and 349 deletions

View File

@@ -6,8 +6,8 @@ if (process.env.NODE_ENV === 'development') {
// socketUrl = "ws://localhost:6001/";
// baseUrl = "https://twin-ui.com/demo/";
// baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
// baseUrl = "https://api.nuttyreading.com/"; // 线上正式
baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑
baseUrl = "https://api.nuttyreading.com/"; // 线上正式
// baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑
// baseUrl = "http://59.110.212.44:9200/pb/";
// baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑
// baseUrl = "http://192.168.110.110:9200/pb/";

View File

@@ -460,6 +460,7 @@
onShow() {
this.getClassInfo()
this.getScore()
},
computed: {
...mapState(["userInfo"]),
@@ -478,6 +479,32 @@
}
return _roleName
},
// 查询考试成绩
getPaperScore(){
console.log('获取卷面成绩');
// $http.request({
// url: "common/class/getUserRole",
// method: "POST",
// data: {
// "classId": this.classId
// },
// header: { //默认 无 说明:请求头
// 'Content-Type': 'application/json'
// },
// })
// .then((res) => {
// uni.hideLoading()
// console.log('res获取身份信息',res);
// this.roleCode = res.result
// }).catch(e => {
// uni.hideLoading()
// this.roleCode = []
// uni.showToast({
// title: '获取身份信息失败',
// icon: 'error'
// })
// });
},
tabList() {
var list = []
if (this.thisClass.state == 0) {
@@ -1050,6 +1077,9 @@
this.getList()
}
var dd = this.getBlankNumber
if(this.thisClass.state == '2'){ // 结班状态下再查询卷面成绩
this.getPaperScore()
}
}
uni.hideLoading()
}).catch(e => {

View File

@@ -5,7 +5,6 @@
<!-- <view class="curseSet" slot="right" @click="shuomingPage('/pages/course/courseSet',tagId,pid)">
<uni-icons type="info" size="24"></uni-icons>设置</view> -->
</z-nav-bar>
<!-- <view class="" style="background-color: #f4f7ff; min-height: calc(100vh - 200rpx);"> -->
<view class="mainContent" v-if="thisClass.id">
<!-- <view class="" style="height: 40rpx;"></view> -->
@@ -45,14 +44,16 @@
<!-- 已开班按钮 -->
<view class="optionsBtn" v-if="thisClass.state != '2'">
<!-- 待开班主任 -->
<view class="" v-if="thisClass.state == '0' && (roleCode.includes('主任') || roleCode.includes('副主任'))">
<view class=""
v-if="thisClass.state == '0' && (roleCode.includes('主任') || roleCode.includes('副主任'))">
<view class="item setBanewei" v-if="thisClass.state != '2'"
@click="goSetAdmin('/pages/miniClass/memberSet')">
<text>设置班委</text>
</view>
</view>
<!-- 待开班班长 -->
<view class="stepBox" v-if="thisClass.state == '0' && (roleCode.includes('1') || roleCode.includes('2'))">
<view class="stepBox"
v-if="thisClass.state == '0' && (roleCode.includes('1') || roleCode.includes('2'))">
<h3 class="PM_font threeStepTitle">快速开班流程</h3>
<view class="flex_box item">
<!-- <i class="PM_font stepItem">1.</i> -->
@@ -104,17 +105,20 @@
</view>
</view>
<view class="flex_box" v-if="thisClass.state == '1'">
<view class="item fabuhomework" @click="goTaskListForWait('0')" v-if="thisClass.state == '1' && classModel.isTask == 1">
<view class="item fabuhomework" @click="goTaskListForWait('0')"
v-if="thisClass.state == '1' && classModel.isTask == 1">
<text>作业列表</text>
</view>
<view class="item yianList" @click="goTaskListForWait('1')" v-if="thisClass.state == '1' && classModel.isMedicalcase == 1">
<view class="item yianList" @click="goTaskListForWait('1')"
v-if="thisClass.state == '1' && classModel.isMedicalcase == 1">
<text>医案列表</text>
</view>
<view class="item setBanewei" v-if="thisClass.state != '2'"
@click="goSetAdmin('/pages/miniClass/memberSet')">
<text>设置班委</text>
</view>
<view class="item overClass" @click="changeClassStatu('2')" v-if="thisClass.state == '1' && thisClass.showOverBtn && (roleCode.includes('1') || roleCode.includes('2'))">
<view class="item overClass" @click="changeClassStatu('2')"
v-if="thisClass.state == '1' && thisClass.showOverBtn && (roleCode.includes('1') || roleCode.includes('2'))">
<text>结班</text>
</view>
@@ -124,7 +128,8 @@
</view>
<!-- 作业批改 -->
<class-infoWork-blank v-if="thisClass.state != '0'" :thisClass="thisClass" :classModel="classModel" :roleCode="roleCode"></class-infoWork-blank>
<class-infoWork-blank v-if="thisClass.state != '0'" :thisClass="thisClass" :classModel="classModel"
:roleCode="roleCode"></class-infoWork-blank>
</view>
<view class="mainBox">
<view class="">
@@ -136,7 +141,8 @@
<view class="" v-if="tabId == '2'">
<view class="classMateBox" v-show="students.length> 0 ">
<view class="" style=" overflow: hidden;">
<uni-section class="mb-10 nobg xueyuanTitle" title="班内学员" type="line" sub-title=""> {{students.length}} 名学员</uni-section>
<uni-section class="mb-10 nobg xueyuanTitle" title="班内学员" type="line" sub-title="">
{{students.length}} 名学员</uni-section>
</view>
<view class="flex_box tips">
<view class="item flex_box">
@@ -153,8 +159,7 @@
</view>
</view>
<view class="newBox">
<view
:class="['item','flexbox',
<view :class="['item','flexbox',
item.student.vip == '1' ? 'superVip' : '',
item.student.vip == '2' ? 'wumenVip' : '',
item.student.vip == '3' ? 'zmVip' : '',
@@ -162,11 +167,13 @@
]" v-for="(item, index) in students" :key="index" @click="clickStudent(item)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="classmateImg">
<image v-if="item.student.avatar != null && item.student.avatar != ''" :src="item.student.avatar" mode="aspectFit"></image>
<image v-if="item.student.avatar != null && item.student.avatar != ''"
:src="item.student.avatar" mode="aspectFit"></image>
<image v-else src="/static/icon/morenAvavter.png" mode="aspectFit"></image>
</view>
<view :class="['textItems','flex_box']">
<text class="txt555" v-if="item.student.nickname != null && item.student.nickname != ''">
<text class="txt555"
v-if="item.student.nickname != null && item.student.nickname != ''">
{{item.student.nickname}}
<template>
<text>{{item.student.tel}}</text>
@@ -175,7 +182,8 @@
<text class="txt555" v-else>
匿名用户
</text>
<text @click.stop="outClass(item.student.id)" class="outBtn" v-if="thisClass.state != '2'">踢出班级</text>
<text @click.stop="outClass(item.student.id)" class="outBtn"
v-if="thisClass.state != '2'">踢出班级</text>
<!-- <text class="userType" v-if="item.student.vip == '1'">超级VIP用户</text>
<text class="userType" v-if="item.student.vip == '2' ">医学VIP用户</text>
<text class="userType" v-if="item.student.vip == '3' ">国学VIP用户</text> -->
@@ -193,19 +201,16 @@
<view class="itt" v-if="thisClass.state == 0">
<text class="ciyao">创建日期</text>
<text
class="mainTxt">{{thisClass.createTime.substring(0,10)}}</text>
<text class="mainTxt">{{thisClass.createTime.substring(0,10)}}</text>
</view>
<view class="itt" v-if="thisClass.state == 1">
<text class="ciyao">开班日期</text>
<text
class="mainTxt">{{thisClass.startTime.substring(0,10)}}</text>
<text class="mainTxt">{{thisClass.startTime.substring(0,10)}}</text>
</view>
<view class="itt" v-if="thisClass.state == 2">
<text class="ciyao">结班日期</text>
<text
class="mainTxt">{{thisClass.endTime.substring(0,10)}}</text>
<text class="mainTxt">{{thisClass.endTime.substring(0,10)}}</text>
</view>
<view class="itt"><text class="ciyao">班级类型</text>
<text class="mainTxt" v-if="classModel.type == '0'">普通小班</text>
@@ -219,7 +224,8 @@
<uni-icons type="eye" size="20" color="#333"></uni-icons>
</view>
</view> -->
<view><text class="ciyao">管理成员</text><text class="mainTxt" @click="seeManager">点击查看</text></view>
<view><text class="ciyao">管理成员</text><text class="mainTxt" @click="seeManager">点击查看</text>
</view>
</view>
<uni-section class="mb-10 nobg" title="教学目标/班级简介" type="line"></uni-section>
<rich-text class="banjiJianjie" :nodes="formatRichText(thisClass.content)"></rich-text>
@@ -285,7 +291,9 @@
</u-popup>
<u-popup key="2" v-if="showStudentBlank" :show="showStudentBlank" :round="10" @close="closePup" ref="">
<view class="upopBox" style="">
<h3 style="margin-bottom: 20rpx;">{{thisStudent.student.nickname != null && thisStudent.student.nickname != '' ? thisStudent.student.nickname : "匿名用户"}}</h3>
<h3 style="margin-bottom: 20rpx;">
{{thisStudent.student.nickname != null && thisStudent.student.nickname != '' ? thisStudent.student.nickname : "匿名用户"}}
</h3>
<view class="item">
<text><b>身份信息</b></text>
<text v-if="thisStudent.student.vip == '0'">普通用户</text>
@@ -309,7 +317,10 @@
</template>
<script>
import { ref, onMounted } from 'vue';
import {
ref,
onMounted
} from 'vue';
import classInfoWorkBlank from "@/components/classInfoWorkBlank.vue";
import $http from '@/config/requestConfig.js';
import {
@@ -342,13 +353,14 @@ import { ref, onMounted } from 'vue';
},
],
thisClass: {},
thisClass: {
showOverBtn: false
},
students: [],
tabId: '2',
curTagIndex: 0,
scrollable: false,
tabList: [
{
tabList: [{
name: '班内学员',
id: '2'
},
@@ -813,11 +825,12 @@ import { ref, onMounted } from 'vue';
} else if (statusCode == '2') {
var nowTime = Date.now()
var datecc = new Date(this.thisClass.endTime);
var time3 = datecc.getTime(); // 创建时间的时间戳 毫秒
console.log('datecc...',datecc,nowTime,time3)
if(nowTime < time3){
// var datecc = new Date(this.thisClass.endTime);
// console.log('datecc...',datecc,nowTime,time3)
var startTime = new Date(this.thisClass.startTime); // 开班时间
var time3 = startTime.getTime(); // 开班时间的时间戳 毫秒
var daysTime = parseInt(this.classModel.days) * 1000 * 60 * 60 * 24
if (nowTime < (time3 + daysTime)) {
uni.showModal({
title: "提示",
content: '是否要提前结班?',
@@ -881,8 +894,7 @@ import { ref, onMounted } from 'vue';
if (userId) {
_useId = userId
_txt = '即将踢出该学员,是否继续?'
}
else {
} else {
return
}
@@ -955,9 +967,10 @@ import { ref, onMounted } from 'vue';
// this.isHave = res.result.isJoin
this.thisClass = res.result.class
this.classModel = res.result.classModel
this.thisClass.showOverBtn = false
// this.thisClass.showOverBtn = false
if (this.thisClass.state == '1') {
const nowTime = Date.now()
// console.log('starting timer...毫秒',nowTime)
console.log('starting timer...毫秒', nowTime)
var datecc = new Date(this.thisClass.startTime);
console.log('datecc...', datecc)
var time3 = datecc.getTime(); // 开班时间的时间戳 毫秒
@@ -973,6 +986,9 @@ import { ref, onMounted } from 'vue';
console.log('不显示');
}
console.log('off70...天数', off70, off70miniSecond)
}
this.thisClass.homeWorkNumber = 4
if (res.result.classModel.days > 0) {
this.thisClass.homeWorkNumber = Math.ceil(res.result.classModel.days / 7)
@@ -1035,8 +1051,17 @@ import { ref, onMounted } from 'vue';
<style lang="scss" scoped>
@import "@/style/mixin.scss";
.upopBox{padding: 40rpx; max-height: 80vh; overflow-y:scroll; color: #666;
.item{padding: 10rpx 0; border-bottom: 1px solid #eee;}
.upopBox {
padding: 40rpx;
max-height: 80vh;
overflow-y: scroll;
color: #666;
.item {
padding: 10rpx 0;
border-bottom: 1px solid #eee;
}
}
.flexbox {
@@ -1048,6 +1073,7 @@ import { ref, onMounted } from 'vue';
padding: 20rpx 0;
color: #e58d44;
}
.dakai {
.item {
margin-bottom: 10rpx;
@@ -1056,11 +1082,17 @@ import { ref, onMounted } from 'vue';
color: #fff;
padding: 10rpx 6rpx;
border-radius: 6rpx;
text{padding-top: 0 !important;}
text {
padding-top: 0 !important;
}
}
.editClass {}
.delClass {}
}
::v-deep .uni-fab__content--other-platform,
::v-deep .uni-fab--rightBottom {
bottom: 100px !important;
@@ -1079,26 +1111,65 @@ import { ref, onMounted } from 'vue';
color: #fff;
font-weight: normal;
}
.threeStepTitle{font-weight: normal; margin-top: 30rpx; color: #55aa00; font-size:50rpx; margin-bottom: 20rpx;}
.stepItem{
font-size: 50rpx; color: #666; margin-right: 10rpx;
.threeStepTitle {
font-weight: normal;
margin-top: 30rpx;
color: #55aa00;
font-size: 50rpx;
margin-bottom: 20rpx;
}
.line1{margin: 20rpx 0; border-bottom: 1px solid #eee;}
.disableBtn{background-color: #9f9f9f !important;}
.stepItem {
font-size: 50rpx;
color: #666;
margin-right: 10rpx;
}
.line1 {
margin: 20rpx 0;
border-bottom: 1px solid #eee;
}
.disableBtn {
background-color: #9f9f9f !important;
}
.stepBox {
.item{ align-items: center;
.item {
align-items: center;
padding: 10rpx 0;
border-bottom: 1px solid #dddddd;
.textBox{color: #333 !important; text-align: left; margin-right: 10rpx; flex: 1;
text{font-size: 40rpx;color: #333; }
span{color: #999; font-size: 26rpx;}
.textBox {
color: #333 !important;
text-align: left;
margin-right: 10rpx;
flex: 1;
text {
font-size: 40rpx;
color: #333;
}
span {
color: #999;
font-size: 26rpx;
}
}
.btn {
text{padding: 0 20rpx;}
text {
padding: 0 20rpx;
}
}
.item:last-child{border: none !important;}
}
.item:last-child {
border: none !important;
}
}
.optionsBtn {
margin-bottom: 10rpx;
// border-bottom: 1px solid #eee;
@@ -1116,8 +1187,12 @@ import { ref, onMounted } from 'vue';
color: #fff;
padding: 20rpx 0;
border-radius: 6rpx;
text{padding-top: 0 !important;}
text {
padding-top: 0 !important;
}
}
.item:last-child {
margin-right: 0 !important;
}
@@ -1134,17 +1209,38 @@ import { ref, onMounted } from 'vue';
background-image: linear-gradient(-90deg, #258feb 0%, rgba(255, 255, 255, 0.1) 80%, rgba(255, 255, 255, 0) 100%);
}
.tips {
padding:20rpx 10rpx ; background-color: #eee; border-radius: 10rpx;
font-size: 24rpx; color: #666; margin: 20rpx 0; margin-bottom: 30rpx;
padding: 20rpx 10rpx;
background-color: #eee;
border-radius: 10rpx;
font-size: 24rpx;
color: #666;
margin: 20rpx 0;
margin-bottom: 30rpx;
.item{align-items: center;}
span{display: inline-block; margin-right: 10rpx; border-radius: 4rpx;; width: 30rpx; height: 30rpx; background-color: #fff; border: 1px solid #999;}
.item {
align-items: center;
}
span {
display: inline-block;
margin-right: 10rpx;
border-radius: 4rpx;
;
width: 30rpx;
height: 30rpx;
background-color: #fff;
border: 1px solid #999;
}
}
.daikaibtn {
.item{ padding: 10rpx 6rpx;}
.item {
padding: 10rpx 6rpx;
}
}
.xuexizhong {
background-image: linear-gradient(-90deg, #55aa00 0%, rgba(255, 255, 255, 0.1) 80%, rgba(255, 255, 255, 0) 100%);
}
@@ -1152,6 +1248,7 @@ import { ref, onMounted } from 'vue';
.yijieban {
background-image: linear-gradient(-90deg, #999 0%, rgba(255, 255, 255, 0.1) 80%, rgba(255, 255, 255, 0) 100%);
}
.delClass {
background-color: #ffa4a6;
}
@@ -1167,13 +1264,19 @@ import { ref, onMounted } from 'vue';
.editClass {
background-color: #35a6eb;
}
.fabuhomework {
background-color: #97a1ff;
}
.yianList{background-color: #55aa7f;}
.yianList {
background-color: #55aa7f;
}
.setBanewei {
background-color: #e7b772;
}
.courseBuyOrNo {
font-size: 28rpx;
border-top: 1px solid #eee;
@@ -1219,12 +1322,16 @@ import { ref, onMounted } from 'vue';
// }
}
.qrcode{width:100%;
.qrcode {
width: 100%;
image {
width: 200rpx;height: 200rpx;
width: 200rpx;
height: 200rpx;
}
}
.manBtnBox {
justify-content: center;
@@ -1302,10 +1409,19 @@ import { ref, onMounted } from 'vue';
.nobg {
background-color: transparent !important;
}
::v-deep .xueyuanTitle {
.uni-section-header{float: left;}
.uni-section-content{float: right; margin-top: 20rpx; font-size: 26rpx;}
.uni-section-header {
float: left;
}
.uni-section-content {
float: right;
margin-top: 20rpx;
font-size: 26rpx;
}
}
.bottomBox {
border-top: 1px solid #eee;
position: fixed;
@@ -1335,6 +1451,7 @@ import { ref, onMounted } from 'vue';
.classMateBox {
.zmVip {
background-image: linear-gradient(-60deg, #53966a 0%, #e1feef 50%, #e1feef 100%);
.outBtn {
color: #fff !important;
border: 1px solid #fff !important;
@@ -1343,6 +1460,7 @@ import { ref, onMounted } from 'vue';
.wumenVip {
background-image: linear-gradient(-60deg, #578df0 0%, #f1f4fd 50%, #f1f4fd 100%);
.outBtn {
color: #fff !important;
border: 1px solid #fff !important;
@@ -1351,6 +1469,7 @@ import { ref, onMounted } from 'vue';
.superVip {
background-image: linear-gradient(-60deg, #965af0 0%, #fdf0ed 50%, #fdf0ed 100%);
.outBtn {
color: #fff !important;
border: 1px solid #fff !important;
@@ -1360,6 +1479,7 @@ import { ref, onMounted } from 'vue';
.newBox {
flex-wrap: wrap;
}
.item {
width: 100%;
position: relative;
@@ -1368,13 +1488,15 @@ import { ref, onMounted } from 'vue';
width: 100%;
align-items: center;
justify-content: space-between;
.outBtn {
padding: 6rpx 10rpx;
display: inline-block;
border-radius: 10rpx;
color: $themeColor;
border: 1px solid $themeColor;
font-size: 26rpx; margin-left: 10rpx;
font-size: 26rpx;
margin-left: 10rpx;
}
.txt555 {
@@ -1392,7 +1514,10 @@ import { ref, onMounted } from 'vue';
}
}
.item.cur{border: 2px solid #55aa00;}
.item.cur {
border: 2px solid #55aa00;
}
}
.classmateImg {
@@ -1418,7 +1543,11 @@ import { ref, onMounted } from 'vue';
// background-color: #f4f7ff;
}
u-divider{font-size: 24rpx;}
u-divider {
font-size: 24rpx;
}
.newBox {
.item {
@@ -1490,7 +1619,11 @@ u-divider{font-size: 24rpx;}
border-radius: 20rpx;
justify-content: space-around;
margin: 20rpx 0;
.itt{margin: 0 20rpx;}
.itt {
margin: 0 20rpx;
}
text {
display: block;
font-size: 28rpx;

View File

@@ -138,9 +138,12 @@
getRoleName() {
var _roleName = ''
switch (this.roleCode) {
case '66':
case '主任':
_roleName = '主任';
break;
case '副主任':
_roleName = '副主任';
break;
case '0':
_roleName = '学员';
break;

View File

@@ -68,6 +68,7 @@
<view class="score noscore" v-else-if="item.scoreInfo != ''">
<text v-show="item.scoreInfos < 2 && item.haveGiveScore">等待其他评分员评分</text>
<text v-show="item.scoreInfos < 2 && !item.haveGiveScore && roleCode.includes('4')">请您评分</text>
<text v-show="item.scoreInfos < 2 && ( roleCode.includes('1') || roleCode.includes('1') || roleCode.includes('主任') || roleCode.includes('副主任'))">已开始评分</text>
<!-- <button v-show="item.scoreInfos >= 2" class="getScore" @click.stop="getRealScore(item.id)" >生成成绩</button> -->
</view>
<view class="score noscore" v-else>未开始评分</view>

View File

@@ -1,7 +1,35 @@
<template style="">
<view class="" style="background-color: #d4eaf0; min-height: calc(100vh); padding: 20rpx;">
<public-module></public-module>
<z-nav-bar title="正在考试"></z-nav-bar>
<z-nav-bar title="正在考试" backState="2000">
<text slot="right" style="padding-right: 20rpx; font-size: 26rpx; color: #666;" @click="showPopup = true">考试说明</text>
</z-nav-bar>
<!-- 有考试结果时候 -->
<template>
<view class="border_radius_10 haveResult">
<view class="scoreBox">
本次考试卷面成绩为<text class="score PM_font">90</text>
</view>
<view class="">
<button type="primary" @click="goToClass">返回班级</button>
</view>
<view class="result_imgBox">
<image src="../../static/jiesuan_Icon.jpg" mode="widthFix"></image>
</view>
</view>
</template>
<!-- 没有考试结果的时候 -->
<template>
<view class="tips border_radius_10">
<text>每位学员共有两次考试的机会考试成绩以两次成绩的最高分作为最终的卷面成绩请认真对待每次考试;<br/>
请在倒计时结束前完成答题倒计时结束后将自动交卷;<br/>
考试结束前中途离开视为放弃此次考试成绩为0分</text>
</view>
<view class="questIndx flex_between flex_box">
<text @click="prev"> << </text>
<text v-for="index of NowList" :key="index" >{{index}}</text>
<text @click="next"> >> </text>
</view>
<view style="padding: 20rpx; " class="timeBox border_radius_10 flex_box flex_between align-items_box" v-if="paperCreateTime > 0">
<!-- <view class=""> -->
<view class="">
@@ -12,7 +40,7 @@
剩余时间
</view>
<view class="">
<uni-countdown :font-size="20" :show-day="false" :hour="paperCreateTime" color="#ffaa7f" />
<uni-countdown @timeup="timeup" :font-size="20" :show-day="false" :hour="paperCreateTime" color="#ffaa7f" />
</view>
</view>
<!-- </view> -->
@@ -43,12 +71,23 @@
<button @click="showNextQuestion" type="primary" v-show="curIndex1 < testPaper.length-1" :disabled="curQuestion.answerIds.length == 0" size="mini">下一题</button>
</view>
</view>
<view class="" style="margin-top: 20rpx;" v-show="curIndex1 == testPaper.length-1">
<view class="" style="margin-top: 20rpx;" v-show="curIndex1 == testPaper.length-1 && !isOvertime">
<button @click="sumitAnswer" type="primary" > </button>
</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/>
请在倒计时结束前完成答题倒计时结束后将自动交卷;<br/>
考试结束前中途离开视为放弃此次考试成绩为0分</text>
</view>
</view>
</u-popup>
</view>
</template>
@@ -60,15 +99,20 @@
export default {
data() {
return {
showPopup:false,
code:0, // 英文code
classId:undefined,
testPaper:[],
curQuestion:{
answerIds:[]
},
result:{}, // 考试结果
curIndex1:0,
paperCreateTime:0,
examId:undefined
examId:undefined,
endTime:undefined, // 结束时间戳
isOvertime:false, // 是否超时
nowPart:1, // 段数
}
},
onLoad(e) {
@@ -79,10 +123,68 @@
this.getTestPage()
}
},
onHide(){
if(!this.isOvertime){}
},
onShow() {
this.endTime = this.hourUp(1)
console.log('this.endTime',this.endTime.getTime());
},
beforeDestroy() {
if(!this.isOvertime){ // 如果中途退出就把成绩记为0
this.giveZero()
}
},
computed: {
...mapState(["userInfo"])
...mapState(["userInfo"]),
NowList(){
var _list = []
console.log('this.nowPart * 8', this.nowPart);
var maxNumber = 0
var minNumber = 0
if(this.nowPart == 1){
maxNumber = this.nowPart + 8
minNumber = 1
}else{
minNumber = (this.nowPart - 1) * 8
maxNumber = this.nowPart * 8
}
for (var i = minNumber-1; i < maxNumber-1; i++) {
_list.push(i)
}
return _list
}
},
methods: {
prev(){
if(this.nowPart > 1){
this.nowPart--
}
},
next(){
if(this.nowPart < 12){
this.nowPart++
}
},
// 倒计时结束 (超时)
timeup(){
this.isOvertime = true
let that = this
uni.showModal({
title:'提示',
content:"考试结束您未在规定时间内交卷本次成绩为0分",
confirmText:'知道了',
showCancel:false,
success: (res) => {
if (res.confirm) {
that.goToClass()
}
}
})
},
// 获取交卷数据
sumitAnswer(){
var _newList = this.testPaper.map( item =>{
@@ -115,7 +217,7 @@
title:'交卷成功',
icon:'success'
})
this.isOvertime = true
}
}).catch(e => {
@@ -203,6 +305,8 @@
this.testPaper = res.examPaper
this.examId = res.id
this.paperCreateTime = 1
this.endTime = this.hourUp(1)
console.log('this.endTime',this.endTime);
this.curQuestion = {...this.testPaper[this.curIndex1] }
uni.showToast({
title: '获取成功',
@@ -224,15 +328,56 @@
})
});
},
giveZero(){
// 没有完成完成考试记为0分
},
showElart(){
// uni.showModal({
// title:'提示',
// content:"您还没有完成考试确定要离开吗离开后成绩会记为0分是否继续"
// })
},
goToClass(){
uni.navigateTo({
url:`/pages/miniClass/classInfo?id=${this.classId}`
})
},
hidePopup(){
this.showPopup = false
},
hourUp(e){
// 比现在多几个小时
var end = Date.now()
var start = 1000*60*60*e
var interval = end + start; //结束 - 开始 = 毫秒值
var a =new Date(interval)
return a
},
}
}
</script>
<style lang="scss" scoped>
@import "@/style/mixin.scss";
.questIndx{
text{padding: 6rpx 10rpx; display: flex; justify-content: center; border-radius: 10rpx; align-items: center; width: 60rpx; height: 60rpx; text-align: center; }
.cur{background-color: #409eff; color: #fff;}
}
.guanli {
padding: 40rpx;
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;
}
.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: 24rpx 20rpx; margin-bottom: 20rpx;}
@@ -242,6 +387,9 @@
border-color: #fbc4c4; color: #f56c6c; background-color: #fef0f0;
}
}
.result_imgBox{width: 100%;
image{width: 100%; height: 100%;}
}
.timeBox{background-color: #fff; margin-bottom: 20rpx;}
.btnBox{
.item{width:40%; display: flex; justify-content: center;}

View File

@@ -39,6 +39,10 @@
</div>
</view>
</view>
<view class="" @click="onPageJump('/pages/miniClass/test')" style="height: 100rpx; line-height: 100rpx; text-align: center;">
去考试页面
</view>
<view class="newLeve2">
<view class="home_nar nomargin" style="padding: 0; background-color: #fff;">
<view class="flexbox">
@@ -770,6 +774,9 @@
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.classItemBox {.jianjie{
@include bov(2);
}}
.nomargin{margin: 0 !important;}
.nopadding{padding: 0 !important;}
.noRadius{border-radius: 0 !important;}

BIN
static/jiesuan_Icon.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB