diff --git a/pages/miniClass/MonitorClassList.vue b/pages/miniClass/MonitorClassList.vue index 885378d..eed33bd 100644 --- a/pages/miniClass/MonitorClassList.vue +++ b/pages/miniClass/MonitorClassList.vue @@ -2,7 +2,7 @@ - + + 修改 @@ -262,18 +263,58 @@ deletePic(event) { this.fileList1.splice(event.index, 1) }, + getHomeWorkDetail(id){ + uni.showLoading({ + title:"加载中" + }) + $http.request({ + url: 'common/class/getClassTaskAndQuesReplyInfo', + method: "POST", + data: { + "replyId":id, //0全部作业1我的作业 + }, + header: { //默认 无 说明:请求头 + 'Content-Type': 'application/json' + }, + }) + .then(res => { + if(res.classTaskAndQuesReply){ + console.log('作业详情res',res); + this.form = res.classTaskAndQuesReply + this.fileList1 = [] + if(res.classTaskAndQuesReply.img != ''){ + var _imgList = res.classTaskAndQuesReply.img.split(',') + _imgList.forEach(item => { + this.fileList1.push({url:item}) + }) + } + // this.fileList1 = [...res.classTaskAndQuesReply.fileList] + console.log('fileList4545',this.fileList1); + this.showEditBlank = true + }else{ + this.form = {} + } + + uni.hideLoading() + }).catch(e => { + uni.hideLoading() + uni.showToast({ + title: '获取作业详情失败', + icon:'none' + }) + }) + }, editOrAdd(item){ console.log('item', item); if(item){ - this.form = item - this.fileList1 = [...item.fileList] - console.log('fileList4545',item.fileList); + this.getHomeWorkDetail(item.id) } else{ console.log('form', this.form); + this.showEditBlank = true } - this.showEditBlank = true + }, radioChange1(e){ @@ -376,22 +417,31 @@ }, onSubmit() { this.$refs.form.validate().then(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{ + this.form.img = '' } var _url = "" this.form.id ? _url = - 'common/class/editClassTaskReply' : _url = 'common/class/addClassTaskReply' + 'common/class/editClassTaskAndQuesReply' : _url = 'common/class/addClassTaskAndQuesReply' + // this.form.id ? _url = + // 'common/class/editClassTaskReply' : _url = 'common/class/addClassTaskReply' + + var data = { - "taskId": this.form.id ? undefined : this.form.taskId, + "relationId": this.form.id ? undefined : this.form.taskId, "id": this.form.id, + "type": this.thisTask.type == '0' || this.thisTask.type == '1' ? '0' : '1', //类型0任务1课后题 "display": this.form.display, //0不展示1展示 "content": this.form.content, - "img": this.form.img + "img": this.form.img } + console.log('data',data); $http.request({ url: _url, diff --git a/pages/miniClass/taskDetailForMan.vue b/pages/miniClass/taskDetailForMan.vue index 08d816c..131bf3d 100644 --- a/pages/miniClass/taskDetailForMan.vue +++ b/pages/miniClass/taskDetailForMan.vue @@ -37,28 +37,28 @@ :src="item.createUser.avatar" mode="aspectFit"> - + 匿名用户 + v-if="item.createUser.nickname != '' && item.createUser.nickname != null">{{item.createUser.nickname}} 匿名用户 - - + {{item.content}} - + 分数:{{item.score}} - 未评分 + + 等待另一名评分员评分 + 请您评分 + + + 未开始评分 {{item.createTime}} @@ -92,7 +92,7 @@ 日期:{{curReplay.createTime}} - + 学员信息:{{curReplay.createUser.nickname != null && curReplay.createUser.nickname != '' ? curReplay.createUser.nickname : '匿名用户'}} / {{curReplay.createUser.tel}} @@ -102,7 +102,7 @@ 未评分 -