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

View File

@@ -739,7 +739,7 @@
v.isAudition == 1 && this.userMsg.vip == 0 && this.librayList[this.curIndex].isBuy == 0 ? v.isAudition == 1 && this.userMsg.vip == 0 && this.librayList[this.curIndex].isBuy == 0 ?
noRecored = true : '' noRecored = true : ''
uni.navigateTo({ 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 { } else {
this.$commonJS.showToast("请先购买课程"); this.$commonJS.showToast("请先购买课程");

View File

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

View File

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