This commit is contained in:
@fawn-nine
2024-09-25 18:17:51 +08:00
parent c0b696aa15
commit 86a1f754c2
13 changed files with 391 additions and 115 deletions

View File

@@ -47,9 +47,9 @@
<view class="in">
<view class="uni-textarea">
<textarea v-show="false" placeholder-style="font-size:26rpx" v-model="form.content"
maxlength="600" auto-height placeholder="请输入内容" />
auto-height placeholder="请输入内容" />
<view class="editor-wrapper">
<editor id="editor" class="ql-container" placeholder="请输入内容..." show-img-size
<editor @input="editorIput" id="editor" class="ql-container" placeholder="请输入内容..." show-img-size
show-img-toolbar show-img-resize @statuschange="onStatusChange"
:read-only="readOnly" @ready="onEditorReady">
</editor>
@@ -80,6 +80,7 @@
} from 'qs';
import $http from '@/config/requestConfig.js';
import permission from "@/js_sdk/wa-permission/permission.js"
import debounce from "@/common/debounce.js";
import {
mapState,
mapMutations
@@ -146,6 +147,9 @@
pageName: ''
};
},
onPullDownRefresh(){
uni.stopPullDownRefresh()
},
//第一次加载
onLoad(e) {
console.log('收到的值', e);
@@ -177,7 +181,7 @@
} else if (e.type == 1) {
this.pageType = '医案'
} else if (e.type == 2) {
this.pageType = '心得222'
this.pageType = '心得'
} else {
this.pageType = '作业'
}
@@ -196,6 +200,9 @@
},
//方法
methods: {
editorIput(e){
},
readOnlyChange() {
this.readOnly = !this.readOnly
},
@@ -325,18 +332,13 @@
});
},
async onSubmit() {
// debounce(async () => {
let that = this
if (this.flag) {
console.log('拦截了吗');
if (this.flag) {
return
} else {
this.flag = true
console.log('没拦截?', this.flag);
}
// this.flag = true
let data = await this.getHtml();
var _data = data.html.replace(/<.*?>/g, "")
}
let data = await this.getHtml();
var _data = data.html.replace(/<.*?>/g, "")
if (!_data || _data == '') {
uni.showToast({
title: '请输入主要内容',
@@ -367,12 +369,13 @@
this.form.img = ''
}
console.log('this.form', this.form);
this.flag = true
uni.showLoading({
title:'请稍后'
})
var _url = ""
this.form.id ? _url = "common/class/editClassTask" : _url = "common/class/addClassTask"
$http.request({
url: _url,
method: "POST",
data: {
var data = {
"id": this.form.id,
"classId": this.form.id ? undefined : this.form.classId,
"type": this.form.type, //类型 0班内任务1医案2心得
@@ -382,13 +385,19 @@
"img": this.form.img,
"sort": this.form.sort && !this.form.id ? parseInt(this.form.sort) +
1 : undefined
},
}
console.log('提交的数据',data);
$http.request({
url: _url,
method: "POST",
data,
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
// this.flag = false
uni.hideLoading()
uni.showToast({
title: '操作成功!',
icon: 'success'
@@ -401,6 +410,7 @@
})
}, 1000)
}).catch(e => {
uni.hideLoading()
this.flag = false
// console.log('表单错误信息:', err);
uni.showToast({
@@ -416,7 +426,9 @@
icon: 'none'
})
})
}
// },300)
},
},
//页面隐藏
onHide() {},
@@ -434,7 +446,7 @@
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.ql-container{height: auto;}
::v-deep .uni-forms-item {
margin-bottom: 26rpx !important;
}

View File

@@ -44,9 +44,9 @@
class="mainTxt">{{students.length}}/{{thisClass.number}}</text></view>
<view><text class="ciyao">管理成员</text><text class="mainTxt" @click="seeManager">点击查看</text></view>
</view>
<!-- v-if="thisClass.state == '2'" -->
<template v-if="isHave">
<view class="pingfenBox testBox" v-if="thisClass.state == '3' || thisClass.state == '2'">
<view class="pingfenBox testBox" v-if=" thisClass.state == '2'">
<view class="scoreTitle">
<view class="titles flex_box">
<text>总分</text><uni-icons type="help" size="18" color="#fff"
@@ -65,18 +65,19 @@
</view>
</view>
</view>
<view class="" v-if="performanceScore.userScore >= 60">
<view class="" v-if="certificate && certificate.id">
<text>恭喜您获得</text>
<text class="yellowScore" v-if=" performanceScore.userScore >= 70"> A </text>
<text class="blueScore"
v-else-if="performanceScore.userScore >= 60 && performanceScore.userScore < 70"> B </text>
<text :class="[certificate.type=='A' ? 'yellowScore':'blueScore']" v-if=" performanceScore.userScore >= 70"> {{certificate.type}} </text>
<!-- <text class=""
v-else-if="performanceScore.userScore >= 60 && performanceScore.userScore < 70"> B </text> -->
<text class="small_btn border_radius_10 zhengshu"
@click="showSubmit">{{certificate && certificate.id ? '查看证书' : '生成证书'}}</text>
@click="showSubmit">
{{certificate && certificate.id && certificate.certificateUrl.length > 0 ? '查看证书' : '去生成证书'}}
</text>
</view>
<template v-if="performanceScore.userScore < 60">
<view class="flex_box flex_center align-items_box" style="justify-content: center;">
<text style="text-align: center;">很遗憾您的成绩未达标</text>
{{newCLass}}
<text style="text-align: center;">很遗憾您的成绩未达标</text>
<view class="" style="text-align: center;"
v-if="newCLass && newCLass != null && newCLass.id">
<text class="small_btn chongxiu border_radius_10"
@@ -84,15 +85,24 @@
</view>
</view>
</template>
</view>
<view class="optionsBox" v-if="thisClass.state == '3' && classModel.isExam == 1" style="margin-top: 20rpx;">
</view>
</view>
<view class="pingfenBox testBox" v-if=" thisClass.state == '3' && classModel.isExam == 1">
<view class="scoreTitle">
<view class="titles flex_box">
<text>考试分</text><uni-icons type="help" size="18" color="#fff"
@click="showTestTips = true"></uni-icons>
</view>
</view>
<view class="optionsBox" v-if="thisClass.state == '3' " style="margin-top: 20rpx;">
<view class=" ">
<view class="">
<!-- -->
<view class="gotoExams" @click="goTest" v-if="paperList.length <= 0">
<text>去考试</text>
</view>
<view class="" v-else-if="paperList.length > 0 && showCountDown">
<view class="flex_box flex_between align-items_box">
<view class="">
@@ -108,7 +118,7 @@
</view>
<view class="flex_box flex_center align-items_box userScore" v-else
style="color: #666; justify-content: space-around !important">
<view class="flex_box align-items_box">
<view class="">
<h3>笔试成绩</h3>
@@ -816,7 +826,7 @@
}
}
if (this.thisClass.state == '2' || this.thisClass.state == '2') {
if (this.thisClass.state == '2') {
var userObj = await this.getUserData()
if (userObj) {
this.submitInfo.name = userObj.name
@@ -954,15 +964,15 @@
return list
},
async showSubmit() {
if (this.certificate && this.certificate.id) {
// if (this.certificate && this.certificate.id && this.certificate.certificateUrl.length > 3) {
// 已生成
uni.navigateTo({
url: '/pages/certificate/certificate'
})
} else { // 未生成
this.showSubmitInfoBlank = true
// } else { // 未生成
// this.showSubmitInfoBlank = true
}
// }
},
async getUserData() {
@@ -1227,7 +1237,7 @@
createCertificate() {
debounce(async () => {
if(this.certificateFlag) return
this.certificateFlag = true
if (this.submitInfo.name && this.submitInfo.name != null && this.submitInfo.name != '' &&
this.submitInfo.photo && this.submitInfo.photo != null && this.submitInfo.photo != '') {
@@ -1259,12 +1269,12 @@
})
return
}
this.certificateFlag = true
uni.showLoading({
title:'正在生成'
})
var data = {
"type": type, //证书类型A a证 B b证 ZK自考
"relationId": this.classId //小班id、课程id
"id": this.certificate.id //证书id
}
// console.log('证书提交数据',data,this.performanceScore.userScore);
$http.request({
@@ -1330,13 +1340,13 @@
this.getNewCLassInfo()
} else {
// >= 60
// if (this.thisClass.state == '2') {
if (this.thisClass.state == '2') {
var certificate = await this.getCertificateInfo()
if (certificate && certificate.length > 0 && certificate[0].id) {
this.certificate = certificate[0]
}
console.log('this.certificate', certificate);
// }
}
}
} else {
@@ -2127,9 +2137,9 @@
.zhengshu {
margin-left: 20rpx;
color: #ffaa7f;
color: #55aa7f;
font-size: 28rpx;
border: 1px solid #ffaa7f
border: 1px solid #55aa7f
}
.chongxiu {

View File

@@ -1,10 +1,11 @@
<template>
<view>
<public-module></public-module>
<z-nav-bar title="班级详情">
<z-nav-bar title="班级详情">
<!-- <view class="curseSet" slot="right" @click="shuomingPage('/pages/course/courseSet',tagId,pid)">
<uni-icons type="info" size="24"></uni-icons>设置</view> -->
</z-nav-bar>
<!-- <text @click="changeClassStatu('2')">结班</text> -->
<!-- <view class="" style="background-color: #f4f7ff; min-height: calc(100vh - 200rpx);"> -->
<view class="mainContent" v-if="thisClass.id">
<!-- <view class="" style="height: 40rpx;"></view> -->
@@ -870,12 +871,7 @@
// 改变班级状态
changeClassStatu(statusCode) {
let that = this
that.opClass(statusCode)
// if (statusCode == '1') {
// } else if (statusCode == '2') {
// that.opClass(statusCode)
// }
that.opClass(statusCode)
},
// 考试周和结班状态下,学员的信息
@@ -943,6 +939,9 @@
})
setTimeout(() => {
this.getClassInfo()
if(statusCode == '2'){
this.allCertificate()
}
}, 500)
} else {
uni.showToast({
@@ -960,6 +959,29 @@
})
});
},
// 批量生成证书
allCertificate(){
$http.request({
url: "common/class/generateCertificateByClassEnd",
method: "POST",
data: {
"classId":this.classId
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
console.log('批量生成成功',res);
}else{
console.log('批量生成证书报错',res.errMsg);
}
}).catch(e => {
console.log('批量生成证书报错',res.errMsg);
});
},
taskEdit(item) {
console.log('taskEdit'.item);
},

View File

@@ -30,7 +30,7 @@
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="flex_box align-items_box">
<view class="classmateImg">
<image v-if="item.user.avatar != null && item.user.avatar != ''"
<image v-if="item.user.avatar && item.user.avatar != null && item.user.avatar != ''"
:src="item.user.avatar" mode="aspectFit"></image>
<image v-else src="/static/icon/morenAvavter.png" mode="aspectFit"></image>
</view>
@@ -75,7 +75,7 @@
</view>
<text class="score">{{item.examScore}}</text>
</view>
<view >
<view v-if="thisClass.state == '2'">
<view class="ciyao">
总分
</view>
@@ -84,7 +84,7 @@
</template>
</template>
<!-- -->
<template v-if="classModel.isExam == 1 && item.classExamUsers.length > 0" >
<template v-if="classModel.isExam == 1 && item.classExamUsers.length > 0 && thisClass.state == '2'" >
<view v-if="item.userScore >= 60 && item.userScore < 70"
:class="['PM_font','zhengshu','Bzheng']"
></view>

View File

@@ -1,5 +1,5 @@
<template>
<view style="min-height: 100vh;">
<view style="min-height: 100vh; background-color: #f6f6f8;">
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar title="我的班级">

View File

@@ -1,4 +1,5 @@
<template>
<page-meta :page-style="'overflow:'+(showEditBlank?'hidden':'visible')"></page-meta>
<view style="min-height: calc(100vh - 120rpx); background-color: #ebf2f5;">
<z-nav-bar title="思考题提交列表"></z-nav-bar>
<view class="pad20">
@@ -29,27 +30,22 @@
<u-divider v-show="status == 3" text="暂无数据"></u-divider>
<u-divider v-show="status == 1" text="加载中..."></u-divider>
<u-popup key="1" v-if="curReplay.replyId" :show="showEditBlank" :round="10" @close="closePup" ref="" z-index="998" overlay-style="z-index:998">
<u-popup key="1" v-if="curReplay.replyId" @touchmove.stop="" :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="anserBox">
<h3>提交的内容</h3>
<view class="" style="border-bottom: 1px solid #eee; padding-bottom: 20rpx; margin-bottom: 20rpx;">
<view class="anserContent" v-html="curReplay.content"></view>
<view class="">
<view class="imgBox flex_box" v-if="curReplay.fileList.length > 0">
<view class="item" v-for="(item, index) in curReplay.fileList" :key="index">
<image @click="previewImage(item.url)" :src="item.url" mode="widthFix"></image>
<scroll-view scroll-top="" scroll-y="true" class="scroll-Y" style="max-height: 500rpx; margin: 20rpx 0;">
<view class="" style="border-bottom: 1px solid #eee; padding-bottom: 20rpx; margin-bottom: 20rpx;">
<view class="anserContent" v-html="curReplay.content"></view>
<view class="">
<view class="imgBox flex_box" v-if="curReplay.fileList.length > 0">
<view class="item" v-for="(item, index) in curReplay.fileList" :key="index">
<image @click="previewImage(item.url)" :src="item.url" mode="widthFix"></image>
</view>
</view>
</view>
</view>
</view>
<!-- <view class="date">
日期{{curReplay.createTime}}
</view> -->
<!-- <view class="" v-if="curReplay.createUser" style="color: #999;padding: 10rpx 0; font-size: 26rpx;">
学员信息{{curReplay.createUser.nickname != null && curReplay.createUser.nickname != '' ? curReplay.createUser.nickname : '匿名用户'}}
/ {{curReplay.createUser.tel}}
</view> -->
</view>
</scroll-view>
<view class="score" v-show="curReplay.scoreSuccess >= 1">
分数{{curReplay.score}}
</view>
@@ -424,7 +420,7 @@
border-bottom: 1px dashed #eee;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
.pp{font-size: 30rpx !important; @include bov(2); line-height: 50rpx;}
.pp{font-size: 30rpx !important; @include bov(2); line-height: 50rpx; height: 100rpx; overflow: hidden;}
// .userName{}
}

View File

@@ -154,6 +154,7 @@
<script>
import permission from "@/js_sdk/wa-permission/permission.js"
import $http from '@/config/requestConfig.js';
import debounce from "@/common/debounce.js";
import {
mapState
} from "vuex";
@@ -300,13 +301,13 @@
},
closePup(){
this.showEditBlank = false
this.form = {
taskId: undefined,
id: undefined,
display: "1", //0不展示1展示
content: "",
img: ""
}
// this.form = {
// // taskId: undefined,
// id: undefined,
// display: "0", //0不展示1展示
// content: "",
// img: ""
// }
this.fileList1 = []
},
deletePic(event) {
@@ -468,7 +469,8 @@
url: `${url}?id=${id}&type=${modeType}`
});
},
onSubmit() {
onSubmit() {
// debounce(async () => {
this.$refs.form.validate().then(res => {
if (this.fileList1.length > 0) {
let _list = this.fileList1
@@ -491,8 +493,7 @@
"display": this.form.display, //0不展示1展示
"content": this.form.content,
"img": this.form.img
}
}
console.log('data',data);
$http.request({
url: _url,
@@ -508,9 +509,9 @@
icon: 'success'
})
this.FileList = []
this.FileList11 = []
this.closePup()
this.FileList11 = []
setTimeout(()=>{
this.closePup()
this.pPage = 0
this.zuoyeList = []
this.getTaskInfo()
@@ -529,6 +530,7 @@
icon: 'none'
})
})
// },300)
},
addPic(e) {
let that = this;

View File

@@ -1,4 +1,5 @@
<template>
<page-meta :page-style="'overflow:'+(showEditBlank?'hidden':'visible')"></page-meta>
<view>
<public-module></public-module>
<z-nav-bar :title="pageType+'详情'"></z-nav-bar>
@@ -86,10 +87,11 @@
<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" @touchmove.stop="" :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="anserBox">
<h3>提交的内容</h3>
<scroll-view scroll-top="" scroll-y="true" class="scroll-Y" style="max-height: 500rpx; margin: 20rpx 0;">
<view class="" style="border-bottom: 1px solid #eee; padding-bottom: 20rpx; margin-bottom: 20rpx;">
<view class="anserContent" v-html="curReplay.content">
@@ -112,6 +114,7 @@
<!-- <view class="score" v-show="curReplay.scoreSuccess != 0">
分数:{{curReplay.score}}
</view> -->
</scroll-view>
<view class="score noscore" v-show="curReplay.scoreSuccess == 0">
未开始评分
</view>

View File

@@ -1,4 +1,5 @@
<template>
<page-meta :page-style="'overflow:'+(showEditBlank?'hidden':'visible')"></page-meta>
<view style="min-height: calc(100vh - 120rpx); background-color: #ebf2f5;">
<z-nav-bar :title="pageName"></z-nav-bar>
<view class="pad20">
@@ -10,7 +11,7 @@
<view class="leve1 flex_box">
<text>{{item.title}}</text>
</view>
<view class="leve2" v-html="item.content">
<view class="leve2 jianjie" v-html="item.content">
<!-- {{item.content}} -->
</view>
<view class="leve3">
@@ -30,11 +31,13 @@
<u-divider v-show="status == 3" text="暂无数据"></u-divider>
<u-divider v-show="status == 1" text="加载中..."></u-divider>
</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" @touchmove.stop=""
overlay-style="z-index:998" >
<view class="" style="padding: 40rpx; max-height: 80vh; overflow-y:scroll">
<view class="anserBox">
<h3>心得详情</h3>
<h3 style="">心得详情</h3>
<scroll-view scroll-top="" scroll-y="true" class="scroll-Y" style="max-height: 500rpx; margin: 20rpx 0;">
<view class="" style="border-bottom: 1px solid #eee; padding-bottom: 20rpx; margin-bottom: 20rpx;">
<view class="anserContent" v-html="curReplay.content">
@@ -54,6 +57,7 @@
学员信息{{curReplay.createUser.nickname != null && curReplay.createUser.nickname != '' ? curReplay.createUser.nickname : '匿名用户'}}
/ {{curReplay.createUser.tel}}
</view>
</scroll-view>
<view class="score" v-show="curReplay.scoreSuccess >= 1">
分数{{curReplay.score}}
</view>
@@ -77,6 +81,7 @@
</view>
</view>
</u-popup>
<z-navigation></z-navigation>
</view>
</template>
@@ -150,6 +155,9 @@
// onBackPress() {
// },
methods: {
moveHandle() {
return false;
},
setScore(val) {
// if(this.form.score == val) return
this.form.score = val
@@ -220,6 +228,7 @@
});
},
closePup() {
// this.canScroll()
this.showEditBlank = false
this.form = {
score: undefined,
@@ -235,6 +244,7 @@
// },1000)
},
clickTask(item) {
// this.noScroll()
// console.log('item',item);
this.curReplay = item
this.form = {
@@ -463,7 +473,7 @@
justify-content: space-between;
color: #666;
font-size: 28rpx;
line-height: 50rpx;
line-height: 50rpx; height: 100rpx; overflow: hidden;
@include bov(3);
.item {