From b55024ee2f42aa93e0ecaa3113bdeb286f6e59ac Mon Sep 17 00:00:00 2001 From: QYF-GitLab1 <1940665526@qq.com> Date: 星期二, 29 七月 2025 18:01:55 +0800 Subject: [PATCH] 优化按钮显示,教学互动 --- packageCourse/pages/teachClass/detail/index.js | 26 ++++++++++++++++++++++++-- 1 files changed, 24 insertions(+), 2 deletions(-) diff --git a/packageCourse/pages/teachClass/detail/index.js b/packageCourse/pages/teachClass/detail/index.js index 00cea8e..3fcab3c 100644 --- a/packageCourse/pages/teachClass/detail/index.js +++ b/packageCourse/pages/teachClass/detail/index.js @@ -93,6 +93,7 @@ }] } app.MG.ugc.getTopicMessageList(data).then((res) => { + debugger const list = res.datas.map((item, i) => { item.question = [] item.bookId = null @@ -101,7 +102,14 @@ try { const obj = JSON.parse(item.content) if (obj.bookId) { - item.question = obj.content + item.question = obj.content.map((citem) => { + return { + ...citem, + updateDate: moment(item.updateDate).format('YYYY-MM-DD HH:mm:ss'), + userId: item.appUserCreator.userId + } + }) + // item.question = obj.content item.bookId = obj.bookId item.path = obj.path item.userName = obj.userName ?? '-' @@ -114,12 +122,15 @@ questionTime: moment(item.updateDate).format('YYYY-MM-DD HH:mm:ss') } }) + console.log(JSON.stringify(list), 'dialog') + this.setData({ dataList: list, loading: false }) }) }, + // 鑾峰彇棰樼洰鍒楄〃 getQuestions(item) { @@ -231,12 +242,20 @@ ] for (let i = 0; i < arr.length; i++) { const item = arr[i] - item.questionTypeList = questionTypeList + item.questionTypeList = JSON.parse(JSON.stringify(questionTypeList)) for (let j = 0; j < zrr.length; j++) { const ele = zrr[j] const qusObj = item.question.find((citem) => citem.cmsItemId == ele.id) if (qusObj?.cmsItemId) { ele.userAnswer = qusObj.answer + if (ele.questionType == 'singleChoice' || ele.questionType == 'multipleChoice' || ele.questionType == 'judge') { + ele.questionOption = ele.questionOption.map(item => { + return { + ...item, + label: item.txt + } + }) + } const index = this.findIndexByValue(questionTypeList, ele.questionType) if (index > -1) { item.questionTypeList[index].data.push(ele) @@ -244,6 +263,9 @@ } } item.questionTypeList = item.questionTypeList.filter((item) => item.data.length > 0) + if (!item.userName) { + item.userName = '-' + } newData.push(item) } return newData.filter((item) => item.questionTypeList.length > 0) -- Gitblit v1.9.1