This commit is contained in:
@fawn-nine
2024-09-19 17:42:12 +08:00
parent 89eabd7a62
commit a0efe173da
4 changed files with 168 additions and 140 deletions

View File

@@ -63,7 +63,7 @@
<view class="">
<view class="PM_font" style="padding: 20rpx; font-size: 40rpx; color: #333">题目内容</view>
<view v-if="curriculumData.questions != ''" class="">
<view class="" v-html="curriculumData.questions"></view>
<view class="" v-html="curriculumData.questions"></view>
<view class="haveAnswer" v-if="myAnswer.id">
<!-- 有答案 -->
<view class=" flex_box flex_between" style="padding: 20rpx; align-items: center;">
@@ -305,6 +305,7 @@
// #endif
this.answerForm.relationId = options.id
this.options = options;
console.log('shoudao de zhi',this.options );
this.noRecored = options.noRecored
console.log('this.noRecored=>', this.noRecored)
this.screenLoading = false;
@@ -807,6 +808,7 @@
},
// 判断用户是否加入了小班
getClassList(){
console.log('是否进入了班级列表查询',this.options);
$http.request({
url: '/common/class/getClassByUser',
method: "POST",
@@ -823,12 +825,12 @@
this.classList = []
console.log('获取班级列表',res.result);
if(res.code == 0){
if(res.result.id){
if(res.result != null && res.result.id){
this.isInClass = true
this.classList.push(res.result)
}else{
this.isInClass = false
// this.classList = []
this.classList = []
}
}
console.log('获取班级列表++++++',this.isInClass);

View File

@@ -739,7 +739,7 @@
v.isAudition == 1 && this.userMsg.vip == 0 && this.librayList[this.curIndex].isBuy == 0 ?
noRecored = true : ''
uni.navigateTo({
url: `${_myurl}?navTitle=${this.pageTitle}&title=${v.title}&id=${v.id}&conditions=${v.conditions}&noRecored=${noRecored}`,
url: `${_myurl}?navTitle=${this.pageTitle}&title=${v.title}&courseId=${this.courseId}&id=${v.id}&conditions=${v.conditions}&noRecored=${noRecored}`,
});
} else {
this.$commonJS.showToast("请先购买课程");

View File

@@ -2,9 +2,9 @@
<view class="page">
<z-nav-bar :title="pageName+pageType"></z-nav-bar>
<!-- 公共组件-每个页面必须引入 -->
<public-module ></public-module>
<public-module></public-module>
<!-- <view class="title">{{pageName+pageType}}</view> -->
<uni-forms :modelValue="form" :rules="rules" ref="form">
<uni-forms :modelValue="form" :rules="rules" ref="form">
<!-- <view class="input_box" v-if="!form.id && form.type != 2">
<uni-forms-item label="" name="type" label-width="0">
<text class="input_tit"><i>*</i>类型:</text>
@@ -30,53 +30,55 @@
</view>
</uni-forms-item>
</view>
<view class="input_box">
<text class="input_tit">上传图片:</text>
<view class="in" style="border: none;" @click="checkPermision">
<u-upload :fileList="fileList1" @afterRead="addPic" @delete="deletePic" multiple :maxCount="4"
width="40" height="40" :previewFullImage="true">
</u-upload>
<!-- <text style="font-size: 24rpx; color: #999;">可上传4张问题截图</text> -->
</view>
<!-- <input type="password" maxlength="8" v-model="confirmPassword" placeholder="请确认密码" /> -->
</view>
<view class="input_box">
<text class="input_tit">上传图片:</text>
<view class="in" style="border: none;" @click="checkPermision">
<u-upload :fileList="fileList1" @afterRead="addPic" @delete="deletePic" multiple :maxCount="4"
width="40" height="40" :previewFullImage="true">
</u-upload>
<!-- <text style="font-size: 24rpx; color: #999;">可上传4张问题截图</text> -->
</view>
<!-- <input type="password" maxlength="8" v-model="confirmPassword" placeholder="请确认密码" /> -->
</view>
<view class="input_box">
<uni-forms-item label="" name="content" label-width="0">
<text class="input_tit"><i>*</i>主要内容:<span style="font-weight: normal; color: #999; font-size: 26rpx;">(600字以内)</span></text>
<text class="input_tit"><i>*</i>主要内容:<span
style="font-weight: normal; color: #999; font-size: 26rpx;">(600字以内)</span></text>
<view class="in">
<view class="uni-textarea">
<!-- <textarea placeholder-style="font-size:26rpx" v-model="form.content" maxlength="600" auto-height
placeholder="请输入内容" /> -->
<view class="editor-wrapper">
<editor id="editor" class="ql-container" placeholder="请输入内容..."
show-img-size show-img-toolbar show-img-resize
@statuschange="onStatusChange" :read-only="readOnly"
@ready="onEditorReady">
</editor>
<textarea v-show="false" placeholder-style="font-size:26rpx" v-model="form.content"
maxlength="600" auto-height placeholder="请输入内容" />
<view class="editor-wrapper">
<editor id="editor" class="ql-container" placeholder="请输入内容..." show-img-size
show-img-toolbar show-img-resize @statuschange="onStatusChange"
:read-only="readOnly" @ready="onEditorReady">
</editor>
</view>
</view>
</view>
</uni-forms-item>
</view>
<view class="input_box" v-if="false">
<radio-group @change="radioChange" class="flex_box">
<view class="" style="margin-right:20rpx ;">
<radio value="0" :checked="0 == form.display" />他人不可见</label>
</view>
<view class="">
<radio value="1" :checked="1 == form.display" />他人可见</label>
</view>
</radio-group>
<span style="color: #999; font-size: 28rpx;">不勾选时班级管理员以外的人看不见提交的数据</span>
<view class="input_box" v-if="false">
<radio-group @change="radioChange" class="flex_box">
<view class="" style="margin-right:20rpx ;">
<radio value="0" :checked="0 == form.display" />他人不可见</label>
</view>
<view class="">
<radio value="1" :checked="1 == form.display" />他人可见</label>
</view>
</radio-group>
<span style="color: #999; font-size: 28rpx;">不勾选时班级管理员以外的人看不见提交的数据</span>
</view>
</uni-forms>
<view class="btn_box"><button @click="onSubmit"> </button></view>
</view>
</template>
<script>
import { parse } from 'qs';
import $http from '@/config/requestConfig.js';
import {
parse
} from 'qs';
import $http from '@/config/requestConfig.js';
import permission from "@/js_sdk/wa-permission/permission.js"
import {
mapState,
@@ -85,33 +87,41 @@ import $http from '@/config/requestConfig.js';
export default {
data() {
return {
flag: false,
fileList1: [],
playData: {},
//手机号账号
form: {
id: undefined, // 作业或者医案id
classId: undefined,
display:'1',
display: '1',
content: '', // 描述
img: '', //图片
type: undefined, // 反馈类型
sort:undefined
sort: undefined
},
range:[
{ value: '0', text: "班内作业",name:"班内作业"},
{ value: '1', text: "班内医案" ,name:"班内医案"},
range: [{
value: '0',
text: "班内作业",
name: "班内作业"
},
{
value: '1',
text: "班内医案",
name: "班内医案"
},
],
readOnly: false,
telError: false,
relationError: false,
relationErrorPattern:false,
relationErrorPattern: false,
rules: {
type: {
rules: [{
required: true,
errorMessage: '请选择类型',
}
]
},
title: {
@@ -122,60 +132,60 @@ import $http from '@/config/requestConfig.js';
]
},
content: {
rules: [{
required: true,
errorMessage: '请输入问题描述',
}
// content: {
// // rules: [{
// // required: true,
// // errorMessage: '请输入问题描述',
// // }
// // ]
// },
]
},
},
pageType: '',
pageName:''
pageName: ''
};
},
//第一次加载
onLoad(e) {
console.log('收到的值', e);
if(e.sort != 'undefined' && e.sort){
this.form.sort = e.sort
}
if(e.type == 2){
if (e.sort != 'undefined' && e.sort) {
this.form.sort = e.sort
}
if (e.type == 2) {
this.form.display = '0'
}
// this.pageType = e.type
this.form.classId = e.classId
this.form.type = e.type
if(e.type){
if (e.type) {
this.form.type = e.type
}else{
} else {
this.form.type = '0'
}
if(e.id){
if (e.id) {
// this.form.renwuId = e.renwuId
this.form.id = e.id
this.pageName = '编辑'
this.pageName = '编辑'
this.getTaskInfo()
}else{
} else {
this.pageName = '添加'
}
if(e.type == 0){
if (e.type == 0) {
// this.form.renwuId = e.renwuId
this.pageType = '作业'
}else if(e.type == 1){
} else if (e.type == 1) {
this.pageType = '医案'
}else if( e.type == 2){
} else if (e.type == 2) {
this.pageType = '心得222'
}else{
} else {
this.pageType = '作业'
}
console.log('收到的值', e);
},
//页面显示
onShow() {
},
computed: {
...mapState(['userInfo']),
@@ -193,7 +203,7 @@ import $http from '@/config/requestConfig.js';
// #ifdef APP-PLUS || MP-WEIXIN || H5
uni.createSelectorQuery().select('#editor').context((res) => {
this.editorCtx = res.context
if (this.form.content == '') return
if (this.form.content == '') return
res.context.setContents({
html: this.form.content
})
@@ -210,16 +220,16 @@ import $http from '@/config/requestConfig.js';
const formats = e.detail
this.formats = formats
},
chageType(e){
chageType(e) {
// console.log('e',e);
if(e == 0){
if (e == 0) {
this.pageType = '作业'
}else if(e == 1){
} else if (e == 1) {
this.pageType = '医案'
}
},
// 获取医案任务详情
getTaskInfo(){
getTaskInfo() {
$http.request({
url: "common/class/getClassTaskInfoStudent",
method: "POST",
@@ -237,10 +247,12 @@ import $http from '@/config/requestConfig.js';
this.form = res.classTask
this.onEditorReady()
this.fileList1 = []
if(this.form.img != ''){
if (this.form.img != '') {
var List = this.form.img.split(',')
List.forEach(item => {
this.fileList1.push({url:item})
this.fileList1.push({
url: item
})
})
}
}
@@ -253,11 +265,11 @@ import $http from '@/config/requestConfig.js';
})
});
},
radioChange(e){
radioChange(e) {
// console.log('点了', e);
this.form.display = e.detail.value
console.log('点了',this.form.show, e);
console.log('点了', this.form.show, e);
},
relationInput(e) {
@@ -268,14 +280,14 @@ import $http from '@/config/requestConfig.js';
// console.log('键盘输入',e);
this.telError = false
},
async checkPermision(){
var result = await permission.premissionCheck("CAMERA_EXTERNAL_STORAGE")
if (result != 1) {
return false
}
async checkPermision() {
var result = await permission.premissionCheck("CAMERA_EXTERNAL_STORAGE")
if (result != 1) {
return false
}
},
async addPic(e) {
console.log("添加图片");
async addPic(e) {
console.log("添加图片");
let that = this;
for (var i = 0; i < e.file.length; i++) {
//console.log(i,e.file[i].url)
@@ -288,7 +300,7 @@ import $http from '@/config/requestConfig.js';
success: (res) => {
that.fileList1.push({
url: JSON.parse(res.data).url,
});
});
console.log(that.fileList1, "that.uploadPicLIst");
},
fail: (error) => {
@@ -313,6 +325,16 @@ import $http from '@/config/requestConfig.js';
});
},
async onSubmit() {
let that = this
if (this.flag) {
console.log('拦截了吗');
return
} else {
this.flag = true
console.log('没拦截?', this.flag);
}
// this.flag = true
let data = await this.getHtml();
var _data = data.html.replace(/<.*?>/g, "")
if (!_data || _data == '') {
@@ -320,10 +342,6 @@ import $http from '@/config/requestConfig.js';
title: '请输入主要内容',
icon: 'none'
})
return
}
this.form.content = data.html
this.$refs.form.validate().then(async res => {
let data = await this.getHtml();
var _data = data.html.replace(/<.*?>/g, "")
if (!_data || _data == '') {
@@ -331,69 +349,68 @@ import $http from '@/config/requestConfig.js';
title: '请输入主要内容',
icon: 'none'
})
// this.flag = false
return
}
this.form.content = data.html
return
}
this.form.content = data.html
console.log('this.form.content', this.form);
this.$refs.form.validate().then(async res => {
if (this.fileList1.length > 0) {
let _list = this.fileList1
_list = _list.map(item => item.url)
// console.log('this.fileList1',_list);
this.form.img = _list.join(',')
}else{
} else {
this.form.img = ''
}
// var newSort = undefined
// if(this.form.sort) {
// console.log('this.sort',this.form.sort);
// // var oldsort = this.form.sort.split('')
// if(oldsort[oldsort.length-1] == '9'){
// oldsort.push('0')
// }else{
// console.log('符合');
// oldsort[oldsort.length-1] = ( parseInt(oldsort[oldsort.length-1]) + 1) + ''
// }
// newSort = oldsort.join('')
// }
console.log('this.form',this.form);
console.log('this.form', this.form);
var _url = ""
this.form.id ? _url = "common/class/editClassTask" : _url = "common/class/addClassTask"
$http.request({
url: _url,
method: "POST",
data: {
"id": this.form.id,
"classId": this.form.id ? undefined : this.form.classId,
"type": this.form.type, //类型 0班内任务1医案2心得
"display": this.form.display, //0不展示1展示
"title": this.form.title,
"content": this.form.content,
"img": this.form.img,
"sort": this.form.sort && !this.form.id ? parseInt(this.form.sort)+1 : undefined
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
this.form.id ? _url = "common/class/editClassTask" : _url = "common/class/addClassTask"
$http.request({
url: _url,
method: "POST",
data: {
"id": this.form.id,
"classId": this.form.id ? undefined : this.form.classId,
"type": this.form.type, //类型 0班内任务1医案2心得
"display": this.form.display, //0不展示1展示
"title": this.form.title,
"content": this.form.content,
"img": this.form.img,
"sort": this.form.sort && !this.form.id ? parseInt(this.form.sort) +
1 : undefined
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
// this.flag = false
uni.showToast({
title:'操作成功!',
icon:'success'
title: '操作成功!',
icon: 'success'
})
setTimeout(()=>{
uni.$emit('refreshData');
setTimeout(() => {
uni.$emit('refreshData');
uni.navigateBack({
delta: 1
})
},1000)
})
}, 1000)
}).catch(e => {
// console.log('表单错误信息:', err);
uni.showToast({
title: '操作失败',
icon: 'error'
})
});
this.flag = false
// console.log('表单错误信息:', err);
uni.showToast({
title: '操作失败',
icon: 'error'
})
});
}).catch(err => {
console.log('表单错误信息:', err);
this.flag = false
uni.showToast({
title: '页面有未填写的内容哦',
icon: 'none'
@@ -417,12 +434,15 @@ import $http from '@/config/requestConfig.js';
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
::v-deep .uni-forms-item{
::v-deep .uni-forms-item {
margin-bottom: 26rpx !important;
}
.input_tit{
.input_tit {
font-weight: bold;
}
.page {
background-color: #ffffff;
padding: 0 65rpx;

View File

@@ -152,7 +152,7 @@
<text class="ciyao">心得得分</text>
<text class="ciyao"><i
class="mainTxt PM_font">{{performanceScore.experienceScore}}</i></text>
</view>
</view>
<view v-if="classModel.isQuestion == 1" :class="['ite', blankNumber < 3 ? 'flex_box' : '']">
<text class="ciyao">思考题分</text>
<text class="ciyao"><i
@@ -241,7 +241,6 @@
<view class="" v-else>
<u-divider text="暂无学员加入"></u-divider>
</view>
</template>
<!-- {{getTijiaoTitleList}} -->
@@ -603,6 +602,9 @@
{
name: '班内心得',
id: '2'
},{
name: '思考题',
id: '3'
},
],
tijiaoTitleId: '0',
@@ -781,6 +783,9 @@
if (this.classModel.isExperience == 1) {
_list.push(this.defaultTijiaoTitleList[2])
}
if (this.classModel.isQuestion == 1) {
_list.push(this.defaultTijiaoTitleList[3])
}
// return _list
if(_list.length > 0){
this.tijiaoTitleList = _list
@@ -2326,8 +2331,9 @@
text {
display: block;
width: 30%;
padding: 8rpx 0;
// width: 30%;
margin: 0 10rpx;
padding: 8rpx;
border-radius: 10rpx;
text-align: center;
border: 1px solid $themeColor;