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

@@ -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

@@ -42,16 +42,16 @@
</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="请输入内容" /> -->
<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 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>
@@ -75,7 +75,9 @@
</view>
</template>
<script>
import { parse } from 'qs';
import {
parse
} from 'qs';
import $http from '@/config/requestConfig.js';
import permission from "@/js_sdk/wa-permission/permission.js"
import {
@@ -85,6 +87,7 @@ import $http from '@/config/requestConfig.js';
export default {
data() {
return {
flag: false,
fileList1: [],
playData: {},
//手机号账号
@@ -97,9 +100,16 @@ import $http from '@/config/requestConfig.js';
type: 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,
@@ -122,14 +132,14 @@ import $http from '@/config/requestConfig.js';
]
},
content: {
rules: [{
required: true,
errorMessage: '请输入问题描述',
}
// content: {
// // rules: [{
// // required: true,
// // errorMessage: '请输入问题描述',
// // }
]
},
// // ]
// },
},
pageType: '',
@@ -240,7 +250,9 @@ import $http from '@/config/requestConfig.js';
if (this.form.img != '') {
var List = this.form.img.split(',')
List.forEach(item => {
this.fileList1.push({url:item})
this.fileList1.push({
url: item
})
})
}
}
@@ -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,20 +342,22 @@ import $http from '@/config/requestConfig.js';
title: '请输入主要内容',
icon: 'none'
})
let data = await this.getHtml();
var _data = data.html.replace(/<.*?>/g, "")
if (!_data || _data == '') {
uni.showToast({
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 => {
let data = await this.getHtml();
var _data = data.html.replace(/<.*?>/g, "")
if (!_data || _data == '') {
uni.showToast({
title: '请输入主要内容',
icon: 'none'
})
return
}
this.form.content = data.html
if (this.fileList1.length > 0) {
let _list = this.fileList1
_list = _list.map(item => item.url)
@@ -342,18 +366,6 @@ import $http from '@/config/requestConfig.js';
} 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);
var _url = ""
this.form.id ? _url = "common/class/editClassTask" : _url = "common/class/addClassTask"
@@ -368,17 +380,20 @@ import $http from '@/config/requestConfig.js';
"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
"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'
})
setTimeout(() => {
uni.$emit('refreshData');
uni.navigateBack({
@@ -386,6 +401,7 @@ import $http from '@/config/requestConfig.js';
})
}, 1000)
}).catch(e => {
this.flag = false
// console.log('表单错误信息:', err);
uni.showToast({
title: '操作失败',
@@ -394,6 +410,7 @@ import $http from '@/config/requestConfig.js';
});
}).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 {
margin-bottom: 26rpx !important;
}
.input_tit {
font-weight: bold;
}
.page {
background-color: #ffffff;
padding: 0 65rpx;

View File

@@ -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;