From 5c236aa8ee143c1f0f23e738f92c0ebc21270549 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期二, 02 四月 2024 16:26:28 +0800 Subject: [PATCH] 答题器bug修改 --- packageBookService/pages/bookServices/detail/index.js | 140 +++++++++++++++++++++++++++------------------- 1 files changed, 82 insertions(+), 58 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index 6d7e767..1aa1212 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -418,9 +418,9 @@ selectedIds: res.datas[0].defaultSaleMethod.id, bookBuy: res.datas[0].purchasedSaleMethodIdList.indexOf(res.datas[0].defaultSaleMethodId) > -1 }); - console.log(this.data.bookItemDetail, 'bookItemData.value'); let times = new Date(res.datas[0].defaultSaleMethod.endDate).getTime() let startTime = new Date(res.datas[0].defaultSaleMethod.beginDate).getTime() + if (times < new Date().getTime() || new Date().getTime() < startTime) { this.setData({ expire: true @@ -523,7 +523,6 @@ } }) } else { - debugger if (this.data.bookDetail.isFavourite) { app.MG.store .delProductLink({ @@ -822,15 +821,7 @@ // 鍥句功娣诲姞璐墿杞� async addBookShopcCar() { if (!this.data.expire) { - const token = wx.getStorageSync('jsek-token') - if (!token) { - return wx.getUserProfile({ - desc: '鐢ㄦ埛鐧诲綍', - success: (res) => { - console.log(res); - } - }) - } + const shoppingCartGetId = [] @@ -1008,49 +999,64 @@ this.setData({ applyResourceState: true }) - wx.showLoading({ - title: '鍔犺浇涓�', - }) - // let role = userStore.userInfo ? userStore.userInfo.role : null - // if (role) { - // if (role == 'Teacher') { - // 鐢宠鏁欏璧勬簮 - let query = { - topicIdOrRefCode: 'productDownLoad', - type: 'applyForDownload', - state: 'WaitAudit', - cmsTypeRefCode: '', - newDataListRequest: [], - name: this.data.bookDetail.name, // name涓虹敵璇风殑涔︽湰鍚嶇О - content: JSON.stringify([{ - name: this.data.bookDetail.name, - id: this.data.bookDetail.id, - // defaultSaleMethodId: bookData.value.defaultSaleMethodId, - icon: this.data.bookDetail.icon - }]) - } - app.MG.ugc.newTopicMessage(query).then(async (res) => { - if (res) { - wx.showToast({ - title: '鐢宠宸叉彁浜わ紝璇峰緟瀹℃牳閫氳繃鍚庝笅杞�', + let role = JSON.parse(wx.getStorageSync(app.config.userInfoKey)).role + if (role) { + if (role == 'Teacher') { + wx.showLoading({ + title: '鍔犺浇涓�', + }) + // 鐢宠鏁欏璧勬簮 + let query = { + topicIdOrRefCode: 'productDownLoad', + type: 'applyForDownload', + state: 'WaitAudit', + cmsTypeRefCode: '', + newDataListRequest: [], + name: this.data.bookDetail.name, // name涓虹敵璇风殑涔︽湰鍚嶇О + content: JSON.stringify([{ + name: this.data.bookDetail.name, + id: this.data.bookDetail.id, + // defaultSaleMethodId: bookData.value.defaultSaleMethodId, + icon: this.data.bookDetail.icon + }]) + } + app.MG.ugc.newTopicMessage(query).then(async (res) => { + if (res) { + wx.showToast({ + title: '鐢宠宸叉彁浜�', + duration: 2000, + }) + } + await this.getApplyInfo(this.data.bookDetail.id) + }) + } else { + wx.showModal({ + title: '灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�', + content: '璇峰厛杩涜鏁欏笀璁よ瘉锛�', + complete: (res) => { + if (res.cancel) {} + if (res.confirm) { + wx.navigateTo({ + url: '/packageDomain/pages/teacherCertification/index', + }) + } + } }) } - await this.getApplyInfo(this.data.bookDetail.id) - }) - // } else { - // ElMessageBox.confirm('璇峰厛杩涜鏁欏笀璁よ瘉锛�', '灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�', { - // confirmButtonText: '鍘昏璇�', - // cancelButtonText: '鍙栨秷', - // type: 'warning' - // }) - // .then(() => { - // isShow.value = true - // }) - // .catch(() => { }) - // } - // } else { - // // logIn() - // } + } else { + wx.showModal({ + title: '灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�', + content: '璇峰厛杩涜鏁欏笀璁よ瘉锛�', + complete: (res) => { + if (res.cancel) {} + if (res.confirm) { + wx.navigateTo({ + url: '/packageDomain/pages/teacherCertification/index', + }) + } + } + }) + } }, // 鏁欏璧勬簮涓嬭浇鍓嶅線PC鎻愮ずDiialog closeTeachDownload() { @@ -1060,10 +1066,27 @@ }, // 涓嬭浇鍔熻兘 downloadTeach(e) { - this.setData({ - isShowTeachDownload: true - }) - console.log('zhuan', this.data.isShowTeachDownload); + let role = JSON.parse(wx.getStorageSync(app.config.userInfoKey)).role + if (role && role == 'Teacher') { + this.setData({ + isShowTeachDownload: true + }) + } else { + wx.showModal({ + title: '灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�', + content: '璇峰厛杩涜鏁欏笀璁よ瘉锛�', + complete: (res) => { + if (res.cancel) { + + } + if (res.confirm) { + wx.navigateTo({ + url: '/packageDomain/pages/teacherCertification/index', + }) + } + } + }) + } // const data = e.detail.value // // const data // // let role = userStore.userInfo ? userStore.userInfo.role : null @@ -1256,6 +1279,7 @@ let freeIds = arr.filter((item) => { return item.saleMethod[0].Price == 0 }) + debugger if (!freeIds.length) return wx.showToast({ icon: "error", title: '鏆傛棤鍏嶈垂璧勬簮', @@ -1270,7 +1294,7 @@ }) } }) - + debugger let query = { remarks: '浜戝涔�', requests, @@ -1518,7 +1542,7 @@ return false; } wx.navigateTo({ - url: '/packageBookService/pages/components/webView/index?md5=' + this.data.fileInfo.md5 + '&fileName=' + this.data.fileInfo.bookName + '&fileType=' + this.data.fileInfo.fileType + '&freePage=' + this.data.fileInfo.freePage + '&bookBuy=' + this.data.bookBuy + url: '/packageBookService/pages/components/webView/index?md5=' + this.data.fileInfo.md5 + '&fileName=' + this.data.fileInfo.bookName + '&fileType=' + this.data.fileInfo.fileType + '&freePage=' + this.data.fileInfo.freePage + '&bookBuy=' + this.data.bookBuy + '&bookId=' + this.data.bookDetail.id }) }, -- Gitblit v1.9.1