This commit is contained in:
@fawn-nine
2024-09-04 17:10:50 +08:00
parent 69cbc35e0a
commit a9f706e96f
11 changed files with 1491 additions and 569 deletions

View File

@@ -30,13 +30,13 @@
</view> </view>
<text>思考题评分</text> <text>思考题评分</text>
</view> </view>
<view :class="['item',blankNumber < 3 ? 'flex_box' : '']" @click="goSikaoList('/pages/miniClass/sikaoQuestionList', thisClass.id)" <!-- <view :class="['item',blankNumber < 3 ? 'flex_box' : '']" @click="goSikaoList('/pages/miniClass/sikaoQuestionList', thisClass.id)"
v-if="classModel.isExam == 1 && thisClass.state == '2'"> v-if="classModel.isExam == 1 && thisClass.state == '2'">
<view class="img"> <view class="img">
<image src="@/static/icon/teseIcon.png" mode="widthFix"></image> <image src="@/static/icon/teseIcon.png" mode="widthFix"></image>
</view> </view>
<text>考试评分</text> <text>考试评分</text>
</view> </view> -->
</view> </view>
</view> </view>
</view> </view>

View File

@@ -717,6 +717,13 @@
{ {
"navigationBarTitleText" : "考试页面" "navigationBarTitleText" : "考试页面"
} }
},
{
"path" : "pages/miniClass/paperBack",
"style" :
{
"navigationBarTitleText" : "查看答案页面"
}
} }
], ],
"globalStyle": { "globalStyle": {

View File

@@ -51,7 +51,7 @@
</view> </view>
</uni-forms-item> </uni-forms-item>
</view> </view>
<view class="input_box" v-if="form.type == 2"> <view class="input_box" v-if="false">
<radio-group @change="radioChange" class="flex_box"> <radio-group @change="radioChange" class="flex_box">
<view class="" style="margin-right:20rpx ;"> <view class="" style="margin-right:20rpx ;">
<radio value="0" :checked="0 == form.display" />他人不可见</label> <radio value="0" :checked="0 == form.display" />他人不可见</label>
@@ -133,7 +133,10 @@ import $http from '@/config/requestConfig.js';
console.log('收到的值', e); console.log('收到的值', e);
if(e.sort != 'undefined' && e.sort){ if(e.sort != 'undefined' && e.sort){
this.form.sort = e.sort this.form.sort = e.sort
} }
if(e.type = 2){
this.form.display = '0'
}
this.pageType = e.type this.pageType = e.type
this.form.classId = e.classId this.form.classId = e.classId
this.form.type = e.type this.form.type = e.type

View File

@@ -209,13 +209,13 @@
</view> </view>
</view> </view>
</view> </view>
<view class="" v-if="tijiaoTitleId == 2" style="margin: 20rpx 0;"> <view class="" v-if="tijiaoTitleId == 2 && false" style="margin: 20rpx 0;">
<radio-group @change="radioChange1" class="flex_box"> <radio-group @change="radioChange1" class="flex_box">
<view class="" style="margin-right:20rpx ;"> <view class="" style="margin-right:20rpx ;">
<radio value="0" checked="true" />全部同学的</label> <radio value="0" />全部同学的</label>
</view> </view>
<view class=""> <view class="">
<radio value="1" />只看我自己的</label> <radio value="1" checked="true" />只看我自己的</label>
</view> </view>
</radio-group> </radio-group>
</view> </view>
@@ -472,7 +472,7 @@
tijiaoTitleId: '0', tijiaoTitleId: '0',
taskList: [], // 任务列表 taskList: [], // 任务列表
taskHaveMore: false, // 是否还有更多 taskHaveMore: false, // 是否还有更多
myExperience: '0', myExperience: '1',
performanceScore: { performanceScore: {
task1Score: 0, task1Score: 0,
experienceScore: 0, experienceScore: 0,
@@ -833,7 +833,7 @@
console.log('e班内提交子按钮', this.tijiaoTitleId); console.log('e班内提交子按钮', this.tijiaoTitleId);
this.pPage = 0 this.pPage = 0
this.taskList = [] this.taskList = []
this.myExperience = 0 this.myExperience = '1'
this.getList() this.getList()
}, },
getUserInfo() { getUserInfo() {

View File

@@ -369,9 +369,9 @@
<view class="item"> <view class="item">
<text><b>电话</b>{{thisStudent.student.tel}}</text> <text><b>电话</b>{{thisStudent.student.tel}}</text>
</view> </view>
<view class="item"> <!-- <view class="item">
<b>课程购买情况</b><br />{{thisStudent.buyState}} <b>课程购买情况</b><br />{{thisStudent.buyState}}
</view> </view> -->
<view class="scoreBox flex_box flex_between border_radius_10 " > <view class="scoreBox flex_box flex_between border_radius_10 " >
<view class=""> <view class="">
<view class="ciyao"> <view class="ciyao">
@@ -407,11 +407,7 @@
></view> --> ></view> -->
</view> </view>
</view> </view>
</u-popup> </u-popup>
<!-- <view class="fabBox">
<uni-fab ref="fab" :pattern="pattern" :content="fabContent" :horizontal="horizontal" :vertical="vertical"
:direction="direction" @trigger="fabTrigger" @fabClick="fabClick" />
</view> -->
</view> </view>
</template> </template>
@@ -441,20 +437,7 @@
buttonColor: '#007AFF', buttonColor: '#007AFF',
iconColor: '#fff' iconColor: '#fff'
}, },
fabContent: [{
iconPath: '/static/icon/pigai2.png',
selectedIconPath: '/static/icon/pigai2.png',
text: '发布作业',
active: false
},
{
iconPath: '/static/icon/pigai1.png',
selectedIconPath: '/static/icon/pigai1.png',
text: '发布医案',
active: false
},
],
thisClass: { thisClass: {
showOverBtn: false showOverBtn: false
}, },
@@ -541,17 +524,17 @@
onLoad(e) { onLoad(e) {
uni.hideTabBar(); uni.hideTabBar();
this.classId = e.id this.classId = e.id
this.getRealRole()
this.interval = setInterval(() => { // this.interval = setInterval(() => {
if (this.thisClass.id) { // if (this.thisClass.id) {
uni.showLoading({ // uni.showLoading({
title: '加载中' // title: '加载中'
}) // })
this.getUserInfo() this.getUserInfo()
clearInterval(this.interval) // clearInterval(this.interval)
console.log('定时清了吗'); // console.log('定时清了吗');
} // }
}, 500) // }, 500)
}, },
onPullDownRefresh() { onPullDownRefresh() {
@@ -662,7 +645,7 @@
url: "common/class/getUserRole", url: "common/class/getUserRole",
method: "POST", method: "POST",
data: { data: {
"classId": this.thisClass.id "classId": this.classId
}, },
header: { //默认 无 说明:请求头 header: { //默认 无 说明:请求头
'Content-Type': 'application/json' 'Content-Type': 'application/json'
@@ -870,31 +853,7 @@
}, },
closeManager() { closeManager() {
this.showMan = false this.showMan = false
}, },
fabClick() {
// uni.showToast({
// title: '点击了悬浮按钮',
// icon: 'none'
// })
},
fabTrigger(e) {
console.log(e)
this.fabContent[e.index].active = !e.item.active
var _url = '/pages/miniClass/addHomeWork'
var _type = '0'
if (e.index == 0) {
// 发布作业/医案
_type = '0'
} else {
_type = '1'
}
this.$refs.fab.close()
setTimeout(() => {
uni.navigateTo({
url: `${_url}?classId=${this.thisClass.id}&type=${_type}`
})
}, 200)
},
// 获取固定作业的数量 // 获取固定作业的数量
async getHomeWorkLength() { async getHomeWorkLength() {
var list = [] var list = []
@@ -1639,6 +1598,7 @@
.item { .item {
border: 1px solid #fff; border: 1px solid #fff;
padding: 10rpx;
} }
} }
@@ -1860,14 +1820,14 @@
color: #666; color: #666;
font-size: 30rpx; font-size: 30rpx;
margin-top: 20rpx; margin-top: 20rpx;
} }
.zhengshu{width: 80rpx; height: 80rpx; background-size: contain;} .zhengshu{width: 80rpx; height: 80rpx; background-size: contain;}
.Azheng{background-image: url(@/static/icon/Az.png);} .Azheng{background-image: url(@/static/icon/Az.png);}
.Bzheng{background-image: url(@/static/icon/Bz.png);} .Bzheng{background-image: url(@/static/icon/Bz.png);}
.scoreBox{ .scoreBox{
align-items: center; align-items: center; border: 1px solid #f1f1f1;
margin-top: 20rpx; margin-top: 20rpx;
text-align: center; background-color: #fff; padding: 20rpx; text-align: center; background-color: #fff; padding: 10rpx 20rpx;
.ciyao{color: #999;} .ciyao{color: #999;}
.score{color: #258feb; font-weight: bold; font-size: 36rpx;} .score{color: #258feb; font-weight: bold; font-size: 36rpx;}
.seePaper{width: 50rpx; height: 50rpx; .seePaper{width: 50rpx; height: 50rpx;

View File

@@ -4,14 +4,12 @@
<z-nav-bar title="班级详情"></z-nav-bar> <z-nav-bar title="班级详情"></z-nav-bar>
<!-- <view class="" style="background-color: #f4f7ff; min-height: calc(100vh - 200rpx);"> --> <!-- <view class="" style="background-color: #f4f7ff; min-height: calc(100vh - 200rpx);"> -->
<view class="mainContent" v-if="thisClass.id"> <view class="mainContent" v-if="thisClass.id">
<!-- <view class="" style="height: 40rpx;">
</view> -->
<view :class="['classStatus', <view :class="['classStatus',
this.thisClass.state == 0 ? 'daikai' :'', thisClass.state == '0' ? 'daikai' :'',
this.thisClass.state == 1 ? 'xuexizhong' :'', thisClass.state == '1' ? 'xuexizhong' :'',
this.thisClass.state == 2 ? 'yijieban' :'' thisClass.state == '2' ? 'yijieban' :'',
thisClass.state == '3' ? 'kaoshizhou' :''
]"> ]">
{{getClassStatus}} {{getClassStatus}}
</view> </view>
@@ -24,7 +22,7 @@
<view class="waitOpen" v-if="thisClass.state == '0'"> <view class="waitOpen" v-if="thisClass.state == '0'">
<text>等待开班</text> <text>等待开班</text>
</view> </view>
<class-infoWork-blank v-else :thisClass="thisClass" :roleCode="roleCode"></class-infoWork-blank> <class-infoWork-blank v-else :thisClass="thisClass" :roleCode="roleCode" :classModel="classModel"></class-infoWork-blank>
</view> </view>
<view class="mainBox"> <view class="mainBox">
<view class=""> <view class="">
@@ -35,39 +33,113 @@
<!-- 学员列表 --> <!-- 学员列表 -->
<view class="" v-if="tabId == '2'"> <view class="" v-if="tabId == '2'">
<view class="classMateBox" v-show="students.length> 0 "> <view class="classMateBox" v-show="students.length> 0 ">
<uni-section class="mb-10 nobg xueyuanTitle" title="班内学员" type="line" sub-title=""> <view class="" style=" overflow: hidden;">
{{students.length}} 名学员</uni-section> <uni-section class="mb-10 nobg xueyuanTitle" title="班内学员" type="line" sub-title="">
{{students.length}} 名学员</uni-section>
</view>
<view class=" tips">
<view class="flex_box">
<view class="item flex_box">
<span class=""></span><text>普通用户</text>
</view>
<view class="item flex_box">
<span class="superVip"></span><text>超级VIP</text>
</view>
<view class="item flex_box">
<span class="wumenVip"></span><text>医学VIP</text>
</view>
<view class="item flex_box">
<span class="zmVip"></span><text>国学VIP</text>
</view>
</view>
<view v-if="thisClass.state == '2'" class=" zhiliang flex_box flex_between align-items_box" style="margin-top: 20rpx;">
<view class="">
<text>A证</text>
<text>20 </text>
</view>
<view class="">
<text>B证</text>
<text>20 </text>
</view>
<view class="">
<text>不合格</text>
<text>20 </text>
</view>
</view>
</view>
<view class="newBox"> <view class="newBox">
<view :class="['item','flexbox', <view :class="['item',
item.student.vip == '1' ? 'superVip' : '', item.student.vip == '1' ? 'superVip' : '',
item.student.vip == '2' ? 'wumenVip' : '', item.student.vip == '2' ? 'wumenVip' : '',
item.student.vip == '3' ? 'zmVip' : '', item.student.vip == '3' ? 'zmVip' : '',
thisStudent.student && thisStudent.student.id == item.student.id ? 'cur' : '' thisStudent.student && thisStudent.student.id == item.student.id ? 'cur' : ''
]" v-for="(item, index) in students" :key="index" @click="clickStudent(item)"> ]" v-for="(item, index) in students" :key="index" @click="clickStudent(item)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> --> <!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="classmateImg"> <view class="flexbox align-items_box">
<image v-if="item.student.avatar != null && item.student.avatar != ''" <view class="classmateImg">
:src="item.student.avatar" mode="aspectFit"></image> <image v-if="item.student.avatar != null && item.student.avatar != ''"
<image v-else src="/static/icon/morenAvavter.png" mode="aspectFit"></image> :src="item.student.avatar" mode="aspectFit"></image>
</view> <image v-else src="/static/icon/morenAvavter.png" mode="aspectFit"></image>
<view :class="['textItems','flex_box']"> </view>
<text class="txt555" <view :class="['textItems','flex_box']">
v-if="item.student.nickname != null && item.student.nickname != ''"> <text class="txt555"
{{item.student.nickname}} v-if="item.student.nickname != null && item.student.nickname != ''">
<template> {{item.student.nickname}}
<text>{{item.student.tel}}</text> <template>
</template> <text>{{item.student.tel}}</text>
</template>
</text> </text>
<text class="txt555" v-else> <text class="txt555" v-else>
匿名用户 匿名用户
</text> </text>
<!-- <text class="userType" v-if="item.student.vip == '1'">超级VIP用户</text> <text @click.stop="outClass(item.student.id)" class="outBtn"
v-if="thisClass.state != '2' && thisClass.state != '3'">踢出班级</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 == '2' ">医学VIP用户</text>
<text class="userType" v-if="item.student.vip == '3' ">国学VIP用户</text> --> <text class="userType" v-if="item.student.vip == '3' ">国学VIP用户</text> -->
</view>
</view>
<view class="" v-if="thisClass.state == '3' || thisClass.state == '2'">
<view class="scoreBox flex_box flex_between border_radius_10 ">
<view class="">
<view class="ciyao">
平时成绩
</view>
<text class="score">{{item.student.score.peacetimeScore}}</text>
</view>
<template v-if="classModel.isExam == 1">
<template v-if="item.student.score.testScore.length == 0">
<view class="" v-if="thisClass.state == '3'">
<view class="" style="color: #ff9496;">
未考试
</view>
</view>
<view class="" v-if="thisClass.state == '2'">
<view class="ciyao">
考试成绩
</view>
<text class="score">0</text>
</view>
</template>
<template v-else >
<view class="" v-if="thisClass.state == '3'">
<view class="" style="color: #55aa7f;">
等待公布分数
</view>
</view>
<view v-if="thisClass.state == '2'">
<view class="ciyao">
考试成绩
</view>
<text class="score">{{item.student.score.testScoreNumber}}</text>
</view>
</template>
</template>
<!-- -->
<view v-if="classModel.isExam == 1 && thisClass.state == '2'" :class="['PM_font','zhengshu',item.student.score.certificateType == 'A' ? 'Azheng' : 'Bzheng']"
></view>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
@@ -77,18 +149,18 @@
</view> </view>
<view class="" v-if="tabId == '0'"> <view class="" v-if="tabId == '0'">
<view class="otherItems flex_box"> <view class="otherItems flex_box">
<view class="itt" v-if="thisClass.state == 0"> <view class="itt" v-if="thisClass.state == '0'">
<text class="ciyao">创建日期</text> <text class="ciyao">创建日期</text>
<text <text
class="mainTxt">{{thisClass.createTime.substring(0,10)}}</text> class="mainTxt">{{thisClass.createTime.substring(0,10)}}</text>
</view> </view>
<view class="itt" v-if="thisClass.state == 1"> <view class="itt" v-if="thisClass.state == '1' || thisClass.state == '3'">
<text class="ciyao">开班日期</text> <text class="ciyao">开班日期</text>
<text <text
class="mainTxt">{{thisClass.startTime.substring(0,10)}}</text> class="mainTxt">{{thisClass.startTime.substring(0,10)}}</text>
</view> </view>
<view class="itt" v-if="thisClass.state == 2"> <view class="itt" v-if="thisClass.state == '2'">
<text class="ciyao">结班日期</text> <text class="ciyao">结班日期</text>
<text <text
class="mainTxt">{{thisClass.endTime.substring(0,10)}}</text> class="mainTxt">{{thisClass.endTime.substring(0,10)}}</text>
@@ -184,19 +256,51 @@
<view class="item"> <view class="item">
<text><b>电话</b>{{thisStudent.student.tel}}</text> <text><b>电话</b>{{thisStudent.student.tel}}</text>
</view> </view>
<view class="item"> <!-- <view class="item">
<b>课程购买情况</b><br />{{thisStudent.buyState}} <b>课程购买情况</b><br />{{thisStudent.buyState}}
</view> -->
<view class="scoreBox flex_box flex_between border_radius_10 " >
<view class="">
<view class="ciyao">
平时成绩
</view>
<text class="score">{{thisStudent.student.score.peacetimeScore}}</text>
</view>
<template v-if="classModel.isExam == 1">
<template v-if="thisStudent.student.score.testScore.length == 0">
<view class="">
<view class="">
未参加考试
</view>
</view>
</template>
<template v-else >
<view class="" v-for="(item1, index1) in thisStudent.student.score.testScore">
<view class="ciyao">
{{index1 == 0 ? '一' : '二'}}次考试成绩
</view>
<view class="flex_box flex_center" @click.stop="seePaper(item1.testPaperId)">
<text class="score">{{item1.score}}</text>
<view class="seePaper">
<image src="../../static/icon/testPaperIcon.png" mode="widthFix" ></image>
</view>
</view>
</view>
</template>
</template>
<!-- && thisClass.state == '2' -->
<!-- <view v-if="classModel.isExam == 1" :class="['PM_font','zhengshu',thisStudent.student.score.certificateType == 'A' ? 'Azheng' : 'Bzheng']"
></view> -->
</view> </view>
</view> </view>
</u-popup> </u-popup>
<!-- <view class="fabBox">
<uni-fab ref="fab" :pattern="pattern" :content="fabContent" :horizontal="horizontal" :vertical="vertical"
:direction="direction" @trigger="fabTrigger" @fabClick="fabClick" />
</view> -->
</view> </view>
</template> </template>
<script> <script>
const classData = require('@/data/classInfoMan.json')
const studentList = require('@/data/manStudentsList.json')
import classInfoWorkBlank from "@/components/classInfoWorkBlank.vue"; import classInfoWorkBlank from "@/components/classInfoWorkBlank.vue";
import $http from '@/config/requestConfig.js'; import $http from '@/config/requestConfig.js';
import { import {
@@ -214,20 +318,7 @@
selectedColor: '#7A7E83', selectedColor: '#7A7E83',
buttonColor: '#007AFF', buttonColor: '#007AFF',
iconColor: '#fff' iconColor: '#fff'
}, },
fabContent: [{
iconPath: '/static/icon/pigai2.png',
selectedIconPath: '/static/icon/pigai2.png',
text: '发布作业',
active: false
},
{
iconPath: '/static/icon/pigai1.png',
selectedIconPath: '/static/icon/pigai1.png',
text: '发布医案',
active: false
},
],
thisClass: {}, thisClass: {},
students: [], students: [],
@@ -296,7 +387,7 @@
taskHaveMore: false, // 是否还有更多 taskHaveMore: false, // 是否还有更多
roleCode: [], // 角色数组 roleCode: [], // 角色数组
interval: null, interval: null,
homeWorkList: [], // homeWorkList: [],
thisStudent: {}, thisStudent: {},
showStudentBlank: false, showStudentBlank: false,
} }
@@ -304,17 +395,17 @@
onLoad(e) { onLoad(e) {
uni.hideTabBar(); uni.hideTabBar();
this.classId = e.id this.classId = e.id
this.getRealRole()
this.interval = setInterval(() => { // this.interval = setInterval(() => {
if (this.thisClass.id) { // if (this.thisClass.id) {
uni.showLoading({ // uni.showLoading({
title: '加载中' // title: '加载中'
}) // })
this.getUserInfo() this.getUserInfo()
clearInterval(this.interval) // clearInterval(this.interval)
console.log('定时清了吗'); // console.log('定时清了吗');
} // }
}, 500) // }, 500)
}, },
onPullDownRefresh() { onPullDownRefresh() {
@@ -382,6 +473,9 @@
case '2': case '2':
_roleName = '已结班'; _roleName = '已结班';
break; break;
case '3':
_roleName = '考试周';
break;
} }
return _roleName return _roleName
} }
@@ -414,7 +508,7 @@
url: "common/class/getUserRole", url: "common/class/getUserRole",
method: "POST", method: "POST",
data: { data: {
"classId": this.thisClass.id "classId": this.classId
}, },
header: { //默认 无 说明:请求头 header: { //默认 无 说明:请求头
'Content-Type': 'application/json' 'Content-Type': 'application/json'
@@ -422,7 +516,7 @@
}) })
.then((res) => { .then((res) => {
uni.hideLoading() uni.hideLoading()
console.log('res获取身份信息', this.thisClass.id, res); console.log('res获取身份信息', res);
this.roleCode = res.result this.roleCode = res.result
}).catch(e => { }).catch(e => {
uni.hideLoading() uni.hideLoading()
@@ -543,10 +637,8 @@
if (this.userInfo.id != undefined) { if (this.userInfo.id != undefined) {
this.$http.post("common/user/getUserInfo").then((res) => { this.$http.post("common/user/getUserInfo").then((res) => {
uni.hideLoading() uni.hideLoading()
this.userMes = res.result; this.userMes = res.result;
this.isMonitor = res.isMonitor // this.getRealRole()
this.isDirector = res.isDirector
this.getRealRole()
}).catch(e => { }).catch(e => {
uni.hideLoading() uni.hideLoading()
@@ -618,122 +710,7 @@
closeManager() { closeManager() {
this.showMan = false this.showMan = false
}, },
fabClick() {
// uni.showToast({
// title: '点击了悬浮按钮',
// icon: 'none'
// })
},
fabTrigger(e) {
console.log(e)
this.fabContent[e.index].active = !e.item.active
var _url = '/pages/miniClass/addHomeWork'
var _type = '0'
if (e.index == 0) {
// 发布作业/医案
_type = '0'
} else {
_type = '1'
}
this.$refs.fab.close()
setTimeout(() => {
uni.navigateTo({
url: `${_url}?classId=${this.thisClass.id}&type=${_type}`
})
}, 200)
},
// 获取固定作业的数量
async getHomeWorkLength() {
var list = []
await $http.request({
url: "common/class/getClassTaskList",
method: "POST",
data: {
"limit": 100,
"page": 1,
"classId": this.thisClass.id,
"type": "0", //类型 0班内任务1医案2心得
"title": ""
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
}
}).then((res) => {
// console.log('班内作业的输俩个',res);
if (res.code == 0) {
list = res.page.records
}
}).catch(e => {
list = []
console.log('e', e);
})
return list
},
// 改变班级状态
changeClassStatu(statusCode) {
// var mm = 0
// mm = await this.getHomeWorkLength()
let that = this
if (statusCode == '1') {
console.log('this.admins', this.admins);
if (this.homeWorkList.length == 0) {
uni.showToast({
title: '开班前请发布班内作业,开班后将不可添加和更改',
icon: 'none',
duration: 3000
})
return
}
if (this.students.length < this.thisClass.number) {
uni.showModal({
title: "提示",
content: '班内成员还没有招满,确定开班操作吗?',
success(res) {
if (res.confirm) {
that.opClass(statusCode)
} else {
return
}
},
})
}
} else {
that.opClass(statusCode)
}
},
// 班级操作
opClass(statusCode) {
$http.request({
url: "common/class/editClass",
method: "POST",
data: {
"id": this.thisClass.id,
"title": this.thisClass.title,
"qrcode": this.thisClass.qrcode,
"state": statusCode, //小班状态0待开班1已开班2完成
"icon": this.thisClass.icon,
"content": this.thisClass.content,
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
// that.isHave = true
uni.showToast({
title: '操作成功',
icon: 'success'
})
setTimeout(() => {
this.getClassInfo()
}, 500)
}
}).catch(e => {
console.log(e, '数据报错')
});
},
taskEdit(item) { taskEdit(item) {
console.log('taskEdit'.item); console.log('taskEdit'.item);
}, },
@@ -742,6 +719,19 @@
url: `/pages/miniClass/classCaskList?id=${this.thisClass.id}&type=${this.tijiaoTitleId}` url: `/pages/miniClass/classCaskList?id=${this.thisClass.id}&type=${this.tijiaoTitleId}`
}) })
}, },
// 考试周和结班状态下,学员的信息
async getStudentScoreList() {
var list = undefined
await this.$http
.post('book/user/info/' + this.userInfo.id)
.then(res => {
// this.userMsg = res.user
list = studentList
}).catch(e => {
list = []
});
return list
},
async getClassInfo() { async getClassInfo() {
uni.showLoading({ uni.showLoading({
title: '正在加载' title: '正在加载'
@@ -760,8 +750,18 @@
console.log('res--------', this.classId, res, ); console.log('res--------', this.classId, res, );
this.refresh = false this.refresh = false
if (res.code == 0) { if (res.code == 0) {
res = classData // 测试数据
this.isHave = res.result.isJoin this.isHave = res.result.isJoin
this.thisClass = res.result.class this.thisClass = res.result.class
if (!this.showAlert && this.thisClass.state == '3') {
uni.showModal({
title: '提示',
content: '您好,当前教学进度已进入考试周,请完成平时成绩打分,考试周结束后将无法评分,感谢您对吴门医述教务的大力支持。',
confirmText: '好的',
showCancel: false
})
this.showAlert = true
}
this.admins.list = res.result.admins this.admins.list = res.result.admins
this.admins.monitor = {} this.admins.monitor = {}
this.admins.dmonitor = {} this.admins.dmonitor = {}
@@ -793,11 +793,14 @@
this.classModel = res.result.classModel this.classModel = res.result.classModel
this.courses = res.result.courses this.courses = res.result.courses
this.students = res.result.students if (this.thisClass.state == '3' || this.thisClass.state == '2') {
this.refresh = true // 考试周 结班状态下的
if (this.thisClass.state == 0) { this.students = await this.getStudentScoreList()
this.homeWorkList = await this.getHomeWorkLength() // console.log('students', this.students);
} else {
this.students = res.result.students
} }
this.refresh = true
} }
uni.hideLoading() uni.hideLoading()
@@ -920,7 +923,9 @@
.xuexizhong { .xuexizhong {
background-image: linear-gradient(-90deg, #55aa00 0%, rgba(255, 255, 255, 0.1) 80%, rgba(255, 255, 255, 0) 100%); background-image: linear-gradient(-90deg, #55aa00 0%, rgba(255, 255, 255, 0.1) 80%, rgba(255, 255, 255, 0) 100%);
} }
.kaoshizhou {
background-image: linear-gradient(-90deg, #ffaa00 0%, rgba(255, 255, 255, 0.1) 80%, rgba(255, 255, 255, 0) 100%);
}
.yijieban { .yijieban {
background-image: linear-gradient(-90deg, #999 0%, rgba(255, 255, 255, 0.1) 80%, rgba(255, 255, 255, 0) 100%); background-image: linear-gradient(-90deg, #999 0%, rgba(255, 255, 255, 0.1) 80%, rgba(255, 255, 255, 0) 100%);
} }
@@ -1102,7 +1107,33 @@
background-image: linear-gradient(30deg, #d4eaf0 0%, #d4eaf0 50%, #fdf0ed 100%); background-image: linear-gradient(30deg, #d4eaf0 0%, #d4eaf0 50%, #fdf0ed 100%);
min-height: 100vh; min-height: 100vh;
} }
.zhiliang{
font-size: 28rpx;
}
.tips {
padding: 20rpx 10rpx;
background-color: #fff;
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;
}
}
.classMateBox { .classMateBox {
.zmVip { .zmVip {
background-image: linear-gradient(-60deg, #53966a 0%, #e1feef 50%, #e1feef 100%); background-image: linear-gradient(-60deg, #53966a 0%, #e1feef 50%, #e1feef 100%);
@@ -1350,7 +1381,19 @@
font-size: 30rpx; font-size: 30rpx;
margin-top: 20rpx; margin-top: 20rpx;
} }
.zhengshu{width: 80rpx; height: 80rpx; background-size: contain;}
.Azheng{background-image: url(@/static/icon/Az.png);}
.Bzheng{background-image: url(@/static/icon/Bz.png);}
.scoreBox{
align-items: center; border: 1px solid #f1f1f1;
margin-top: 20rpx;
text-align: center; background-color: #fff; padding: 10rpx 20rpx;
.ciyao{color: #999; font-size: 28rpx;}
.score{color: #258feb; font-weight: bold; font-size: 36rpx;}
.seePaper{width: 50rpx; height: 50rpx;
image{width: 100%; height: 100%;}
}
}
.className { .className {
padding: 30rpx 0; padding: 30rpx 0;
position: relative; position: relative;

View File

@@ -0,0 +1,616 @@
<template style="">
<view class="" style="background-color: #d4eaf0; min-height: calc(100vh); padding: 20rpx;">
<public-module></public-module>
<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 style="padding: 20rpx; " class="timeBox border_radius_10 flex_box flex_between align-items_box"
v-if="paperCreateTime > 0">
<!-- <view class=""> -->
<view class="">
<text><i style="color: #00aaff; font-style: normal; margin-right: 10rpx;" class="">{{curIndex1+1}}
</i> / {{testPaper.length}}</text>
</view>
<view class="flex_box align-items_box">
<view class="">
剩余时间
</view>
<view class="">
<uni-countdown @timeup="timeup" :font-size="20" :show-day="false" :hour="paperCreateTime"
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>
<view class="questionItem" v-if="curQuestion.id">
<view class="">
<text>{{curQuestion.content}}</text>
</view>
<!-- <view class="">
{{curQuestion}}-{{curIndex1}}
</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">
<button @click="showNextQuestion" type="primary"
:disabled="curIndex1 == testPaper.length-1" size="mini">下一题</button>
</view>
</view>
<!-- v-show="curIndex1 == testPaper.length-1 && !isOvertime" -->
<view class="" style="margin-top: 20rpx;"
>
<button @click="sumitAnswer" type="primary"> </button>
</view>
</view>
<view class="questIndx ">
<view class="" style="text-align: center; font-size: 24rpx; color: #666;">
<span>题目索引</span>
</view>
<scroll-view class="scroll-view_H" scroll-x="true">
<view class="scroll-view-item_H" v-for="index of getallLIst" :key="index">
<text @click="clickIndex(index)"
:class="[ haveAnswerList.includes(index-1) ? 'green' : '', noAnswerList.includes(index-1) ? 'red' : '',(curIndex1+1) == index ? 'cur' :'']">{{index}}</text>
</view>
</scroll-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>
<script>
const paperBack = require('@/data/paperBack.json')
import $http from '@/config/requestConfig.js';
import {
mapState
} from "vuex";
export default {
data() {
return {
showPopup: false,
code: 0, // 英文code
classId: undefined,
testPaper: [],
curQuestion: {
answerIds: []
},
result: {}, // 考试结果
curIndex1: 0,
paperCreateTime: 0,
examId: undefined,
endTime: undefined, // 结束时间戳
isOvertime: false, // 是否超时
step: 8, /// 步长
// questIndexList: [],
nowPart: 1,
maxNumber: 0,
minNumber: 0,
noAnswerList: [],
haveAnswerList:[]
}
},
async onLoad(e) {
console.log('收到得值');
this.classId = e.classId
if (this.testPaper.length == 0) {
this.getTestPage()
}
// this.questIndexList = await this.getNowList('add')
},
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(100).keys(), n => n + 1);
console.log('numbers', numbers);
return numbers
}
},
methods: {
// 单个题的提交
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.curIndex1; i++) {
if (this.testPaper[i].answerIds.length == 0) {
console.log('fuhe?');
list.push(i)
}
}
}
return list
},
gethaveAnswerList() {
var list = []
if (this.curIndex1 > 0) {
for (var i = 0; i < this.curIndex1; i++) {
if (this.testPaper[i].answerIds.length > 0) {
console.log('fuhe?');
list.push(i)
}
}
}
return list
},
// 倒计时结束 (超时)
timeup() {
this.isOvertime = true
this.sumitAnswer()
let that = this
uni.showModal({
title: '提示',
content: "考试结束,系统已为您自动交卷",
confirmText: '知道了',
showCancel: false,
success: (res) => {
if (res.confirm) {
// that.goToClass()
}
}
})
},
// 获取交卷数据
sumitAnswer() {
// var list = []
// var _newList = this.testPaper.map(item => {
// return item.answerIds
// })
// _newList = _newList.map(item => {
// return item.join(',')
// })
// console.log('_newList', _newList);
// list = _newList
// return list
this.sumbitPaper()
},
// q请求提交试卷
sumbitPaper(ids) {
$http.request({
url: "common/classExam/submitExamPaper",
method: "POST",
data: {
id: this.examId
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
uni.hideLoading()
if (res.code == 0) {
uni.showToast({
title: '交卷成功',
icon: 'success'
})
this.isOvertime = true
}
}).catch(e => {
uni.hideLoading()
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: e.errorMsg,
icon: 'error'
})
});
},
showPrevQuestion() {
// 上一题
this.curIndex1--
// this.curQuestion.answerIds = []
this.curQuestion = {
...this.testPaper[this.curIndex1]
}
console.log('----------------', this.testPaper );
// this.haveAnswerList = this.gethaveAnswerList()
},
showNextQuestion() {
// 下一题
this.curIndex1++
// this.curQuestion.answerIds = []
this.curQuestion = {
...this.testPaper[this.curIndex1]
}
console.log('+++++++++++++++', this.testPaper, );
this.haveAnswerList = this.gethaveAnswerList()
},
clickOption(item, index) {
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)
},
setDesc() {
const letterArr = []
// 字母A的code值是65但因为已经到字母D了所以直接从69E开始循环
for (let i = 65; i < 91; i++) {
letterArr[i] = String.fromCharCode(i)
}
return letterArr
},
getTestPage() {
uni.showLoading({
title: '正在生成试卷'
})
$http.request({
url: "common/classExam/generateExamPaper",
method: "POST",
data: {
"classId": this.classId
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
uni.hideLoading()
if (res.code == 0) {
// that.isHave = true
res.examPaper.forEach(item => {
item.answerIds = []
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 = this.hourUp(1)
console.log('this.endTime', this.endTime);
this.curQuestion = {
...this.testPaper[this.curIndex1]
}
uni.showToast({
title: '获取成功',
icon: 'success'
})
console.log(res, '试卷', this.curQuestion)
// setTimeout(() => {
// this.getClassInfo()
// }, 500)
} 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
})
});
},
giveZero() {
// 没有完成完成考试记为0分
},
showElart() {
// uni.showModal({
// title:'提示',
// content:"您还没有完成考试确定要离开吗离开后成绩会记为0分是否继续"
// })
},
goToClass() {
uni.navigateTo({
url: `/pages/miniClass/classInfo?id=${this.classId}`
})
},
hidePopup() {
this.showPopup = false
},
clickIndex(val) {
this.curIndex1 = val - 1
console.log('val', val, this.curIndex1, this.testPaper.length);
this.curQuestion = this.testPaper[this.curIndex1]
this.noAnswerList = this.getNoAnswerList()
this.haveAnswerList = this.gethaveAnswerList()
},
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 { 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 {
background-color: #fff;
padding: 6rpx 10rpx;
display: flex;
justify-content: center;
border-radius: 10rpx;
align-items: center;
width: 60rpx;
height: 60rpx;
text-align: center;
border: 1px solid #eee;
}
.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;
}
.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: 24rpx 20rpx;
margin-bottom: 20rpx;
}
.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 {
background-color: #409eff;
color: #fff;
}
}
.btnBox {
.item {
width: 40%;
display: flex;
justify-content: center;
}
}
</style>

View File

@@ -33,7 +33,7 @@
<!-- 提交记录 --> <!-- 提交记录 -->
<view v-show="thisTask.reply"> <view v-show="thisTask.reply">
<uni-section class="mb-10 nobg" title="提交记录" type="line"></uni-section> <uni-section class="mb-10 nobg" title="提交记录" type="line"></uni-section>
<view class=""> <view class="" v-if="thisTask.type == '1'">
<radio-group @change="radioChange1" class="flex_box"> <radio-group @change="radioChange1" class="flex_box">
<view class="" style="margin-right:20rpx ;"> <view class="" style="margin-right:20rpx ;">
<radio value="0" />全部同学的提交</label> <radio value="0" />全部同学的提交</label>
@@ -124,7 +124,7 @@
<!-- <input type="password" maxlength="8" v-model="confirmPassword" placeholder="请确认密码" /> --> <!-- <input type="password" maxlength="8" v-model="confirmPassword" placeholder="请确认密码" /> -->
</view> </view>
<view class="input_box"> <view class="input_box" v-if="thisTask.type == '1'">
<radio-group @change="radioChange" class="flex_box"> <radio-group @change="radioChange" class="flex_box">
<view class="" style="margin-right:20rpx ;"> <view class="" style="margin-right:20rpx ;">
<radio value="0" :checked="0 == form.display" />他人不可见</label> <radio value="0" :checked="0 == form.display" />他人不可见</label>
@@ -168,7 +168,7 @@
form: { form: {
taskId: undefined, taskId: undefined,
id: undefined, id: undefined,
display: "1", //0不展示1展示 display: "0", //0不展示1展示
content: "", content: "",
img: "" img: ""
}, },

View File

@@ -115,7 +115,7 @@
<view class="score noscore" v-show="curReplay.scoreSuccess == 0"> <view class="score noscore" v-show="curReplay.scoreSuccess == 0">
未生成成绩 未生成成绩
</view> </view>
<template v-if="roleCode.includes('4') || roleCode.includes('5') && curReplay.scoreSuccess < 2"> <template v-if="roleCode.includes('4') || roleCode.includes('5') && curReplay.scoreSuccess < 2 && (classState == '1' || classState == '3')">
<view class="" style=" padding: 10rpx 10rpx; margin-top: 20rpx;"> <view class="" style=" padding: 10rpx 10rpx; margin-top: 20rpx;">
<view class="scoreBox flex_box"> <view class="scoreBox flex_box">
<text>分数</text> <text>分数</text>

View File

@@ -1,8 +1,9 @@
<template style=""> <template style="">
<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="正在考试" backState="2000"> <z-nav-bar title="正在考试" backState="2000">
<text slot="right" style="padding-right: 20rpx; font-size: 26rpx; color: #666;" @click="showPopup = true">考试说明</text> <text slot="right" style="padding-right: 20rpx; font-size: 26rpx; color: #666;"
@click="showPopup = true">考试说明</text>
</z-nav-bar> </z-nav-bar>
<!-- 有考试结果时候 --> <!-- 有考试结果时候 -->
<template> <template>
@@ -11,84 +12,100 @@
本次考试卷面成绩为<text class="score PM_font">90</text> 本次考试卷面成绩为<text class="score PM_font">90</text>
</view> </view>
<view class=""> <view class="">
<button type="primary" @click="goToClass">返回班级</button> <button type="primary" @click="goToClass">返回班级</button> <button type="primary" @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>
</view> </view>
</view> </view>
</template> </template>
<!-- 没有考试结果的时候 --> <!-- 没有考试结果的时候 -->
<template> <template>
<view class="tips border_radius_10"> <!-- <view class="tips border_radius_10">
<text>每位学员共有两次考试的机会考试成绩以两次成绩的最高分作为最终的卷面成绩请认真对待每次考试;<br/> <text>每位学员共有两次考试的机会考试成绩以两次成绩的最高分作为最终的卷面成绩请认真对待每次考试;<br />
请在倒计时结束前完成答题倒计时结束后将自动交卷;<br/> 请在倒计时结束前完成答题倒计时结束后将自动交卷;<br />
考试结束前中途离开视为放弃此次考试成绩为0分</text> 考试结束前中途离开视为放弃此次考试成绩为0分</text>
</view> </view> -->
<view class="questIndx flex_between flex_box"> <view style="padding: 20rpx; " class="timeBox border_radius_10 flex_box flex_between align-items_box"
<text @click="prev"> << </text> v-if="paperCreateTime > 0">
<text v-for="index of NowList" :key="index" >{{index}}</text> <!-- <view class=""> -->
<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=""> <view class="">
<text><i style="color: #00aaff; font-style: normal; margin-right: 10rpx;" class="">{{curIndex1+1}} </i> / {{testPaper.length}}</text> <text><i style="color: #00aaff; font-style: normal; margin-right: 10rpx;" class="">{{curIndex1+1}}
</i> / {{testPaper.length}}</text>
</view> </view>
<view class="flex_box align-items_box"> <view class="flex_box align-items_box">
<view class=""> <view class="">
剩余时间 剩余时间
</view> </view>
<view class=""> <view class="">
<uni-countdown @timeup="timeup" :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> </view>
<!-- </view> --> <!-- </view> -->
<!-- <pre>{{testPaper}}</pre> --> <!-- <pre>{{testPaper}}</pre> -->
</view> </view>
<view class="question border_radius_10" v-if="curQuestion.id"> <view class="question border_radius_10" v-if="curQuestion.id">
<view class=""> <view class="">
<text class="questionType">{{curQuestion.type == 0 ? '单选题' : '多选题'}}</text> <text class="questionType">{{curQuestion.type == 0 ? '单选题' : '多选题'}}</text>
<view class="questionItem" v-if="curQuestion.id"> <view class="questionItem" v-if="curQuestion.id">
<view class=""> <view class="">
<text>{{curQuestion.content}}</text> <text>{{curQuestion.content}}</text>
</view> </view>
<!-- <view class=""> <!-- <view class="">
{{curQuestion}}-{{curIndex1}} {{curQuestion}}-{{curIndex1}}
</view> --> </view> -->
<view class="optionsBox"> <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"> <view
<text>{{item.content}}</text> :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>
</view>
<view class="btnBox ">
<view class="flex_box flex_between">
<view class="item">
<button @click="showPrevQuestion" type="default" plain="true" v-if="curIndex1 > 0" size="mini">上一题</button>
</view> </view>
<view class="item" > <view class="btnBox " style="overflow: hidden;">
<button @click="showNextQuestion" type="primary" v-show="curIndex1 < testPaper.length-1" :disabled="curQuestion.answerIds.length == 0" size="mini">下一题</button> <view class="flex_box flex_between">
</view> <view class="item">
</view> <button @click="showPrevQuestion" type="default" plain="true" :disabled="curIndex1 == 0"
<view class="" style="margin-top: 20rpx;" v-show="curIndex1 == testPaper.length-1 && !isOvertime"> size="mini">上一题</button>
<button @click="sumitAnswer" type="primary" > </button> </view>
</view> <view class="item">
<button @click="showNextQuestion" type="primary"
:disabled="curIndex1 == testPaper.length-1" size="mini">下一题</button>
</view>
</view>
<!-- v-show="curIndex1 == testPaper.length-1 && !isOvertime" -->
<view class="" style="margin-top: 20rpx;"
>
<button @click="sumitAnswer" type="primary"> </button>
</view>
</view>
<view class="questIndx ">
<view class="" style="text-align: center; font-size: 24rpx; color: #666;">
<span>题目索引</span>
</view>
<scroll-view class="scroll-view_H" scroll-x="true">
<view class="scroll-view-item_H" v-for="index of getallLIst" :key="index">
<text @click="clickIndex(index)"
:class="[ haveAnswerList.includes(index-1) ? 'green' : '', noAnswerList.includes(index-1) ? 'red' : '',(curIndex1+1) == index ? 'cur' :'']">{{index}}</text>
</view>
</scroll-view>
</view>
</view> </view>
</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">
<view class="guanli"> <view class="guanli">
<h3>考试说明</h3> <h3>考试说明</h3>
<view class="tips border_radius_10"> <view class="tips border_radius_10">
<text>每位学员共有两次考试的机会考试成绩以两次成绩的最高分作为最终的卷面成绩请认真对待每次考试;<br/> <text>每位学员共有两次考试的机会考试成绩以两次成绩的最高分作为最终的卷面成绩请认真对待每次考试;<br />
请在倒计时结束前完成答题倒计时结束后将自动交卷;<br/> 请在倒计时结束前完成答题倒计时结束后将自动交卷;<br />
考试结束前中途离开视为放弃此次考试成绩为0分</text> 考试结束前中途离开视为放弃此次考试成绩为0分</text>
</view> </view>
</view> </view>
</u-popup> </u-popup>
</view> </view>
</template> </template>
<script> <script>
@@ -99,113 +116,164 @@
export default { export default {
data() { data() {
return { return {
showPopup:false, showPopup: false,
code:0, // 英文code code: 0, // 英文code
classId:undefined, classId: undefined,
testPaper:[], testPaper: [],
curQuestion:{ curQuestion: {
answerIds:[] answerIds: []
}, },
result:{}, // 考试结果 result: {}, // 考试结果
curIndex1:0, curIndex1: 0,
paperCreateTime:0, paperCreateTime: 0,
examId:undefined, examId: undefined,
endTime:undefined, // 结束时间戳 endTime: undefined, // 结束时间戳
isOvertime:false, // 是否超时 isOvertime: false, // 是否超时
nowPart:1, // 段数 step: 8, /// 步长
// questIndexList: [],
nowPart: 1,
maxNumber: 0,
minNumber: 0,
noAnswerList: [],
haveAnswerList:[]
} }
}, },
onLoad(e) { async onLoad(e) {
console.log('收到得值'); console.log('收到得值');
this.classId = e.classId this.classId = e.classId
if(this.testPaper.length == 0){ if (this.testPaper.length == 0) {
this.getTestPage() this.getTestPage()
} }
// this.questIndexList = await this.getNowList('add')
}, },
onHide(){ onHide() {
if(!this.isOvertime){} if (!this.isOvertime) {}
}, },
onShow() { onShow() {
this.endTime = this.hourUp(1) this.endTime = this.hourUp(1)
console.log('this.endTime',this.endTime.getTime()); console.log('this.endTime', this.endTime.getTime());
}, },
beforeDestroy() { beforeDestroy() {
if(!this.isOvertime){ // 如果中途退出 if (!this.isOvertime) { // 如果中途退出
this.giveZero() this.giveZero()
} }
}, },
computed: { computed: {
...mapState(["userInfo"]), ...mapState(["userInfo"]),
NowList(){ getallLIst() {
var _list = [] const numbers = Array.from(Array(100).keys(), n => n + 1);
console.log('this.nowPart * 8', this.nowPart); console.log('numbers', numbers);
var maxNumber = 0 return numbers
var minNumber = 0
if(this.nowPart == 1){
maxNumber = this.nowPart + 7
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: { methods: {
prev(){ // 单个题的提交
if(this.nowPart > 1){ saveQuestAnswer(paperId,questIndex,ids){
this.nowPart-- 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'
})
});
}, },
next(){ getNoAnswerList() {
if(this.nowPart < 12){ var list = []
this.nowPart++ if (this.curIndex1 > 0) {
for (var i = 0; i < this.curIndex1; i++) {
if (this.testPaper[i].answerIds.length == 0) {
console.log('fuhe?');
list.push(i)
}
}
} }
return list
}, },
gethaveAnswerList() {
var list = []
if (this.curIndex1 > 0) {
for (var i = 0; i < this.curIndex1; i++) {
if (this.testPaper[i].answerIds.length > 0) {
console.log('fuhe?');
list.push(i)
}
}
}
return list
},
// 倒计时结束 (超时) // 倒计时结束 (超时)
timeup(){ timeup() {
this.isOvertime = true this.isOvertime = true
this.sumitAnswer() this.sumitAnswer()
let that = this let that = this
uni.showModal({ uni.showModal({
title:'提示', title: '提示',
content:"考试结束,系统已为您自动交卷", content: "考试结束,系统已为您自动交卷",
confirmText:'知道了', confirmText: '知道了',
showCancel:false, showCancel: false,
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
// that.goToClass() // that.goToClass()
} }
} }
}) })
}, },
// 获取交卷数据 goToPaper(){
sumitAnswer(){ uni.navigateTo({
var _newList = this.testPaper.map( item =>{ url: `/pages/miniClass/paperBack?id=${this.classId}`
return item.answerIds
}) })
_newList = _newList.map(item => { },
return item.join(',') // 获取交卷数据
}) sumitAnswer() {
console.log('_newList',_newList); // var list = []
this.sumbitPaper(_newList) // var _newList = this.testPaper.map(item => {
// return item.answerIds
// })
// _newList = _newList.map(item => {
// return item.join(',')
// })
// console.log('_newList', _newList);
// list = _newList
// return list
this.sumbitPaper()
}, },
// q请求提交试卷 // q请求提交试卷
sumbitPaper(ids){ sumbitPaper(ids) {
$http.request({ $http.request({
url: "common/classExam/submitExamPaper", url: "common/classExam/submitExamPaper",
method: "POST", method: "POST",
data: { data: {
id: this.examId, id: this.examId
"answer": ids
}, },
header: { //默认 无 说明:请求头 header: { //默认 无 说明:请求头
'Content-Type': 'application/json' 'Content-Type': 'application/json'
@@ -213,14 +281,14 @@
}) })
.then(res => { .then(res => {
uni.hideLoading() uni.hideLoading()
if (res.code == 0) { if (res.code == 0) {
uni.showToast({ uni.showToast({
title:'交卷成功', title: '交卷成功',
icon:'success' icon: 'success'
}) })
this.isOvertime = true this.isOvertime = true
} }
}).catch(e => { }).catch(e => {
uni.hideLoading() uni.hideLoading()
console.log(e, '数据报错') console.log(e, '数据报错')
@@ -231,54 +299,65 @@
}) })
}); });
}, },
showPrevQuestion(){ showPrevQuestion() {
// 上一题 // 上一题
this.curIndex1-- this.curIndex1--
// this.curQuestion.answerIds = [] // this.curQuestion.answerIds = []
this.curQuestion = {...this.testPaper[this.curIndex1]} this.curQuestion = {
console.log('----------------',this.testPaper,); ...this.testPaper[this.curIndex1]
}
console.log('----------------', this.testPaper );
// this.haveAnswerList = this.gethaveAnswerList()
}, },
showNextQuestion(){ showNextQuestion() {
// 下一题 // 下一题
this.curIndex1++ this.curIndex1++
// this.curQuestion.answerIds = [] // this.curQuestion.answerIds = []
this.curQuestion = {...this.testPaper[this.curIndex1]} this.curQuestion = {
console.log('+++++++++++++++',this.testPaper,); ...this.testPaper[this.curIndex1]
}
console.log('+++++++++++++++', this.testPaper, );
this.haveAnswerList = this.gethaveAnswerList()
}, },
clickOption(item, index){ clickOption(item, index) {
console.log('item',item,index,this.curIndex1); console.log('item', item, index, this.curIndex1);
if(this.curQuestion.type == 0){ if (this.curQuestion.type == 0) {
this.testPaper[this.curIndex1].answerIds = [item.id] this.testPaper[this.curIndex1].answerIds = [item.id]
this.curQuestion.answerIds = [item.id] this.curQuestion.answerIds = [item.id]
console.log('666666666',this.testPaper, this.curQuestion.answerIds); // console.log('666666666', this.testPaper, this.curQuestion.answerIds);
this.$forceUpdate() this.$forceUpdate()
}else if(this.curQuestion.type == 1){ } else if (this.curQuestion.type == 1) {
console.log('多选'); console.log('多选');
var isIN = this.curQuestion.answerIds.findIndex( itemss => { var isIN = this.curQuestion.answerIds.findIndex(itemss => {
return itemss == item.id return itemss == item.id
}) })
if(isIN >= 0){ if (isIN >= 0) {
console.log('有重复的,删除对应的', isIN); console.log('有重复的,删除对应的', isIN);
this.testPaper[this.curIndex1].answerIds.splice(isIN,1) this.testPaper[this.curIndex1].answerIds.splice(isIN, 1)
this.curQuestion.answerIds.splice(isIN,1) this.curQuestion.answerIds.splice(isIN, 1)
}else{ } else {
this.testPaper[this.curIndex1].answerIds.push(item.id) this.testPaper[this.curIndex1].answerIds.push(item.id)
this.curQuestion.answerIds = [...this.testPaper[this.curIndex1].answerIds] 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)
}, },
setDesc() { setDesc() {
const letterArr = [] const letterArr = []
// 字母A的code值是65但因为已经到字母D了所以直接从69E开始循环 // 字母A的code值是65但因为已经到字母D了所以直接从69E开始循环
for (let i = 65; i < 91; i++) { for (let i = 65; i < 91; i++) {
letterArr[i] = String.fromCharCode(i) letterArr[i] = String.fromCharCode(i)
} }
return letterArr return letterArr
}, },
getTestPage(){ getTestPage() {
uni.showLoading({ uni.showLoading({
title:'正在生成试卷' title: '正在生成试卷'
}) })
$http.request({ $http.request({
url: "common/classExam/generateExamPaper", url: "common/classExam/generateExamPaper",
@@ -292,107 +371,251 @@
}) })
.then(res => { .then(res => {
uni.hideLoading() uni.hideLoading()
if (res.code == 0) { if (res.code == 0) {
// that.isHave = true // that.isHave = true
res.examPaper.forEach(item => { res.examPaper.forEach(item => {
item.answerIds = [] item.answerIds = []
var code = 0 var code = 0
item.options.forEach(item1 => { item.options.forEach(item1 => {
const randomAbc = this.setDesc().splice(65) const randomAbc = this.setDesc().splice(65)
item1.content = randomAbc[code]+'、'+item1.content item1.content = randomAbc[code] + '、' + item1.content
code++ code++
}) })
}) })
this.testPaper = res.examPaper this.testPaper = res.examPaper
this.examId = res.id this.examId = res.id
this.paperCreateTime = 1 this.paperCreateTime = 1
this.endTime = this.hourUp(1) this.endTime = this.hourUp(1)
console.log('this.endTime',this.endTime); console.log('this.endTime', this.endTime);
this.curQuestion = {...this.testPaper[this.curIndex1] } this.curQuestion = {
uni.showToast({ ...this.testPaper[this.curIndex1]
title: '获取成功', }
icon: 'success' uni.showToast({
}) title: '获取成功',
console.log(res, '试卷',this.curQuestion) icon: 'success'
})
console.log(res, '试卷', this.curQuestion)
// setTimeout(() => { // setTimeout(() => {
// this.getClassInfo() // this.getClassInfo()
// }, 500) // }, 500)
} else {
uni.showToast({
title: res.errMsg,
icon: 'none',
duration: 3000
})
} }
}).catch(e => { }).catch(e => {
uni.hideLoading() uni.hideLoading()
console.log(e, '数据报错') console.log(e, '数据报错')
// this.status = 3 // this.status = 3
uni.showToast({ uni.showToast({
title: e.errorMsg, title: e.errMsg,
icon: 'error' icon: 'none',
duration: 3000
}) })
}); });
}, },
giveZero(){ giveZero() {
// 没有完成完成考试记为0分 // 没有完成完成考试记为0分
}, },
showElart(){ showElart() {
// uni.showModal({ // uni.showModal({
// title:'提示', // title:'提示',
// content:"您还没有完成考试确定要离开吗离开后成绩会记为0分是否继续" // content:"您还没有完成考试确定要离开吗离开后成绩会记为0分是否继续"
// }) // })
}, },
goToClass(){ goToClass() {
uni.navigateTo({ uni.navigateTo({
url:`/pages/miniClass/classInfo?id=${this.classId}` url: `/pages/miniClass/classInfo?id=${this.classId}`
}) })
}, },
hidePopup(){ hidePopup() {
this.showPopup = false this.showPopup = false
}, },
hourUp(e){ clickIndex(val) {
this.curIndex1 = val - 1
console.log('val', val, this.curIndex1, this.testPaper.length);
this.curQuestion = this.testPaper[this.curIndex1]
this.noAnswerList = this.getNoAnswerList()
this.haveAnswerList = this.gethaveAnswerList()
},
hourUp(e) {
// 比现在多几个小时 // 比现在多几个小时
var end = Date.now() var end = Date.now()
var start = 1000*60*60*e var start = 1000 * 60 * 60 * e
var interval = end + start; //结束 - 开始 = 毫秒值 var interval = end + start; //结束 - 开始 = 毫秒值
var a =new Date(interval) var a = new Date(interval)
return a return a
}, },
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/style/mixin.scss"; @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; } .questIndx { overflow: hidden;
.cur{background-color: #409eff; color: #fff;} 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 {
background-color: #fff;
padding: 6rpx 10rpx;
display: flex;
justify-content: center;
border-radius: 10rpx;
align-items: center;
width: 60rpx;
height: 60rpx;
text-align: center;
border: 1px solid #eee;
}
.cur {
background-color: #409eff;
color: #fff;
}
} }
.guanli { .guanli {
padding: 40rpx; padding: 40rpx;
h3 { h3 {
text-align: center; text-align: center;
margin-bottom: 20rpx; margin-bottom: 20rpx;
color: #333; 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;}
.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%;} .tips {
background: #fbe8e8;
color: #f56c6c;
line-height: 50rpx;
font-size: 28rpx;
padding: 10rpx 20rpx;
text-align: justify;
} }
.timeBox{background-color: #fff; margin-bottom: 20rpx;}
.btnBox{ .questionType {
.item{width:40%; display: flex; justify-content: center;} position: absolute;
left: 0;
top: 20rpx;
background-color: $themeColor;
color: #fff;
padding: 10rpx 20rpx;
border-radius: 0 50rpx 50rpx 0;
} }
</style>
.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: 24rpx 20rpx;
margin-bottom: 20rpx;
}
.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 {
background-color: #409eff;
color: #fff;
}
}
.btnBox {
.item {
width: 40%;
display: flex;
justify-content: center;
}
}
</style>

View File

@@ -2,26 +2,26 @@
<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> <z-nav-bar :title="pageName"></z-nav-bar>
<view class="pad20"> <view class="pad20">
<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)">
<view class="leve1 flex_box"> <view class="leve1 flex_box">
<text>{{item.title}}</text> <text>{{item.title}}</text>
</view> </view>
<view class="leve2"> <view class="leve2">
{{item.content}} {{item.content}}
</view> </view>
<view class="leve3"> <view class="leve3">
<view class="score" v-if="item.scoreSuccess == 1"> <view class="score" v-if="item.scoreSuccess == 1">
分数{{item.score}} 分数{{item.score}}
</view> </view>
<view class="score noscore" v-else>未评分</view> <view class="score noscore" v-else>未评分</view>
<view class="date"> <view class="date">
{{item.createTime}} {{item.createTime}}
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
@@ -30,13 +30,14 @@
<u-divider v-show="status == 3" text="暂无数据"></u-divider> <u-divider v-show="status == 3" text="暂无数据"></u-divider>
<u-divider v-show="status == 1" text="加载中..."></u-divider> <u-divider v-show="status == 1" text="加载中..."></u-divider>
</view> </view>
<u-popup key="1" :show="showEditBlank" :round="10" @close="closePup" ref="" z-index="998" overlay-style="z-index:998"> <u-popup key="1" :show="showEditBlank" :round="10" @close="closePup" ref="" z-index="998"
overlay-style="z-index:998">
<view class="" style="padding: 40rpx; max-height: 80vh; overflow-y:scroll"> <view class="" style="padding: 40rpx; max-height: 80vh; overflow-y:scroll">
<view class="anserBox"> <view class="anserBox">
<h3>心得详情</h3> <h3>心得详情</h3>
<view class="" style="border-bottom: 1px solid #eee; padding-bottom: 20rpx; margin-bottom: 20rpx;"> <view class="" style="border-bottom: 1px solid #eee; padding-bottom: 20rpx; margin-bottom: 20rpx;">
<view class="anserContent" v-html="curReplay.content"> <view class="anserContent" v-html="curReplay.content">
</view> </view>
<view class="图片"> <view class="图片">
<view class="imgBox flex_box" v-if="fileList1.length > 0"> <view class="imgBox flex_box" v-if="fileList1.length > 0">
@@ -52,7 +53,7 @@
<view class="" v-if="curReplay.createUser" style="color: #999;padding: 10rpx 0;"> <view class="" v-if="curReplay.createUser" style="color: #999;padding: 10rpx 0;">
学员信息{{curReplay.createUser.nickname != null && curReplay.createUser.nickname != '' ? curReplay.createUser.nickname : '匿名用户'}} 学员信息{{curReplay.createUser.nickname != null && curReplay.createUser.nickname != '' ? curReplay.createUser.nickname : '匿名用户'}}
/ {{curReplay.createUser.tel}} / {{curReplay.createUser.tel}}
</view> </view>
<view class="score" v-show="curReplay.scoreSuccess == 1"> <view class="score" v-show="curReplay.scoreSuccess == 1">
分数{{curReplay.score}} 分数{{curReplay.score}}
</view> </view>
@@ -60,13 +61,15 @@
未生成成绩 未生成成绩
</view> </view>
<!-- --> <!-- -->
<template v-if="roleCode.includes('4') && curReplay.scoreSuccess != 1 || roleCode.includes('5') && curReplay.scoreSuccess != 1 "> <template
v-if="roleCode.includes('4') && curReplay.scoreSuccess != 1 || roleCode.includes('5') && curReplay.scoreSuccess != 1 && (classState == '1' || classState == '3')">
<view class="" style=" padding: 10rpx 10rpx; margin-top: 20rpx;"> <view class="" style=" padding: 10rpx 10rpx; margin-top: 20rpx;">
<view class="scoreBox flex_box"> <view class="scoreBox flex_box">
<text>分数</text> <text>分数</text>
<text v-for="(item, index) in scoreList" @click="setScore(item)" :class="[item == form.score ?'active' : '' ]"> <text v-for="(item, index) in scoreList" @click="setScore(item)"
{{item}} :class="[item == form.score ?'active' : '' ]">
</text> {{item}}
</text>
</view> </view>
<!-- <uni-forms :modelValue="form" :rules="rules" ref="form"> <!-- <uni-forms :modelValue="form" :rules="rules" ref="form">
<uni-forms-item label="分数" name="score" > <uni-forms-item label="分数" name="score" >
@@ -84,8 +87,8 @@
</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 {
@@ -96,9 +99,9 @@
loadFlag: false, loadFlag: false,
pageName: '', pageName: '',
taskList: [], taskList: [],
fileList1:[], fileList1: [],
scoreList:[ scoreList: [
0,0.5,1,1.5,2,2.5 0, 0.5, 1, 1.5, 2, 2.5
], ],
rules: { rules: {
score: { score: {
@@ -106,27 +109,29 @@
required: true, required: true,
errorMessage: '请输入分数', errorMessage: '请输入分数',
} }
] ]
}, },
}, },
roleCode:'', roleCode: '',
showEditBlank:false, showEditBlank: false,
curReplay:{}, curReplay: {},
form: { form: {
score: undefined, //分数 score: undefined, //分数
id: undefined, id: undefined,
}, },
// ispreviewImage :false, classState : undefined
// ispreviewImage :false,
} }
}, },
onLoad(e) { onLoad(e) {
console.log('e',e); console.log('e', e);
this.classId = e.classId this.classId = e.classId
this.pageType = e.type this.pageType = e.type
this.roleCode = e.roleCode this.roleCode = e.roleCode
this.pageName = '心得列表' this.pageName = '心得列表'
this.classState = e.classState
this.getList() this.getList()
}, },
onPullDownRefresh() { onPullDownRefresh() {
@@ -150,52 +155,52 @@
// onBackPress() { // onBackPress() {
// }, // },
methods: { methods: {
setScore(val){ setScore(val) {
// if(this.form.score == val) return // if(this.form.score == val) return
this.form.score = val this.form.score = val
}, },
onSubmit() { onSubmit() {
// this.$refs.form.validate().then(res => { // this.$refs.form.validate().then(res => {
if(!this.form.score && this.form.score != 0){ if (!this.form.score && this.form.score != 0) {
uni.showToast({
title: '请选择分值',
icon: 'none'
})
return
}
var _url = "common/class/editTaskScore"
var data = {
"score": this.form.score,
"taskId": this.form.id
}
console.log('data后台提交数据', data);
$http.request({
url: _url,
method: "POST",
data,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
uni.showToast({ uni.showToast({
title:'请选择分值', title: '操作成功!',
icon:'none' icon: 'success'
}) })
return setTimeout(() => {
} this.pPage = 0
var _url = "common/class/editTaskScore" this.taskList = []
var data = { this.getList()
"score": this.form.score, this.closePup()
"taskId": this.form.id }, 1000)
} }).catch(e => {
console.log('data后台提交数据', data); uni.showToast({
$http.request({ title: '操作失败',
url: _url, icon: 'error'
method: "POST",
data,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}) })
.then(res => { });
uni.showToast({
title: '操作成功!',
icon: 'success'
})
setTimeout(()=>{
this.pPage = 0
this.taskList = []
this.getList()
this.closePup()
},1000)
}).catch(e => {
uni.showToast({
title: '操作失败',
icon: 'error'
})
});
// }).catch(err => { // }).catch(err => {
// console.log('表单错误信息:', err); // console.log('表单错误信息:', err);
// uni.showToast({ // uni.showToast({
@@ -222,31 +227,35 @@
this.showEditBlank = false this.showEditBlank = false
this.form = { this.form = {
score: undefined, score: undefined,
id: undefined, id: undefined,
} }
this.curReplay = {} this.curReplay = {}
this.fileList1 = [] this.fileList1 = []
console.log('this.fileList1',this.fileList1); console.log('this.fileList1', this.fileList1);
// setTimeout(()=>{ // setTimeout(()=>{
// this.pPage = 0 // this.pPage = 0
// this.taskList = [] // this.taskList = []
// this.getList() // this.getList()
// },1000) // },1000)
}, },
clickTask(item){ clickTask(item) {
// console.log('item',item); // console.log('item',item);
this.curReplay = item this.curReplay = item
this.form = {...item} this.form = {
if(this.form.scoreSuccess == 0){ ...item
this.form.score = undefined }
} if (this.form.scoreSuccess == 0) {
if(item.img != ''){ this.form.score = undefined
var _list = item.img.split(',') }
_list.forEach( item => { if (item.img != '') {
this.fileList1.push({url:item}) var _list = item.img.split(',')
_list.forEach(item => {
this.fileList1.push({
url: item
}) })
} })
this.showEditBlank = true }
this.showEditBlank = true
}, },
getList() { getList() {
this.status = 1; this.status = 1;
@@ -325,8 +334,8 @@
/* #endif */ /* #endif */
flex: 1 flex: 1
} }
.anserBox { .anserBox {
border: 4rpx dotted #2bb447; border: 4rpx dotted #2bb447;
margin-top: 30rpx; margin-top: 30rpx;
padding: 20rpx; padding: 20rpx;
@@ -334,20 +343,28 @@
border-radius: 20rpx; border-radius: 20rpx;
overflow: hidden; overflow: hidden;
padding-top: 0; padding-top: 0;
.imgBox { .imgBox {
flex-wrap: wrap; flex-wrap: wrap;
.item { .item {
width: 20%; width: 20%;
margin-right: 10rpx; margin-right: 10rpx;
border: 1px solid #eee; border: 1px solid #eee;
padding: 0 !important; padding: 0 !important;
image { image {
width: 100%; width: 100%;
} }
} }
} }
.anserContent{line-height: 50rpx; padding: 20rpx 0; display: block;}
.anserContent {
line-height: 50rpx;
padding: 20rpx 0;
display: block;
}
h3 { h3 {
line-height: 80rpx; line-height: 80rpx;
width: 50%; width: 50%;
@@ -358,15 +375,33 @@
border-radius: 0 0 20rpx 20rpx; border-radius: 0 0 20rpx 20rpx;
} }
} }
.scoreBox{
text{display: inline-block; font-size: 26rpx; width: 100%; border: 1px solid #ddd; text-align: center; line-height:60rpx; border-right: none;} .scoreBox {
text:last-child{border-right: 1px solid #ddd;} text {
text.active{background-color: #55aaff; color: #fff; border-color: #55aaff;} display: inline-block;
font-size: 26rpx;
width: 100%;
border: 1px solid #ddd;
text-align: center;
line-height: 60rpx;
border-right: none;
}
text:last-child {
border-right: 1px solid #ddd;
}
text.active {
background-color: #55aaff;
color: #fff;
border-color: #55aaff;
}
} }
.btn_box { .btn_box {
margin-top: 70rpx; margin-top: 70rpx;
padding-bottom: 20rpx; padding-bottom: 20rpx;
button { button {
font-size: 32rpx; font-size: 32rpx;
@include theme('btn_bg') color: #fff; @include theme('btn_bg') color: #fff;
@@ -375,10 +410,27 @@
border-radius: 50rpx; border-radius: 50rpx;
} }
} }
::v-deep .uni-forms-item{margin-bottom: 0 !important;}
.date {font-size: 26rpx; color: #999;} ::v-deep .uni-forms-item {
.score{color: #55aaff; font-size: 30rpx !important; font-weight: bold;;} margin-bottom: 0 !important;
.noscore{color: #ffaa7f;} }
.date {
font-size: 26rpx;
color: #999;
}
.score {
color: #55aaff;
font-size: 30rpx !important;
font-weight: bold;
;
}
.noscore {
color: #ffaa7f;
}
.submitRecode { .submitRecode {
// padding: 20rpx; // padding: 20rpx;
@@ -399,29 +451,47 @@
box-shadow: none !important; box-shadow: none !important;
// border-bottom: 1px solid #eee; // border-bottom: 1px solid #eee;
border-radius: 20rpx; border-radius: 20rpx;
padding: 20rpx ; padding: 20rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
.leve1 { .leve1 {
align-items: center; align-items: center;
border-bottom: 1px dashed #eee; border-bottom: 1px dashed #eee;
padding-bottom: 20rpx; padding-bottom: 20rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
// .userName{} // .userName{}
} }
.leve2 { justify-content: space-between; .leve2 {
color: #666; font-size: 28rpx; line-height: 50rpx; justify-content: space-between;
@include bov(3); color: #666;
.item{text-align: center; padding-top: 0; padding-bottom: 0; margin-bottom: 0;} font-size: 28rpx;
line-height: 50rpx;
@include bov(3);
.item {
text-align: center;
padding-top: 0;
padding-bottom: 0;
margin-bottom: 0;
}
} }
.leve3 { overflow: hidden; .leve3 {
overflow: hidden;
color: #999; color: #999;
text-align: center; text-align: center;
padding-top: 10rpx; padding-top: 10rpx;
.score{float: left;}
.date{float: right;} .score {
float: left;
}
.date {
float: right;
}
.tips { .tips {
width: 100%; width: 100%;
justify-content: space-between; justify-content: space-between;
@@ -429,7 +499,7 @@
color: #999; color: #999;
} }
.btn { .btn {
border: 1px solid $themeColor; border: 1px solid $themeColor;