From 3d73fb33c46aada16a6060adcd4ea14bb33b6b2a Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期二, 09 四月 2024 10:39:11 +0800 Subject: [PATCH] 详情页tabs样式优化,答题添加页面退出拦截,合并代码 --- packageBookService/pages/bookServices/list/index.wxml | 6 packageBookService/pages/bookServices/examination/questionList/index.wxss | 9 packageBookService/pages/bookServices/examination/questionList/index.wxml | 5 packageBookService/pages/bookServices/detail/index.wxml | 292 +++++++- packageBookService/pages/bookServices/detail/index.wxss | 3 pages/bookServices/assort/index.js | 121 +- packageBookService/pages/bookServices/examination/examination.wxml | 8 packagePersonal/pages/feedBack/index.wxml | 2 packageBookService/pages/bookServices/examination/examination.js | 35 pages/personalCenter/feedBackSubmit/index.js | 17 packageBookService/pages/bookServices/detail/components/note/note.js | 301 ++++---- packageBookService/pages/bookServices/detail/components/testResource/testResource.js | 138 ++- packageBookService/pages/bookServices/detail/components/tree/index.js | 6 packagePersonal/pages/myMassage/index.js | 18 packageBookService/pages/bookServices/list/index.js | 344 +++++---- packagePersonal/pages/feedBack/index.js | 23 packageDomain/pages/sampleBookList/index.js | 48 - pages/bookServices/assort/index.wxml | 4 packageBookService/pages/bookServices/detail/index.js | 250 ++++-- pages/bookServices/assort/index.wxss | 7 packageBookService/pages/bookServices/detail/components/teachResource/index.js | 6 packageBookService/pages/bookServices/detail/components/note/note.wxml | 4 packageBookService/pages/bookServices/detail/components/note/note.wxss | 14 packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxml | 6 packageBookService/pages/bookServices/detail/components/teachResource/index.wxml | 11 packageBookService/pages/bookServices/examination/questionOptions/index.js | 230 +++--- packageDomain/pages/sampleBookList/applicationForm/index.js | 12 packageBookService/pages/bookServices/detail/components/tree/index.wxss | 19 packageBookService/pages/bookServices/detail/components/tree/index.wxml | 19 pages/bookServices/assort/index.json | 2 packageDomain/pages/sampleBookList/index.json | 3 packagePersonal/pages/downloads/index.js | 2 packagePersonal/pages/sampleBooks/index.js | 2 packageBookService/pages/bookServices/detail/components/testResource/testResource.wxss | 5 packageBookService/pages/bookServices/detail/components/testResource/testResource.wxml | 11 35 files changed, 1,155 insertions(+), 828 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxml b/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxml index b8ee0b4..ed858eb 100644 --- a/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxml +++ b/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxml @@ -24,14 +24,14 @@ theme="primary" style="height: 72rpx; font-size: 28rpx" bind:tap="goBuyResource" - style="margin: {{!isshowDrawBtn ? '0 30rpx' : ''}}" + style="height: 72rpx; font-size: 28rpx;margin: {{!isshowDrawBtn ? '0 30rpx' : ''}}" > <view slot="content" class="btn-content"> <image src="/static/images/bookService/detail/yijiangoumai.png" /> <text>璧勬簮璐拱</text> </view> </t-button> - <t-button + <!-- <t-button class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx" @@ -39,5 +39,5 @@ > <image src="/static/images/bookService/detail/renwudan锛廼con.png" /> 瀛︿範浠诲姟鍗� - </t-button> + </t-button> --> </view> diff --git a/packageBookService/pages/bookServices/detail/components/note/note.js b/packageBookService/pages/bookServices/detail/components/note/note.js index 3d9d9e0..f09f7d7 100644 --- a/packageBookService/pages/bookServices/detail/components/note/note.js +++ b/packageBookService/pages/bookServices/detail/components/note/note.js @@ -1,5 +1,5 @@ // pages/bookServices/detail/components/note/note.js -const app = getApp() +const app = getApp(); Component({ /** * 缁勪欢鐨勫睘鎬у垪琛� @@ -7,21 +7,22 @@ properties: { bookInfo: { type: Object, - value: {} - } + value: {}, + }, }, /** * 缁勪欢鐨勫垵濮嬫暟鎹� */ data: { - inputStyle: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding:16rpx', - placeholderstyle: 'font-size:28rpx', + inputStyle: + "border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding:16rpx", + placeholderstyle: "font-size:28rpx", flag: false, // 杈撳叆妗嗘槸鍚︽樉绀� submitType: "new", // 鏂板缓 or 缂栬緫 showNoteDialog: false, - textvalue: '', - noteId: '', + textvalue: "", + noteId: "", showInput: false, submitTitle: "", pageCount: { @@ -39,294 +40,306 @@ */ methods: { onReachBottom() { - const flag = this.data.noteList.length < this.data.pageCount.total + const flag = this.data.noteList.length < this.data.pageCount.total; if (flag) { this.setData({ isMore: true, - "pageCount.page": this.data.pageCount.page + 1 - }) - this.getNoteList() + "pageCount.page": this.data.pageCount.page + 1, + }); + this.getNoteList(); } else { this.setData({ - isMore: true - }) + isMore: true, + }); setTimeout(() => { this.setData({ - isMore: false - }) - }, 100) + isMore: false, + }); + }, 100); } }, handleSubmitTitle() { this.setData({ - submitTitle: this.properties.bookInfo.name - }) + submitTitle: this.properties.bookInfo.name, + }); }, openDialog() { this.setData({ submitTitle: this.properties.bookInfo.name, - showNoteDialog: true - }) + showNoteDialog: true, + }); }, closeDialog() { this.setData({ flag: false, showNoteDialog: false, - submitTitle: '', + submitTitle: "", textvalue: "", - }) + }); }, textareaChange(e) { this.setData({ - textvalue: e.detail.value - }) + textvalue: e.detail.value, + }); }, textareaBlur() { - console.log('澶卞幓鐒︾偣'); + console.log("澶卞幓鐒︾偣"); }, // 鏍囬杈撳叆妗嗗�� inputChange(e) { this.setData({ - submitTitle: e.detail.value - }) + submitTitle: e.detail.value, + }); }, // 寮圭獥纭畾鎸夐挳 confirmSuggest() { - const submitTitle = this.data.submitTitle.trim() - const textvalue = this.data.textvalue.trim() + const submitTitle = this.data.submitTitle.trim(); + const textvalue = this.data.textvalue.trim(); if (!submitTitle.length) { return wx.showToast({ - icon: 'error', - title: '璇峰~鍐欑瑪璁版爣棰�', - }) + icon: "error", + title: "璇峰~鍐欑瑪璁版爣棰�", + }); } else if (!textvalue.length) { return wx.showToast({ - icon: 'error', - title: '璇峰~鍐欑瑪璁板唴瀹�', - }) + icon: "error", + title: "璇峰~鍐欑瑪璁板唴瀹�", + }); } - if (this.data.submitType == 'new') { - this.makeNote() - } else if (this.data.submitType == 'edit') { - this.updateNote() + if (this.data.submitType == "new") { + this.makeNote(); + } else if (this.data.submitType == "edit") { + this.updateNote(); } this.setData({ - showNoteDialog: false - }) + showNoteDialog: false, + }); }, handleChange(e) { this.setData({ - activeValues: e.detail.value - }) + activeValues: e.detail.value, + }); }, // 鏍煎紡鍖栫瑪璁版椂闂� convertTimestamp(timestamp) { - const isoDate = new Date(timestamp) - const year = isoDate.getFullYear() - const month = String(isoDate.getMonth() + 1).padStart(2, '0') - const day = String(isoDate.getDate()).padStart(2, '0') - const hours = String(isoDate.getHours()).padStart(2, '0') - const minutes = String(isoDate.getMinutes()).padStart(2, '0') - const seconds = String(isoDate.getSeconds()).padStart(2, '0') - const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}` - return formattedDate + const isoDate = new Date(timestamp); + const year = isoDate.getFullYear(); + const month = String(isoDate.getMonth() + 1).padStart(2, "0"); + const day = String(isoDate.getDate()).padStart(2, "0"); + const hours = String(isoDate.getHours()).padStart(2, "0"); + const minutes = String(isoDate.getMinutes()).padStart(2, "0"); + const seconds = String(isoDate.getSeconds()).padStart(2, "0"); + const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; + return formattedDate; }, changeLoading() { this.setData({ - loading: true - }) + loading: true, + }); + }, + changeNoList() { + this.setData({ + noList: true, + }); }, // 鑾峰彇绗旇鍒楄〃 async getNoteList() { + if (!this.data.isMore) { + this.setData({ + loading: true, + }); + } this.setData({ - loading: true, - noList: false - }) - let topicId + noList: false, + }); + let topicId; await app.MG.ugc .getProductUserSubmitTopic({ productId: this.properties.bookInfo.id, - appRefCode: app.config.appRefCode + appRefCode: app.config.appRefCode, }) .then((res) => { if (res) { - topicId = res.id + topicId = res.id; } else { return wx.showToast({ icon: "error", - title: '鏌ヨ澶辫触', - }) + title: "鏌ヨ澶辫触", + }); } - }) + }); // loadings.value.bookResource = true let query = { start: 0, size: this.data.pageCount.page * 5, - messageType: 'note', + messageType: "note", sort: { - type: 'Desc', - field: 'CreateDate' + type: "Desc", + field: "CreateDate", }, appRefCode: app.config.appRefCode, - topicIdOrRefCode: topicId + '' - } + topicIdOrRefCode: topicId + "", + }; await app.MG.ugc.getTopicMessageList(query).then((res) => { if (!res.datas.length) { return this.setData({ - noList: true, loading: false, + noList: true, noteList: res.datas, - }) + }); } // notePage.value.total = res.totalSize res.datas.forEach((item) => { - item.compliceHover = false - item.deleteHover = false - item.createDate = this.convertTimestamp(item.createDate) - }) + item.compliceHover = false; + item.deleteHover = false; + item.createDate = this.convertTimestamp(item.createDate); + }); this.setData({ "pageCount.total": res.totalSize, noteList: res.datas, - loading: false - }) - }) + loading: false, + noList: false, + }); + }); }, // 鏂板缓绗旇鎺ュ彛 async makeNote() { - const token = wx.getStorageSync('jsek-token') + const token = wx.getStorageSync("jsek-token"); if (!token) { return wx.getUserProfile({ - desc: '鐢ㄦ埛鐧诲綍', + desc: "鐢ㄦ埛鐧诲綍", success: (res) => { console.log(res); - } - }) + }, + }); } - let topicId + let topicId; await app.MG.ugc .getProductUserSubmitTopic({ productId: this.properties.bookInfo.id, - appRefCode: app.config.appRefCode + appRefCode: app.config.appRefCode, }) .then((res) => { if (res) { - topicId = res.id + topicId = res.id; } else { return wx.showToast({ - icon: 'error', - title: '鏂板缓澶辫触', - }) + icon: "error", + title: "鏂板缓澶辫触", + }); } - }) + }); let query = { - topicIdOrRefCode: topicId + '', + topicIdOrRefCode: topicId + "", name: this.data.submitTitle, content: this.data.textvalue, - type: 'note', - cmsTypeRefCode: '', - newDataListRequest: [] - } + type: "note", + cmsTypeRefCode: "", + newDataListRequest: [], + }; await app.MG.ugc.newTopicMessage(query).then((res) => { wx.showToast({ - title: '鏂板缓鎴愬姛', - }) - this.closeDialog() - this.getNoteList() - }) + title: "鏂板缓鎴愬姛", + }); + this.closeDialog(); + this.getNoteList(); + }); }, // 鍒犻櫎绗旇 deleteNote(e) { - const id = e.currentTarget.dataset.id - const messageIds = [] - messageIds.push(id) + const id = e.currentTarget.dataset.id; + const messageIds = []; + messageIds.push(id); wx.showModal({ - title: '鎻愮ず', - content: '纭鍒犻櫎璇ョ瑪璁板悧锛�', //editable濡傛灉涓簍rue锛岃繖灏辨槸杈撳叆妗嗙殑鍐呭 + title: "鎻愮ず", + content: "纭鍒犻櫎璇ョ瑪璁板悧锛�", //editable濡傛灉涓簍rue锛岃繖灏辨槸杈撳叆妗嗙殑鍐呭 + confirmColor: "#ff6c00", + cancelColor: "#949494", editable: false, //鏄惁鏄剧ず杈撳叆妗� - placeholderText: '璇疯緭鍏ュ唴瀹瑰惂', //杈撳叆妗嗙殑榛樿鍐呭 + placeholderText: "璇疯緭鍏ュ唴瀹瑰惂", //杈撳叆妗嗙殑榛樿鍐呭 success: (res) => { if (res.confirm) { app.MG.ugc .delTopicMessage({ - messageIds + messageIds, }) .then((res) => { wx.showToast({ - title: '鍒犻櫎鎴愬姛', - }) + title: "鍒犻櫎鎴愬姛", + }); // if ((notePage.value.total % 3) - 1 == 0) { // notePage.value.page -= 1 // } - this.getNoteList() - }) + this.getNoteList(); + }); } else if (res.cancel) { - console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷') + console.log("鐢ㄦ埛鐐瑰嚮鍙栨秷"); } - } - }) + }, + }); }, // 鏍囬鏀瑰彉 changeTitle(e) { this.setData({ - flag: e.currentTarget.dataset.value - }) + flag: e.currentTarget.dataset.value, + }); }, // 缂栬緫鎸夐挳 editNote(e) { - const note = e.currentTarget.dataset.note + const note = e.currentTarget.dataset.note; this.setData({ submitType: "edit", textvalue: note.content, submitTitle: note.name, - noteId: note.id - }) + noteId: note.id, + }); console.log(note.name, this.data.submitTitle); this.setData({ - showNoteDialog: true - }) + showNoteDialog: true, + }); }, // 缂栬緫绗旇鎺ュ彛 updateNote() { - const token = wx.getStorageSync('jsek-token') + const token = wx.getStorageSync("jsek-token"); if (!token) { return wx.getUserProfile({ - desc: '鐢ㄦ埛鐧诲綍', + desc: "鐢ㄦ埛鐧诲綍", success: (res) => { console.log(res); - } - }) + }, + }); } if (!this.data.submitTitle) { return wx.showToast({ - icon: 'error', - title: '璇峰~鍐欑瑪璁版爣棰�', - }) + icon: "error", + title: "璇峰~鍐欑瑪璁版爣棰�", + }); } else if (!this.data.textvalue) { return wx.showToast({ - icon: 'error', - title: '璇峰~鍐欑瑪璁板唴瀹�', - }) + icon: "error", + title: "璇峰~鍐欑瑪璁板唴瀹�", + }); } let query = { id: this.data.noteId, name: this.data.submitTitle, - description: 'string', - icon: 'string', - type: 'note', + description: "string", + icon: "string", + type: "note", content: this.data.textvalue, newDataRequests: [], - updateDataRequests: [] - } + updateDataRequests: [], + }; app.MG.ugc.updateTopicMessage(query).then((res) => { wx.showToast({ - title: '缂栬緫鎴愬姛', - }) - this.closeDialog() - this.getNoteList() - }) + title: "缂栬緫鎴愬姛", + }); + this.closeDialog(); + this.getNoteList(); + }); this.setData({ - submitType: "new" - }) - } - } -}) \ No newline at end of file + submitType: "new", + }); + }, + }, +}); diff --git a/packageBookService/pages/bookServices/detail/components/note/note.wxml b/packageBookService/pages/bookServices/detail/components/note/note.wxml index 6a772b5..981c403 100644 --- a/packageBookService/pages/bookServices/detail/components/note/note.wxml +++ b/packageBookService/pages/bookServices/detail/components/note/note.wxml @@ -7,9 +7,9 @@ bind:tap="openDialog" style="width: 240rpx" > - <view slot="content"> + <view slot="content" class="btn-content"> <image src="/static/images/bookService/detail/makeNote.png" /> - 璁扮瑪璁� + <text class="note-btn-text">璁扮瑪璁�</text> </view> </t-button> </view> diff --git a/packageBookService/pages/bookServices/detail/components/note/note.wxss b/packageBookService/pages/bookServices/detail/components/note/note.wxss index 8e0e378..a1db1c5 100644 --- a/packageBookService/pages/bookServices/detail/components/note/note.wxss +++ b/packageBookService/pages/bookServices/detail/components/note/note.wxss @@ -2,6 +2,7 @@ .note { height: 100%; + padding-bottom: 50rpx; } .popup { @@ -25,7 +26,11 @@ .note-btn image { width: 28rpx; height: 32rpx; - margin-top: 24rpx; + margin-right: 5rpx; +} + +.note-btn-text { + font-size: 28rpx; } @@ -82,9 +87,7 @@ font-size: 28rpx; color: #949494; margin-bottom: 20rpx; - max-height: 600rpx; text-align: justify; - /* padding-bottom: 200rpx; */ } .wrapper { @@ -153,4 +156,9 @@ .t-input__placeholder { font-size: 28rpx !important +} + +.btn-content { + display: flex; + align-items: center; } \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/teachResource/index.js b/packageBookService/pages/bookServices/detail/components/teachResource/index.js index 379bab2..ec299ce 100644 --- a/packageBookService/pages/bookServices/detail/components/teachResource/index.js +++ b/packageBookService/pages/bookServices/detail/components/teachResource/index.js @@ -24,14 +24,12 @@ methods: { copy() { wx.setClipboardData({ - data: "11", + data: "http://182.92.203.7:3007/jsek/website/#/home/index", success: function (res) { wx.showToast({ title: "澶嶅埗鎴愬姛" }); }, fail: function (res) { - wx.showToast({ - title: "澶辫触", - }); + console.log(res); }, }); }, diff --git a/packageBookService/pages/bookServices/detail/components/teachResource/index.wxml b/packageBookService/pages/bookServices/detail/components/teachResource/index.wxml index c93a4a0..2548bc6 100644 --- a/packageBookService/pages/bookServices/detail/components/teachResource/index.wxml +++ b/packageBookService/pages/bookServices/detail/components/teachResource/index.wxml @@ -26,11 +26,14 @@ <view> 璧勬簮涓嬭浇鐢宠宸查�氳繃<text wx:if="{{deadline}}" >锛屾湁鏁堟棩鏈熸埅鑷筹細{{ deadline }}</text - ></view> - <!-- <view style="display: flex; align-items: center; margin-top: 10rpx"> + ></view + > + <view style="display: flex; align-items: center; margin-top: 10rpx"> <text>涓嬭浇璧勬簮璇峰埌PC绔含甯圗璇�</text> - <t-button style="font-size: 24rpx; height: 50rpx" bind:tap="copy">澶嶅埗</t-button> - </view> --> + <t-button style="font-size: 24rpx; height: 50rpx" bind:tap="copy" + >澶嶅埗</t-button + > + </view> </view> <view wx:if="{{applyState == 'Reject'}}" >璧勬簮涓嬭浇闇�瑕佺敵璇凤紝璇峰厛鐢宠骞剁瓑寰呭鏍搁�氳繃鍚庢柟鍙笅杞�</view diff --git a/packageBookService/pages/bookServices/detail/components/testResource/testResource.js b/packageBookService/pages/bookServices/detail/components/testResource/testResource.js index e16efd3..88b146f 100644 --- a/packageBookService/pages/bookServices/detail/components/testResource/testResource.js +++ b/packageBookService/pages/bookServices/detail/components/testResource/testResource.js @@ -1,5 +1,5 @@ // pages/bookServices/detail/components/testResource/testResource.js -const app = getApp() +const app = getApp(); Component({ /** * 缁勪欢鐨勫睘鎬у垪琛� @@ -7,7 +7,7 @@ properties: { list: { type: Array, - value: [] + value: [], }, bookInfo: { type: Object, @@ -15,16 +15,17 @@ }, mockData: { type: Object, - value: {} - } + value: {}, + }, }, /** * 缁勪欢鐨勫垵濮嬫暟鎹� */ data: { - selectBtn: 'test', // test mock - radioItem: 'test', + selectBtn: "test", // test mock + radioItem: "test", + loading: false, }, /** @@ -32,88 +33,100 @@ */ methods: { async goTest(e) { - const value = e.currentTarget.dataset.value - const token = wx.getStorageSync('jsek-token') + const value = e.currentTarget.dataset.value; + const token = wx.getStorageSync("jsek-token"); if (!token) { return wx.getUserProfile({ - desc: '鐢ㄦ埛鐧诲綍', + desc: "鐢ㄦ埛鐧诲綍", success: (res) => { console.log(res); - } - }) + }, + }); } wx.showLoading({ - title: '鍔犺浇涓�', - }) + title: "鍔犺浇涓�", + }); // 鑾峰彇绔犺妭涓嬫槸鍚︽湁棰樼洰 - let idPathList = [] + let idPathList = []; let query = { - path: '*', - queryType: '*', + path: "*", + queryType: "*", productId: this.properties.bookInfo.id, cmsPath: value.productLinkPath, pading: { start: 0, - size: 999 - } - } + size: 999, + }, + }; if (value.childrenFolderCount == 0) { - wx.hideLoading() + wx.hideLoading(); return wx.showToast({ icon: "error", - title: '鏆傛棤鏁版嵁', - }) + title: "鏆傛棤鏁版嵁", + }); } else { - const res = await app.MG.store.getProductDetail(query) + const res = await app.MG.store.getProductDetail(query); res.datas.cmsDatas[0].datas.forEach((item) => { idPathList.push({ id: item.id, name: item.name, productLinkPath: item.productLinkPath, - type: item.type - }) - }) + type: item.type, + }); + }); } - wx.hideLoading() + wx.hideLoading(); wx.navigateTo({ - url: `/packageBookService/pages/bookServices/examination/examination?bookId=${this.properties.bookInfo.id}&productLinkPath=${value.productLinkPath}&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&idPathList=${JSON.stringify(idPathList)}&answerTitle=${value.name}&answerType=${'option'}`, - }) + url: `/packageBookService/pages/bookServices/examination/examination?bookId=${ + this.properties.bookInfo.id + }&productLinkPath=${value.productLinkPath}&rootCmsItemId=${ + this.properties.bookInfo.rootCmsItemId + }&idPathList=${JSON.stringify(idPathList)}&answerTitle=${ + value.name + }&answerType=${"option"}`, + }); }, goMycollect(e) { - const answertype = e.currentTarget.dataset.answertype - const token = wx.getStorageSync('jsek-token') + const answertype = e.currentTarget.dataset.answertype; + const token = wx.getStorageSync("jsek-token"); if (!token) { return wx.getUserProfile({ - desc: '鐢ㄦ埛鐧诲綍', + desc: "鐢ㄦ埛鐧诲綍", success: (res) => { console.log(res); - } - }) + }, + }); } wx.navigateTo({ - url: `/packageBookService/pages/bookServices/examination/examination?bookId=${this.properties.bookInfo.id}&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${answertype == 'collectQuestion' ? '鎴戠殑鏀惰棌' : '鎴戠殑閿欓'}&answerType=${answertype}`, - }) + url: `/packageBookService/pages/bookServices/examination/examination?bookId=${ + this.properties.bookInfo.id + }&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${ + answertype == "collectQuestion" ? "鎴戠殑鏀惰棌" : "鎴戠殑閿欓" + }&answerType=${answertype}`, + }); }, // 缁冧範 缁勪欢鍒囨崲 onRadioChange(e) { this.setData({ - radioItem: e.detail.value - }) + radioItem: e.detail.value, + }); + if (e.detail.value == "mock") { + } }, async getMockId() { wx.showLoading({ - title: '鍔犺浇涓�' - }) - let id + title: "鍔犺浇涓�", + }); + let id; let query = { start: 0, size: 99, - productId: this.properties.bookInfo.id - } + productId: this.properties.bookInfo.id, + }; await app.MG.edu.getQuizConfigListByProduct(query).then((res) => { - id = res.datas[0].id - }) - return id + id = res.datas[0].id; + }); + return id; }, // 缁勫嵎璺宠浆绛旈鐣岄潰 async goMackPaper(e) { @@ -121,21 +134,30 @@ // if (!token) { // return logIn() // } - const mockid = await this.getMockId() - wx.hideLoading() - const item = e.currentTarget.dataset.item + const mockid = await this.getMockId(); + wx.hideLoading(); + const item = e.currentTarget.dataset.item; wx.navigateTo({ - url: `/packageBookService/pages/bookServices/examination/examination?bookId=${this.properties.bookInfo.id}&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${item.name}&answerType=${'mock'}&uuid=${item.id}&mockid=${mockid}`, - }) + url: `/packageBookService/pages/bookServices/examination/examination?bookId=${ + this.properties.bookInfo.id + }&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${ + item.name + }&answerType=${"mock"}&uuid=${item.id}&mockid=${mockid}`, + }); }, // 璐拱缁勫嵎 buyMock() { - var myEventDetail = {} + var myEventDetail = {}; var myEventOption = { bubbles: true, - composed: true - } - this.triggerEvent('buyMock', myEventDetail, myEventOption) - } - } -}) + composed: true, + }; + this.triggerEvent("buyMock", myEventDetail, myEventOption); + }, + changeTestLoaidng(type) { + this.setData({ + loading: type, + }); + }, + }, +}); diff --git a/packageBookService/pages/bookServices/detail/components/testResource/testResource.wxml b/packageBookService/pages/bookServices/detail/components/testResource/testResource.wxml index cf0e3d4..b6cc4e9 100644 --- a/packageBookService/pages/bookServices/detail/components/testResource/testResource.wxml +++ b/packageBookService/pages/bookServices/detail/components/testResource/testResource.wxml @@ -14,7 +14,7 @@ <image src="{{ radioItem == 'test' ? '/static/images/bookService/detail/practice-icon.png' : '/static/images/bookService/detail/notest.png'}}" ></image> - <text style="color: {{radioItem == 'test' ? '#fff':''}};" + <text style="color: {{radioItem == 'test' ? '#fff':'#ff6c00'}};" >缁冧範</text > </view> @@ -26,7 +26,7 @@ <image src="{{ radioItem == 'mock' ? '/static/images/bookService/detail/checkpaper.png' : '/static/images/bookService/detail/zujuan.png'}}" ></image> - <text style="color: {{radioItem == 'mock' ? '#fff':''}};" + <text style="color: {{radioItem == 'mock' ? '#fff':'#ff6c00'}};" >缁勫嵎</text > </view> @@ -43,7 +43,7 @@ > <view slot="content" class="btn-content"> <image src="/static/images/bookService/detail/cuoti.png"></image> - <text>鎴戠殑閿欓</text> + <text class="primary-color">鎴戠殑閿欓</text> </view> </t-button> <t-button @@ -56,7 +56,7 @@ > <view slot="content" class="btn-content"> <image src="/static/images/bookService/detail/wodeshoucang.png"></image> - <text> 鎴戠殑鏀惰棌</text> + <text class="primary-color"> 鎴戠殑鏀惰棌</text> </view> </t-button> </view> @@ -137,4 +137,7 @@ <t-button class="buy-mock-btn" bind:tap="buyMock">璐拱缁勫嵎</t-button> </view> </view> + <view class="loading-box" wx:if="{{}}"> + <t-loading loading="{{}}" /> + </view> </view> diff --git a/packageBookService/pages/bookServices/detail/components/testResource/testResource.wxss b/packageBookService/pages/bookServices/detail/components/testResource/testResource.wxss index 8dd151b..982fb06 100644 --- a/packageBookService/pages/bookServices/detail/components/testResource/testResource.wxss +++ b/packageBookService/pages/bookServices/detail/components/testResource/testResource.wxss @@ -3,6 +3,10 @@ padding-top: 20rpx; } +.primary-color { + color: #ff6c00; +} + .resource-list { height: 80rpx; margin: 20rpx; @@ -149,7 +153,6 @@ } .radio-content { - padding: 0 8rpx; display: flex; align-items: center; justify-content: center; diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.js b/packageBookService/pages/bookServices/detail/components/tree/index.js index 58c7e5a..d946ea5 100644 --- a/packageBookService/pages/bookServices/detail/components/tree/index.js +++ b/packageBookService/pages/bookServices/detail/components/tree/index.js @@ -55,10 +55,7 @@ shoppingCart: true, stop: false, }, - ready() { - this.setData({}); - console.log("鍑嗗"); - }, + ready() {}, onLoad() { this.setData({ @@ -73,7 +70,6 @@ treeList: function (newValue) { const list = []; let checked = ""; - console.log("鏂板��", this.properties.treeList); this.properties.treeList.forEach((item) => { if (item.children && item.children.length > 0) { list.push(...this.flattenTree([item])); diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.wxml b/packageBookService/pages/bookServices/detail/components/tree/index.wxml index bfd7ca2..5ba283f 100644 --- a/packageBookService/pages/bookServices/detail/components/tree/index.wxml +++ b/packageBookService/pages/bookServices/detail/components/tree/index.wxml @@ -17,11 +17,11 @@ wx:if="{{isShowCheck}}" /> <!-- 绔犺妭鍚� --> - <view style="width: 100%"> - <text>{{item.name}} </text - ><text wx:if="{{item.sysType =='CmsFolder'}}" - >锛坽{item.children ? item.children.length : 0}}锛�</text - > + <view class="title-box"> + <text class="title-name">{{item.name}} </text> + <view wx:if="{{item.sysType =='CmsFolder'}}" class="title-num"> + 锛坽{item.children ? item.children.length : 0}}锛� + </view> </view> </view> </view> @@ -37,12 +37,7 @@ class="listItems" wx:if="{{citem.childrenFolderCount <= 0 && citem.sysType == 'CmsItem'}}" > - <view - class="itemsInfo" - wx:if="{{citem.name}}" - data-item="{{citem}}" - data-index="{{cindex}}" - > + <view class="itemsInfo" data-item="{{citem}}" data-index="{{cindex}}"> <view class="contentBox" bind:tap="goPlayer" @@ -123,7 +118,7 @@ <text class="name" style="{{ tab == 'jsek_teachingResources' ? 'width: 300rpx;' : 'width: 400rpx;'}}" - >{{citem.name}}</text + >{{citem.name || '-'}}</text > </view> <!-- 鏁欏璧勬簮绫诲瀷 --> diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.wxss b/packageBookService/pages/bookServices/detail/components/tree/index.wxss index 11dfe51..1cad023 100644 --- a/packageBookService/pages/bookServices/detail/components/tree/index.wxss +++ b/packageBookService/pages/bookServices/detail/components/tree/index.wxss @@ -11,9 +11,28 @@ align-items: center; --td-checkbox-vertical-padding: 0 } + +.title-box { + width: 100%; + display: flex; + align-items: flex-start; +} + .title-checkBox { + width: 100%; display: flex; } + + + +.title-name { + display: inline-block; + /* max-width: 60%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; */ +} + .t-class { background-color: #F7F7F7; } diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index 97cf4ee..8f2c887 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -1,9 +1,7 @@ // pages/bookServices/detail/index.js import Toast from "tdesign-miniprogram/toast"; import tool from "../../../../assets/js/toolClass"; -import { - loginInfo -} from "../../../../assets/js/login"; +import { loginInfo } from "../../../../assets/js/login"; const app = getApp(); Page({ /** @@ -166,7 +164,6 @@ if (token) { this.getShoppingCartProductGet(); this.getApplyInfo(options.id); - this.getMockData(); this.getAlreadyPBookList(); this.getAlreadyEBookList(); } @@ -225,7 +222,7 @@ onReachBottom() { if (this.data.tabValue == "jsek_note") { const child = this.selectComponent("#note"); - child.onReachBottom(); + if (!child.data.noList) child.onReachBottom(); } }, @@ -303,7 +300,19 @@ }, // 杩斿洖 goBack() { - wx.navigateBack(); + let bookPathList = wx.getStorageSync("bookPathList"); + if (bookPathList && JSON.parse(bookPathList).length) { + bookPathList = JSON.parse(bookPathList); + this.setData({ + pageLoading: true, + tabValue: "brief", + }); + this.onLoad(bookPathList[bookPathList.length - 1]); + bookPathList.pop(); + wx.setStorageSync("bookPathList", JSON.stringify(bookPathList)); + } else { + wx.navigateBack(); + } }, // 鑾峰彇鍥句功璇︽儏 getBookInfo(id) { @@ -357,14 +366,15 @@ this.getSubTtem(); // 鑾峰彇鍥句功鍒嗙被 let className = ""; - if ( - Array.isArray(res.datas.bookClassification) && - res.datas.bookClassification.length - ) { - const iconType = JSON.parse(res.datas.bookClassification)[0][0]; - const classType = JSON.parse(res.datas.bookClassification)[0][1]; - className = await this.getBookClass(iconType, classType); + if (res.datas.bookClassification) { + const bookClassification = JSON.parse(res.datas.bookClassification); + if (Array.isArray(bookClassification) && bookClassification.length) { + const iconType = bookClassification[0][0]; + const classType = bookClassification[0][1]; + className = await this.getBookClass(iconType, classType); + } } + // 鑾峰彇缁勫嵎閿�鍞甶d if (res.datas.saleMethod && res.datas.saleMethod.length) { res.datas.saleMethod.forEach((item) => { @@ -429,13 +439,14 @@ }; app.MG.store.getProductList(obj).then((res) => { if (res.datas && res.datas.length > 0) { - console.log(res.datas[0], 2) + console.log(res.datas[0], 2); this.setData({ bookItemDetail: res.datas[0], selectedIds: res.datas[0].defaultSaleMethod.id, - bookBuy: res.datas[0].purchasedSaleMethodIdList.indexOf( - res.datas[0].defaultSaleMethodId - ) > -1, + bookBuy: + res.datas[0].purchasedSaleMethodIdList.indexOf( + res.datas[0].defaultSaleMethodId + ) > -1, "bookDetail.price": this.numFormat(res.datas[0].price), }); let times = new Date(res.datas[0].defaultSaleMethod.endDate).getTime(); @@ -498,9 +509,10 @@ } this.setData({ selectedIds: this.data.bookDetail.defaultSaleMethodId, - bookBuy: this.data.bookDetail.purchasedSaleMethodIdList.indexOf( - this.data.bookDetail.defaultSaleMethodId - ) > -1, + bookBuy: + this.data.bookDetail.purchasedSaleMethodIdList.indexOf( + this.data.bookDetail.defaultSaleMethodId + ) > -1, }); let times = new Date( this.data.bookDetail.defaultSaleMethod.endDate @@ -604,15 +616,14 @@ }, // 璺宠浆缃戝簵 goShop(e) { - const { - link - } = e.currentTarget.dataset; + const { link } = e.currentTarget.dataset; wx.navigateTo({ url: `/packageBookService/pages/bookServices/webpage/index?url=${link}`, }); }, // tag鍒囨崲 onTabsChange(e) { + const token = wx.getStorageSync(app.config.tokenKey); this.setData({ tabValue: e.detail.value, noResources: false, @@ -641,6 +652,7 @@ ) { this.getResourceData(checkData); } + if (e.detail.value == "questionBank" && token) this.getMockData(); } else { this.setData({ noResources: true, @@ -653,6 +665,8 @@ if (token) { child.changeLoading(); child.getNoteList(); + } else { + child.changeNoList(); } } else if (e.detail.label == "鐢靛瓙涔�") { const child = this.selectComponent("#eBook"); @@ -730,13 +744,13 @@ const list = await this.getAllResource(res.datas.cmsDatas[0].datas); let result = []; if (type.refCode == "jsek_teachingResources") { - console.log("鏁欏璧勬簮", list); this.findChildIds(list, result); this.setData({ teach: list, loading: false, openTeachids: result, }); + console.log("鏁欏璧勬簮", list); } else if (type.refCode == "jsek_cloudLearning") { let arr = this.handleTreeData(list).filter( (item) => item.saleMethod[0] @@ -850,7 +864,7 @@ item.checked = false; } else if (this.data.tabValue == "jsek_cloudLearning") { item.checked = false; - item.isbuy = this.resourceIsBuy(item); + item.isbuy = this.isShowNeedBuy(item); item.isShopCar = this.isShoppingCart(item); } }); @@ -899,19 +913,18 @@ res.datas.forEach((item) => { shoppingCartGetId.push(item.saleMethod.id); }); - console.log(shoppingCartGetId, "shoppingCartGetId"); - console.log(this.data.selectedIds, "閿�鍞柟寮廼d"); const determine = shoppingCartGetId.some( (item) => item == this.data.selectedIds ); - console.log(determine); if (!determine) { let query = { - requests: [{ - saleMethodId: this.data.selectedIds, - storeEventId: null, - agentCode: "鐢靛瓙涔�", - }, ], + requests: [ + { + saleMethodId: this.data.selectedIds, + storeEventId: null, + agentCode: "鐢靛瓙涔�", + }, + ], }; const addRes = app.MG.store.addShoppingCart(query); this.showSuccessToast(); @@ -952,11 +965,14 @@ let bookOrdersId = ""; let query = { remarks: "鐢靛瓙涔�", - requests: [{ - saleMethodId: this.data.bookItemDetail.defaultSaleMethodId ? - this.data.bookItemDetail.defaultSaleMethodId : this.data.bookDetail.defaultSaleMethodId, - count: 1, - }, ], + requests: [ + { + saleMethodId: this.data.bookItemDetail.defaultSaleMethodId + ? this.data.bookItemDetail.defaultSaleMethodId + : this.data.bookDetail.defaultSaleMethodId, + count: 1, + }, + ], }; // 鍙戣捣璁㈠崟鍒濆鍖栬姹傚苟绛夊緟缁撴灉 const res = await app.MG.store.initOrder(query); @@ -966,20 +982,23 @@ // 妫�鏌ヨ鍗曞彿鏄惁瀛樺湪 if (bookOrdersId) { if (this.data.bookDetail.price == "0.00") { - app.MG.store.confirmOrder({ - orderNum: bookOrdersId - }).then(res => { - if (res) { - wx.showToast({ - title: "棰嗗彇鎴愬姛", - icon: "none", - duration: 1000, - }); - this.getBookInfo(this.data.bookDetail.id); - } - }) + app.MG.store + .confirmOrder({ + orderNum: bookOrdersId, + }) + .then((res) => { + if (res) { + wx.showToast({ + title: "棰嗗彇鎴愬姛", + icon: "none", + duration: 1000, + }); + this.getBookInfo(this.data.bookDetail.id); + } + }); } else { - const url = "/pages/cart/paymentPage/index?orderNumber=" + bookOrdersId; + const url = + "/pages/cart/paymentPage/index?orderNumber=" + bookOrdersId; wx.navigateTo({ url, }); @@ -987,7 +1006,6 @@ } else { console.log(222); } - } else { wx.showToast({ title: "鍟嗗搧涓嶅湪鏈夋晥鏈�", @@ -1096,12 +1114,14 @@ 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, - }, ]), + 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) { @@ -1116,8 +1136,11 @@ wx.showModal({ title: "灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�", content: "璇峰厛杩涜鏁欏笀璁よ瘉锛�", + confirmColor: "#ff6c00", + cancelColor: "#949494", complete: (res) => { - if (res.cancel) {} + if (res.cancel) { + } if (res.confirm) { wx.navigateTo({ url: "/packageDomain/pages/teacherCertification/index", @@ -1130,8 +1153,11 @@ wx.showModal({ title: "灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�", content: "璇峰厛杩涜鏁欏笀璁よ瘉锛�", + confirmColor: "#ff6c00", + cancelColor: "#949494", complete: (res) => { - if (res.cancel) {} + if (res.cancel) { + } if (res.confirm) { wx.navigateTo({ url: "/packageDomain/pages/teacherCertification/index", @@ -1158,8 +1184,11 @@ wx.showModal({ title: "灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�", content: "璇峰厛杩涜鏁欏笀璁よ瘉锛�", + confirmColor: "#ff6c00", + cancelColor: "#949494", complete: (res) => { - if (res.cancel) {} + if (res.cancel) { + } if (res.confirm) { wx.navigateTo({ url: "/packageDomain/pages/teacherCertification/index", @@ -1288,6 +1317,22 @@ const isSHow = this.data.buyIdList.some( (item) => item == data.saleMethod[0].Id ); + return !isSHow; + } else { + return false; + } + }, + // 浜戝涔犺祫婧愭槸鍚︽樉绀洪攣鍥炬爣锛堟湭璐拱锛屼笖璧勬簮鍞环澶т簬闆讹級 + isShowNeedBuy(data) { + if (data.saleMethod && data.saleMethod.length) { + const isSHow = this.data.buyIdList.some( + (item) => item == data.saleMethod[0].Id + ); + if (isSHow) { + return false; + } else { + return data.saleMethod[0].price > 0 ? true : false; + } return !isSHow; } else { return false; @@ -1515,9 +1560,9 @@ if (new RegExp("(" + k + ")").test(fmt)) { fmt = fmt.replace( RegExp.$1, - RegExp.$1.length == 1 ? - o[k] : - ("00" + o[k]).substr(("" + o[k]).length) + RegExp.$1.length == 1 + ? o[k] + : ("00" + o[k]).substr(("" + o[k]).length) ); } } @@ -1528,6 +1573,8 @@ }, // 鑾峰彇缁勫嵎绛旈鏁版嵁 getMockData() { + // const child = this.selectComponent("#test-resource"); + // if (child) child.changeTestLoaidng(true); this.setData({ "mockData.useCount": 0, "mockData.mockList": [], @@ -1571,10 +1618,12 @@ try { let query = { remarks: "缁勫嵎", - requests: [{ - saleMethodId: this.data.mockData.id, - count: 1, - }, ], + requests: [ + { + saleMethodId: this.data.mockData.id, + count: 1, + }, + ], }; if (this.data.flag) { this.setData({ @@ -1624,11 +1673,13 @@ }); // 璁板綍璐拱鏃堕棿锛屽苟璁剧姸鎬乻tate涓�1锛岃〃绀哄垰璐拱瀹屾垚缁勫嵎 app.MG.identity.setUserKey({ - setKeyRequests: [{ - domain: "mockData", - key: this.data.bookDetail.id + "", - value: JSON.stringify(this.data.mockData.mockList), - }, ], + setKeyRequests: [ + { + domain: "mockData", + key: this.data.bookDetail.id + "", + value: JSON.stringify(this.data.mockData.mockList), + }, + ], }); }, // 鑾峰彇鐩稿叧鍥句功 @@ -1658,33 +1709,45 @@ (item) => item.id != this.data.bookDetail.id ); let bookArr = []; - // if (Arr.length > 3) { - // for (var i = 0; i < 3; i++) { - // var _num = Math.floor(Math.random() * Arr.length); - // var mm = Arr[_num]; - // Arr.splice(_num, 1); - // bookArr.push(mm); - // } - // } else { - // bookArr = Arr; - // } + if (Arr.length > 9) { + for (var i = 0; i < 9; i++) { + var _num = Math.floor(Math.random() * Arr.length); + var mm = Arr[_num]; + Arr.splice(_num, 1); + bookArr.push(mm); + } + } else { + bookArr = Arr; + } this.setData({ - relatedBookData: Arr, + relatedBookData: bookArr, relatedBookLoading: false, }); if (!this.data.relatedBookData.length) this.setData({ noRelatedBookData: true, }); - console.log("鐩稿叧鍥句功", this.data.relatedBookData); }); }, goBookDetails(e) { - console.log(e); this.setData({ tabValue: "brief", pageLoading: true, }); + let bookPathList = wx.getStorageSync("bookPathList"); + const bookPath = { + id: this.data.bookDetail.id, + name: this.data.bookDetail.name, + }; + if (bookPathList) { + bookPathList = JSON.parse(bookPathList); + if (bookPathList.length > 8) bookPathList.shift(); + bookPathList.push(bookPath); + } else { + bookPathList = [bookPath]; + } + + wx.setStorageSync("bookPathList", JSON.stringify(bookPathList)); this.onLoad({ id: e.detail.id, name: e.detail.name, @@ -1712,7 +1775,8 @@ return false; } wx.navigateTo({ - url: "/packageBookService/pages/components/webView/index?md5=" + + url: + "/packageBookService/pages/components/webView/index?md5=" + this.data.fileInfo.md5 + "&fileName=" + this.data.fileInfo.bookName + @@ -1883,12 +1947,15 @@ wx.showModal({ title: "灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�", //鎻愮ず鐨勬爣棰� content: "璇峰厛杩涜鏁欏笀璁よ瘉锛�", //鎻愮ず鐨勫唴瀹� + confirmColor: "#ff6c00", + cancelColor: "#949494", success: function (res) { if (res.confirm) { wx.navigateTo({ url: "/packageDomain/pages/teacherCertification/index", }); - } else if (res.cancel) {} + } else if (res.cancel) { + } }, }); } @@ -1953,12 +2020,15 @@ wx.showModal({ title: "灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�", //鎻愮ず鐨勬爣棰� content: "璇峰厛杩涜鏁欏笀璁よ瘉锛�", //鎻愮ず鐨勫唴瀹� + confirmColor: "#ff6c00", + cancelColor: "#949494", success: function (res) { if (res.confirm) { wx.navigateTo({ url: "/packageDomain/pages/teacherCertification/index", }); - } else if (res.cancel) {} + } else if (res.cancel) { + } }, }); } @@ -2043,4 +2113,4 @@ teach: tree, }); }, -}); \ No newline at end of file +}); diff --git a/packageBookService/pages/bookServices/detail/index.wxml b/packageBookService/pages/bookServices/detail/index.wxml index b2d668b..f88a1ce 100644 --- a/packageBookService/pages/bookServices/detail/index.wxml +++ b/packageBookService/pages/bookServices/detail/index.wxml @@ -4,37 +4,62 @@ <view style="width: 100%; height: {{barHeight}}px; "></view> <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> <view> - <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> + <t-icon + name="chevron-left" + size="30" + data-name="{{item}}" + bind:click="goBack" + /> </view> <view class="navbar-title">{{options.name}}</view> </view> <t-toast id="t-toast" /> - <scroll-view scroll-y="{{true}}" class="book" bindscrolltolower="onReachBottom"> + <scroll-view + scroll-y="{{true}}" + class="book" + bindscrolltolower="onReachBottom" + > <!-- 鍥句功璇︽儏 --> <view class="book-box"> <view class="book-detail" id="book-detail"> <view class="detail-left"> <view class="book-img"> - <image loading="" src="{{bookDetail.icon ? bookDetail.icon : '/static/images/default-book-img.png'}}" mode="aspectFill" aria-label="{{bookDetail.name}}" /> + <image + loading="" + src="{{bookDetail.icon ? bookDetail.icon : '/static/images/default-book-img.png'}}" + mode="aspectFill" + aria-label="{{bookDetail.name}}" + /> </view> <view class="book-use"> <view class="collect" bind:tap="setCollect"> <view> - <image loading="" src="/static/images/bookService/detail/collect.png" wx:if="{{!bookDetail.isFavourite}}" /> - <image loading="" src="/static/images/bookService/detail/collecting.png" wx:if="{{bookDetail.isFavourite}}" /> + <image + loading="" + src="/static/images/bookService/detail/collect.png" + wx:if="{{!bookDetail.isFavourite}}" + /> + <image + loading="" + src="/static/images/bookService/detail/collecting.png" + wx:if="{{bookDetail.isFavourite}}" + /> </view> <view class="use-title">鏀惰棌</view> </view> <view class="suggest" bind:tap="suggestBtn"> <view> - <image loading="" src="/static/images/bookService/detail/suggest.png" /> + <image + loading="" + src="/static/images/bookService/detail/suggest.png" + /> </view> <view class="use-title">鎴戣寤鸿</view> </view> </view> </view> <view class="detail-right"> - <view class="book-name">{{bookDetail.name}}</view> + <view class="book-name showTow">{{bookDetail.name}}</view> <view class="book-message"> <view class="message-li" wx:if="{{bookDetail.seriesName}}"> <view class="li-title">涓涗功鍚嶏細</view> @@ -49,15 +74,24 @@ <view class="li-content">{{bookDetail.isbn}}</view> </view> <view class="message-li"> - <view class="li-title" wx:if="{{bookDetail.publicationDate}}">鍑虹増鏃堕棿锛�</view> + <view class="li-title" wx:if="{{bookDetail.publicationDate}}" + >鍑虹増鏃堕棿锛�</view + > <view class="li-content">{{bookDetail.publicationDate}}</view> </view> - <view class="message-li" wx:if="{{bookDetail.class}}" style="height: 80rpx"> + <view + class="message-li" + wx:if="{{bookDetail.class}}" + style="height: 80rpx" + > <view class="li-title">鍥句功鍒嗙被锛�</view> <view class="class-name showTow">{{bookDetail.class}}</view> </view> </view> - <image src="/static/images/bookService/detail/square.png" class="right-background" /> + <image + src="/static/images/bookService/detail/square.png" + class="right-background" + /> </view> </view> <!-- 閿�鍞俊鎭� --> @@ -66,12 +100,17 @@ <!-- 鐢靛瓙涔﹀敭浠� --> <view class="electron-price" wx:if="{{bookDetail.price}}"> <view> - <image src="/static/images/bookService/detail/electon-price.png" /> + <image + src="/static/images/bookService/detail/electon-price.png" + /> </view> <view class="price"> - <view class="price-text">{{bookDetail.price == '0.00' ? '鍏嶈垂' : '楼'+ - bookDetail.price}}</view> - <view class="price-old" wx:if="{{bookDetail.oldPrice != '0.00'}}">楼{{bookDetail.oldPrice}} + <view class="price-text" + >{{bookDetail.price == '0.00' ? '鍏嶈垂' : '楼'+ + bookDetail.price}}</view + > + <view class="price-old" wx:if="{{bookDetail.oldPrice != '0.00'}}" + >楼{{bookDetail.oldPrice}} </view> </view> <view> </view> @@ -81,24 +120,66 @@ <view> <image src="/static/images/bookService/detail/paper-price.png" /> </view> - <view class="price">{{bookDetail.paperPrice == '0.00' ? '鍏嶈垂' : - '楼'+bookDetail.paperPrice}}</view> + <view class="price" + >{{bookDetail.paperPrice == '0.00' ? '鍏嶈垂' : + '楼'+bookDetail.paperPrice}}</view + > </view> </view> <!-- 缃戝簵 --> <view class="book-web"> - <image src="/static/images/bookService/detail/jd.png" wx:if="{{bookDetail.JDLink}}" bind:tap="goShop" data-link="{{bookDetail.JDLink}}" data-type="jd" /> - <image class="tmall-image" src="/static/images/bookService/detail/tmall.png" bind:tap="goShop" data-link="{{bookDetail.tmallLink}}" wx:if="{{bookDetail.tmallLink}}" /> - <image src="/static/images/bookService/detail/dangdang.png" bind:tap="goShop" data-link="{{bookDetail.dangdangLink}}" wx:if="{{bookDetail.dangdangLink}}" /> - <image src="/static/images/bookService/detail/weidian.png" bind:tap="goShop" data-link="{{bookDetail.weidianLink}}" wx:if="{{bookDetail.weidianLink}}" /> + <image + src="/static/images/bookService/detail/jd.png" + wx:if="{{bookDetail.JDLink}}" + bind:tap="goShop" + data-link="{{bookDetail.JDLink}}" + data-type="jd" + /> + <image + class="tmall-image" + src="/static/images/bookService/detail/tmall.png" + bind:tap="goShop" + data-link="{{bookDetail.tmallLink}}" + wx:if="{{bookDetail.tmallLink}}" + /> + <image + src="/static/images/bookService/detail/dangdang.png" + bind:tap="goShop" + data-link="{{bookDetail.dangdangLink}}" + wx:if="{{bookDetail.dangdangLink}}" + /> + <image + src="/static/images/bookService/detail/weidian.png" + bind:tap="goShop" + data-link="{{bookDetail.weidianLink}}" + wx:if="{{bookDetail.weidianLink}}" + /> </view> </view> </view> <view class="book-resource"> - <t-tabs value="{{tabValue}}" bind:change="onTabsChange" t-class="custom-tabs" t-class-content="custom-panel" class="tab-class"> - <t-tab-panel label="鍥句功绠�浠�" icon="{{ tabValue == 'brief' ? briefIconClick : briefIcon}}" value="brief" style="{{tabPanelstyle}}"> - <book-brief content="{{bookDetail.content}}" authorIntroduction="{{bookDetail.authorIntroduction}}" wx:if="{{bookDetail.content || bookDetail.authorIntroduction}}"></book-brief> - <view wx:if="{{!bookDetail.content && !bookDetail.authorIntroduction}}" class="noData"> + <t-tabs + value="{{tabValue}}" + bind:change="onTabsChange" + t-class="custom-tabs" + t-class-content="custom-panel" + class="tab-class" + > + <t-tab-panel + label="鍥句功绠�浠�" + icon="{{ tabValue == 'brief' ? briefIconClick : briefIcon}}" + value="brief" + style="{{tabPanelstyle}}" + > + <book-brief + content="{{bookDetail.content}}" + authorIntroduction="{{bookDetail.authorIntroduction}}" + wx:if="{{bookDetail.content || bookDetail.authorIntroduction}}" + ></book-brief> + <view + wx:if="{{!bookDetail.content && !bookDetail.authorIntroduction}}" + class="noData" + > <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> </t-tab-panel> @@ -109,48 +190,141 @@ style="{{tabPanelstyle}}" > </t-tab-panel> --> - <t-tab-panel label="鏁欏璧勬簮" icon="{{tabValue == 'jsek_teachingResources' ? teachResourcesClickIcon : teachResourcesIcon}}" value="jsek_teachingResources" class="{{loading ? 'loading': ''}}"> - <view wx:if="{{!loading && teach.length && !noResources && applyState}}"> - <teach-resource applyState="{{applyState}}" rejectCause="{{rejectCause}}" deadline="{{deadline}}" bind:applyResource="applyResource" applyResourceLoading="{{applyResourceLoading}}"></teach-resource> - <tree id="teach-tree" openIds="{{openTeachids}}" bookInfo="{{bookDetail}}" treeList="{{teach}}" tab="{{tabValue}}" applyState="{{applyState}}" bind:downloadTeach="downloadTeach" bind:handleTree="handleTree" openTeachids="{{openTeachids}}" wx:if="{{teach.length}}"></tree> + <t-tab-panel + label="鏁欏璧勬簮" + icon="{{tabValue == 'jsek_teachingResources' ? teachResourcesClickIcon : teachResourcesIcon}}" + value="jsek_teachingResources" + class="{{loading ? 'loading': ''}}" + > + <view + wx:if="{{!loading && teach.length && !noResources && applyState}}" + > + <teach-resource + applyState="{{applyState}}" + rejectCause="{{rejectCause}}" + deadline="{{deadline}}" + bind:applyResource="applyResource" + applyResourceLoading="{{applyResourceLoading}}" + ></teach-resource> + <tree + id="teach-tree" + openIds="{{openTeachids}}" + bookInfo="{{bookDetail}}" + treeList="{{teach}}" + tab="{{tabValue}}" + applyState="{{applyState}}" + bind:downloadTeach="downloadTeach" + bind:handleTree="handleTree" + openTeachids="{{openTeachids}}" + wx:if="{{teach.length}}" + ></tree> </view> - <t-loading theme="circular" size="60rpx" class="loading" loading="{{loading }}" /> + <t-loading + theme="circular" + size="60rpx" + class="loading" + loading="{{loading }}" + /> <view wx:if="{{noResources}}" class="noData"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> </t-tab-panel> - <t-tab-panel label="浜戝涔�" icon="{{tabValue == 'jsek_cloudLearning' ? learnResourceClickIcon : learnResourceIcon}}" value="jsek_cloudLearning" style="{{tabPanelstyle}}"> + <t-tab-panel + label="浜戝涔�" + icon="{{tabValue == 'jsek_cloudLearning' ? learnResourceClickIcon : learnResourceIcon}}" + value="jsek_cloudLearning" + style="{{tabPanelstyle}}" + > <view wx:if="{{!loading && learn.length}}"> - <learn-resource bind:getFreeResource="getFreeResource" bind:allAddShoppiingCar="allAddShoppiingCar" id="learn-resource" buyResourceData="{{buyResourceData}}" bookId="{{bookDetail.id}}" isshowDrawBtn="{{isshowDrawBtn}}"></learn-resource> + <learn-resource + bind:getFreeResource="getFreeResource" + bind:allAddShoppiingCar="allAddShoppiingCar" + id="learn-resource" + buyResourceData="{{buyResourceData}}" + bookId="{{bookDetail.id}}" + isshowDrawBtn="{{isshowDrawBtn}}" + ></learn-resource> - <tree id="tree" openIds="{{openLearnids}}" bookInfo="{{bookDetail}}" tab="{{tabValue}}" treeList="{{learn}}" buyIds="{{buyIdList}}" openLearnids="{{openLearnids}}" bind:updateShoppingCartHidden="updateShoppingCartHidden" bind:updateCloudLearning="updateCloudLearning"></tree> + <tree + id="tree" + openIds="{{openLearnids}}" + bookInfo="{{bookDetail}}" + tab="{{tabValue}}" + treeList="{{learn}}" + buyIds="{{buyIdList}}" + openLearnids="{{openLearnids}}" + bind:updateShoppingCartHidden="updateShoppingCartHidden" + bind:updateCloudLearning="updateCloudLearning" + ></tree> </view> <view wx:if="{{noResources}}" class="noData"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> </t-tab-panel> - <t-tab-panel label="浜戞祴璇�" icon="{{tabValue == 'questionBank' ? testResourceClickIocn : testResourceIocn}}" value="questionBank" style="{{tabPanelstyle}}"> + <t-tab-panel + label="浜戞祴璇�" + icon="{{tabValue == 'questionBank' ? testResourceClickIocn : testResourceIocn}}" + value="questionBank" + style="{{tabPanelstyle}}" + > <view wx:if="{{!loading}}"> - <test-resource list="{{test}}" bookInfo="{{bookDetail}}" mockData="{{mockData}}" bind:buyMock="buyMock"></test-resource> + <test-resource + id="test-resource" + list="{{test}}" + bookInfo="{{bookDetail}}" + mockData="{{mockData}}" + bind:buyMock="buyMock" + ></test-resource> </view> </t-tab-panel> - <t-tab-panel label="浜戠瑪璁�" icon="{{tabValue == 'jsek_note' ? noteClickIcon: noteIcon}}" value="jsek_note" style="{{tabPanelstyle}}"> + <t-tab-panel + label="浜戠瑪璁�" + icon="{{tabValue == 'jsek_note' ? noteClickIcon: noteIcon}}" + value="jsek_note" + style="{{tabPanelstyle}}" + > <note bookInfo="{{bookDetail}}" id="note" class="note-list"></note> </t-tab-panel> - <t-tab-panel label="鐩稿叧鍥句功" icon="{{tabValue == 'related_books' ? linkClickIcon: linkIcon}}" value="related_books" style="{{tabPanelstyle}}"> - <related-books relatedBookData="{{relatedBookData}}" relatedBookLoading="{{relatedBookLoading}}" noRelatedBookData="{{noRelatedBookData}}" bind:goBookDetails="goBookDetails"></related-books> + <t-tab-panel + label="鐩稿叧鍥句功" + icon="{{tabValue == 'related_books' ? linkClickIcon: linkIcon}}" + value="related_books" + style="{{tabPanelstyle}}" + > + <related-books + relatedBookData="{{relatedBookData}}" + relatedBookLoading="{{relatedBookLoading}}" + noRelatedBookData="{{noRelatedBookData}}" + bind:goBookDetails="goBookDetails" + ></related-books> </t-tab-panel> </t-tabs> </view> </scroll-view> <!-- 鎴戣寤鸿寮圭獥 --> - <suggest class="suggest-component" id="suggest-component" bookIcon="{{bookDetail.icon}}" bookName="{{bookDetail.name}}"></suggest> + <suggest + class="suggest-component" + id="suggest-component" + bookIcon="{{bookDetail.icon}}" + bookName="{{bookDetail.name}}" + ></suggest> <!-- 鏁欏璧勬簮涓嬭浇鎻愮ず寮圭獥 --> - <t-dialog class="teachDownloadDialog" visible="{{isShowTeachDownload}}" title="鎻愮ず" content="璇峰墠寰�PC绔笅杞�" confirm-btn="{{ confirmBtn }}" bind:confirm="closeTeachDownload" /> + <t-dialog + class="teachDownloadDialog" + visible="{{isShowTeachDownload}}" + title="鎻愮ず" + content="璇峰墠寰�PC绔笅杞�" + confirm-btn="{{ confirmBtn }}" + bind:confirm="closeTeachDownload" + /> <view class="applyBox" bindtap="goApply"> <view class="box"> - <t-image src="/static/images/home/yangshuForm1.png" mode="heightFix" class="img" /> + <t-image + src="/static/images/home/yangshuForm1.png" + mode="heightFix" + class="img" + /> <view class="num" wx:if="{{num > 0}}">{{num}}</view> </view> </view> @@ -158,30 +332,54 @@ <view class="box-bottom"> <view class="bottom-btn" bind:tap="appplyElectronicBook"> <view> - <t-image loading="" src="/static/images/bookService/detail/ebook.png"></t-image> + <t-image + loading="" + src="/static/images/bookService/detail/ebook.png" + ></t-image> </view> <view class="btn-text">鐢靛瓙鏍蜂功鐢宠</view> </view> <view class="bottom-btn" bind:tap="appplyPaperBook"> <view> - <t-image src="/static/images/bookService/detail/paper-book.png"></t-image> + <t-image + src="/static/images/bookService/detail/paper-book.png" + ></t-image> </view> <view class="btn-text">绾歌川鏍蜂功鐢宠</view> </view> - <view class="{{!bookBuy && bookDetail.isSell == '1' ? 'bottom-btn tryRead' : 'bottom-btn try'}}" bind:tap="goRead" wx:if="{{!bookBuy}}"> + <view + class="{{!bookBuy && bookDetail.isSell ? 'bottom-btn tryRead' : 'bottom-btn try'}}" + bind:tap="goRead" + wx:if="{{!bookBuy}}" + > <view> <t-image src="/static/images/bookService/detail/shidu.png"></t-image> </view> <view class="btn-text">璇曡</view> </view> - <view class="shopCar shopCarColor" bind:tap="addBookShopcCar" wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell == '1'}}">鍔犲叆璐墿杞�</view> - <view class="buy buyColor" bind:tap="buyBtn" wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell == '1'}}">绔嬪嵆璐拱</view> - <view class="buy receiveColor" bind:tap="buyBtn" wx:if="{{!bookBuy && bookDetail.price == '0.00' && bookDetail.isSell == '1'}}">鍏嶈垂棰嗗彇</view> + <view + class="shopCar shopCarColor" + bind:tap="addBookShopcCar" + wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell}}" + >鍔犲叆璐墿杞�</view + > + <view + class="buy buyColor" + bind:tap="buyBtn" + wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell}}" + >绔嬪嵆璐拱</view + > + <view + class="buy receiveColor" + bind:tap="buyBtn" + wx:if="{{!bookBuy && bookDetail.price == '0.00' && bookDetail.isSell}}" + >鍏嶈垂棰嗗彇</view + > <view class="buy read" bind:tap="goRead" wx:if="{{bookBuy}}">绔嬪嵆鏌ョ湅</view> </view> </view> <view class="loading" wx:if="{{pageLoading}}"> <t-loading loading="{{pageLoading}}" size="40"></t-loading> -</view> \ No newline at end of file +</view> diff --git a/packageBookService/pages/bookServices/detail/index.wxss b/packageBookService/pages/bookServices/detail/index.wxss index 5a305ee..c92e620 100644 --- a/packageBookService/pages/bookServices/detail/index.wxss +++ b/packageBookService/pages/bookServices/detail/index.wxss @@ -66,9 +66,6 @@ font-size: 36rpx; color: #000000; margin-bottom: 30rpx; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; } .showTow { diff --git a/packageBookService/pages/bookServices/examination/examination.js b/packageBookService/pages/bookServices/examination/examination.js index d864f29..108f1e6 100644 --- a/packageBookService/pages/bookServices/examination/examination.js +++ b/packageBookService/pages/bookServices/examination/examination.js @@ -50,15 +50,6 @@ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ onLoad(options) { - // wx.enableAlertBeforeUnload({ - // message: "鏈彁浜わ紝鏄惁閫�鍑虹瓟棰橈紵", - // success: function (res) { - // console.log('纭畾', res); - // }, - // fail: function (err) { - // console.log("澶辫触锛�", err); - // }, - // }); const systInfo = wx.getSystemInfoSync(); const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅 const navBarHeight = @@ -199,6 +190,25 @@ const oldVal = value; // 璁板綍灞炴�х殑鏃у�� value = newVal; // 鏇存柊灞炴�х殑鍊� callback.call(context, newVal, oldVal); // 璋冪敤鍥炶皟鍑芥暟锛屼紶閫掓柊鍊煎拰鏃у�� + }, + }); + }, + // 杩斿洖鎷︽埅 + beforeleave() { + wx.showModal({ + title: "鎻愮ず", + content: "鏈彁浜わ紝鏄惁閫�鍑虹瓟棰�", + confirmColor: "#ff6c00", + cancelColor: "#949494", + complete: (res) => { + if (res.cancel) { + } + if (res.confirm) { + this.setData({ + submitStatus: true, + }); + wx.navigateBack(); + } }, }); }, @@ -441,8 +451,6 @@ }, // 鎻愪氦閫昏緫 submitPaper() { - // 鍏抽棴閫�鍑洪〉闈㈢洃鍚� - wx.disableAlertBeforeUnload(); this.setData({ submitStatus: true, loading: true, @@ -669,7 +677,6 @@ let value = JSON.parse(res[0].value); // 鏈夌瓟棰樿褰曪紝寰楀垎璧嬪�� if (value) { - wx.disableAlertBeforeUnload(); this.setData({ submitStatus: true, }); @@ -1203,6 +1210,8 @@ wx.showModal({ title: "鎻愮ず", content: "鏀惰棌澶规殏鏃犳暟鎹�", //editable濡傛灉涓簍rue锛岃繖灏辨槸杈撳叆妗嗙殑鍐呭 + confirmColor: "#ff6c00", + cancelColor: "#949494", editable: false, //鏄惁鏄剧ず杈撳叆妗� showCancel: false, success: (res) => { @@ -1439,6 +1448,8 @@ wx.showModal({ title: "鎻愮ず", content: "閿欓闆嗘殏鏃犳暟鎹�", //editable濡傛灉涓簍rue锛岃繖灏辨槸杈撳叆妗嗙殑鍐呭 + confirmColor: "#ff6c00", + cancelColor: "#949494", editable: false, //鏄惁鏄剧ず杈撳叆妗� showCancel: false, success: (res) => { diff --git a/packageBookService/pages/bookServices/examination/examination.wxml b/packageBookService/pages/bookServices/examination/examination.wxml index 6d08914..588d13e 100644 --- a/packageBookService/pages/bookServices/examination/examination.wxml +++ b/packageBookService/pages/bookServices/examination/examination.wxml @@ -90,3 +90,11 @@ bind:onChangeSlider="onChangeSlider" ></question-options> </view> + +<page-container + wx:if="{{(answerType == 'mock' || answerType == 'option') && !submitStatus}}" + show="{{true}}" + duration="{{false}}" + overlay="{{false}}" + bind:beforeleave="beforeleave" +></page-container> diff --git a/packageBookService/pages/bookServices/examination/questionList/index.wxml b/packageBookService/pages/bookServices/examination/questionList/index.wxml index 6d3cdc5..73943a5 100644 --- a/packageBookService/pages/bookServices/examination/questionList/index.wxml +++ b/packageBookService/pages/bookServices/examination/questionList/index.wxml @@ -126,8 +126,7 @@ style="height: min-content" > <text>{{contentItem.value}}銆�</text> - <text class="radio-textimg">{{contentItem.txt}}</text> - + <view class="radio-textimg">{{contentItem.txt}}</view> <image src="{{contentItem.img}}" mode="aspectFit" /> </view> <!-- 瀵屾枃鏈� --> @@ -291,7 +290,7 @@ wx:if="{{item.analysisCon}}" style="color: {{isNight ? '#fff' : '#000'}};" > - <text style="font-size: {{sliderValue || 32}}rpx;">绛旀瑙f瀽锛�</text> + <text style="font-size: {{sliderValue || 32}}rpx;" class="answer-analysis">绛旀瑙f瀽锛�</text> <rich-text style="font-size: {{sliderValue || 32}}rpx;" nodes="{{item.analysisCon}}" diff --git a/packageBookService/pages/bookServices/examination/questionList/index.wxss b/packageBookService/pages/bookServices/examination/questionList/index.wxss index 70cc1af..fab99bc 100644 --- a/packageBookService/pages/bookServices/examination/questionList/index.wxss +++ b/packageBookService/pages/bookServices/examination/questionList/index.wxss @@ -47,9 +47,8 @@ } .radio-item { - max-height: 300rpx; + min-height: 100rpx; padding: 0 32rpx; - min-height: 98rpx; display: flex; align-items: center; justify-content: space-between; @@ -229,6 +228,7 @@ } .judge-rich-box { + height: 100%; display: flex; align-items: center; } @@ -265,4 +265,9 @@ --td-button-primary-active-bg-color: #fff0e6; --td-button-primary-border-color: #ff6c00; --td-button-primary-active-border-color: #ff6c00; +} + +.answer-analysis { + display: inline-block; + width: 192rpx; } \ No newline at end of file diff --git a/packageBookService/pages/bookServices/examination/questionOptions/index.js b/packageBookService/pages/bookServices/examination/questionOptions/index.js index e627970..40919c9 100644 --- a/packageBookService/pages/bookServices/examination/questionOptions/index.js +++ b/packageBookService/pages/bookServices/examination/questionOptions/index.js @@ -1,4 +1,3 @@ - // pages/bookServices/examination/questionOptions/index.js Component({ /** @@ -11,15 +10,15 @@ }, questionDataList: { type: Array, - value: [] + value: [], }, cardList: { type: Array, - value: [] + value: [], }, subjectiveTotal: { type: Number, - value: 0 + value: 0, }, countdownTime: { type: Number, @@ -27,23 +26,23 @@ }, answerType: { type: String, - value: '' + value: "", }, subjectiveNum: { type: Number, - value: 0 + value: 0, }, subjectiveGrade: { type: Number, - value: 0 + value: 0, }, correctNum: { type: Number, - value: 0 + value: 0, }, submitStatus: { type: Boolean, - value: false + value: false, }, mockSumTime: { type: Number, @@ -51,8 +50,8 @@ }, isNight: { type: Boolean, - value: false - } + value: false, + }, }, /** @@ -65,28 +64,34 @@ setUpPopup: false, testReportState: false, sliderValue: 36, - useTime: '', - radioItem: 'daytime' + useTime: "", + radioItem: "daytime", }, observers: { - "countdownTime": function (newValue, oldValue) { - if (this.properties.answerType == 'option') { + countdownTime: function (newValue, oldValue) { + if (this.properties.answerType == "option") { this.setData({ - useTime: this.formatTime(2 * 60 * 60 * 1000 - this.properties.countdownTime) - }) - } - else if (this.properties.answerType == 'option') { + useTime: this.formatTime( + 2 * 60 * 60 * 1000 - this.properties.countdownTime + ), + }); + } else if (this.properties.answerType == "option") { this.setData({ - useTime: this.formatTime(this.properties.mockSumTime - this.properties.countdownTime) - }) + useTime: this.formatTime( + this.properties.mockSumTime - this.properties.countdownTime + ), + }); } - if (newValue == 0 && (this.properties.answerType == 'option' || this.properties.answerType == 'mock')) { - this.timeout() + if ( + newValue == 0 && + (this.properties.answerType == "option" || + this.properties.answerType == "mock") + ) { + this.timeout(); } }, }, - created() { - }, + created() {}, /** * 缁勪欢鐨勬柟娉曞垪琛� @@ -96,61 +101,60 @@ formatTime(ms) { const hours = Math.floor((ms / (1000 * 60 * 60)) % 24) .toString() - .padStart(2, '0') + .padStart(2, "0"); const minutes = Math.floor((ms / (1000 * 60)) % 60) .toString() - .padStart(2, '0') + .padStart(2, "0"); const seconds = Math.floor((ms / 1000) % 60) .toString() - .padStart(2, '0') - return `${hours}:${minutes}:${seconds}` + .padStart(2, "0"); + return `${hours}:${minutes}:${seconds}`; }, // 鍒ゆ柇鏄惁杈撳叆绛旀 isHaveAnswer(data) { - if (typeof data == 'string') { + if (typeof data == "string") { data = data - .replace(/<[^>]*>/g, '') - .replace(/ /g, '') - .trim() + .replace(/<[^>]*>/g, "") + .replace(/ /g, "") + .trim(); if (data.length) { - return true + return true; } else { - return false + return false; } } else { - const answer = data.find((item) => item.length > 0) + const answer = data.find((item) => item.length > 0); if (answer) { - return true + return true; } else { - return false + return false; } } }, setCollect() { - var myEventDetail = { - } + var myEventDetail = {}; var myEventOption = { bubbles: true, composed: true, - } - this.triggerEvent('setCollect', myEventDetail, myEventOption) + }; + this.triggerEvent("setCollect", myEventDetail, myEventOption); }, // 绛旈鍗℃寜閽� handlePopup() { this.setData({ - questionCardState: true - }) + questionCardState: true, + }); }, // 绛旈鍗¤烦杞鐩� goQuestion(e) { var myEventDetail = { - id: e.currentTarget.dataset.id - } + id: e.currentTarget.dataset.id, + }; var myEventOption = { bubbles: true, composed: true, - } - this.triggerEvent('goQuestion', myEventDetail, myEventOption) + }; + this.triggerEvent("goQuestion", myEventDetail, myEventOption); }, // 绛旈鍗¢伄缃╁眰鐐瑰嚮 onVisibleChange(e) { @@ -161,136 +165,144 @@ // 璁剧疆鎸夐挳 setUpBtn() { this.setData({ - setUpPopup: true - }) + setUpPopup: true, + }); }, // 婊戝潡鍙樺寲 onChangeSlider(e) { - const value = e.detail.value + const value = e.detail.value; console.log(value); - this.triggerEvent('onChangeSlider', { value }) + this.triggerEvent("onChangeSlider", { value }); }, // 璁剧疆閬僵灞傜偣鍑� onSetUpChange(e) { this.setData({ - setUpPopup: e.detail.visible - }) + setUpPopup: e.detail.visible, + }); }, // 璁剧疆妯″紡鍒囨崲 onRadioChange(e) { this.setData({ - radioItem: e.detail.value - }) - const value = e.detail.value == 'night' ? true : false + radioItem: e.detail.value, + }); + const value = e.detail.value == "night" ? true : false; wx.setNavigationBarColor({ - backgroundColor: '#222', - frontColor: '#222', - }) + backgroundColor: "#222", + frontColor: "#222", + }); - this.triggerEvent('changeBGColor', { value }) + this.triggerEvent("changeBGColor", { value }); }, // 閲嶅仛鎸夐挳 resterBtn() { wx.showModal({ - title: '鎻愮ず', - content: '鏄惁閲嶆柊寮�濮嬬瓟棰橈紵',//editable濡傛灉涓簍rue锛岃繖灏辨槸杈撳叆妗嗙殑鍐呭 - editable: false,//鏄惁鏄剧ず杈撳叆妗� + title: "鎻愮ず", + content: "鏄惁閲嶆柊寮�濮嬬瓟棰橈紵", //editable濡傛灉涓簍rue锛岃繖灏辨槸杈撳叆妗嗙殑鍐呭 + confirmColor: "#ff6c00", + cancelColor: "#949494", + editable: false, //鏄惁鏄剧ず杈撳叆妗� success: (res) => { if (res.confirm) { - this.restart() + this.restart(); } - } - }) + }, + }); }, // 閲嶅仛浜嬩欢 restart() { - var myEventDetail = { - } + var myEventDetail = {}; var myEventOption = { bubbles: true, composed: true, - } - this.triggerEvent('restart', myEventDetail, myEventOption) + }; + this.triggerEvent("restart", myEventDetail, myEventOption); }, // 杩樻湁N閬撻鏈仛寮圭獥 confrimPromptDialog() { wx.showModal({ - title: '鎻愮ず', - content: `鎮ㄨ繕鏈� ${this.data.noReady}閬撻鏈瓟锛屾槸鍚︽彁浜わ紵`,//editable濡傛灉涓簍rue锛岃繖灏辨槸杈撳叆妗嗙殑鍐呭 - editable: false,//鏄惁鏄剧ず杈撳叆妗� + title: "鎻愮ず", + content: `鎮ㄨ繕鏈� ${this.data.noReady}閬撻鏈瓟锛屾槸鍚︽彁浜わ紵`, //editable濡傛灉涓簍rue锛岃繖灏辨槸杈撳叆妗嗙殑鍐呭 + confirmColor: "#ff6c00", + cancelColor: "#949494", + editable: false, //鏄惁鏄剧ず杈撳叆妗� success: (res) => { if (res.confirm) { - this.submitPaper() + this.submitPaper(); } - } - }) + }, + }); }, // 搴曢儴鎻愪氦鎸夐挳 submitBtn() { this.setData({ - noReady: 0 - }) + noReady: 0, + }); // 鎴戠殑閿欓鍜屾敹钘� 鐩存帴璧版彁浜ら�昏緫 - if (this.properties.answerType == 'collectQuestion' || this.properties.answerType == 'errorQuestion') { - this.submitPaper() - return wx.navigateBack() - } else if (this.properties.answerType == 'option' || this.properties.answerType == 'mock') { - if (this.properties.submitStatus) return wx.navigateBack() - this.properties.questionDataList.forEach(item => { + if ( + this.properties.answerType == "collectQuestion" || + this.properties.answerType == "errorQuestion" + ) { + this.submitPaper(); + return wx.navigateBack(); + } else if ( + this.properties.answerType == "option" || + this.properties.answerType == "mock" + ) { + if (this.properties.submitStatus) return wx.navigateBack(); + this.properties.questionDataList.forEach((item) => { if (!this.isHaveAnswer(item.userAnswer)) { this.setData({ - noReady: this.data.noReady + 1 - }) + noReady: this.data.noReady + 1, + }); } - }) + }); // 鏈仛瀹岋紝鎵撳紑鎻愮ず寮圭獥 if (this.data.noReady > 0) { - this.confrimPromptDialog() + this.confrimPromptDialog(); } else { // 鍋氬畬浜嗙洿鎺ユ墽琛屾彁浜や簨浠� - this.submitPaper() + this.submitPaper(); } } - }, // 鎻愪氦浜嬩欢 submitPaper() { - var myEventDetail = { - } + var myEventDetail = {}; var myEventOption = { bubbles: true, composed: true, - } - this.triggerEvent('submitPaper', myEventDetail, myEventOption) + }; + this.triggerEvent("submitPaper", myEventDetail, myEventOption); }, // 鎵撳紑娴嬭瘯鎶ュ憡寮圭獥 openTestReportDialog() { this.setData({ - testReportState: true - }) + testReportState: true, + }); }, // 鍏抽棴娴嬭瘯鎶ュ憡寮圭獥 closeTestReportDialog(e) { this.setData({ - testReportState: false - }) + testReportState: false, + }); }, // 娴嬭瘯鎶ュ憡寮圭獥鏌ョ湅绛旀瑙f瀽鎸夐挳 viewAnswer() { - this.closeTestReportDialog() + this.closeTestReportDialog(); }, // 绛旈鏃堕棿鍒� timeout() { wx.showModal({ - title: '鎻愮ず', - content: '绛旈鏃堕棿宸插埌',//editable濡傛灉涓簍rue锛岃繖灏辨槸杈撳叆妗嗙殑鍐呭 - editable: false,//鏄惁鏄剧ず杈撳叆妗� + title: "鎻愮ず", + content: "绛旈鏃堕棿宸插埌", //editable濡傛灉涓簍rue锛岃繖灏辨槸杈撳叆妗嗙殑鍐呭 + confirmColor: "#ff6c00", + cancelColor: "#949494", + editable: false, //鏄惁鏄剧ず杈撳叆妗� showCancel: false, - success: (res) => { - } - }) - this.submitPaper() + success: (res) => {}, + }); + this.submitPaper(); }, - } -}) + }, +}); diff --git a/packageBookService/pages/bookServices/list/index.js b/packageBookService/pages/bookServices/list/index.js index 7903f4f..6f9dd50 100644 --- a/packageBookService/pages/bookServices/list/index.js +++ b/packageBookService/pages/bookServices/list/index.js @@ -1,16 +1,14 @@ const app = getApp(); -import { - loginInfo -} from '../../../../assets/js/login'; +import { loginInfo } from "../../../../assets/js/login"; Page({ /** * 椤甸潰鐨勫垵濮嬫暟鎹� */ data: { - barHeight: '', - navBarHeight: '', - searchValue: '', - path: '', + barHeight: "", + navBarHeight: "", + searchValue: "", + path: "", pathList: [], pageCount: { page: 1, @@ -18,16 +16,18 @@ }, isMore: null, assortCheck: { - name: '', - code: '', + name: "", + code: "", }, bookList: [], stairList: { - value: '', - options: [{ - value: '', - label: '涓�绾�', - }, ], + value: "", + options: [ + { + value: "", + label: "涓�绾�", + }, + ], }, secondList: { value: [], @@ -39,38 +39,40 @@ options: [], }, sortList: { - value: 'default', - options: [{ - value: 'default', - label: '榛樿鎺掑簭', - }, { - value: 'name-asc', - label: '鍚嶇О姝e簭' + value: "default", + options: [ + { + value: "default", + label: "榛樿鎺掑簭", }, { - value: 'name-desc', - label: '鍚嶇О鍊掑彊' + value: "name-asc", + label: "鍚嶇О姝e簭", }, { - value: 'time-asc', - label: '鍑虹増鏃堕棿姝e簭' + value: "name-desc", + label: "鍚嶇О鍊掑彊", }, { - value: 'time-desc', - label: '鍑虹増鏃堕棿鍊掑彊' - } + value: "time-asc", + label: "鍑虹増鏃堕棿姝e簭", + }, + { + value: "time-desc", + label: "鍑虹増鏃堕棿鍊掑彊", + }, ], }, newTextBook: { value: [], options: [], }, - stairCode: '', // 涓�绾у垎绫婚�変腑椤� - secondCode: '', // 浜岀骇鍒嗙被閫変腑椤� - sort: '', // 鎺掑簭 + stairCode: "", // 涓�绾у垎绫婚�変腑椤� + secondCode: "", // 浜岀骇鍒嗙被閫変腑椤� + sort: "", // 鎺掑簭 enable: false, loadingProps: { - size: '50rpx' + size: "50rpx", }, loading: false, noData: false, @@ -81,6 +83,7 @@ disabledProject: false, disabledNewForms: false, triggered: false, + backTop: "", }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 @@ -88,7 +91,8 @@ onLoad(options) { const systInfo = wx.getSystemInfoSync(); const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅 - const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 瀵艰埅鏍忛珮搴� + const navBarHeight = + (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 瀵艰埅鏍忛珮搴� this.setData({ barHeight: systInfo.statusBarHeight, navBarHeight: navBarHeight, @@ -114,7 +118,7 @@ // 涓�绾у垎绫诲拰path璧嬪�� if (options.stairCode) { this.setData({ - 'stairList.value': options.stairCode, + "stairList.value": options.stairCode, stairCode: options.stairCode, path: `${options.assortCode}\\${options.stairCode}`, }); @@ -123,19 +127,21 @@ if (options.secondCode) { this.setData({ secondCode: options.secondCode, - pathList: [{ - Path: options.secondCode, - Type: '*', - StoreRefCode: app.config.goodsStore, - }], - }) + pathList: [ + { + Path: options.secondCode, + Type: "*", + StoreRefCode: app.config.goodsStore, + }, + ], + }); } // 鑾峰彇浜岀骇鍒嗙被 this.getSecondList(`${options.assortCode}\\${options.stairCode}`); this.getBookList(`${options.assortCode}\\${options.stairCode}`); // 鑾峰彇閲嶇偣椤圭洰 - this.getProjectList('bookClassification'); - this.getProjectList('newFormsTextbooks'); + this.getProjectList("bookClassification"); + this.getProjectList("newFormsTextbooks"); }, /** @@ -163,11 +169,11 @@ */ onPullDownRefresh() { this.setData({ - triggered: true - }) + triggered: true, + }); this.setData({ - 'pageCount.page': 1 - }) + "pageCount.page": 1, + }); this.getBookList(this.data.path); }, @@ -175,25 +181,24 @@ * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� */ onReachBottom(e) { - const flag = this.data.bookList.length < this.data.pageCount.total + const flag = this.data.bookList.length < this.data.pageCount.total; if (flag) { if (!this.data.isRequesting) { this.setData({ isMore: true, - "pageCount.page": this.data.pageCount.page + 1 - }) - this.getBookList(this.data.path) + "pageCount.page": this.data.pageCount.page + 1, + }); + this.getBookList(this.data.path); } } else { this.setData({ isMore: true, - }) + }); setTimeout(() => { this.setData({ - isMore: false - }) - }, 100) - console.log('娌℃湁鏇村浜�'); + isMore: false, + }); + }, 100); } }, @@ -207,26 +212,28 @@ // 鑾峰彇涓�绾у垪琛� getStairList(path) { this.setData({ - disabledStair: false - }) + disabledStair: false, + }); const query = { path, filterList: [], - queryType: '\\', + queryType: "\\", searchList: [], - size: '30', - start: '0', + size: "30", + start: "0", storeRefCode: app.config.goodsStore, sort: { - type: 'Asc', - field: 'LinkOrder' + type: "Asc", + field: "LinkOrder", }, }; app.MG.store.getStoreChannelList(query).then(async (res) => { - const options = [{ - value: '', - label: '涓�绾�', - }, ]; + const options = [ + { + value: "", + label: "涓�绾�", + }, + ]; for (let index = 0; index < res.datas.length; index++) { const item = res.datas[index]; options.push({ @@ -235,13 +242,13 @@ }); } this.setData({ - 'stairList.options': options, - 'stairList.value': this.data.stairCode, + "stairList.options": options, + "stairList.value": this.data.stairCode, }); if (!options.length) { this.setData({ - disabledStair: true - }) + disabledStair: true, + }); } }); }, @@ -251,25 +258,25 @@ const query = { path, filterList: [], - queryType: '\\', + queryType: "\\", searchList: [], - size: '30', - start: '0', + size: "30", + start: "0", storeRefCode: app.config.goodsStore, sort: { - type: 'Asc', - field: 'LinkOrder' + type: "Asc", + field: "LinkOrder", }, }; app.MG.store.getStoreChannelList(query).then((res) => { if (!res.datas.length) { this.setData({ - disabledSecondList: true - }) + disabledSecondList: true, + }); } else { this.setData({ - disabledSecondList: false - }) + disabledSecondList: false, + }); } for (let index = 0; index < res.datas.length; index++) { const item = res.datas[index]; @@ -279,20 +286,20 @@ }); } this.setData({ - 'secondList.options': options, + "secondList.options": options, }); - const second = [this.data.secondCode] + const second = [this.data.secondCode]; this.setData({ - 'secondList.value': second - }) + "secondList.value": second, + }); }); }, // 鑾峰彇閲嶇偣椤圭洰 getProjectList(type) { this.setData({ disabledProject: false, - disabledNewForms: false - }) + disabledNewForms: false, + }); const options = []; const arr = []; let array = []; @@ -300,7 +307,9 @@ refCodes: [type], }; app.MG.store.getProductTypeField(query).then((res) => { - array = JSON.parse(res[0].config).option.filter(item => item.value == this.data.assortCheck.code); + array = JSON.parse(res[0].config).option.filter( + (item) => item.value == this.data.assortCheck.code + ); for (let index = 0; index < array.length; index++) { const element = array[index]; if (element.child) { @@ -310,7 +319,7 @@ } } } - if (type == 'bookClassification') { + if (type == "bookClassification") { for (let index = 0; index < arr.length; index++) { const element = arr[index]; options.push({ @@ -320,13 +329,13 @@ } if (!options.length) { this.setData({ - disabledProject: true - }) + disabledProject: true, + }); } this.setData({ - 'majorProjectList.options': options, + "majorProjectList.options": options, }); - } else if (type == 'newFormsTextbooks') { + } else if (type == "newFormsTextbooks") { for (let index = 0; index < arr.length; index++) { const element = arr[index]; options.push({ @@ -336,13 +345,13 @@ } if (!options.length) { this.setData({ - disabledNewForms: true - }) + disabledNewForms: true, + }); } this.setData({ - 'newTextBook.options': options, + "newTextBook.options": options, }); - console.log('閲嶇偣椤圭洰', this.data.newTextBook); + console.log("閲嶇偣椤圭洰", this.data.newTextBook); } }); }, @@ -354,8 +363,8 @@ this.setData({ loading: true, noData: false, - isRequesting: true - }) + isRequesting: true, + }); let sort; let pathObj = {}; if (this.data.pathList.length) { @@ -365,34 +374,34 @@ } else { pathObj = { path, - queryType: '*', + queryType: "*", }; } - if (this.data.sortList.value == 'name-asc') { + if (this.data.sortList.value == "name-asc") { sort = { - Name: 'Asc', - BaseType: '' - } - } else if (this.data.sortList.value == 'name-desc') { + Name: "Asc", + BaseType: "", + }; + } else if (this.data.sortList.value == "name-desc") { sort = { - Name: 'Desc', - BaseType: '' - } - } else if (this.data.sortList.value == 'time-asc') { + Name: "Desc", + BaseType: "", + }; + } else if (this.data.sortList.value == "time-asc") { sort = { - PublicationDate: 'Asc', - BaseType: 'DateTime' - } - } else if (this.data.sortList.value == 'time-desc') { + PublicationDate: "Asc", + BaseType: "DateTime", + }; + } else if (this.data.sortList.value == "time-desc") { sort = { - PublicationDate: 'Desc', - BaseType: 'DateTime' - } - } else if (this.data.sortList.value == 'default') { + PublicationDate: "Desc", + BaseType: "DateTime", + }; + } else if (this.data.sortList.value == "default") { sort = { - field: 'order', - type: 'Desc' - } + field: "order", + type: "Desc", + }; } // if (this.data.sort) { // sort = { @@ -409,18 +418,20 @@ let searchObj = {}; if (this.data.searchValue) { searchObj = { - 'Name*': this.data.searchValue, - '||author*': this.data.searchValue, - '||isbn*': this.data.searchValue, - '||seriesName*': this.data.searchValue, + "Name*": this.data.searchValue, + "||author*": this.data.searchValue, + "||isbn*": this.data.searchValue, + "||seriesName*": this.data.searchValue, }; } const query = { ...pathObj, - filterList: [{ - value: 'Normal', - field: 'state', - }, ], + filterList: [ + { + value: "Normal", + field: "state", + }, + ], sort, paging: { start: 0, @@ -430,51 +441,53 @@ author: [], publicationDate: [], ...searchObj, - 'bookClassification*': this.data.majorProjectList.value, - 'newFormsTextbooks*': this.data.newTextBook.value, + "bookClassification*": this.data.majorProjectList.value, + "newFormsTextbooks*": this.data.newTextBook.value, }, }; app.MG.store.getProductList(query).then((res) => { this.setData({ bookList: res.datas, + isMore: null, enable: false, "pageCount.total": res.total, loading: false, - isRequesting: false + isRequesting: false, }); if (!res.datas.length) { this.setData({ noData: true, - }) + }); } if (this.data.triggered) { this.setData({ - triggered: false - }) + triggered: false, + }); wx.showToast({ - title: '鍒锋柊鎴愬姛', - }) + title: "鍒锋柊鎴愬姛", + }); } }); }, // 涓�绾у垎绫诲垏鎹� onChangeStair(e) { - const path = e.detail.value.length ? - `${this.data.assortCheck.code}\\${e.detail.value}` : - this.data.assortCheck.code; + const path = e.detail.value.length + ? `${this.data.assortCheck.code}\\${e.detail.value}` + : this.data.assortCheck.code; console.log(this.data.path); this.setData({ + backTop: "#assort-title", pathList: [], stairCode: e.detail.value, - secondCode: '', + secondCode: "", path: path, - 'stairList.value': e.detail.value, + "stairList.value": e.detail.value, }); - if (e.detail.value == '') { + if (e.detail.value == "") { this.setData({ - disabledSecondList: true + disabledSecondList: true, }); } else { this.getSecondList(path); @@ -489,38 +502,41 @@ const element = e.detail.value[index]; pathList.push({ Path: element, - Type: '*', + Type: "*", StoreRefCode: app.config.goodsStore, }); } this.setData({ + backTop: "#assort-title", pathList: pathList, - 'secondList.value': e.detail.value, + "secondList.value": e.detail.value, }); }, - // + // onConfirmSecond() { this.getBookList(this.data.path); }, // 閲嶇偣椤圭洰鏀瑰彉 changeMajorProject(e) { this.setData({ - 'majorProjectList.value': e.detail.value, + backTop: "#assort-title", + "majorProjectList.value": e.detail.value, }); this.getBookList(this.data.path); }, // 閲嶇偣椤圭洰閲嶇疆 resetMajorProject() { this.setData({ - 'majorProjectList.value': [], + "majorProjectList.value": [], }); this.getBookList(this.data.path); }, // 鎺掑簭鍒囨崲 onSortChange(e) { this.setData({ - 'sortList.value': e.detail.value - }) + backTop: "#assort-title", + "sortList.value": e.detail.value, + }); let path; if (this.data.secondCode) { @@ -535,15 +551,17 @@ }); this.getBookList(path); }, + // 鏂板舰鎬佹暀鏉愭敼鍙� changeNewText(e) { this.setData({ - 'newTextBook.value': e.detail.value, + backTop: "#assort-title", + "newTextBook.value": e.detail.value, }); this.getBookList(this.data.path); }, resetNewText() { this.setData({ - 'newTextBook.value': [], + "newTextBook.value": [], }); this.getBookList(this.data.path); }, @@ -577,37 +595,35 @@ // }, // 鎼滅储鍥句功 searchBook(e) { - console.log(e.detail.value); this.setData({ + backTop: "#assort-title", searchValue: e.detail.value, }); this.getBookList(this.data.path); }, // 璺宠浆鍥句功璇︽儏 goDetail(e) { - const { - book - } = e.currentTarget.dataset; + const { book } = e.currentTarget.dataset; wx.navigateTo({ url: `/packageBookService/pages/bookServices/detail/index?id=${book.id}&name=${book.name}`, }); }, onRefresh() { this.setData({ - enable: true + enable: true, }); - this.getBookList(this.data.path) + this.getBookList(this.data.path); }, openDropdown() { - console.log('灞曞紑鍝�', ); + console.log("灞曞紑鍝�"); this.setData({ - showDropdown: true - }) + showDropdown: true, + }); }, closeDropdown() { - console.log('鍏抽棴'); + console.log("鍏抽棴"); this.setData({ - showDropdown: false - }) - } -}); \ No newline at end of file + showDropdown: false, + }); + }, +}); diff --git a/packageBookService/pages/bookServices/list/index.wxml b/packageBookService/pages/bookServices/list/index.wxml index d70c179..8749e98 100644 --- a/packageBookService/pages/bookServices/list/index.wxml +++ b/packageBookService/pages/bookServices/list/index.wxml @@ -78,6 +78,7 @@ </view> <scroll-view scroll-y="{{true}}" + scroll-into-view="{{backTop}}" refresher-enabled="{{true}}" lower-threshold="{{200}}" refresher-threshold="{{80}}" @@ -99,7 +100,7 @@ /> </view> </view> - <view class="assort-title"> + <view class="assort-title" id="assort-title"> <view class="title-box"></view> <view class="title-name">{{assortCheck.name}}</view> </view> @@ -137,12 +138,13 @@ /> </view> </view> - <view class="bottom-box"> + <view class="bottom-box" wx:if="{{bookList.length}}"> <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" + loading="{{isMore}}" /> <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> </view> diff --git a/packageDomain/pages/sampleBookList/applicationForm/index.js b/packageDomain/pages/sampleBookList/applicationForm/index.js index b1831f9..6b599f9 100644 --- a/packageDomain/pages/sampleBookList/applicationForm/index.js +++ b/packageDomain/pages/sampleBookList/applicationForm/index.js @@ -46,18 +46,6 @@ 'contactInfo.phone': JSON.parse(this.data.userInfo.data).phone, 'contactInfo.detailedAddress': JSON.parse(this.data.userInfo.data).detailedAddress, }) - } else { - wx.showModal({ - title: '灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�', //鎻愮ず鐨勬爣棰� - content: '璇峰厛杩涜鏁欏笀璁よ瘉锛�', //鎻愮ず鐨勫唴瀹� - success: function (res) { - if (res.confirm) { - wx.navigateTo({ - url: "/packageDomain/pages/teacherCertification/index", - }); - } - } - }) } if (wx.getStorageSync("paperBookList")) { this.setData({ diff --git a/packageDomain/pages/sampleBookList/index.js b/packageDomain/pages/sampleBookList/index.js index eb4db74..0858a02 100644 --- a/packageDomain/pages/sampleBookList/index.js +++ b/packageDomain/pages/sampleBookList/index.js @@ -420,8 +420,6 @@ author: [], isbn: [], publicationDate: [], - pdf: [], - protectedEpub: [], isApplyBook: [], 'isApplyBook>': ['1'], ...searchObj, @@ -497,9 +495,6 @@ }) } else { that.setData({ - bookList: [], - pageTotalCount: 0, - bottomLoading: false, skeletonLoding: false, loading: false }) @@ -812,55 +807,14 @@ }, //閫夋嫨鐢靛瓙鏍蜂功 - async onChangeElectron(e) { + onChangeElectron(e) { const item = e.currentTarget.dataset.book; - console.log(item) const index = this.data.bookList.findIndex(citem => citem.id == item.id) let role = this.data.userInfo != null ? this.data.userInfo.role : null if (role && role == 'Teacher') { // 鏄暀甯� if (e.detail.checked) { // 鐐瑰嚮閫変腑 - //鍟嗗搧鏈夋棤鐢靛瓙涔� - const obj = { - path: '*', - queryType: 'SubProduct', - sort: { - type: 'Desc', - field: 'CreateDate' - }, - paging: { - start: 0, - size: 1 - }, - mainProductId: item.id, - fields: { - bookshelf_pdf: [], - bookshelf_protectedEpub: [], - } - } - const res = await app.MG.store.getProductList(obj) - if (res.datas.length > 0) { - if (!res.datas[0].bookshelf_pdf && !res.datas[0].bookshelf_protectedEpub) { - wx.showToast({ - title: "鏆傛棤鐢靛瓙涔︽枃浠�,璇疯仈绯荤鐞嗗憳!", - icon: 'none', - duration: 1000, - }) - return false; - } - } else { - if (!item.pdf && !item.protectedEpub) { - wx.showToast({ - title: "鏆傛棤鐢靛瓙涔︽枃浠�,璇疯仈绯荤鐞嗗憳!", - icon: 'none', - duration: 1000, - }) - return false; - } - } - - //鐢宠娆℃暟 if (this.data.ebookCount == 0) { wx.showToast({ title: "鎮ㄧ殑鐢靛瓙鏍蜂功鐢宠娆℃暟宸茬敤灏斤紝鑻ヨ缁х画锛岃鑱旂郴绠$悊鍛橈紒", diff --git a/packageDomain/pages/sampleBookList/index.json b/packageDomain/pages/sampleBookList/index.json index f62f659..cf12577 100644 --- a/packageDomain/pages/sampleBookList/index.json +++ b/packageDomain/pages/sampleBookList/index.json @@ -11,7 +11,6 @@ "t-search": "tdesign-miniprogram/search/search", "t-checkbox": "tdesign-miniprogram/checkbox/checkbox", "t-loading": "tdesign-miniprogram/loading/loading", - "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh", - "t-empty": "tdesign-miniprogram/empty/empty" + "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh" } } \ No newline at end of file diff --git a/packagePersonal/pages/downloads/index.js b/packagePersonal/pages/downloads/index.js index f87e7d1..76aa687 100644 --- a/packagePersonal/pages/downloads/index.js +++ b/packagePersonal/pages/downloads/index.js @@ -67,8 +67,6 @@ }) } else { this.setData({ - list: [], - pageTotalCount: 0, skeletonLoding: false, }) } diff --git a/packagePersonal/pages/feedBack/index.js b/packagePersonal/pages/feedBack/index.js index 618acf0..e1511ec 100644 --- a/packagePersonal/pages/feedBack/index.js +++ b/packagePersonal/pages/feedBack/index.js @@ -9,7 +9,8 @@ data: { active: 0, activeName: "bookOpinion", - tabList: [{ + tabList: [ + { label: '鍥句功寤鸿', key: 0, value: 'bookOpinion' @@ -79,15 +80,15 @@ getDataList(isReachBottom) { app.MG.ugc.getTopicMessageList({ - appRefCode: app.config.appRefCode, - topicIdOrRefCode: this.data.topicIdOrRefCode, - start: this.data.page * this.data.limit - this.data.limit, - size: this.data.limit, - sort: { - type: "Desc", - field: "CreateDate" - } - }) + appRefCode: app.config.appRefCode, + topicIdOrRefCode: this.data.topicIdOrRefCode, + start: this.data.page * this.data.limit - this.data.limit, + size: this.data.limit, + sort: { + type: "Desc", + field: "CreateDate" + } + }) .then(res => { try { if (res.datas.length > 0) { @@ -111,8 +112,6 @@ }) } else { this.setData({ - list: [], - pageTotalCount: 0, skeletonLoding: false, }) } diff --git a/packagePersonal/pages/feedBack/index.wxml b/packagePersonal/pages/feedBack/index.wxml index 4eba6c7..0c8222d 100644 --- a/packagePersonal/pages/feedBack/index.wxml +++ b/packagePersonal/pages/feedBack/index.wxml @@ -17,7 +17,7 @@ <view wx:if="{{activeName == 'bookOpinion'}}" class="listBox"> <view class="content-item" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"> <view class="icon"> - <t-image src="{{item.content.icon ? item.content.icon : '/static/images/default-book-img.png'}}" mode="aspectFill" class="img" /> + <t-image src="{{item.content.icon}}" mode="aspectFill" class="img" /> </view> <view class="item-con"> <view class="titleBox"> diff --git a/packagePersonal/pages/myMassage/index.js b/packagePersonal/pages/myMassage/index.js index 998b88d..34762a5 100644 --- a/packagePersonal/pages/myMassage/index.js +++ b/packagePersonal/pages/myMassage/index.js @@ -29,14 +29,14 @@ getDataList(isReachBottom) { app.MG.app.getAppMessageList({ - appRefCode: app.config.appRefCode, - start: this.data.page * this.data.limit - this.data.limit, - size: this.data.limit, - sort: { - type: "Desc", - field: "CreateDate" - } - }) + appRefCode: app.config.appRefCode, + start: this.data.page * this.data.limit - this.data.limit, + size: this.data.limit, + sort: { + type: "Desc", + field: "CreateDate" + } + }) .then(res => { try { if (res.datas.length > 0) { @@ -59,8 +59,6 @@ }) } else { this.setData({ - list: [], - pageTotalCount: 0, skeletonLoding: false, }) } diff --git a/packagePersonal/pages/sampleBooks/index.js b/packagePersonal/pages/sampleBooks/index.js index ede0a53..bc1a1e4 100644 --- a/packagePersonal/pages/sampleBooks/index.js +++ b/packagePersonal/pages/sampleBooks/index.js @@ -143,8 +143,6 @@ }) } else { this.setData({ - list: [], - pageTotalCount: 0, skeletonLoding: false, loading: false }) diff --git a/pages/bookServices/assort/index.js b/pages/bookServices/assort/index.js index fa4c9de..ad80311 100644 --- a/pages/bookServices/assort/index.js +++ b/pages/bookServices/assort/index.js @@ -1,22 +1,24 @@ // pages/bookServices/assort/index.js -import { getPublicImage } from '../../../assets/js/middleGround/tool' +import { getPublicImage } from "../../../assets/js/middleGround/tool"; const app = getApp(); Page({ /** * 椤甸潰鐨勫垵濮嬫暟鎹� */ data: { - placeholderstyle: 'font-size:28rpx', + barHeight: "", + navBarHeight: "", + placeholderstyle: "font-size:28rpx", assortList: [], assortCheck: { - name: '', - code: '', + name: "", + code: "", }, startList: [], startCheck: { - id: '', - code: '' + id: "", + code: "", }, bookList: [], loading: false, @@ -27,75 +29,85 @@ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ onLoad(options) { + const systInfo = wx.getSystemInfoSync(); + const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅 + const navBarHeight = + (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 瀵艰埅鏍忛珮搴� + this.setData({ + barHeight: systInfo.statusBarHeight, + navBarHeight: navBarHeight, + }); this.getAssortList(); }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 */ - onReady() { }, + onReady() {}, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず */ onShow() { - if (typeof this.getTabBar === 'function' && this.getTabBar()) { + if (typeof this.getTabBar === "function" && this.getTabBar()) { this.getTabBar().setData({ - active: 1 - }) + active: 1, + }); } }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌 */ - onHide() { }, + onHide() {}, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇 */ - onUnload() { }, + onUnload() {}, /** * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔 */ - onPullDownRefresh() { }, + onPullDownRefresh() {}, /** * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� */ - onReachBottom() { }, + onReachBottom() {}, /** * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� */ - onShareAppMessage() { }, + onShareAppMessage() {}, // 鑾峰彇渚ц竟鏍忓垪琛� getAssortList() { this.setData({ - loading: true - }) + loading: true, + }); const query = { - path: '*', + path: "*", filterList: [ { - value: 'Normal', - field: 'state', + value: "Normal", + field: "state", }, ], - queryType: '\\', + queryType: "\\", searchList: [], - size: '30', - start: '0', + size: "30", + start: "0", storeRefCode: app.config.goodsStore, - sort: { type: 'Asc', field: 'LinkOrder' }, + sort: { type: "Asc", field: "LinkOrder" }, }; app.MG.store.getStoreChannelList(query).then((res) => { - const list = res.datas.filter((item) => item.refCode != 'jsek_homepageBookService'); + const list = res.datas.filter( + (item) => item.refCode != "jsek_homepageBookService" + ); this.setData({ assortList: list, - loading: false + loading: false, }); this.setData({ assortCheck: { @@ -125,22 +137,24 @@ path, filterList: [ { - value: 'Normal', - field: 'state' - } + value: "Normal", + field: "state", + }, ], - queryType: '\\', + queryType: "\\", searchList: [], - size: '30', - start: '0', + size: "30", + start: "0", storeRefCode: app.config.goodsStore, - sort: { type: 'Asc', field: 'LinkOrder' }, + sort: { type: "Asc", field: "LinkOrder" }, }; app.MG.store.getStoreChannelList(query).then(async (res) => { // 鑾峰彇浜岀骇鍒嗙被 for (let index = 0; index < res.datas.length; index++) { const item = res.datas[index]; - item.icon ? item.icon = getPublicImage(item.icon, 500) : item.icon = item.icon + item.icon + ? (item.icon = getPublicImage(item.icon, 500)) + : (item.icon = item.icon); item.children = await this.getSecondList(item); } console.log(res.datas); @@ -148,8 +162,8 @@ this.setData({ startList: res.datas, listLoding: false, - 'startCheck.id': res.datas[0].id, - 'startCheck..code': '' + "startCheck.id": res.datas[0].id, + "startCheck..code": "", }); }); }, @@ -162,26 +176,24 @@ path, filterList: [ { - value: 'Normal', - field: 'state' - } + value: "Normal", + field: "state", + }, ], coverSize: { - width: 500 + width: 500, }, - queryType: '\\', + queryType: "\\", searchList: [], - size: '30', - start: '0', + size: "30", + start: "0", storeRefCode: app.config.goodsStore, - sort: { type: 'Asc', field: 'LinkOrder' }, + sort: { type: "Asc", field: "LinkOrder" }, }; await app.MG.store.getStoreChannelList(query).then((res) => { for (let index = 0; index < res.datas.length; index++) { const element = res.datas[index]; - if (element.icon) - element.icon = getPublicImage(element.icon, 500) - + if (element.icon) element.icon = getPublicImage(element.icon, 500); } datas = res.datas; }); @@ -190,19 +202,19 @@ tabClick(e) { const data = e.currentTarget.dataset.tabdata; this.setData({ - 'startCheck.id': data.id, - 'startCheck.code': data.refCode, + "startCheck.id": data.id, + "startCheck.code": data.refCode, }); console.log(data); }, // 璺宠浆鍒楄〃椤� goPageList(e) { - const tab = e.currentTarget.dataset.tabdata - const stair = e.currentTarget.dataset.stair + const tab = e.currentTarget.dataset.tabdata; + const stair = e.currentTarget.dataset.stair; this.setData({ - 'startCheck.id': tab.id, - 'startCheck.code': tab.refCode - }) + "startCheck.id": tab.id, + "startCheck.code": tab.refCode, + }); if (stair) { const secondCode = `${stair.pathLinks[0].linkPath}\\${stair.id}`; wx.navigateTo({ @@ -213,7 +225,6 @@ url: `/packageBookService/pages/bookServices/list/index?assorName=${this.data.assortCheck.name}&assortCode=${this.data.assortCheck.code}`, }); } - }, navToSearchPage(e) { wx.navigateTo({ diff --git a/pages/bookServices/assort/index.json b/pages/bookServices/assort/index.json index 45e1881..bc96060 100644 --- a/pages/bookServices/assort/index.json +++ b/pages/bookServices/assort/index.json @@ -1,5 +1,5 @@ { - "navigationBarTitleText": "鍥句功鏈嶅姟", + "navigationStyle": "custom", "onReachBottomDistance": 10, "backgroundTextStyle": "light", "disableScroll": true, diff --git a/pages/bookServices/assort/index.wxml b/pages/bookServices/assort/index.wxml index dd4bbe7..2e9aa3f 100644 --- a/pages/bookServices/assort/index.wxml +++ b/pages/bookServices/assort/index.wxml @@ -1,5 +1,9 @@ <!--鍥句功鏈嶅姟鍒嗙被--> <page-meta style="width: 100vw; overflow: hidden"> + <view style="width: 100%; height: {{barHeight}}px; "></view> + <view class="nacigationBar" style="width: 100%; height: {{navBarHeight}}px;"> + <view class="navbar-title">鍥句功鏈嶅姟</view> + </view> <view class="page-header"> <!-- 鎼滅储妗� --> <view class="search"> diff --git a/pages/bookServices/assort/index.wxss b/pages/bookServices/assort/index.wxss index bf82130..afa1650 100644 --- a/pages/bookServices/assort/index.wxss +++ b/pages/bookServices/assort/index.wxss @@ -5,6 +5,13 @@ padding-bottom: calc(env(safe-area-inset-bottom) + 96rpx); } +.navbar-title { + text-align: center; + color: #0F1214; + font-size: 40rpx; + font-weight: bold; +} + .page-header { position: relative; } diff --git a/pages/personalCenter/feedBackSubmit/index.js b/pages/personalCenter/feedBackSubmit/index.js index 462762c..a6f3185 100644 --- a/pages/personalCenter/feedBackSubmit/index.js +++ b/pages/personalCenter/feedBackSubmit/index.js @@ -68,18 +68,11 @@ const { phoneError } = this.data; - if (e.detail.value) { - const isPhoneNumber = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(e.detail.value); - if (phoneError === isPhoneNumber) { - this.setData({ - phoneError: !isPhoneNumber, - mannder: e.detail.value, - }); - } - } else { + const isPhoneNumber = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(e.detail.value); + if (phoneError === isPhoneNumber) { this.setData({ - phoneError: false, - mannder: '' + phoneError: !isPhoneNumber, + mannder: e.detail.value, }); } }, @@ -104,7 +97,7 @@ if (this.data.mannder.replace(/^\s*|\s*$/g, "") == '') { this.data.lock = true; wx.showToast({ - title: "鑱旂郴鏂瑰紡涓嶈兘涓虹┖", + title: "鍙嶉鍐呭涓嶈兘涓虹┖", icon: 'none', duration: 1000 }) -- Gitblit v1.9.1