From 99dfeb5fc86bce593a5d3f43f45c26eedc00ab0a Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期二, 10 九月 2024 16:28:54 +0800 Subject: [PATCH] bug --- pages/digitalCourses/digitalCoursesDetails/index.js | 75 +++++++++++++++++++++++++++++-------- 1 files changed, 59 insertions(+), 16 deletions(-) diff --git a/pages/digitalCourses/digitalCoursesDetails/index.js b/pages/digitalCourses/digitalCoursesDetails/index.js index ad21895..8b78e3a 100644 --- a/pages/digitalCourses/digitalCoursesDetails/index.js +++ b/pages/digitalCourses/digitalCoursesDetails/index.js @@ -310,22 +310,8 @@ if (res.datas.publishingUnit) { await this.getBookPublishUnit(res.datas.publishingUnit) } - let lecturer = [] if (res.datas.datas.speaker && res.datas.datas.speaker.length > 0) { - res.datas.datas.speaker.forEach(item => { - if (res.datas.subItems && res.datas.subItems.QueryCms.length > 0) { - res.datas.subItems.QueryCms.forEach(item1 => { - if (JSON.parse(item.Data.Value).items[0] == item1.id) { - lecturer.push({ - name: item1.name, - icon: item1.icon ? item1.icon : '', - description: item1.description ? item1.description : '', - }) - } - }) - - } - }) + this.getSpeaker(res.datas.datas.speaker) } if (this.data.bookPath) { this.getAboutBook(this.data.bookPath) @@ -338,12 +324,69 @@ '<img style="max-width:100%;height:auto;display:block;margin-top:0;margin-bottom:0;"' ) this.setData({ - lecturerList: lecturer, digitalsData: res.datas, loading: false }) }) }, + //鑾峰彇涓昏浜� + getSpeaker(list) { + let query = { + path: 'jsek_speaker', + fields: { + content: [], + positionalTitle: [] + }, + coverSize: { + height: 250 + } + } + app.MG.resource.getItem(query).then((res) => { + let lecturerList = [] + if (list && res.datas.length > 0) { + list.forEach((item) => { + if (res.datas && res.datas.length > 0) { + res.datas.forEach((item1) => { + if (JSON.parse(item.Data.Value).items[0] == item1.id) { + lecturerList.push({ + name: item1.name, + positionalTitle: item1.positionalTitle, + icon: item1.icon, + description: item1.description ? item1.description : '鏆傛棤绠�浠�' + }) + } + }) + } + }) + this.getPositionalTitle(lecturerList) + } + }) + }, + async getPositionalTitle(listStr) { + let list = [] + let query = { + refCodes: ['positionalTitle'] + } + await app.MG.store.getProductTypeField(query).then((res) => { + let option = JSON.parse(res[0].config).option + listStr.forEach((unit) => { + option.forEach((item) => { + if (item.value == unit.positionalTitle) { + unit.positionalName = item.name + } + }) + list.push({ + name: unit.name, + positionalTitle: unit.positionalName, + icon: unit.icon, + description: unit.description ? unit.description : '鏆傛棤绠�浠�' + }) + }) + this.setData({ + lecturerList: list + }) + }) + }, //鑾峰彇鍥句功鍑虹増鍗曚綅 async getBookPublishUnit(listStr) { -- Gitblit v1.9.1