From ebd8dff627e80edc2506631f46f677cbf22460e0 Mon Sep 17 00:00:00 2001 From: "@fawn-nine" <1271023382@qq.com> Date: Wed, 7 Aug 2024 10:41:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/miniClass/addHomeWork.vue | 56 +++++++++++++--- pages/miniClass/classInfo.vue | 104 ++++++++++++++++++++++------- pages/miniClass/classInfoMan.vue | 1 - pages/miniClass/myClassList.vue | 8 +-- pages/miniClass/taskDetail.vue | 108 ++++++++++++++++--------------- 5 files changed, 187 insertions(+), 90 deletions(-) diff --git a/pages/miniClass/addHomeWork.vue b/pages/miniClass/addHomeWork.vue index 55af8ef..4ff8791 100644 --- a/pages/miniClass/addHomeWork.vue +++ b/pages/miniClass/addHomeWork.vue @@ -104,10 +104,11 @@ this.pageType = e.type this.form.classId = e.id this.form.type = e.type - if(e.options){ + if(e.id){ // this.form.renwuId = e.renwuId - this.form = JSON.parse(e.options) - this.pageName = '编辑' + this.form.id = e.id + this.pageName = '编辑' + this.getTaskInfo() }else{ this.pageName = '添加' } @@ -123,7 +124,7 @@ }, //页面显示 onShow() { - + }, computed: { ...mapState(['userInfo']), @@ -134,6 +135,40 @@ }, //方法 methods: { + // 获取医案任务详情 + getTaskInfo(){ + $http.request({ + url: "common/class/getClassTaskInfo", + method: "POST", + data: { + "taskId": this.form.id + }, + header: { //默认 无 说明:请求头 + 'Content-Type': 'application/json' + }, + }) + .then(res => { + if (res.code == 0) { + // that.isHave = true + console.log(res) + this.form = res.classTask + this.fileList1 = [] + if(this.form.img != ''){ + var List = this.form.img.split(',') + List.forEach(item => { + this.fileList1.push({url:item}) + }) + } + } + }).catch(e => { + console.log(e, '数据报错') + // this.status = 3 + uni.showToast({ + title: e.msg, + icon: 'error' + }) + }); + }, radioChange(e){ // console.log('点了', e); @@ -183,10 +218,10 @@ }, onSubmit() { this.$refs.form.validate().then(res => { - var _show = '1' - if(this.form.type == 2){ - this.form.display == true ? _show = '1' : _show = '0' - } + // var _show = '1' + // if(this.form.type == 2){ + // this.form.display == true ? _show = '1' : _show = '0' + // } if (this.fileList1.length > 0) { let _list = this.fileList1 @@ -200,9 +235,10 @@ url: _url, method: "POST", data: { - "classId": this.form.classId, + "id": this.form.id, + "classId": this.form.id ? undefined : this.form.classId, "type": this.form.type, //类型 0班内任务1医案2心得 - "display": _show, //0不展示1展示 + "display": this.form.display, //0不展示1展示 "title": this.form.title, "content": this.form.content, "img": this.form.img diff --git a/pages/miniClass/classInfo.vue b/pages/miniClass/classInfo.vue index 37d4107..18ca83a 100644 --- a/pages/miniClass/classInfo.vue +++ b/pages/miniClass/classInfo.vue @@ -58,18 +58,19 @@ - + - - - {{item.nickname}} + + {{item.student.nickname}} + 匿名用户 @@ -108,8 +109,7 @@ - - + @@ -117,16 +117,21 @@ {{item.title}} - {{item.content}} - - - 修改 + {{item.content}} + + + + 发布者:{{item.createUser.nickname != null && item.createUser.nickname != '' ? item.createUser.nickname : '匿名用户'}} + 日期:{{item.createTime}} + + + 修改 已提交答案 - 未提交答案 + 未提交答案 点击开始答题 @@ -148,7 +153,53 @@ - + + + +

班内管理人员

+ + 班长: + + {{admins.monitor.user.nickname != null && admins.monitor.user.nickname != '' ? admins.monitor.user.nickname : '匿名用户'}} + ({{admins.monitor.user.tel}}) + + 暂未设置 + + + 副班长: + + {{admins.dmonitor.user.nickname != null && admins.dmonitor.user.nickname != '' ? admins.dmonitor.user.nickname : '匿名用户'}} + ({{admins.dmonitor.user.tel}}) + + 暂未设置 + + 学习委员: + + {{admins.learner.user.nickname != null && admins.learner.user.nickname != '' ? admins.learner.user.nickname : '匿名用户'}} + ({{admins.learner.user.tel}}) + + 暂未设置 + + 记分员: + + 暂未设置 + + 评分员: + + 暂未设置 + +
+
@@ -239,11 +290,11 @@ id: '0' }, { - name: '医案', + name: '班内医案', id: '1' }, { - name: '心得', + name: '班内心得', id: '2' }, ], @@ -285,9 +336,9 @@ }, methods: { editMyXinde(item){ - var options = JSON.stringify(item) + // var options = JSON.stringify(item) uni.navigateTo({ - url:`/pages/miniClass/addHomeWork?options=${options}&type=2` + url:`/pages/miniClass/addHomeWork?id=${item.id}&type=2` }) }, radioChange1(e){ @@ -316,7 +367,7 @@ // console.log('options',options); uni.navigateTo({ - url:`/pages/miniClass/taskDetail?options=${options}` + url:`/pages/miniClass/taskDetail?id=${item.id}` }) }, delClass() { @@ -371,7 +422,7 @@ url: "common/class/getClassTaskListStudent", method: "POST", data: { - "limit": 100, + "limit": 10, "page": 1, "classId": this.thisClass.id, "type": this.tijiaoTitleId+'', //类型 0班内任务1医案2心得 @@ -855,10 +906,18 @@ // .userName{} } .leve2{ - color: #999; - @include bov() + color: #666; + @include bov(3) + } - .leve3{color: $themeColor; text-align: center; padding-top: 10rpx;} + .leve3{ + color: $themeColor; text-align: center; padding-top: 10rpx; + .tips{ + width: 100%; justify-content: space-between;font-size: 26rpx; color: #999; + } + .date{ } + .btn{border: 1px solid $themeColor; margin-top: 20rpx; display: inline-block; width: 50%; padding: 6rpx 0; border-radius: 10rpx;} + } .leve3.no{color: #ff9277; text-align: center;} } } @@ -894,6 +953,7 @@ } .classMateBox { + .newBox{justify-content: space-between; flex-wrap: wrap;} .zmVip { background-image: linear-gradient(-60deg, #53966a 0%, #e1feef 50%, #e1feef 100%); } @@ -907,7 +967,7 @@ } .item { - width: 100%; + width:48%; position: relative; .textItems { diff --git a/pages/miniClass/classInfoMan.vue b/pages/miniClass/classInfoMan.vue index e0a01e6..0d252b4 100644 --- a/pages/miniClass/classInfoMan.vue +++ b/pages/miniClass/classInfoMan.vue @@ -179,7 +179,6 @@
-

班内管理人员

diff --git a/pages/miniClass/myClassList.vue b/pages/miniClass/myClassList.vue index c23cbd6..8e76c43 100644 --- a/pages/miniClass/myClassList.vue +++ b/pages/miniClass/myClassList.vue @@ -18,7 +18,7 @@ - + @@ -26,8 +26,8 @@ - - + + {{item.title}} @@ -37,7 +37,7 @@ --> - 进入班级 + 进入班级 diff --git a/pages/miniClass/taskDetail.vue b/pages/miniClass/taskDetail.vue index 75160cb..a440146 100644 --- a/pages/miniClass/taskDetail.vue +++ b/pages/miniClass/taskDetail.vue @@ -175,23 +175,18 @@ }, onLoad(e) { uni.hideTabBar(); - this.thisTask = JSON.parse(e.options) - console.log('e', this.thisTask) - - if (this.thisTask.img != '') { - var imgs = this.thisTask.img.split(',') - imgs = imgs.forEach((item, index) => { - this.FileList11.push({ - url: item - }) - }) - } else { - this.FileList11 = [] - } - console.log('this.FileList', this.FileList) + // this.thisTask = JSON.parse(e.options) + console.log('e',e) + if(e.id){ + this.thisTask.id = e.id + this.getTaskInfo() + this.getZuoyeList() + } + + // console.log('this.FileList', this.FileList) // this.TaskId = e.id this.getUserInfo() - this.getZuoyeList() + }, onReachBottom() { if (this.status != 2 && this.status != 3) { @@ -203,14 +198,50 @@ uni.stopPullDownRefresh() }, onShow() { - this.form.taskId = this.thisTask.id - - // this.getTaskInfo() + this.form.taskId = this.thisTask.id + }, computed: { ...mapState(["userInfo"]), }, methods: { + // 获取医案任务详情 + getTaskInfo(){ + $http.request({ + url: "common/class/getClassTaskInfo", + method: "POST", + data: { + "taskId": this.thisTask.id + }, + header: { //默认 无 说明:请求头 + 'Content-Type': 'application/json' + }, + }) + .then(res => { + if (res.code == 0) { + // that.isHave = true + console.log(res) + this.thisTask = res.classTask + this.fileList11 = [] + if (this.thisTask.img != '') { + var imgs = this.thisTask.img.split(',') + imgs = imgs.forEach((item, index) => { + this.FileList11.push({ + url: item + }) + }) + } + console.log('this.fileList11',this.fileList11); + } + }).catch(e => { + console.log(e, '数据报错') + // this.status = 3 + uni.showToast({ + title: e.msg, + icon: 'error' + }) + }); + }, closePup(){ this.showEditBlank = false this.form = { @@ -270,7 +301,7 @@ this.loadFlag = true; this.pPage++; $http.request({ - url: 'common/class/getReplyListByTaskId', + url: 'common/class/getReplyListByTaskIdStudent', method: "POST", data: { "limit": 10, @@ -370,11 +401,11 @@ icon: 'success' }) this.FileList = [] - this.closePup() - this.thisTask.reply = true + this.closePup() setTimeout(()=>{ this.pPage = 0 this.zuoyeList = [] + this.getTaskInfo() this.getZuoyeList() },200) }).catch(e => { @@ -425,38 +456,8 @@ this.form.display = e.detail.value console.log('点了', this.form.display, e); - }, - getTaskInfo() { - uni.showLoading({ - title: '正在加载' - }) - $http.request({ - url: "common/class/getTaskInfo", - method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档 - data: { - "TaskId": this.TaskId // 班类型 0小班 1联合班 2精英班 - }, - header: { //默认 无 说明:请求头 - 'Content-Type': 'application/json' - }, - }) - .then(res => { - this.refresh = false - if (res.code == 0) { - - - } - uni.hideLoading() - }).catch(e => { - uni.hideLoading() - console.log(e, '数据报错') - // this.status = 3 - uni.showToast({ - title: `获取数据失败`, - icon: 'error' - }) - }); } + } } @@ -473,7 +474,8 @@ padding-right: 20rpx; } .noanser{ padding: 20rpx; - text-align: center; border-bottom: 1px solid #eee; + text-align: center; + // border-bottom: 1px solid #eee; .btn{display: inline-block; border-radius: 20rpx ; padding: 10rpx 20rpx; background-color: $themeColor; color: #fff;} } .in {