diff --git a/pages/miniClass/addHomeWork.vue b/pages/miniClass/addHomeWork.vue
index 5efc25b..3e1d884 100644
--- a/pages/miniClass/addHomeWork.vue
+++ b/pages/miniClass/addHomeWork.vue
@@ -42,11 +42,18 @@
- *说明:(600字以内)
+ *主要内容:(600字以内)
-
+
+
+
+
+
@@ -94,6 +101,7 @@ import $http from '@/config/requestConfig.js';
{ value: '0', text: "班内作业",name:"班内作业"},
{ value: '1', text: "班内医案" ,name:"班内医案"},
],
+ readOnly: false,
telError: false,
relationError: false,
relationErrorPattern:false,
@@ -178,6 +186,30 @@ import $http from '@/config/requestConfig.js';
},
//方法
methods: {
+ readOnlyChange() {
+ this.readOnly = !this.readOnly
+ },
+ onEditorReady() {
+ // #ifdef APP-PLUS || MP-WEIXIN || H5
+ uni.createSelectorQuery().select('#editor').context((res) => {
+ this.editorCtx = res.context
+ if (this.form.content == '') return
+ res.context.setContents({
+ html: this.form.content
+ })
+ }).exec()
+ // #endif
+ },
+ undo() {
+ this.editorCtx.undo()
+ },
+ redo() {
+ this.editorCtx.redo()
+ },
+ onStatusChange(e) {
+ const formats = e.detail
+ this.formats = formats
+ },
chageType(e){
// console.log('e',e);
if(e == 0){
@@ -203,6 +235,7 @@ import $http from '@/config/requestConfig.js';
// that.isHave = true
console.log(res)
this.form = res.classTask
+ this.onEditorReady()
this.fileList1 = []
if(this.form.img != ''){
var List = this.form.img.split(',')
@@ -267,8 +300,40 @@ import $http from '@/config/requestConfig.js';
deletePic(event) {
this.fileList1.splice(event.index, 1)
},
- onSubmit() {
- this.$refs.form.validate().then(res => {
+ getHtml() {
+ return new Promise((resolve, reject) => {
+ this.editorCtx.getContents({
+ success: (res) => {
+ resolve(res);
+ },
+ fail: (error) => {
+ reject(err);
+ },
+ });
+ });
+ },
+ async onSubmit() {
+ 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
+ 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)
diff --git a/pages/miniClass/classInfo.vue b/pages/miniClass/classInfo.vue
index c695207..c5b478a 100644
--- a/pages/miniClass/classInfo.vue
+++ b/pages/miniClass/classInfo.vue
@@ -67,7 +67,7 @@
A证,
查看证书
-->
- 很遗憾,您的成绩未达标
+
设置班委
-
结班
-
-
+ -->
+ v-if="thisClass.showOverBtn && (roleCode.includes('1') || roleCode.includes('2'))">
结班
@@ -1090,25 +1089,26 @@
}
this.classModel = res.result.classModel
// this.thisClass.showOverBtn = false
- if (this.thisClass.state == '1') {
+ // if (this.thisClass.state == '1') {
const nowTime = Date.now()
console.log('starting timer...毫秒', nowTime)
var datecc = new Date(this.thisClass.startTime);
console.log('datecc...', datecc)
var time3 = datecc.getTime(); // 开班时间的时间戳 毫秒
console.log('time3...毫秒', time3, this.classModel.days)
- var off70 = undefined // 时长过70%显示结班按钮天数
- off70 = Math.ceil(parseInt(this.classModel.days) * 0.7)
- var off70miniSecond = off70 * 1000 * 60 * 60 * 24
+ // var off70 = undefined // 时长过70%显示结班按钮天数
+ // off70 = Math.ceil(parseInt(this.classModel.days) * 0.7)
+ var off70miniSecond = this.classModel.days * 1000 * 60 * 60 * 24
console.log('时间比较', (off70miniSecond + time3), nowTime)
if ((off70miniSecond + time3) <= nowTime) {
console.log('显示结班按钮');
this.thisClass.showOverBtn = true
} else {
console.log('不显示');
+ this.thisClass.showOverBtn = false
}
- console.log('off70...天数', off70, off70miniSecond)
- }
+ // console.log('off70...天数', off70, off70miniSecond)
+ // }
this.thisClass.homeWorkNumber = 4
@@ -1365,6 +1365,7 @@
}
.daikaibtn {
+ margin-top: 20rpx; margin-left: 20rpx;
.item {
padding: 10rpx 6rpx;
}