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 | 107 +++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 75 insertions(+), 32 deletions(-) diff --git a/pages/digitalCourses/digitalCoursesDetails/index.js b/pages/digitalCourses/digitalCoursesDetails/index.js index c9aedc0..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,9 +324,66 @@ '<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 }) }) }, @@ -1013,22 +1056,22 @@ onCertificate() { - // if (!this.data.isBuy) { - // wx.showToast({ - // title: "璇峰厛璐拱锛屼綋楠屽畬鏁存湇鍔�", - // icon: "none", - // duration: 1000, - // }); - // return false - // } - // if (!this.data.isLearn) { - // wx.showToast({ - // title: "鎮ㄧ殑瀛︿範浠诲姟杩樻湭瀹屾垚锛屾殏涓嶈兘鐢宠璇佷功锛屽姞娌瑰摝锛�", - // icon: "none", - // duration: 1000, - // }); - // return false - // } + if (!this.data.isBuy) { + wx.showToast({ + title: "璇峰厛璐拱锛屼綋楠屽畬鏁存湇鍔�", + icon: "none", + duration: 1000, + }); + return false + } + if (!this.data.isLearn) { + wx.showToast({ + title: "鎮ㄧ殑瀛︿範浠诲姟杩樻湭瀹屾垚锛屾殏涓嶈兘鐢宠璇佷功锛屽姞娌瑰摝锛�", + icon: "none", + duration: 1000, + }); + return false + } if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') { wx.showToast({ title: "鎮ㄧ敵璇风殑璇佷功姝e湪瀹℃牳涓�", -- Gitblit v1.9.1