From f4425543db1c8db8c47a34c53ef477e72cfe318e Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期一, 11 三月 2024 18:19:56 +0800 Subject: [PATCH] feat(答题器): 答题器 --- pages/bookServices/examination/questionList/index.wxss | 25 pages/bookServices/examination/questionOptions/index.json | 8 pages/bookServices/list/index.wxss | 19 static/images/bookService/examination/reset.png | 0 pages/bookServices/detail/components/teachResource/index.wxml | 8 static/images/bookService/detail/cuoti.png | 0 pages/bookServices/detail/components/testResource/testResource.js | 58 + pages/bookServices/list/index.js | 32 pages/bookServices/detail/components/note/note.wxml | 66 + pages/bookServices/detail/index.js | 345 +++++-- static/images/bookService/detail/wodeshoucang.png | 0 pages/bookServices/detail/components/suggest/suggest.wxml | 29 pages/bookServices/assort/index.wxml | 52 pages/bookServices/detail/components/tree/index.wxss | 18 pages/bookServices/detail/components/suggest/suggest.json | 6 pages/bookServices/detail/components/learnResource/learnResource.wxss | 3 pages/bookServices/detail/index.wxml | 196 +++ pages/bookServices/examination/examination.json | 11 static/images/bookService/detail/deleteHover.png | 0 pages/bookServices/examination/questionSchedule/index.wxml | 11 pages/bookServices/list/index.json | 6 static/images/bookService/detail/edit.png | 0 static/images/bookService/detail/cart.png | 0 pages/bookServices/examination/examination.js | 339 +++++++ pages/bookServices/examination/examination.wxss | 23 pages/bookServices/examination/questionOptions/index.wxss | 31 pages/bookServices/detail/components/testResource/testResource.wxml | 31 static/images/bookService/detail/feedback.png | 0 pages/bookServices/detail/components/note/note.json | 9 pages/bookServices/detail/components/learnResource/learnResource.js | 30 pages/bookServices/examination/questionList/index.wxml | 13 pages/bookServices/examination/questionSchedule/index.js | 115 ++ static/images/bookService/examination/questionCard.png | 0 pages/bookServices/list/index.wxml | 6 pages/bookServices/assort/index.js | 45 pages/bookServices/detail/components/teachResource/index.wxss | 31 pages/bookServices/examination/questionSchedule/index.json | 6 pages/bookServices/examination/questionList/index.js | 44 pages/bookServices/detail/components/suggest/suggest.wxss | 96 + static/images/bookService/examination/collect.png | 0 pages/bookServices/assort/index.wxss | 11 pages/bookServices/detail/components/note/note.js | 302 ++++++ pages/bookServices/detail/components/note/note.wxss | 129 ++ static/images/bookService/detail/compliceHover.png | 0 static/images/bookService/detail/practice-icon.png | 0 pages/bookServices/detail/components/tree/index.wxml | 176 +++ .vscode/settings.json | 2 pages/bookServices/detail/components/learnResource/learnResource.wxml | 6 pages/bookServices/detail/index.wxss | 42 static/images/bookService/detail/note-icon.png | 0 static/images/bookService/detail/zujuan.png | 0 static/images/bookService/examination/setting.png | 0 pages/bookServices/detail/components/suggest/suggest.js | 42 pages/bookServices/examination/questionOptions/index.js | 23 pages/bookServices/examination/questionSchedule/index.wxss | 32 app.json | 3 pages/bookServices/detail/components/testResource/testResource.wxss | 7 pages/bookServices/examination/examination.wxml | 24 .prettierrc | 22 pages/bookServices/detail/index.json | 6 pages/bookServices/examination/questionList/index.json | 7 pages/bookServices/examination/questionOptions/index.wxml | 24 static/images/bookService/detail/makeNote.png | 0 pages/bookServices/detail/components/tree/index.js | 106 ++ 64 files changed, 2,327 insertions(+), 349 deletions(-) diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..f36a893 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,22 @@ +{ + "overrides": [ + { + "files": "*.wxml", + "options": { + "parser": "html" + } + }, + { + "files": "*.wxss", + "options": { + "parser": "css" + } + }, + { + "files": "*.wxs", + "options": { + "parser": "babel" + } + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 8096c21..22d6d96 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -32,7 +32,7 @@ }, "editor.tabSize": 2, "[wxml]": { - "editor.defaultFormatter": "wechat.miniprogram.wxml-language-features" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[css]": { "editor.defaultFormatter": "HookyQR.beautify" diff --git a/app.json b/app.json index d43ff7c..7b12d5f 100644 --- a/app.json +++ b/app.json @@ -52,7 +52,8 @@ "pages/personalCenter/sampleBooks/index", "pages/personalCenter/downloads/index", "pages/personalCenter/activateProduct/index", - "pages/testLogin/index" + "pages/testLogin/index", + "pages/bookServices/examination/examination" ], "tabBar": { "custom": true, diff --git a/pages/bookServices/assort/index.js b/pages/bookServices/assort/index.js index a4a3240..cdb9bcf 100644 --- a/pages/bookServices/assort/index.js +++ b/pages/bookServices/assort/index.js @@ -1,4 +1,5 @@ // pages/bookServices/assort/index.js +import { getPublicImage } from '../../../assets/js/middleGround/tool' const app = getApp(); Page({ /** @@ -79,9 +80,7 @@ sort: { type: 'Asc', field: 'LinkOrder' }, }; app.MG.store.getStoreChannelList(query).then((res) => { - const list = res.datas.filter((item) => item.refCode != 'jsek_homepageBookService'); - this.setData({ assortList: list, }); @@ -120,15 +119,14 @@ sort: { type: 'Asc', field: 'LinkOrder' }, }; app.MG.store.getStoreChannelList(query).then(async (res) => { - - console.log(res, 'res'); // 涓�绾у垎绫婚�変腑 - this.setData({ - startCheck: res.datas[0].refCode, - }); + // this.setData({ + // startCheck: res.datas[0].refCode, + // }); // 鑾峰彇浜岀骇鍒嗙被 for (let index = 0; index < res.datas.length; index++) { const item = res.datas[index]; + item.icon ? item.icon = getPublicImage(item.icon, 58, 72) : item.icon = item.icon item.children = await this.getSecondList(item); } // 涓�绾у垎绫昏祴鍊� @@ -156,22 +154,41 @@ 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, 58, 72) + + } datas = res.datas; }); return datas; }, - tabClick(tabData) { - const data = tabData.currentTarget.dataset.tabdata; + tabClick(e) { + const data = e.currentTarget.dataset.tabdata; this.setData({ startCheck: data.refCode, }); + console.log(data); }, // 璺宠浆鍒楄〃椤� - goPageList(item) { - const secondCode = `${item.currentTarget.dataset.staircode.pathLinks[0].linkPath}\\${item.currentTarget.dataset.staircode.id}`; - wx.navigateTo({ - url: `/pages/bookServices/list/index?assorName=${this.data.assortCheck.name}&assortCode=${this.data.assortCheck.code}&stairCode=${this.data.startCheck}&secondCode=${secondCode}`, - }); + goPageList(e) { + const tab = e.currentTarget.dataset.tabdata + const stair = e.currentTarget.dataset.stair + this.setData({ + startCheck: tab.refCode + }) + if (stair) { + const secondCode = `${stair.pathLinks[0].linkPath}\\${stair.id}`; + wx.navigateTo({ + url: `/pages/bookServices/list/index?assorName=${this.data.assortCheck.name}&assortCode=${this.data.assortCheck.code}&stairCode=${this.data.startCheck}&secondCode=${secondCode}`, + }); + } else { + wx.navigateTo({ + url: `/pages/bookServices/list/index?assorName=${this.data.assortCheck.name}&assortCode=${this.data.assortCheck.code}`, + }); + } + }, navToSearchPage(e) { console.log(e.detail.value); diff --git a/pages/bookServices/assort/index.wxml b/pages/bookServices/assort/index.wxml index bd6d2dd..aca70a8 100644 --- a/pages/bookServices/assort/index.wxml +++ b/pages/bookServices/assort/index.wxml @@ -2,13 +2,7 @@ <view class="page-header"> <!-- 鎼滅储妗� --> <view class="search"> - <t-search - t-class-input="t-search__input" - t-class-input-container="t-search__input-container" - placeholder="璇疯緭鍏ュ叧閿瘝/涔﹀悕/ISBN/浣滆��" - leftIcon="" - bind:submit="navToSearchPage" - > + <t-search t-class-input="t-search__input" t-class-input-container="t-search__input-container" placeholder="璇疯緭鍏ュ叧閿瘝/涔﹀悕/ISBN/浣滆��" leftIcon="" bind:submit="navToSearchPage" placeholder-class="placeholder" placeholder-style="font-size:28rpx;"> <t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" /> </t-search> </view> @@ -18,28 +12,14 @@ <view class="side-bar-wrapper"> <view class="tab-left"> <t-side-bar value="{{assortCheck.code}}" bind:change="changeAssort"> - <t-side-bar-item - wx:for="{{assortList}}" - wx:key="id" - value="{{item.refCode}}" - label="{{item.name}}" - badge-props="{{item.badgeProps}}" - /> + <t-side-bar-item wx:for="{{assortList}}" wx:key="id" value="{{item.refCode}}" label="{{item.name}}" badge-props="{{item.badgeProps}}" /> </t-side-bar> </view> <view class="side-bar-content"> <!-- 涓�绾у垎绫� --> <view class="tab-top"> <scroll-view scroll-x="{{true}}" class="myScroll"> - <view - wx:for="{{startList}}" - wx:key="id" - class="row {{startCheck == item.refCode ? 'tab-active' : ''}}" - bind:tap="tabClick" - data-tabData="{{item}}" - wx:if="{{item.children.length}}" - >{{item.name}}</view - > + <view wx:for="{{startList}}" wx:key="id" class="row {{startCheck == item.refCode ? 'tab-active' : ''}}" bind:tap="tabClick" data-tabData="{{item}}">{{item.name}}</view> </scroll-view> </view> <!-- 鍐呭 --> @@ -47,30 +27,20 @@ <view wx:if="{{listLoading}}"> <t-loading theme="spinner" size="400rpx" loading="{{listLoading}}"></t-loading> </view> - <view - wx:for="{{startList}}" - wx:for-item="item" - wx:key="item.refCode" - id="{{item.refCode}}" - class="class-box" - wx:if="{{item.children.length && !listLoading}}" - > + <view wx:for="{{startList}}" wx:for-item="item" wx:key="item.refCode" id="{{item.refCode}}" class="class-box" wx:if="{{!listLoading}}"> <view class="class-name">{{item.name}}</view> <view class="class-content"> - <view - wx:for="{{item.children}}" - wx:for-item="citem" - wx:key="id" - class="book-box" - bind:tap="goPageList" - data-stairCode="{{citem}}" - > - <t-image src="/static/images/bookService/assort/book-img.png" mode="heightFix" width="58" height="72" /> + <view wx:for="{{item.children}}" wx:for-item="citem" wx:key="id" class="book-box" bind:tap="goPageList" data-stair="{{citem}}" data-tabData="{{item}}" wx:if="{{item.children.length}}"> + <image src="{{citem.icon ? citem.icon : '/static/images/bookService/assort/book-img.png'}}" mode="heightFix" /> <view class="classify">{{citem.name}}</view> + </view> + <view wx:if="{{!item.children.length}}" class="book-box" bind:tap="goPageList" data-tabData="{{item}}"> + <image src="{{item.icon ? item.icon : '/static/images/bookService/assort/book-img.png'}}" mode="heightFix"></image> + <text class="classify">鍏ㄩ儴</text> </view> </view> </view> </scroll-view> </view> </view> -</view> +</view> \ No newline at end of file diff --git a/pages/bookServices/assort/index.wxss b/pages/bookServices/assort/index.wxss index 3c71ffe..f0b7169 100644 --- a/pages/bookServices/assort/index.wxss +++ b/pages/bookServices/assort/index.wxss @@ -13,6 +13,11 @@ left: 0; width: 100%; z-index: 99; + font-size: 28rpx; +} + +.placeholder { + font-size: 28rpx; } .page-header .t-search__input-container { @@ -108,7 +113,7 @@ .book-box { width: 140rpx; - margin-right: 10rpx; + margin: 0 10rpx 20rpx 0 } .book-box:nth-child(3n) { @@ -116,8 +121,8 @@ } .book-box image { - width: 58px; - height: 70px; + height: 142rpx; + object-fit: contain; } .classify { diff --git a/pages/bookServices/detail/components/learnResource/learnResource.js b/pages/bookServices/detail/components/learnResource/learnResource.js index 8d30b76..3a67e7b 100644 --- a/pages/bookServices/detail/components/learnResource/learnResource.js +++ b/pages/bookServices/detail/components/learnResource/learnResource.js @@ -11,13 +11,39 @@ * 缁勪欢鐨勫垵濮嬫暟鎹� */ data: { - + receive: false, + buy: false, }, /** * 缁勪欢鐨勬柟娉曞垪琛� */ methods: { - + getFreeResource() { + var myEventDetail = {} // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟 + var myEventOption = { + bubbles: true, + composed: true + } // 瑙﹀彂浜嬩欢鐨勯�夐」 + this.triggerEvent('getFreeResource', myEventDetail, myEventOption) + }, + allAddShoppiingCar() { + var myEventDetail = {} // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟 + var myEventOption = { + bubbles: true, + composed: true + } // 瑙﹀彂浜嬩欢鐨勯�夐」 + this.triggerEvent('allAddShoppiingCar', myEventDetail, myEventOption) + }, + changeReceive(type) { + this.setData({ + receive: type + }) + }, + changeBuy(type) { + this.setData({ + buy: type + }) + } } }) diff --git a/pages/bookServices/detail/components/learnResource/learnResource.wxml b/pages/bookServices/detail/components/learnResource/learnResource.wxml index 3a76308..4dde643 100644 --- a/pages/bookServices/detail/components/learnResource/learnResource.wxml +++ b/pages/bookServices/detail/components/learnResource/learnResource.wxml @@ -1,14 +1,14 @@ <!--pages/bookServices/detail/components/learnResource/learnResource.wxml--> <view class="learnResource" theme="primary"> - <t-button class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx; " t-class="external-class"> + <t-button loading="{{receive}}" class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx; " t-class="external-class" bind:tap="getFreeResource"> <t-image src=" /static/images/bookService/detail/yijianlingqu.png"></t-image> <text>棰嗗彇鏌ョ湅</text> </t-button> - <t-button class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx;"> + <t-button loading="{{buy}}" class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx;" bind:tap="allAddShoppiingCar"> <t-image src="/static/images/bookService/detail/yijiangoumai.png"></t-image> 涓�閿喘涔� </t-button> - <t-button class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx;"> + <t-button class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx;" wx:if="{{false}}"> <t-image src="/static/images/bookService/detail/renwudan锛廼con.png"></t-image> 瀛︿範浠诲姟鍗� </t-button> diff --git a/pages/bookServices/detail/components/learnResource/learnResource.wxss b/pages/bookServices/detail/components/learnResource/learnResource.wxss index e95fe96..ca5e2f5 100644 --- a/pages/bookServices/detail/components/learnResource/learnResource.wxss +++ b/pages/bookServices/detail/components/learnResource/learnResource.wxss @@ -8,7 +8,7 @@ } .btn { - width: 232rpx; + width: 300rpx; font-size: 28rpx; --td-button-primary-bg-color: #fff; --td-button-primary-border-color: #FF6C00; @@ -23,4 +23,5 @@ .btn image { width: 28rpx; height: 32rpx; + margin: 25rpx 10rpx 0 0; } \ No newline at end of file diff --git a/pages/bookServices/detail/components/note/note.js b/pages/bookServices/detail/components/note/note.js index 585c609..772e741 100644 --- a/pages/bookServices/detail/components/note/note.js +++ b/pages/bookServices/detail/components/note/note.js @@ -1,23 +1,317 @@ // pages/bookServices/detail/components/note/note.js +const app = getApp() Component({ /** * 缁勪欢鐨勫睘鎬у垪琛� */ properties: { - + bookInfo: { + type: Object, + value: {} + } }, /** * 缁勪欢鐨勫垵濮嬫暟鎹� */ data: { - + 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: '', + showInput: false, + submitTitle: "", + pageCount: { + page: 1, + total: 0, + }, + isMore: null, + noteList: [], + activeValues: 0, + loading: false, }, - /** * 缁勪欢鐨勬柟娉曞垪琛� */ methods: { - + onReachBottom() { + 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() + } else { + this.setData({ + isMore: true + }) + setTimeout(() => { + this.setData({ + isMore: false + }) + }, 100) + } + }, + handleSubmitTitle() { + this.setData({ + submitTitle: this.properties.bookInfo.name + }) + }, + openDialog() { + this.setData({ + submitTitle: this.properties.bookInfo.name, + showNoteDialog: true + }) + }, + closeDialog() { + this.setData({ + flag: false, + showNoteDialog: false, + submitTitle: '', + textvalue: "", + }) + }, + textareaChange(e) { + this.setData({ + textvalue: e.detail.value + }) + }, + textareaBlur() { + console.log('澶卞幓鐒︾偣'); + }, + // 鏍囬杈撳叆妗嗗�� + inputChange(e) { + this.setData({ + submitTitle: e.detail.value + }) + }, + // 寮圭獥纭畾鎸夐挳 + confirmSuggest() { + if (!this.data.submitTitle) { + return wx.showToast({ + icon: 'error', + title: '璇峰~鍐欑瑪璁版爣棰�', + }) + } else if (!this.data.textvalue) { + return wx.showToast({ + icon: 'error', + title: '璇峰~鍐欑瑪璁板唴瀹�', + }) + } + if (this.data.submitType == 'new') { + this.makeNote() + } else if (this.data.submitType == 'edit') { + this.updateNote() + } + this.setData({ + showNoteDialog: false + }) + }, + handleChange(e) { + this.setData({ + 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 + }, + changeLoading() { + this.setData({ + loading:true + }) + }, + // 鑾峰彇绗旇鍒楄〃 + async getNoteList() { + // this.setData({ + // loading: true + // }) + let topicId + await app.MG.ugc + .getProductUserSubmitTopic({ + productId: this.properties.bookInfo.id, + appRefCode: app.config.appRefCode + }) + .then((res) => { + if (res) { + topicId = res.id + } else { + return wx.showToast({ + icon: "error", + title: '鏌ヨ澶辫触', + }) + } + }) + // loadings.value.bookResource = true + let query = { + start: 0, + size: this.data.pageCount.page * 5, + messageType: 'note', + sort: { + type: 'Desc', + field: 'CreateDate' + }, + appRefCode: app.config.appRefCode, + topicIdOrRefCode: topicId + '' + } + await app.MG.ugc.getTopicMessageList(query).then((res) => { + // notePage.value.total = res.totalSize + res.datas.forEach((item) => { + item.compliceHover = false + item.deleteHover = false + item.createDate = this.convertTimestamp(item.createDate) + }) + this.setData({ + "pageCount.total": res.totalSize, + noteList: res.datas, + loading: false + }) + console.log('绗旇鍒楄〃', res.datas); + }) + }, + // 鏂板缓绗旇鎺ュ彛 + async makeNote() { + const token = wx.getStorageSync('jsek-token') + if (!token) { + return wx.getUserProfile({ + desc: '鐢ㄦ埛鐧诲綍', + success: (res) => { + console.log(res); + } + }) + } + let topicId + await app.MG.ugc + .getProductUserSubmitTopic({ + productId: this.properties.bookInfo.id, + appRefCode: app.config.appRefCode + }) + .then((res) => { + if (res) { + topicId = res.id + } else { + return wx.showToast({ + icon: 'error', + title: '鏂板缓澶辫触', + }) + } + }) + let query = { + topicIdOrRefCode: topicId + '', + name: this.data.submitTitle, + content: this.data.textvalue, + type: 'note', + cmsTypeRefCode: '', + newDataListRequest: [] + } + await app.MG.ugc.newTopicMessage(query).then((res) => { + wx.showToast({ + title: '鏂板缓鎴愬姛', + }) + this.closeDialog() + this.getNoteList() + }) + }, + // 鍒犻櫎绗旇 + deleteNote(e) { + const id = e.currentTarget.dataset.id + const messageIds = [] + messageIds.push(id) + wx.showModal({ + title: '鎻愮ず', + content: '纭鍒犻櫎璇ョ瑪璁板悧锛�',//editable濡傛灉涓簍rue锛岃繖灏辨槸杈撳叆妗嗙殑鍐呭 + editable: false,//鏄惁鏄剧ず杈撳叆妗� + placeholderText: '璇疯緭鍏ュ唴瀹瑰惂',//杈撳叆妗嗙殑榛樿鍐呭 + success: (res) => { + if (res.confirm) { + app.MG.ugc + .delTopicMessage({ messageIds }) + .then((res) => { + wx.showToast({ + title: '鍒犻櫎鎴愬姛', + }) + // if ((notePage.value.total % 3) - 1 == 0) { + // notePage.value.page -= 1 + // } + this.getNoteList() + }) + } else if (res.cancel) { + console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷') + } + } + }) + }, + // 鏍囬鏀瑰彉 + changeTitle(e) { + this.setData({ + flag: e.currentTarget.dataset.value + }) + }, + // 缂栬緫鎸夐挳 + editNote(e) { + const note = e.currentTarget.dataset.note + this.setData({ + submitType: "edit", + textvalue: note.content, + submitTitle: note.name, + noteId: note.id + }) + this.openDialog() + }, + // 缂栬緫绗旇鎺ュ彛 + updateNote() { + const token = wx.getStorageSync('jsek-token') + if (!token) { + return wx.getUserProfile({ + desc: '鐢ㄦ埛鐧诲綍', + success: (res) => { + console.log(res); + } + }) + } + if (!this.data.submitTitle) { + return wx.showToast({ + icon: 'error', + title: '璇峰~鍐欑瑪璁版爣棰�', + }) + } else if (!this.data.textvalue) { + return wx.showToast({ + icon: 'error', + title: '璇峰~鍐欑瑪璁板唴瀹�', + }) + } + let query = { + id: this.data.noteId, + name: this.data.submitTitle, + description: 'string', + icon: 'string', + type: 'note', + content: this.data.textvalue, + newDataRequests: [], + updateDataRequests: [] + } + app.MG.ugc.updateTopicMessage(query).then((res) => { + wx.showToast({ + title: '缂栬緫鎴愬姛', + }) + this.closeDialog() + this.getNoteList() + }) + this.setData({ + submitType: "new" + }) + } } }) diff --git a/pages/bookServices/detail/components/note/note.json b/pages/bookServices/detail/components/note/note.json index c766c63..598afe7 100644 --- a/pages/bookServices/detail/components/note/note.json +++ b/pages/bookServices/detail/components/note/note.json @@ -1,8 +1,15 @@ { "component": true, "usingComponents": { + "t-image": "tdesign-miniprogram/image/image", "t-button": "tdesign-miniprogram/button/button", "t-collapse": "tdesign-miniprogram/collapse/collapse", - "t-collapse-panel": "tdesign-miniprogram/collapse-panel/collapse-panel" + "t-collapse-panel": "tdesign-miniprogram/collapse-panel/collapse-panel", + "t-dialog": "tdesign-miniprogram/dialog/dialog", + "t-textarea": "tdesign-miniprogram/textarea/textarea", + "t-input": "tdesign-miniprogram/input/input", + "t-loading": "tdesign-miniprogram/loading/loading", + "t-popup": "tdesign-miniprogram/popup/popup", + "t-icon": "tdesign-miniprogram/icon/icon" } } \ No newline at end of file diff --git a/pages/bookServices/detail/components/note/note.wxml b/pages/bookServices/detail/components/note/note.wxml index 949ece5..19eb4cf 100644 --- a/pages/bookServices/detail/components/note/note.wxml +++ b/pages/bookServices/detail/components/note/note.wxml @@ -1,15 +1,63 @@ <!--pages/bookServices/detail/components/note/note.wxml--> -<view class="note"> +<view class="note" wx:if="{{!loading && noteList.length}}"> <view class="note-btn"> - <t-button theme="primary" class="make-note">璁扮瑪璁�</t-button> + <t-button theme="primary" class="make-note" bind:tap="openDialog" style="width: 240rpx;"> + <view slot="content"> + <t-image src="/static/images/bookService/detail/makeNote.png"></t-image> + 璁扮瑪璁� + </view> + </t-button> </view> <view class="note-content"> - <view class="wrapper"> - <t-collapse value="{{activeValues}}" bind:change="handleChange"> - <t-collapse-panel header="鎶樺彔闈㈡澘鏍囬" value="{{0}}" expandIcon> - 姝ゅ鍙嚜瀹氫箟鍐呭姝ゅ鍙嚜瀹氫箟鍐呭姝ゅ鍙嚜瀹氫箟鍐呭姝ゅ鍙嚜瀹氫箟鍐呭姝ゅ鍙嚜瀹氫箟鍐呭姝ゅ鍙嚜瀹氫箟鍐呭姝ゅ鍙嚜瀹氫箟鍐呭姝ゅ鍙嚜瀹氫箟鍐呭 - </t-collapse-panel> - </t-collapse> + + <t-collapse value="{{activeValues}}" bind:change="handleChange"> + <t-collapse-panel value="{{item.id}}" expandIcon wx:for="{{noteList}}"> + <view slot="header" class="collapse-header"> + <t-image class="note-icon" src="/static/images/bookService/detail/note-icon.png"></t-image> + <view class="header-name">{{item.name}}</view> + </view> + <view> + <view class="note-content">{{item.content}}</view> + <view class="note-bottom"> + <view class="note-time">{{item.createDate}}</view> + <view class="bottom-btn"> + <t-image src="/static/images/bookService/detail/compliceHover.png" class="complice" bind:tap="editNote" data-note="{{item}}"></t-image> + <t-image src="/static/images/bookService/detail/deleteHover.png" class="delete" bind:tap="deleteNote" data-id="{{item.id}}"></t-image> + </view> + </view> + </view> + </t-collapse-panel> + </t-collapse> + + </view> + <view class="bottom-box"> + <t-loading wx:if="{{isMore == true}}"></t-loading> + <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> + </view> +</view> +<view class="loading-box" wx:if="{{loading}}"> + <t-loading loading="{{loading}}" size="60rpx"></t-loading> +</view> + + +<!-- 璁扮瑪璁板脊绐� --> +<t-popup visible="{{showNoteDialog}}" bind:visible-change="onVisibleChange" placement="center"> + <view class="popup"> + <view slot="title"> + <view class="title-text" wx:if="{{!flag}}"> + <text class="note-title">{{submitTitle}}</text> + <t-image src="/static/images/bookService/detail/edit.png" class="edit-icon" bind:tap="changeTitle" data-value="{{true}}"></t-image> + </view> + <view wx:else> + <t-input value="{{submitTitle}}" data-value="{{false}}" bind:enter="changeTitle" bind:blur="changeTitle" bind:change="inputChange" maxlength="{{50}}" style="{{inputStyle}}"></t-input> + </view> + </view> + <view slot="content" class="content"> + <t-textarea value="{{textvalue}}" t-class="external-class" label="" placeholder="璇疯緭鍏ョ瑪璁板唴瀹�" maxcharacter="500" disableDefaultPadding="{{true}}" indicator bind:change="textareaChange" bind:blur="" style="{{inputStyle}}" placeholder-style="{{placeholderstyle}}" /> + </view> + <view class="submit-btn"> + <t-button theme="primary" size="large" block bind:tap="confirmSuggest">鎻愪氦</t-button> </view> </view> -</view> \ No newline at end of file + <t-icon t-class="close-btn" name="close-circle" size="32" color="#fff" bind:tap="closeDialog" /> +</t-popup> \ No newline at end of file diff --git a/pages/bookServices/detail/components/note/note.wxss b/pages/bookServices/detail/components/note/note.wxss index 7604004..959c6d2 100644 --- a/pages/bookServices/detail/components/note/note.wxss +++ b/pages/bookServices/detail/components/note/note.wxss @@ -1,5 +1,9 @@ /* pages/bookServices/detail/components/note/note.wxss */ -.note {} + +.popup { + padding: 40rpx; + width: 600rpx; +} .note-btn { height: 140rpx; @@ -13,7 +17,130 @@ --td-button-primary-active-bg-color: #fff0e6; } +.note-btn image { + width: 28rpx; + height: 32rpx; + margin-top: 24rpx; +} + + + +.note-title { + width: 90%; + height: 84rpx; + line-height: 84rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + .make-note { margin: 0; margin-right: 40rpx; +} + +.title-text { + display: flex; + align-items: center; +} + +.edit-icon { + margin-left: 10rpx; + width: 30rpx; + height: 30rpx; +} + +.header { + display: flex; +} + +.note-icon { + width: 44rpx; + height: 48rpx; + margin-right: 20rpx; +} + +.collapse-header { + display: flex; +} + +.collapse-header .header-name { + font-size: 32rpx; + width: 500rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.note-content { + height: min-content; + font-size: 28rpx; + color: #949494; + margin-bottom: 20rpx; + max-height: 600rpx; + text-align: justify; + /* padding-bottom: 200rpx; */ +} + +.wrapper { + height: 100%; +} + +.note-bottom { + display: flex; + justify-content: space-between; + align-items: center; +} + +.bottom-btn { + height: 40rpx; + display: flex; + align-items: center; +} + +.note-time { + color: #D9D9D9; +} + +.complice, +.delete { + width: 30rpx; + height: 30rpx; +} + +.delete { + margin-left: 40rpx; +} + +.loading-box { + width: 100%; + min-height: 550rpx; + display: flex; + align-items: center; + justify-content: center; +} + +.content { + margin-top: 20rpx; +} + +.close-btn { + position: absolute; + left: 50%; + margin-left: -32rpx; + bottom: calc(-1 * (48rpx + 64rpx)); +} + +.submit-btn { + padding: 40rpx; + --td-button-border-radius: 60rpx; + --td-button-primary-bg-color: #ff6c00; + --td-button-primary-border-color: #ff6c00; + --td-button-primary-active-bg-color: #ff984d; + --td-button-primary-active-border-color: #ff984d; +} + +.bottom-box { + display: flex; + justify-content: center; } \ No newline at end of file diff --git a/pages/bookServices/detail/components/suggest/suggest.js b/pages/bookServices/detail/components/suggest/suggest.js index ed54626..b79c95e 100644 --- a/pages/bookServices/detail/components/suggest/suggest.js +++ b/pages/bookServices/detail/components/suggest/suggest.js @@ -16,13 +16,14 @@ }, data: { + inputStyle: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding:16rpx', + placeholderstyle: 'font-size:28rpx', dialogKey: '', showWithInput: false, showTextAndTitleWithInput: false, inputvalue: '', textvalue: '', ratevalue: 0, - phoneError: false, textError: false, }, methods: { @@ -52,12 +53,6 @@ this.setData({ inputvalue: 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 (this.data.phoneError === isPhoneNumber) { - this.setData({ - phoneError: !isPhoneNumber, - }); - } }, // 鏂囨湰妗嗘敼鍙� textareaChange(e) { @@ -68,10 +63,6 @@ feedBack() { const token = wx.getStorageSync('jsek-token') if (!token) { - // return wx.showToast({ - // icon: 'error', - // title: '璇峰厛鐧诲綍', - // }) return wx.getUserProfile({ desc: '鐢ㄦ埛鐧诲綍', success: (res) => { @@ -79,6 +70,7 @@ } }) } + this.closeDialog() let content = { source: this.data.ratevalue, phone: this.data.inputvalue, @@ -100,20 +92,30 @@ icon: 'success', duration: 2000 }) - this.closeDialog() }) }, // 纭畾 confirmSuggest() { - if (!this.data.inputvalue) { - return this.setData({ - phoneError: true - }) - } - if (!this.data.textvalue || this.data.ratevalue) { + 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(this.data.inputvalue); + if (!this.data.ratevalue) { return wx.showToast({ - success: 'error', - title: '璇峰~鍐欏畬鏁磋〃鍗�', + icon: "error", + title: '璇烽�夋嫨璇勫垎', + }) + } else if (!this.data.inputvalue) { + return wx.showToast({ + icon: "error", + title: '璇峰~鍐欒仈绯绘柟寮�', + }) + } else if (!isPhoneNumber) { + return wx.showToast({ + icon: "error", + title: '璇疯緭鍏ユ纭仈绯绘柟寮�', + }) + } else if (!this.data.textvalue) { + return wx.showToast({ + icon: 'error', + title: '璇疯緭鍏ュ弽棣堝弽棣堝唴瀹�', }) } this.feedBack() diff --git a/pages/bookServices/detail/components/suggest/suggest.json b/pages/bookServices/detail/components/suggest/suggest.json index 941c25a..20935c7 100644 --- a/pages/bookServices/detail/components/suggest/suggest.json +++ b/pages/bookServices/detail/components/suggest/suggest.json @@ -4,6 +4,10 @@ "t-dialog": "tdesign-miniprogram/dialog/dialog", "t-input": "tdesign-miniprogram/input/input", "t-textarea": "tdesign-miniprogram/textarea/textarea", - "t-rate": "tdesign-miniprogram/rate/rate" + "t-rate": "tdesign-miniprogram/rate/rate", + "t-popup": "tdesign-miniprogram/popup/popup", + "t-icon": "tdesign-miniprogram/icon/icon", + "t-button": "tdesign-miniprogram/button/button", + "t-image": "tdesign-miniprogram/image/image" } } \ No newline at end of file diff --git a/pages/bookServices/detail/components/suggest/suggest.wxml b/pages/bookServices/detail/components/suggest/suggest.wxml index e6b21c4..335097d 100644 --- a/pages/bookServices/detail/components/suggest/suggest.wxml +++ b/pages/bookServices/detail/components/suggest/suggest.wxml @@ -1,10 +1,31 @@ -<t-dialog visible="{{showWithInput}}" title="鎴戣寤鸿" confirm-btn="纭畾" cancel-btn="鍙栨秷" bind:confirm="confirmSuggest" bind:cancel="closeDialog" class="suggest-dialog"> +<!-- <t-dialog visible="{{showWithInput}}" title="鎴戣寤鸿" confirm-btn="纭畾" cancel-btn="鍙栨秷" bind:confirm="confirmSuggest" bind:cancel="closeDialog" class="suggest-dialog"> <view slot="content"> <view class="demo-rate"> - <view class="demo-rate__title">瀹炲績璇勫垎</view> + <view class="demo-rate__title">璇勫垎</view> <t-rate value="{{ratevalue}}" catch:change="onChangeRate" /> </view> <t-input clearable value="{{inputvalue}}" slot="content" label="鑱旂郴鏂瑰紡" placeholder="璇疯緭鍏ヨ仈绯绘柟寮�" placeholder-class="placeholder" bind:change="inputChange" type="number" maxlength="{{11}}" tips="{{phoneError ? '鎵嬫満鍙疯緭鍏ヤ笉姝g‘' : ''}}" /> - <t-textarea value="{{textvalue}}" t-class="external-class" label="鏍囩鏂囧瓧" placeholder="璁剧疆鏈�澶у瓧绗︿釜鏁帮紝涓�涓眽瀛楄〃绀轰袱涓瓧绗�" maxcharacter="200" disableDefaultPadding="{{true}}" indicator bind:change="textareaChange" /> + <t-textarea value="{{textvalue}}" t-class="external-class" label="鎰忚鍙嶉" placeholder="璇疯緭鍏ュ唴瀹�" maxcharacter="200" disableDefaultPadding="{{true}}" indicator bind:change="textareaChange" /> </view> -</t-dialog> \ No newline at end of file +</t-dialog> --> +<!-- <view class="suggest"> --> +<t-popup visible="{{showWithInput}}" bind:visible-change="onVisibleChange" placement="center"> + <view class="top-icon"> + <t-image src="/static/images/bookService/detail/feedback.png"></t-image> + </view> + <view slot="content" class="content"> + <view class="top-title">鎴戣寤鸿</view> + <view class="demo-rate"> + <t-rate value="{{ratevalue}}" catch:change="onChangeRate" size="{{30}}" color="#FFB400" /> + </view> + <view class="phone-input"> + <t-input clearable value="{{inputvalue}}" slot="content" label="" placeholder="璇疯緭鍏ヨ仈绯绘柟寮�" placeholder-class="placeholder" bind:change="inputChange" type="number" maxlength="{{11}}" class="phone" style="{{inputStyle}}" placeholder-style="{{placeholderstyle}}" /> + </view> + <t-textarea value="{{textvalue}}" t-class="external-class" label="" placeholder="璇疯緭鍏ュ弽棣堝唴瀹�" maxcharacter="200" disableDefaultPadding="{{true}}" indicator bind:change="textareaChange" style="{{inputStyle}}" placeholder-style="{{placeholderstyle}}" /> + </view> + <view class="submit-btn"> + <t-button theme="primary" size="large" block bind:tap="confirmSuggest">鎻愪氦</t-button> + </view> + <t-icon t-class="close-btn" name="close-circle" size="32" color="#fff" bind:tap="closeDialog" /> +</t-popup> +<!-- </view> --> \ No newline at end of file diff --git a/pages/bookServices/detail/components/suggest/suggest.wxss b/pages/bookServices/detail/components/suggest/suggest.wxss index b727089..ab4504c 100644 --- a/pages/bookServices/detail/components/suggest/suggest.wxss +++ b/pages/bookServices/detail/components/suggest/suggest.wxss @@ -1,19 +1,4 @@ /* pages/bookServices/detail/components/suggest/suggest.wxss */ -.suggest-dialog { - --td-dialog-close-color: #666 -} - -.t-class-content { - height: 400px; -} - -.t-button--text { - color: #333 -} - -.wrapper { - margin-bottom: 32rpx; -} .placeholder { color: rgba(0, 0, 0, 0.26); @@ -38,18 +23,7 @@ line-height: 96rpx; } -.demo-rate { - background-color: #fff; - height: 96rpx; - display: flex; - align-items: center; - justify-content: space-between; - padding: 0 32rpx; - border-bottom: solid 1rpx #f0f0f0; - border-top: solid 1rpx #f0f0f0; - margin-top: 32rpx; - margin-bottom: 32rpx; -} + .demo-rate__title { width: 200rpx; @@ -59,4 +33,72 @@ background-color: transparent; padding-left: 32rpx; border: 0; +} + +.block { + position: relative; + width: 240px; + height: 240px; + background: #fff; + border-radius: 16rpx; +} + +.close-btn { + position: absolute; + left: 50%; + margin-left: -32rpx; + bottom: calc(-1 * (48rpx + 64rpx)); +} + +.wrapper { + margin: 32rpx; + display: block; +} + +.content { + position: relative; + border-radius: 40rpx; + padding: 100rpx 40rpx 0rpx 40rpx; + width: 600rpx; + background-image: linear-gradient(to bottom, #FFF8E5, #fffcf5); +} + +.demo-rate { + width: 350rpx; + margin: 20rpx auto 20rpx auto; +} + +.phone { + margin-bottom: 16rpx; + --td-input-border-radius: 20rpx; + border-radius: 20rpx; +} + + +.submit-btn { + padding: 40rpx; + --td-button-border-radius: 60rpx; + --td-button-primary-bg-color: #ff6c00; + --td-button-primary-border-color: #ff6c00; + --td-button-primary-active-bg-color: #ff984d; + --td-button-primary-active-border-color: #ff984d; +} + +.top-icon { + top: -50rpx; + left: 40%; + position: absolute; +} + +.top-icon image { + width: 146rpx; + height: 146rpx; +} + +.top-title { + width: 160rpx; + margin: 0 auto; + color: #0F1214; + font-size: 40rpx; + font-weight: bold; } \ No newline at end of file diff --git a/pages/bookServices/detail/components/teachResource/index.wxml b/pages/bookServices/detail/components/teachResource/index.wxml index 3f589f2..c6e9715 100644 --- a/pages/bookServices/detail/components/teachResource/index.wxml +++ b/pages/bookServices/detail/components/teachResource/index.wxml @@ -1,7 +1,7 @@ -<view class="teach-btn"> - <t-button theme="primary" style="width: 120px; height: 36px;" class="btn-upload"> - <t-image src="/static/images/bookService/detail/upload.png"></t-image> - 涓婁紶璧勬簮 +<view class="teach-btn" wx:if="{{false}}"> + <t-button theme="primary" style="width: 120px; height: 36px;" class="btn-upload" wx:if="{{false}}"> + <t-image src="/static/images/bookService/detail/upload.png" style="margin-top: 20rpx;"></t-image> + <text>涓婁紶璧勬簮</text> </t-button> <t-button theme="primary" style="width: 120px; height: 36px;"> <t-image src="/static/images/bookService/detail/download.png"></t-image> diff --git a/pages/bookServices/detail/components/teachResource/index.wxss b/pages/bookServices/detail/components/teachResource/index.wxss index f6d8eaa..e207958 100644 --- a/pages/bookServices/detail/components/teachResource/index.wxss +++ b/pages/bookServices/detail/components/teachResource/index.wxss @@ -1,6 +1,6 @@ .teach-btn { display: flex; - justify-content: flex-end; + justify-content: flex-start; align-items: center; height: 134rpx; --td-button-primary-bg-color: #fff; @@ -10,21 +10,23 @@ --td-button-primary-active-border-color: #ff6c00; } -.teach-btn image { - width: 32rpx; - height: 32rpx; - margin-right: 6rpx; -} - -.teach-btn .t-button__content { +.btn-content { display: flex; align-items: center; } +.teach-btn image { + width: 32rpx; + height: 32rpx; + margin-right: 6rpx; + margin-top: 20rpx; +} + + .applyResult { padding: 0 10rpx; - width: 740rpx; - height: 80rpx; + width: 660rpx; + min-height: 80rpx; display: flex; align-items: center; margin: 0 auto; @@ -42,6 +44,7 @@ } .applyPass { + background-color: rgba(0, 128, 0, 0.16); border: 1px solid green; } @@ -51,6 +54,14 @@ border: 1px solid #ff6c00; } +.applyNone, +.applyReject, +.applyPass, +.applying { + margin-top: 40rpx; + margin-bottom: 40rpx; +} + .btn-box { display: flex; } diff --git a/pages/bookServices/detail/components/testResource/testResource.js b/pages/bookServices/detail/components/testResource/testResource.js index 4db3b81..10282d4 100644 --- a/pages/bookServices/detail/components/testResource/testResource.js +++ b/pages/bookServices/detail/components/testResource/testResource.js @@ -1,4 +1,5 @@ // pages/bookServices/detail/components/testResource/testResource.js +const app = getApp() Component({ /** * 缁勪欢鐨勫睘鎬у垪琛� @@ -7,6 +8,10 @@ list: { type: Array, value: [] + }, + bookInfo: { + type: Object, + value: "", } }, @@ -21,6 +26,59 @@ * 缁勪欢鐨勬柟娉曞垪琛� */ methods: { + async goTest(e) { + const value = e.currentTarget.dataset.value + const token = wx.getStorageSync('jsek-token') + if (!token) { + return wx.getUserProfile({ + desc: '鐢ㄦ埛鐧诲綍', + success: (res) => { + console.log(res); + } + }) + } + // 鑾峰彇绔犺妭涓嬫槸鍚︽湁棰樼洰 + let idPathList = [] + let query = { + path: '*', + queryType: '*', + productId: this.properties.bookInfo.id, + cmsPath: value.productLinkPath, + pading: { + start: 0, + size: 999 + } + } + if (value.childrenFolderCount == 0) { + return wx.showToast({ + icon: "error", + title: '鏆傛棤鏁版嵁', + }) + } else { + const res = await app.MG.store.getProductDetail(query) + debugger + res.datas.cmsDatas[0].datas.forEach((item) => { + idPathList.push({ + id: item.id, + name: item.name, + productLinkPath: item.productLinkPath, + type: item.type + }) + }) + } + // query: { + // title: bookData.value.test, + // bookId: route.query.bookId, + // productLinkPath: data.productLinkPath, + // answerTitle: data.name, + // answerType: 'option', + // rootCmsItemId: bookData.value.rootCmsItemId, + // idPathList: JSON.stringify(idPathList) + // } + wx.navigateTo({ + url: `/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'}`, + }) + } } }) diff --git a/pages/bookServices/detail/components/testResource/testResource.wxml b/pages/bookServices/detail/components/testResource/testResource.wxml index d80c4f1..522eef5 100644 --- a/pages/bookServices/detail/components/testResource/testResource.wxml +++ b/pages/bookServices/detail/components/testResource/testResource.wxml @@ -1,17 +1,38 @@ <!--pages/bookServices/detail/components/testResource/testResource.wxml--> <view class="test-resource"> <view class="top-btn"> - <t-button class="practice-btn" theme="primary" size="medium">缁冧範</t-button> - <t-button class="paper-btn" theme="default" size="medium">缁勫嵎</t-button> - <t-button class="error-btn" theme="default" size="medium">鎴戠殑閿欓</t-button> - <t-button class="collect-btn" theme="default" size="medium">鎴戠殑鏀惰棌</t-button> + <t-button class="practice-btn" theme="primary" size="medium" style="width: 85px;"> + <view slot="content"> + <t-image src="/static/images/bookService/detail/practice-icon.png"></t-image> + 缁冧範 + </view> + </t-button> + <t-button class="paper-btn" theme="default" size="medium" style="width: 85px;"> + <view slot="content"> + <t-image src="/static/images/bookService/detail/zujuan.png"></t-image> + 缁勫嵎 + </view> + + </t-button> + <t-button class="error-btn" theme="default" size="medium" style="padding: 0 12rpx;"> + <view slot="content"> + <t-image src="/static/images/bookService/detail/cuoti.png"></t-image> + 鎴戠殑閿欓 + </view> + </t-button> + <t-button class="collect-btn" theme="default" size="medium" style="padding: 0 12rpx;"> + <view slot="content"> + <t-image src="/static/images/bookService/detail/wodeshoucang.png"></t-image> + 鎴戠殑鏀惰棌 + </view> + </t-button> </view> <view class="resource-list" wx:for="{{list}}" wx:key="item.id"> <view class="list-title"> <t-image src="/static/images/bookService/detail/test-icon.png"></t-image> <text>{{item.name}}</text> </view> - <view class="practice"> + <view class="practice" bind:tap="goTest" data-value="{{item}}"> <t-image src="/static/images/bookService/detail/lianxi-icon.png"></t-image> </view> </view> diff --git a/pages/bookServices/detail/components/testResource/testResource.wxss b/pages/bookServices/detail/components/testResource/testResource.wxss index 6362921..4342f7d 100644 --- a/pages/bookServices/detail/components/testResource/testResource.wxss +++ b/pages/bookServices/detail/components/testResource/testResource.wxss @@ -10,6 +10,7 @@ display: flex; justify-content: space-between; align-items: center; + background-color: #FFF6F0; } .list-title image { @@ -32,6 +33,12 @@ justify-content: space-evenly; } +.top-btn image { + margin-top: 20rpx; + width: 36rpx; + height: 36rpx; +} + .practice-btn { --td-button-primary-bg-color: #ff6c00; --td-button-primary-border-color: #ff6c00; diff --git a/pages/bookServices/detail/components/tree/index.js b/pages/bookServices/detail/components/tree/index.js index d3706b0..11f74cb 100644 --- a/pages/bookServices/detail/components/tree/index.js +++ b/pages/bookServices/detail/components/tree/index.js @@ -22,6 +22,14 @@ applyState: { type: String, value: '' + }, + openTeachids: { + type: Array, + value: '' + }, + openLearnids: { + type: Array, + value: "" } }, data: { @@ -48,7 +56,6 @@ } }, downloadTeach(e) { - console.log('鐐瑰嚮浜�', e); const value = e.currentTarget.dataset.value var myEventDetail = { value, @@ -58,6 +65,7 @@ composed: true } // 瑙﹀彂浜嬩欢鐨勯�夐」 this.triggerEvent('downloadTeach', myEventDetail, myEventOption) + }, // 鍒ゆ柇璧勬簮鏄惁璐拱 resourceIsBuy(data) { @@ -72,11 +80,105 @@ goPlayer(e) { const item = e.currentTarget.dataset.item const parent = e.currentTarget.dataset.parent - console.log(this.properties.bookInfo); + console.log(item.selectType); + debugger wx.navigateTo({ url: `/pages/resourceDetails/index?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parent.productLinkPath}&parentName=${parent.name}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}`, }) console.log(e); + }, + // 鎷垮埌鎵�鏈夐」 + getAllChildren(id) { + let result = []; + function findChildren(item) { + if (item.id === id) { + if (item.children && item.children.length > 0) { + item.children.forEach(child => { + findChildren(child); + }); + } + } else { + if (item.children && item.children.length > 0) { + item.children.forEach(child => { + findChildren(child); + }); + } + } + if (item.children && item.children.length > 0) { + result.push(...item.children); + } + } + this.properties.treeList.forEach(item => { + findChildren(item); + }); + return result; + }, + // 鎷垮埌褰撳墠椤瑰瓙椤� + flattenTree(tree) { + let result = []; + function flatten(node) { + result.push(node); + if (node.children && node.children.length > 0) { + node.children.forEach(child => { + flatten(child); + }); + } + } + tree.forEach(node => { + flatten(node); + }); + return result + }, + findAndUpdateItemById(tree, id) { + function findAndUpdate(node) { + if (node.id === id) { + node.check = true; // 灏嗙洰鏍囬」鐨� check 灞炴�ц缃负 true + return true; // 杩斿洖 true 琛ㄧず鎵惧埌浜嗙洰鏍囬」 + } + if (node.children && node.children.length > 0) { + for (let child of node.children) { + if (findAndUpdate(child)) { + return true; // 濡傛灉鍦ㄥ瓙鑺傜偣涓壘鍒颁簡鐩爣椤癸紝鍒欑洿鎺ヨ繑鍥� true + } + } + } + return false; // 琛ㄧず鏈壘鍒扮洰鏍囬」 + } + + for (let node of tree) { + if (findAndUpdate(node)) { + break; // 濡傛灉鍦ㄩ《灞傝妭鐐逛腑鎵惧埌浜嗙洰鏍囬」锛岀洿鎺ラ��鍑哄惊鐜� + } + } + }, + // 鍙樹负true + findAndUpdateItemsByIds(tree, ids) { + function findAndUpdate(node) { + if (ids.includes(node.id)) { + node.checked = true; // 灏嗙洰鏍囬」鐨� check 灞炴�ц缃负 true + } + if (node.children && node.children.length > 0) { + for (let child of node.children) { + findAndUpdate(child); // 閫掑綊澶勭悊瀛愯妭鐐� + } + } + } + + for (let node of tree) { + findAndUpdate(node); // 瀵规瘡涓《灞傝妭鐐规墽琛屾煡鎵惧拰鏇存柊鎿嶄綔 + } + return tree; // 杩斿洖淇敼鍚庣殑瀹屾暣鏁扮粍 + }, + // 绔犺妭鍕鹃�� + checkResourceTitle(e) { + const item = e.currentTarget.dataset.item + let list = this.flattenTree([item]) + let ids = [] + list.forEach(item => { + ids.push(item.id) + }) + const tab = this.findAndUpdateItemsByIds([item], ids) + console.log(ids, tab); } } }) \ No newline at end of file diff --git a/pages/bookServices/detail/components/tree/index.wxml b/pages/bookServices/detail/components/tree/index.wxml index 3d2acc5..ce30d1f 100644 --- a/pages/bookServices/detail/components/tree/index.wxml +++ b/pages/bookServices/detail/components/tree/index.wxml @@ -1,58 +1,168 @@ <view class="tree"> - <t-collapse defaultValue="{{activeValues}}" bind:change="handleChange"> - <t-collapse-panel wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" value="{{index}}" expandIcon> + <t-collapse default-value="{{activeValues}}" bind:change="handleChange"> + <t-collapse-panel + wx:for="{{treeList}}" + wx:for-item="item" + wx:for-index="index" + wx:key="id" + value="{{index}}" + expandIcon + > <view slot="header" class="header-title"> - <view> - <t-checkbox icon="rectangle" checked="{{item.checked}}" data-item="{{item}}" catch:change="checkResourceTitle" wx:if="{{tab == 'jsek_teachingResources'}}" /> + <view wx:if="{{tab == 'jsek_cloudLearning'}}"> + <t-checkbox + icon="rectangle" + checked="{{item.checked}}" + data-item="{{item}}" + bind:change="checkResourceTitle" + /> </view> <text>{{item.name}}</text> </view> - <view class="list" wx:for="{{item.children}}" wx:for-item="citem" wx:for-index="cindex" wx:key="cindex"> + <view + class="list" + wx:for="{{item.children}}" + wx:for-item="citem" + wx:for-index="cindex" + wx:key="cindex" + > <!-- // 鍒ゆ柇 鏃犲瓙椤� 涓斾负鍟嗗搧item 鐩存帴鏄剧ず --> - <view class="listItems" wx:if="{{citem.childrenFolderCount <= 0 && citem.type == 'productItem'}}"> - <view class="itemsInfo" wx:if="{{citem.name}}" data-item="{{citem}}" data-index="{{cindex}}"> - <view class="contentBox" bind:tap="goPlayer" data-item="{{citem}}" data-parent="{{item}}"> + <view + class="listItems" + wx:if="{{citem.childrenFolderCount <= 0 && citem.type == 'productItem'}}" + > + <view + class="itemsInfo" + wx:if="{{citem.name}}" + data-item="{{citem}}" + data-index="{{cindex}}" + > + <view + class="contentBox" + bind:tap="goPlayer" + data-item="{{citem}}" + data-parent="{{item}}" + > <!-- 鏁欏璧勬簮 浜戝涔� 鍥炬爣 --> - <view class="box-image"> - <view class="checkBox"> - <t-checkbox icon="rectangle" checked="{{citem.checked}}" disabled="{{citem.selectType=='webpage' || citem.isDownload != 1 || citem.fileMap[citem.file].protectType == 'Private'}}" bind:change="checkResource" data-item="{{citem}}" wx:if="{{tab == 'jsek_teachingResources'}}" /> + <view + class="box-image" + style="{{ tab == 'jsek_teachingResources' ? 'width: 350rpx;' : 'width: 450rpx;'}}" + > + <view class="checkBox" wx:if="{{tab == 'jsek_cloudLearning'}}"> + <t-checkbox + icon="rectangle" + checked="{{citem.checked}}" + disabled="{{citem.selectType=='webpage' || citem.isDownload != 1 || citem.fileMap[citem.file].protectType == 'Private'}}" + catch:change="checkResource" + data-item="{{citem}}" + /> </view> <!-- 鏁欏璧勬簮鍥炬爣 --> <view class="teach-icon"> - <t-image wx:if="{{citem.selectType == 'audio'}}" src="/static/images/bookService/detail/audioIcon.png" mode="aspectFill" /> - <t-image wx:if="{{citem.selectType == 'video'}}" src="/static/images/bookService/detail/video.png" mode="aspectFill" /> - <t-image wx:if="{{citem.selectType == 'pdf'}}" src="/static/images/bookService/detail/pdf.png" mode="aspectFill" /> - <t-image wx:if="{{citem.selectType == 'webpage'}}" src="/static/images/bookService/detail/net.png" mode="aspectFill" /> - <t-image wx:if="{{citem.selectType == 'picture'}}" src="/static/images/bookService/detail/picture.png" mode="aspectFill" /> - <t-image wx:if="{{citem.selectType == 'zip'}}" src="/static/images/bookService/detail/zip.png" mode="aspectFill" /> - <t-image wx:if="{{ citem.fileMap[citem.file].extension == 'doc' || citem.fileMap[citem.file].extension == 'docx'}}" src="/static/images/bookService/detail/word.png" mode="aspectFill" /> - <t-image wx:if="{{ citem.fileMap[citem.file].extension == 'xlsx' || citem.fileMap[citem.file].extension == 'xlsx'}}" src="/static/images/bookService/detail/excel.png" mode="aspectFill" /> - <t-image wx:if="{{ citem.fileMap[citem.file].extension == 'ppt' || citem.fileMap[citem.file].extension == 'pptx'}}" src="/static/images/bookService/detail/PPT.png" mode="aspectFill" /> + <t-image + wx:if="{{citem.selectType == 'audio'}}" + src="/static/images/bookService/detail/audioIcon.png" + mode="aspectFill" + /> + <t-image + wx:if="{{citem.selectType == 'video'}}" + src="/static/images/bookService/detail/video.png" + mode="aspectFill" + /> + <t-image + wx:if="{{citem.selectType == 'pdf'}}" + src="/static/images/bookService/detail/pdf.png" + mode="aspectFill" + /> + <t-image + wx:if="{{citem.selectType == 'webpage'}}" + src="/static/images/bookService/detail/net.png" + mode="aspectFill" + /> + <t-image + wx:if="{{citem.selectType == 'picture'}}" + src="/static/images/bookService/detail/picture.png" + mode="aspectFill" + /> + <t-image + wx:if="{{citem.selectType == 'zip'}}" + src="/static/images/bookService/detail/zip.png" + mode="aspectFill" + /> + <t-image + wx:if="{{ citem.fileMap[citem.file].extension == 'doc' || citem.fileMap[citem.file].extension == 'docx'}}" + src="/static/images/bookService/detail/word.png" + mode="aspectFill" + /> + <t-image + wx:if="{{ citem.fileMap[citem.file].extension == 'xlsx' || citem.fileMap[citem.file].extension == 'xlsx'}}" + src="/static/images/bookService/detail/excel.png" + mode="aspectFill" + /> + <t-image + wx:if="{{ citem.fileMap[citem.file].extension == 'ppt' || citem.fileMap[citem.file].extension == 'pptx'}}" + src="/static/images/bookService/detail/PPT.png" + mode="aspectFill" + /> </view> <!-- 浜戝涔犲浘鏍� --> - <view> - - </view> + <view> </view> <!-- 鍚嶇О --> - <text class="name">{{citem.name}}</text> + <text + class="name" + style="{{ tab == 'jsek_teachingResources' ? 'width: 300rpx;' : 'width: 400rpx;'}}" + >{{citem.name}}</text + > </view> <!-- 鏁欏璧勬簮绫诲瀷 --> - <view class="teachClass"> - {{citem.resourceClass}} - </view> - <view class="teach-btn" wx:if="{{tab == 'jsek_teachingResources'}}"> + <view class="teachClass"> {{citem.resourceClass}} </view> + <view + class="teach-btn" + wx:if="{{tab == 'jsek_teachingResources'}}" + > <!-- 涓嬭浇鎸夐挳 --> - <t-image src="/static/images/bookService/detail/download-icon.png" width="16" height="16" class="download" data-value="{{citem}}" bind:tap="downloadTeach"></t-image> + <t-image + src="/static/images/bookService/detail/download-icon.png" + width="16" + height="16" + class="download" + data-value="{{citem}}" + catchtap="downloadTeach" + ></t-image> </view> <view wx:if="{{tab == 'jsek_cloudLearning'}}"> - <t-image src="/static/images/bookService/detail/shikan.png" class="testSee" wx:if="{{citem.isuy }}"></t-image> - <t-image src="/static/images/bookService/detail/need-buy.png" class="need-buy"></t-image> + <!-- 浜戝涔犺瘯鐪嬪浘鏍� --> + <t-image + src="/static/images/bookService/detail/shikan.png" + class="testSee" + wx:if="{{!citem.isbuy ? false : citem.freeFile ? true : false}}" + ></t-image> + <!-- 浜戝涔犲姞鍏ヨ喘鐗╄溅鍥炬爣 --> + <t-image + src="/static/images/bookService/detail/cart.png" + wx:if="{{citem.isShopCar}}" + class="shopCar" + ></t-image> + <!-- 浜戝涔犺喘涔板浘鏍� --> + <t-image + src="/static/images/bookService/detail/need-buy.png" + class="need-buy" + wx:if="{{citem.isbuy }}" + ></t-image> </view> </view> </view> </view> <!-- // 鍒ゆ柇 涓嶆槸鍟嗗搧 鏈夊瓙椤� 閫掑綊缁勪欢 --> - <tree wx:else bookInfo="{{bookInfo}}" treeList="{{[citem]}}" itemId="{{itemId}}" tab="{{tab}}"></tree> + <tree + wx:else + bookInfo="{{bookInfo}}" + treeList="{{[citem]}}" + itemId="{{itemId}}" + tab="{{tab}}" + openTeachids="{{openTeachids}}" + openLearnids="{{openLearnids}}" + ></tree> </view> <view class="listItems" wx:if="{{children.length <= 0 && !loading}}"> 鏆傛棤鏁版嵁 @@ -62,4 +172,4 @@ </view> </t-collapse-panel> </t-collapse> -</view> \ No newline at end of file +</view> diff --git a/pages/bookServices/detail/components/tree/index.wxss b/pages/bookServices/detail/components/tree/index.wxss index 26aebde..6f1e9fb 100644 --- a/pages/bookServices/detail/components/tree/index.wxss +++ b/pages/bookServices/detail/components/tree/index.wxss @@ -1,5 +1,7 @@ .tree { - --td-collapse-content-padding: 32rpx 12rpx 32rpx 32rpx; + --td-collapse-content-padding: 0rpx 12rpx 32rpx 12rpx; + --td-collapse-header-text-color: #ff6C00; + --td-collapse-icon-color: #ff6c00 } .header-title { @@ -8,9 +10,15 @@ --td-checkbox-vertical-padding: 0 } +.t-class { + background-color: #F7F7F7; +} + .t-class-content { padding: 0; } + + .contentBox { padding: 0 26rpx; @@ -55,7 +63,13 @@ } .testSee, -.need-buy { +.need-buy, +.shopCar { width: 38rpx; height: 38rpx; +} + +.testSee, +.shopCar { + margin-right: 20rpx; } \ No newline at end of file diff --git a/pages/bookServices/detail/index.js b/pages/bookServices/detail/index.js index ee631de..396240d 100644 --- a/pages/bookServices/detail/index.js +++ b/pages/bookServices/detail/index.js @@ -37,7 +37,10 @@ rejectCause: "", // 涓嬭浇鎷掔粷鍘熷洜 buyIdList: [], shoppingCartGetId: [], // 宸茶喘涔癷d鍒楄〃 - shoppingList: [] + shoppingList: [], + loading: false, + isShowTeachDownload: false, // 鎻愮ずPC涓嬭浇寮圭獥鐘舵�� + confirmBtn: { content: '鎴戠煡閬撲簡', variant: 'base' }, }, resetTree: function (e) { @@ -98,12 +101,20 @@ /** * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔 */ - onPullDownRefresh() { }, + onPullDownRefresh() { + + + }, /** * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� */ - onReachBottom() { }, + onReachBottom() { + if (this.data.tabValue == 'jesk_note') { + const child = this.selectComponent('#note') + child.onReachBottom() + } + }, /** * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� @@ -200,7 +211,8 @@ freeEpubPage: [], //epub璇曡鐧惧垎姣� }, }; - app.MG.store.getProductDetail(query).then((res) => { + app.MG.store.getProductDetail(query).then(async (res) => { + this.setData({ bookDetail: res.datas, cmsDatas: res.datas.cmsDatas[0].datas, @@ -209,9 +221,10 @@ // 鑾峰彇鍥句功鍒嗙被 const iconType = JSON.parse(res.datas.bookClassification)[0][0]; const classType = JSON.parse(res.datas.bookClassification)[0][1]; + const className = await this.getBookClass(iconType, classType) this.setData({ 'bookDetail.publicationDate': this.formatDate(this.data.bookDetail.publicationDate), - 'bookDetail.class': this.getBookClass(iconType, classType), + 'bookDetail.class': className, 'bookDetail.price': this.numFormat(this.data.bookDetail.price), 'bookDetail.oldPrice': this.numFormat(this.data.bookDetail.oldPrice), 'bookDetail.paperPrice': this.numFormat(this.data.bookDetail.paperPrice), @@ -219,17 +232,17 @@ }); }, // 鑾峰彇鍥句功鍒嗙被 - getBookClass(iconType, classType) { + async getBookClass(iconType, classType) { let name = ''; const query = { refCodes: ['bookClassification'], }; - app.MG.store.getProductTypeField(query).then((res) => { + await app.MG.store.getProductTypeField(query).then((res) => { JSON.parse(res[0].config).option.forEach((item) => { if (item.value == iconType) { - item.child.forEach((item) => { - if (item.value == classType) { - name = item.name; + item.child.forEach((citem) => { + if (citem.value == classType) { + name = citem.name; } }); } @@ -298,7 +311,17 @@ || (e.detail.value == 'questionBank' && !this.data.test.length)) { this.getResourceData(checkData) } + } + } else if (e.detail.label == '浜戠瑪璁�') { + const token = wx.getStorageSync('jsek-token') + const child = this.selectComponent('#note') + child.handleSubmitTitle() + if (token) { + child.changeLoading() + child.getNoteList() + } + } }, // 鑾峰彇璧勬簮鎵�灞炲垎绫� @@ -314,6 +337,9 @@ }, // 鑾峰彇鏁欏璧勬簮 浜戝涔� 浜戞祴璇� getResourceData(type) { + this.setData({ + loading: true + }) let query = { path: '*', queryType: '*', @@ -355,13 +381,15 @@ }) const list = await this.getAllResource(res.datas.cmsDatas[0].datas) this.setData({ - teach: list + teach: list, + loading: false }) this.findChildIds(this.data.teach, this.data.openTeachids = []) } else if (type.refCode == 'jsek_cloudLearning') { const list = await this.getAllResource(res.datas.cmsDatas[0].datas) this.setData({ - learn: list + learn: list, + loading: false }) this.findChildIds(this.data.learn, this.data.openLearnids = []) } @@ -371,10 +399,9 @@ } else if (type.refCode == 'jsek_questionBank') { // const list = await this.getAllResource(res.datas.cmsDatas[0].datas) this.setData({ - test: res.datas.cmsDatas[0].datas + test: res.datas.cmsDatas[0].datas, + loading: false }) - // this.findChildIds(this.data.test, this.data.openTestids = []) - console.log('浜戞祴璇�', this.data.test); } else { console.log('鍏朵粬'); } @@ -528,14 +555,14 @@ const endDate = JSON.parse(applyResource.feedBack).endDate // const endDate = new Date(JSON.parse(applyResource.feedBack).endDate + ' 23:59:59').getTime() if (endDate == '姘镐箙') { - // deadline.value = '姘镐箙' this.setData({ applyState: 'Normal', deadline: '姘镐箙', }) + console.log('鏈夋晥鏃ユ湡', this.data.deadline); } else { + let endTime = new Date(endDate + ' 23:59:59').getTime() - // deadline.value = endDate + ' 23:59:59' this.setData({ deadline: endDate + ' 23:59:59' }) @@ -560,9 +587,8 @@ applyState: 'none' }) } - console.log('鐢宠閫氳繃', this.data.applyState); }) - + console.log('鏈夋晥鏃ユ湡', this.data.deadline); }, // 鐢宠鏁欏璧勬簮 applyResource() { @@ -607,92 +633,102 @@ // // logIn() // } }, + // 鏁欏璧勬簮涓嬭浇鍓嶅線PC鎻愮ずDiialog + closeTeachDownload() { + this.setData({ + isShowTeachDownload: false + }) + }, + // 涓嬭浇鍔熻兘 downloadTeach(e) { - - const data = e.detail.value - // const data - // let role = userStore.userInfo ? userStore.userInfo.role : null - // if (role) { - // if (role == 'Teacher') { - if (this.properties.applyState == 'Normal' || this.properties.applyState == 'none') { - // 鏄惁鍏佽涓嬭浇 - if (data.isDownload == 1) { - // 鐢宠閫氳繃 - let url = app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' - if (data.file) { - // 鍒ゆ柇鏄惁绉佹湁 - if (data.fileMap[data.file].protectType == 'Private') - return Message.error({ - context: this, - offset: ['20rpx', '32rpx'], - duration: 5000, - content: '璇ユ枃浠舵棤娉曚笅杞�' - }) - url = url + data.file + '&token=' + wx.getStorageSync('jsek-token') - } else if (data.freeFile) { - url = url + data.freeFile + '&token=' + wx.getStorageSync('jsek-token') - } else { - Message.error({ - context: this, - offset: ['20rpx', '32rpx'], - duration: 5000, - content: '鏆傛棤璧勬簮', - }) - } - this.downloadFile(url) - } else { - Message.error({ - context: this, - offset: ['20rpx', '32rpx'], - duration: 5000, - content: '璇ヨ祫婧愭棤娉曚笅杞�', - }) - } - } else if (this.properties.applyState == 'WaitAudit') { - // ElMessageBox.confirm('璇峰厛鐢宠涓嬭浇锛�', '灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�', { - // confirmButtonText: '鐢宠', - // cancelButtonText: '鍙栨秷', - // type: 'warning' - // }) - // .then(() => applyBookInfo()) - // .catch() - Message.error({ - context: this, - offset: ['20rpx', '32rpx'], - duration: 5000, - content: '璇ヨ祫婧愪笅杞界敵璇峰鏍镐腑', - }) - } else if (this.properties.applyState == 'Reject') { - Message.error({ - context: this, - offset: ['20rpx', '32rpx'], - duration: 5000, - content: '璧勬簮涓嬭浇鐢宠鏈�氳繃' - }) - - } else { - // Message.error({ - // context: this, - // offset: ['20rpx', '32rpx'], - // duration: 5000, - // content: '璇峰厛鐢宠涓嬭浇' - // }) - console.log('璇峰厛鐢宠涓嬭浇'); - } - // } else { - // ElMessageBox.confirm('璇峰厛杩涜鏁欏笀璁よ瘉锛�', '灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�', { - // confirmButtonText: '鍘昏璇�', - // cancelButtonText: '鍙栨秷', - // type: 'warning' - // }) - // .then(() => { - // isShow.value = true + this.setData({ + isShowTeachDownload: true + }) + console.log('zhuan', this.data.isShowTeachDownload); + // const data = e.detail.value + // // const data + // // let role = userStore.userInfo ? userStore.userInfo.role : null + // // if (role) { + // // if (role == 'Teacher') { + // if (this.properties.applyState == 'Normal' || this.properties.applyState == 'none') { + // // 鏄惁鍏佽涓嬭浇 + // if (data.isDownload == 1) { + // // 鐢宠閫氳繃 + // let url = app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + // if (data.file) { + // // 鍒ゆ柇鏄惁绉佹湁 + // if (data.fileMap[data.file].protectType == 'Private') + // return Message.error({ + // context: this, + // offset: ['20rpx', '32rpx'], + // duration: 5000, + // content: '璇ユ枃浠舵棤娉曚笅杞�' + // }) + // url = url + data.file + '&token=' + wx.getStorageSync('jsek-token') + // } else if (data.freeFile) { + // url = url + data.freeFile + '&token=' + wx.getStorageSync('jsek-token') + // } else { + // Message.error({ + // context: this, + // offset: ['20rpx', '32rpx'], + // duration: 5000, + // content: '鏆傛棤璧勬簮', + // }) + // } + // this.downloadFile(url) + // } else { + // Message.error({ + // context: this, + // offset: ['20rpx', '32rpx'], + // duration: 5000, + // content: '璇ヨ祫婧愭棤娉曚笅杞�', // }) - // .catch(() => { }) + // } + // } else if (this.properties.applyState == 'WaitAudit') { + // // ElMessageBox.confirm('璇峰厛鐢宠涓嬭浇锛�', '灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�', { + // // confirmButtonText: '鐢宠', + // // cancelButtonText: '鍙栨秷', + // // type: 'warning' + // // }) + // // .then(() => applyBookInfo()) + // // .catch() + // Message.error({ + // context: this, + // offset: ['20rpx', '32rpx'], + // duration: 5000, + // content: '璇ヨ祫婧愪笅杞界敵璇峰鏍镐腑', + // }) + // } else if (this.properties.applyState == 'Reject') { + // Message.error({ + // context: this, + // offset: ['20rpx', '32rpx'], + // duration: 5000, + // content: '璧勬簮涓嬭浇鐢宠鏈�氳繃' + // }) + + // } else { + // // Message.error({ + // // context: this, + // // offset: ['20rpx', '32rpx'], + // // duration: 5000, + // // content: '璇峰厛鐢宠涓嬭浇' + // // }) + // console.log('璇峰厛鐢宠涓嬭浇'); // } - // } else { - // logIn() - // } + // // } else { + // // ElMessageBox.confirm('璇峰厛杩涜鏁欏笀璁よ瘉锛�', '灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�', { + // // confirmButtonText: '鍘昏璇�', + // // cancelButtonText: '鍙栨秷', + // // type: 'warning' + // // }) + // // .then(() => { + // // isShow.value = true + // // }) + // // .catch(() => { }) + // // } + // // } else { + // // logIn() + // // } }, downloadFile(url) { wx.downloadFile({ @@ -749,7 +785,6 @@ shoppingList: res.datas, shoppingCartGetId: list }) - console.log('璐拱', this.data); }) }, // 鍒ゆ柇璧勬簮鍔犲叆璐墿杞︽寜閽槸鍚︽樉绀� @@ -778,7 +813,7 @@ flattenedArray.push(node) // 閫掑綊澶勭悊瀛愯妭鐐� if (node.children && node.children.length > 0) { - const childrenArray = handleTreeData(node.children) + const childrenArray = this.handleTreeData(node.children) flattenedArray.push(...childrenArray) } }) @@ -786,18 +821,28 @@ }, // 浜戝涔犱竴閿鍙� async getFreeResource() { - // if (!localStorage.getItem('jsek-token')) { - // return logIn() - // } - let arr = handleTreeData(this.data.learn).filter((item) => resourceIsBuy(item)) + const child = this.selectComponent('#learn-resource') + const token = wx.getStorageSync('jsek-token') + if (!token) { + return wx.getUserProfile({ + desc: '鐢ㄦ埛鐧诲綍', + success: (res) => { + console.log(res); + } + }) + } + let arr = this.handleTreeData(this.data.learn).filter((item) => this.resourceIsBuy(item)) let freeIds = arr.filter((item) => { return item.saleMethod[0].Price == 0 }) - if (!freeIds.length) return console.log('鏆傛棤鍏嶈垂璧勬簮') - btnLoading.freeBtn = true + if (!freeIds.length) return wx.showToast({ + icon: "error", + title: '鏆傛棤鍏嶈垂璧勬簮', + }) + child.changeReceive(true) let requests = [] freeIds.forEach((item, index) => { - if (resourceIsBuy(item)) { + if (this.resourceIsBuy(item)) { requests.push({ saleMethodId: item.saleMethod[0].Id, count: 1 @@ -815,14 +860,84 @@ orderNum: initOrderRes.orderNumber } // 纭璁㈠崟 - const confirmOrderRes = await MG.store.confirmOrder(parameter) + const confirmOrderRes = await app.MG.store.confirmOrder(parameter) if (confirmOrderRes.orderNumber) { - // btnLoading.freeBtn = false - console.log('棰嗗彇鎴愬叡'); + child.changeReceive(false) + wx.showToast({ + title: '棰嗗彇鎴愬姛', + }) this.getBookInfo(this.data.bookId) } } catch (error) { console.log(error) } - } + }, + // 浜戝涔犱竴閿喘涔� + async allAddShoppiingCar() { + const child = this.selectComponent('#learn-resource') + const token = wx.getStorageSync('jsek-token') + if (!token) { + return wx.getUserProfile({ + desc: '鐢ㄦ埛鐧诲綍', + success: (res) => { + console.log(res); + } + }) + } + let shopList = this.handleTreeData(this.data.learn).filter((item) => this.resourceIsBuy(item)) + this.getShoppingCartProductGet() + if (!shopList.length) return wx.showToast({ + icon: "error", + title: '宸插叏閮ㄨ喘涔�', + }) + child.changeBuy(true) + let requests = [] + shopList.forEach((item) => { + requests.push({ + saleMethodId: item.saleMethod[0].Id, + count: 1, + }) + }) + let query = { + remarks: '浜戝涔�', + requests, + } + const initOrderRes = await app.MG.store.initOrder(query) + child.changeBuy(false) + // 妫�鏌ヨ鍗曞彿鏄惁瀛樺湪 + if (initOrderRes.orderNumber) { + // bookService: orderNumber.value, 灏戜紶杩欎釜 锛屾殏鏃朵笉鐭ラ亾鏈変粈涔堢敤 + wx.navigateTo({ + url: `/pages/cart/paymentPage/index?&bookId=${this.data.bookDetail.id}&bookName=${this.data.bookDetail.name}&orderNum=${initOrderRes.orderNumber}`, + }) + } else { + // 璁㈠崟鍙蜂笉瀛樺湪锛屾樉绀鸿鍛婃秷鎭� + wx.showToast({ + icon: "error", + title: '璇烽噸璇�', + }) + } + }, + // 鍙樹负鎵�鏈塩heck true + findAndUpdateItemsByIds(tree, ids) { + function findAndUpdate(node) { + if (ids.includes(node.id)) { + node.checked = true; // 灏嗙洰鏍囬」鐨� check 灞炴�ц缃负 true + } + if (node.children && node.children.length > 0) { + for (let child of node.children) { + findAndUpdate(child); // 閫掑綊澶勭悊瀛愯妭鐐� + } + } + } + + for (let node of tree) { + findAndUpdate(node); // 瀵规瘡涓《灞傝妭鐐规墽琛屾煡鎵惧拰鏇存柊鎿嶄綔 + } + return tree; // 杩斿洖淇敼鍚庣殑瀹屾暣鏁扮粍 + }, + handleTrue() { + // findAndUpdateItemsByIds(this.date.) + }, + }) diff --git a/pages/bookServices/detail/index.json b/pages/bookServices/detail/index.json index e023f75..72d8522 100644 --- a/pages/bookServices/detail/index.json +++ b/pages/bookServices/detail/index.json @@ -13,7 +13,9 @@ "note": "/pages/bookServices/detail/components/note/note", "tree": "/pages/bookServices/detail/components/tree/index", "suggest": "/pages/bookServices/detail/components/suggest/suggest", - "t-loading": "tdesign-miniprogram/loading/loading" + "t-loading": "tdesign-miniprogram/loading/loading", + "t-dialog": "tdesign-miniprogram/dialog/dialog" }, - "navigationStyle": "custom" + "navigationStyle": "custom", + "onReachBottomDistance": 200 } \ No newline at end of file diff --git a/pages/bookServices/detail/index.wxml b/pages/bookServices/detail/index.wxml index 760f1b1..fff1970 100644 --- a/pages/bookServices/detail/index.wxml +++ b/pages/bookServices/detail/index.wxml @@ -3,29 +3,48 @@ <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> -<scroll-view scroll-y="{{true}}" class="book"> +<scroll-view scroll-y="{{true}}" class="book" bindscrolltolower="onReachBottom"> <!-- 鍥句功璇︽儏 --> <view class="book-box"> <view class="book-detail"> <view class="detail-left"> <view class="book-img"> - <t-image src="{{bookDetail.icon}}" mode="aspectFill" width="120" height="170" aria-label="{{bookDetail.name}}" /> + <t-image + src="{{bookDetail.icon}}" + mode="aspectFill" + width="120" + height="170" + aria-label="{{bookDetail.name}}" + /> </view> <view class="book-use"> <view class="collect" bind:tap="setCollect"> <view> - <t-image src="/static/images/bookService/detail/collect.png" wx:if="{{!bookDetail.isFavourite}}"></t-image> - <t-image src="/static/images/bookService/detail/collecting.png" wx:if="{{bookDetail.isFavourite}}"></t-image> + <t-image + src="/static/images/bookService/detail/collect.png" + wx:if="{{!bookDetail.isFavourite}}" + ></t-image> + <t-image + src="/static/images/bookService/detail/collecting.png" + wx:if="{{bookDetail.isFavourite}}" + ></t-image> </view> <view class="use-title">鏀惰棌</view> </view> <view class="suggest" bind:tap="suggestBtn"> <view> - <t-image src="/static/images/bookService/detail/suggest.png"></t-image> + <t-image + src="/static/images/bookService/detail/suggest.png" + ></t-image> </view> <view class="use-title">鎴戣寤鸿</view> </view> @@ -50,9 +69,13 @@ <view class="li-title">鍑虹増鏃堕棿锛�</view> <view class="li-content">{{bookDetail.publicationDate}}</view> </view> - <view class="message-li"> + <view + class="message-li" + wx:if="{{bookDetail.class}}" + style="height: 80rpx" + > <view class="li-title">鍥句功鍒嗙被锛�</view> - <view class="li-content">{{bookDetail.class}}</view> + <view class="class-name showTow">{{bookDetail.class}}</view> </view> </view> </view> @@ -63,11 +86,16 @@ <!-- 鐢靛瓙涔﹀敭浠� --> <view class="electron-price"> <view> - <t-image src="/static/images/bookService/detail/electon-price.png"></t-image> + <t-image + src="/static/images/bookService/detail/electon-price.png" + ></t-image> </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="line"></view> + <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="line"></view> </view> </view> <view> </view> @@ -75,41 +103,131 @@ <!-- 绾歌川涔﹀敭浠� --> <view class="paper-price"> <view> - <t-image src="/static/images/bookService/detail/paper-price.png"></t-image> + <t-image + src="/static/images/bookService/detail/paper-price.png" + ></t-image> </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"> - <t-image src="/static/images/bookService/detail/jd.png" wx:if="{{bookDetail.JDLink}}" bind:tap="goShop" data-link="{{bookDetail.tmallLink}}" data-type="jd"></t-image> - <t-image src="/static/images/bookService/detail/tmall.png" width="32" height="22" bind:tap="goShop" data-link="{{bookDetail.tmallLink}}" wx:if="{{bookDetail.tmallLink}}"></t-image> - <t-image src="/static/images/bookService/detail/dangdang.png" bind:tap="goShop" data-link="{{bookDetail.dangdangLink}}" wx:if="{{bookDetail.dangdangLink}}"></t-image> - <t-image src="/static/images/bookService/detail/jd.png" bind:tap="goShop" data-link="{{bookDetail.weidianLink}}" wx:if="{{bookDetail.weidianLink}}"></t-image> + <t-image + src="/static/images/bookService/detail/jd.png" + wx:if="{{bookDetail.JDLink}}" + bind:tap="goShop" + data-link="{{bookDetail.tmallLink}}" + data-type="jd" + ></t-image> + <t-image + src="/static/images/bookService/detail/tmall.png" + width="32" + height="22" + bind:tap="goShop" + data-link="{{bookDetail.tmallLink}}" + wx:if="{{bookDetail.tmallLink}}" + ></t-image> + <t-image + src="/static/images/bookService/detail/dangdang.png" + bind:tap="goShop" + data-link="{{bookDetail.dangdangLink}}" + wx:if="{{bookDetail.dangdangLink}}" + ></t-image> + <t-image + src="/static/images/bookService/detail/jd.png" + bind:tap="goShop" + data-link="{{bookDetail.weidianLink}}" + wx:if="{{bookDetail.weidianLink}}" + ></t-image> </view> </view> </view> <view class="book-resource"> - <t-tabs defaultValue="{{tabValue}}" bind:change="onTabsChange" t-class="custom-tabs" t-class-content="custom-panel" class="tab-class"> + <t-tabs + defaultValue="{{tabValue}}" + bind:change="onTabsChange" + t-class="custom-tabs" + t-class-content="custom-panel" + class="tab-class" + > <t-tab-panel label="鍥句功绠�浠�" value="brief" style="{{tabPanelstyle}}"> - <book-brief content="{{bookDetail.content}}" authorIntroduction="{{bookDetail.authorIntroduction}}"></book-brief> + <book-brief + content="{{bookDetail.content}}" + authorIntroduction="{{bookDetail.authorIntroduction}}" + ></book-brief> </t-tab-panel> <t-tab-panel label="鐢靛瓙涔�" value="1" style="{{tabPanelstyle}}"> 鐢靛瓙涔� </t-tab-panel> - <t-tab-panel label="鏁欏璧勬簮" value="jsek_teachingResources"> - <teach-resource applyState="{{applyState}}" rejectCause="{{rejectCause}}" bind:applyResource="applyResource"></teach-resource> - <tree bookInfo="{{bookDetail}}" treeList="{{teach}}" tab="{{tabValue}}" applyState="{{applyState}}" bind:downloadTeach="downloadTeach"></tree> + <t-tab-panel + label="鏁欏璧勬簮" + value="jsek_teachingResources" + class="{{loading ? 'loading': ''}}" + > + <view wx:if="{{!loading && teach.length}}"> + <teach-resource + applyState="{{applyState}}" + rejectCause="{{rejectCause}}" + bind:applyResource="applyResource" + ></teach-resource> + <tree + bookInfo="{{bookDetail}}" + treeList="{{teach}}" + tab="{{tabValue}}" + applyState="{{applyState}}" + bind:downloadTeach="downloadTeach" + openTeachids="{{openTeachids}}" + ></tree> + </view> + <t-loading + theme="circular" + size="60rpx" + class="loading" + loading="{{loading}}" + /> </t-tab-panel> - <t-tab-panel label="浜戝涔�" value="jsek_cloudLearning" style="{{tabPanelstyle}}"> - <learn-resource></learn-resource> - <tree bookInfo="{{bookDetail}}" tab="{{tabValue}}" treeList="{{learn}}" buyIds="{{buyIdList}}"></tree> + <t-tab-panel + label="浜戝涔�" + value="jsek_cloudLearning" + style="{{tabPanelstyle}}" + > + <view wx:if="{{!loading && learn.length}}"> + <learn-resource + bind:getFreeResource="getFreeResource" + bind:allAddShoppiingCar="allAddShoppiingCar" + id="learn-resource" + ></learn-resource> + <tree + bookInfo="{{bookDetail}}" + tab="{{tabValue}}" + treeList="{{learn}}" + buyIds="{{buyIdList}}" + openLearnids="{{openLearnids}}" + ></tree> + </view> </t-tab-panel> - <t-tab-panel label="浜戞祴璇�" value="questionBank" style="{{tabPanelstyle}}"> - <test-resource list="{{test}}"></test-resource> + <t-tab-panel + label="浜戞祴璇�" + value="questionBank" + style="{{tabPanelstyle}}" + > + <view wx:if="{{!loading && test.length}}"> + <test-resource + list="{{test}}" + bookInfo="{{bookDetail}}" + ></test-resource> + </view> </t-tab-panel> - <t-tab-panel label="浜戠瑪璁�" value="note" style="{{tabPanelstyle}}"> - <note></note> + <t-tab-panel label="浜戠瑪璁�" value="jesk_note" style="{{tabPanelstyle}}"> + <note + bookInfo="{{bookDetail}}" + id="note" + class="note-list" + bind:changeLoaidng="changeLoaidng" + ></note> </t-tab-panel> </t-tabs> </view> @@ -123,7 +241,9 @@ </view> <view class="bottom-btn"> <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> @@ -132,4 +252,18 @@ </view> </scroll-view> <!-- 鎴戣寤鸿寮圭獥 --> -<suggest class="suggest-component" id="suggest-component" bookIcon="{{bookDetail.icon}}" bookName="{{bookDetail.name}}"></suggest> \ No newline at end of file +<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" +/> diff --git a/pages/bookServices/detail/index.wxss b/pages/bookServices/detail/index.wxss index 35cea5c..3fbcf6f 100644 --- a/pages/bookServices/detail/index.wxss +++ b/pages/bookServices/detail/index.wxss @@ -33,9 +33,22 @@ } .detail-right .book-name { + width: 420rpx; font-weight: bold; font-size: 36rpx; color: #000000; + margin-bottom: 30rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.showTow { + word-break: break-all; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + overflow: hidden; } .book-message { @@ -60,6 +73,12 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; +} + +.class-name { + height: 2.5em; + width: 280rpx; + font-size: 28rpx; } .book-use { @@ -153,6 +172,7 @@ .book-web { margin-left: 30rpx; + display: flex; } .book-web image { @@ -239,4 +259,26 @@ .tab-box { min-height: 550rpx; +} + +.note-list { + /* margin-bottom: 80rpx; */ +} + +.tab-class { + --td-loading-color: #ff6c00 +} + +.loading { + min-height: 550rpx; + display: flex; + align-items: center; + justify-content: center; +} + +.teachDownloadDialog { + --td-button-primary-bg-color: #ff6c00; + --td-button-primary-border-color: #ff6c00; + --td-button-primary-active-bg-color: #ff984d; + --td-button-primary-active-border-color: #ff984d; } \ No newline at end of file diff --git a/pages/bookServices/examination/examination.js b/pages/bookServices/examination/examination.js new file mode 100644 index 0000000..a8bc3ce --- /dev/null +++ b/pages/bookServices/examination/examination.js @@ -0,0 +1,339 @@ +const app = getApp() +Page({ + + /** + * 椤甸潰鐨勫垵濮嬫暟鎹� + */ + data: { + barHeight: "", + navBarHeight: "", + loading: false, + answerTitle: "", // 瀵艰埅鏍忔爣棰� + bookId: "", + productLinkPath: "", + rootCmsItemId: "", + idPathList: [], // 棰樼洰鍒楄〃 + answerType: "", // 绛旈绫诲瀷 + submitStatus: false, // 鎻愪氦鐘舵�� + currentIndex: 0, // 褰撳墠绛旈鏁� + collectList: [], // 鏀惰棌棰樼洰鍒楄〃 + subjectiveNum: 0, // 涓昏棰樺緱鍒� + subjectiveGrade: 0, // 涓昏棰樻�诲垎 + total: 0, // 棰樼洰鎬绘暟 + correctNum: 0, // 姝g‘棰樼洰鏁伴噺 + cardList: [], // 鎻愪氦椤�, + questionDataList: [] + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 + */ + 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, + answerTitle: options.answerTitle, + bookId: options.bookId, + productLinkPath: options.productLinkPath, + rootCmsItemId: options.rootCmsItemId, + idPathList: JSON.parse(options.idPathList), + answerType: options.answerType + }); + this.init() + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 + */ + onReady() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず + */ + onShow() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌 + */ + onHide() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇 + */ + onUnload() { + + }, + + /** + * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔 + */ + onPullDownRefresh() { + + }, + + /** + * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� + */ + onReachBottom() { + + }, + + /** + * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� + */ + onShareAppMessage() { + }, + // 杩斿洖 + goBack() { + wx.navigateBack(); + }, + // 鍒濆鍖栧嚱鏁� + async init() { + if (this.data.answerType == 'option') { + // 娴嬭瘯绛旈 + await this.getCollectIdList() // 鑾峰彇鏀惰棌id鍒楄〃 + // await getErrorList() // 鑾峰彇閿欓id鍒楄〃 + } + }, + // 鑾峰彇鏀惰棌棰樼洰鍒楄〃id + getCollectIdList() { + app.MG.identity + .getUserKey({ + domain: 'collectData', + keys: [this.data.rootCmsItemId] + }) + .then(async (res) => { + try { + this.setData({ + collectList: JSON.parse(res[0].value) + }) + } catch (error) { + } + if (this.data.answerType == 'option') { + // 鍏堣幏鍙栫敤鎴风瓟棰樿褰� + await this.getAnswerInfo((res) => { + if (res.length) { + // 鏈夎褰曪紝涓嶈兘绛旈锛岀姸鎬佽涓哄凡鎻愪氦 + this.setData({ + submitStatus: true + }) + let value = JSON.parse(res[0].value) + // console.log('绛旈璁板綍', JSON.parse(res[0].value)) + // 鏈夌瓟棰樿褰曪紝寰楀垎璧嬪�� + if (value) { + value.dataList.forEach((item) => { + if (item.name == '瀹㈣棰樺緱鍒�' && item.path == this.data.productLinkPath) + this.setData({ + subjectiveNum: item.score + }) + }) + } + this.setData({ + currentIndex: value.currentIndex + }) + // 鎼哄甫绛旈璁板綍 鑾峰彇棰樼洰 + this.getQuestionList(value.dataList) + } else { + this.getQuestionList() // 鑾峰彇棰樺簱棰樼洰 + } + }) + } + }) + }, + // 鑾峰彇棰樺簱棰樼洰 + getQuestionList(oldData) { + // 娓呯┖姝g‘棰樻暟璁板綍 + this.setData({ + correctNum: 0 + }) + let flag = 0 + this.data.idPathList.forEach((pathitem) => { + const pathList = this.data.cardList + pathList.push({ + name: pathitem.name, + path: pathitem.productLinkPath, + catalogName: pathitem.type, + infoList: [] + }) + this.setData({ + cardList: pathList + }) + // 鑾峰彇棰樼洰 + let questionArr = [] + let query = { + path: '*', + queryType: '*', + productId: this.data.bookId, + cmsPath: pathitem.productLinkPath, + itemFields: { + // SysType: 'CmsFolder', + Embedded_QuestionBank_Stem: [], + Embedded_QuestionBank_AnalysisCon: [], + Embedded_QuestionBank_Answer: [], + Embedded_QuestionBank_Option: [], + Embedded_QuestionBank_QuestionType: [], + Embedded_QuestionBank_StemStyle: [], + Embedded_QuestionBank_OptionStyle: [], + Embedded_QuestionBank_KnowledgePoint: [], + Embedded_QuestionBank_Difficulty: [] + }, + pading: { + start: 0, + size: 999 + } + } + app.MG.store.getProductDetail(query).then((res) => { + this.setData({ + total: res.datas.cmsDatas[0].datas.length + }) + // total.value += res.datas.cmsDatas[0].datas.length + let oldList + if (oldData) { + // 鎻愪氦杩囷紝瀛樺湪绛旈璁板綍 + oldList = oldData.find((item) => item.path == pathitem.productLinkPath).infoList + this.setData({ + submitStatus: true + }) + } + res.datas.cmsDatas[0].datas.forEach((item, index) => { + let oldObj = '' + if (oldList) oldObj = oldList.find((oldItem) => oldItem.id == item.id) + let questionObj = { + // num: index, // 棰樺彿 + id: item.id, + stem: + item.Embedded_QuestionBank_QuestionType == 'completion' + ? JSON.parse(item.Embedded_QuestionBank_Stem) + .stemTxt.replaceAll('<vacancy>', ',input,') + .split(',') + : JSON.parse(item.Embedded_QuestionBank_Stem), // 棰樺共 + answer: item.Embedded_QuestionBank_Answer, // 绛旀 + option: item.Embedded_QuestionBank_Option + ? JSON.parse(item.Embedded_QuestionBank_Option) + : '', // 閫夋嫨棰橀�夐」 + analysisCon: item.Embedded_QuestionBank_AnalysisCon, // 瑙f瀽 + questionType: item.Embedded_QuestionBank_QuestionType, // 棰樺瀷 + optionStyle: item.Embedded_QuestionBank_OptionStyle, // 閫夐」鏄剧ず绫诲瀷 + stemStyle: item.Embedded_QuestionBank_StemStyle, // 棰樺共鏄剧ず绫诲瀷 + difficulty: item.Embedded_QuestionBank_Difficulty + ? 4 - item.Embedded_QuestionBank_Difficulty + : 0, // 闅惧害绛夌骇 + userAnswer: oldObj + ? oldObj.userAnswer + : item.Embedded_QuestionBank_QuestionType == 'completion' || + item.Embedded_QuestionBank_QuestionType == 'multipleChoice' + ? [] + : '', + isRight: oldObj ? oldObj.isRight : null, + isComplete: oldObj ? oldObj.isComplete : false, + isCollect: this.data.collectList.indexOf(item.id) > -1 ? true : false, + isUnfold: '' // 鎺у埗瑙f瀽鐨勬姌鍙犻潰鏉挎槸鍚﹀睍寮� + } + // 澶氶�夊拰濉┖绛旀鑲负鏁扮粍锛岃杞崲JSON鏍煎紡 + if ( + questionObj.questionType == 'completion' || + questionObj.questionType == 'multipleChoice' + ) { + try { + questionObj.answer = JSON.parse(questionObj.answer) + } catch (error) { + questionObj.answer = item.Embedded_QuestionBank_Answer + } + } + // 濉┖棰樻敼閫� + if (questionObj.questionType == 'completion') { + let index = 0 + for (let i = 0; i < questionObj.stem.length; i++) { + const item = questionObj.stem[i] + if (item == 'input') { + questionObj.stem[i] = { + num: index, + data: 'input' + } + if (!oldObj) questionObj.userAnswer[index] = '' + index++ + } + } + } + questionArr.push(questionObj) + // 鏃ф暟鎹噷 棰樼洰宸茬粡浣滅瓟锛屼慨鏀瑰凡绛旈鐩暟閲� + // if (oldObj && oldObj.userAnswer.length > 0) countDownRef.value.changeAlready() + // 鏃ф暟鎹噷 棰樼洰姝g‘ 璁板綍姝g‘鏁伴噺 + if (questionObj.isRight) { + this.setData({ + correctNum: this.data.correctNum + 1 + }) + } + // if (pathitem.name == '鍒ゆ柇棰�') { + // topicList.value.judge.data = questionArr + // topicList.value.judge.path = pathitem.productLinkPath + // if (oldData) subjectiveTotal.value += 1 // 鏈夋棫鏁版嵁锛岃绠椾富瑙傞鏁� + // } else if (pathitem.name == '濉┖棰�') { + // topicList.value.gap.data = questionArr + // topicList.value.gap.path = pathitem.productLinkPath + // if (oldData) subjectiveTotal.value += 1 + // } else if (pathitem.name == '澶氶�夐') { + // topicList.value.check.data = questionArr + // topicList.value.check.path = pathitem.productLinkPath + // if (oldData) subjectiveTotal.value += 1 + // } else if (pathitem.name == '鍗曢�夐') { + // topicList.value.radio.data = questionArr + // topicList.value.radio.path = pathitem.productLinkPath + // if (oldData) subjectiveTotal.value += 1 + // } else if (pathitem.name == '绠�绛旈') { + // topicList.value.short.data = questionArr + // topicList.value.short.path = pathitem.productLinkPath + // } else if (pathitem.name == '缈昏瘧棰�') { + // topicList.value.translate.data = questionArr + // topicList.value.translate.path = pathitem.productLinkPath + // } else if (pathitem.name == '鍚姏棰�') { + // topicList.value.listen.data = questionArr + // topicList.value.listen.path = pathitem.productLinkPath + // if (oldData) subjectiveTotal.value += 1 + // } + let infoList = + this.data.cardList[this.data.cardList.findIndex((item) => item.path == pathitem.productLinkPath)] + .infoList + infoList.push(questionObj) + flag++; + let questionList = [] + // if (flag == this.data.idPathList.length) { + this.data.cardList.forEach(aitem => { + aitem.infoList.forEach(bitem => { + questionList.push(bitem) + bitem.number = questionList.length + }) + }) + this.setData({ + questionDataList: questionList + }) + // } + }) + }) + }) + this.setData({ + loading: false, + }) + console.log('棰樼洰鍒楄〃', this.data.questionDataList, this.data.cardList); + }, + // 鑾峰彇绛旈鏁版嵁 + getAnswerInfo(callback) { + app.MG.identity + .getUserKey({ + domain: 'answerData', + keys: [this.data.productLinkPath] + }) + .then((res) => { + if (callback) callback(res) + }) + } +}) \ No newline at end of file diff --git a/pages/bookServices/examination/examination.json b/pages/bookServices/examination/examination.json new file mode 100644 index 0000000..2365a43 --- /dev/null +++ b/pages/bookServices/examination/examination.json @@ -0,0 +1,11 @@ +{ + "usingComponents": { + "question-options": "/pages/bookServices/examination/questionOptions/index", + "question-schedule": "/pages/bookServices/examination/questionSchedule/index", + "question-list": "/pages/bookServices/examination/questionList/index", + "t-icon": "tdesign-miniprogram/icon/icon", + "t-image": "tdesign-miniprogram/image/image", + "t-button": "tdesign-miniprogram/button/button" + }, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/pages/bookServices/examination/examination.wxml b/pages/bookServices/examination/examination.wxml new file mode 100644 index 0000000..25d54f3 --- /dev/null +++ b/pages/bookServices/examination/examination.wxml @@ -0,0 +1,24 @@ +<!--pages/examination/examination.wxml--> +<!--瀵艰埅鍖哄煙 --> +<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" + /> + </view> + <view class="navbar-title">{{answerTitle}}</view> +</view> +<view class="page-content"> + <question-schedule></question-schedule> + <question-list questionList="{{questionDataList}}"></question-list> +</view> + +<!-- 搴曢儴鍖哄煙--> + +<view class="page-bottom"> + <question-options></question-options> +</view> diff --git a/pages/bookServices/examination/examination.wxss b/pages/bookServices/examination/examination.wxss new file mode 100644 index 0000000..82abb98 --- /dev/null +++ b/pages/bookServices/examination/examination.wxss @@ -0,0 +1,23 @@ +/* pages/examination/examination.wxss */ + +.nacigationBar { + display: flex; + align-items: center; +} + +.navbar-title { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + color: #0F1214; + font-size: 40rpx; + font-weight: 600; +} + +.page-content { + box-sizing: border-box; + width: 100%; + height: 78vh; + padding: 20rpx; + background-color: #F2F3F8; +} \ No newline at end of file diff --git a/pages/bookServices/examination/questionList/index.js b/pages/bookServices/examination/questionList/index.js new file mode 100644 index 0000000..75b694a --- /dev/null +++ b/pages/bookServices/examination/questionList/index.js @@ -0,0 +1,44 @@ +// pages/bookServices/examination/questionList/index.js + +const imageCdn = 'https://tdesign.gtimg.com/mobile/demos'; +const swiperList = [ + `${imageCdn}/swiper1.png`, + `${imageCdn}/swiper2.png`, + `${imageCdn}/swiper1.png`, + `${imageCdn}/swiper2.png`, + `${imageCdn}/swiper1.png`, +]; + +Component({ + /** + * 缁勪欢鐨勫睘鎬у垪琛� + */ + properties: { + questionList: { + type: Array, + value: [] + } + }, + created() { + console.log('缁勪欢浼犲弬', this.properties); + }, + /** + * 缁勪欢鐨勫垵濮嬫暟鎹� + */ + data: { + current: 2, + autoplay: true, + duration: 500, + interval: 5000, + paginationPosition: 'bottom-right', + swiperList, + navigation: { type: 'fraction' }, + }, + + /** + * 缁勪欢鐨勬柟娉曞垪琛� + */ + methods: { + + } +}) diff --git a/pages/bookServices/examination/questionList/index.json b/pages/bookServices/examination/questionList/index.json new file mode 100644 index 0000000..e44c80e --- /dev/null +++ b/pages/bookServices/examination/questionList/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "t-swiper": "tdesign-miniprogram/swiper/swiper", + "t-swiper-nav": "tdesign-miniprogram/swiper-nav/swiper-nav" + } +} \ No newline at end of file diff --git a/pages/bookServices/examination/questionList/index.wxml b/pages/bookServices/examination/questionList/index.wxml new file mode 100644 index 0000000..91ed472 --- /dev/null +++ b/pages/bookServices/examination/questionList/index.wxml @@ -0,0 +1,13 @@ +<!--pages/bookServices/examination/questionList/index.wxml--> +<view class="question-list"> + <!-- 棰樺瀷title --> + <view class="question-title"> + <text class="title-name">鍗曢�夐</text><text class="title-score">(姣忛2鍒�)</text> + </view> + <!-- 棰樼洰鍒楄〃 --> + <swiper> + <swiper-item wx:for="{{questionList}}"> + <text>{{item.stem.stemTxt}}</text> + </swiper-item> + </swiper> +</view> diff --git a/pages/bookServices/examination/questionList/index.wxss b/pages/bookServices/examination/questionList/index.wxss new file mode 100644 index 0000000..691bc42 --- /dev/null +++ b/pages/bookServices/examination/questionList/index.wxss @@ -0,0 +1,25 @@ +/* pages/bookServices/examination/questionList/index.wxss */ +.question-list { + width: 100%; + height: 90%; + padding: 20rpx; + background-color: #ffffff; + border-radius: 20rpx; + margin-top: 20rpx; +} + +.question-title { + font-size: 28rpx; + margin-bottom: 20rpx; +} + +.title-name { + padding: 6rpx; + background-color: #ff6c00; + color: #ffffff; + margin-right: 10rpx; +} + +.title-score { + color: #000; +} \ No newline at end of file diff --git a/pages/bookServices/examination/questionOptions/index.js b/pages/bookServices/examination/questionOptions/index.js new file mode 100644 index 0000000..d4fb8ec --- /dev/null +++ b/pages/bookServices/examination/questionOptions/index.js @@ -0,0 +1,23 @@ +// pages/bookServices/examination/questionOptions/index.js +Component({ + /** + * 缁勪欢鐨勫睘鎬у垪琛� + */ + properties: { + + }, + + /** + * 缁勪欢鐨勫垵濮嬫暟鎹� + */ + data: { + btnStyle: "width:320rpx;border-radius:60rpx", + }, + + /** + * 缁勪欢鐨勬柟娉曞垪琛� + */ + methods: { + + } +}) diff --git a/pages/bookServices/examination/questionOptions/index.json b/pages/bookServices/examination/questionOptions/index.json new file mode 100644 index 0000000..5a5e332 --- /dev/null +++ b/pages/bookServices/examination/questionOptions/index.json @@ -0,0 +1,8 @@ +{ + "component": true, + "usingComponents": { + "t-icon": "tdesign-miniprogram/icon/icon", + "t-image": "tdesign-miniprogram/image/image", + "t-button": "tdesign-miniprogram/button/button" + } +} \ No newline at end of file diff --git a/pages/bookServices/examination/questionOptions/index.wxml b/pages/bookServices/examination/questionOptions/index.wxml new file mode 100644 index 0000000..10464c9 --- /dev/null +++ b/pages/bookServices/examination/questionOptions/index.wxml @@ -0,0 +1,24 @@ +<!--pages/bookServices/examination/questionOptions/index.wxml--> +<view class="page-bottom"> + <view class="li-option"> + <t-image src="/static/images/bookService/examination/collect.png"></t-image> + 鏀惰棌 + </view> + <view class="li-option"> + <t-image + src="/static/images/bookService/examination/questionCard.png" + ></t-image> + 绛旈鍗� + </view> + <view class="li-option"> + <t-image src="/static/images/bookService/examination/setting.png"></t-image> + 璁剧疆 + </view> + <view class="li-option"> + <t-image src="/static/images/bookService/examination/reset.png"></t-image> + 閲嶅仛 + </view> + <view class="bottom-submit"> + <t-button theme="primary" size="large" style="{{btnStyle}}">鎻愪氦</t-button> + </view> +</view> diff --git a/pages/bookServices/examination/questionOptions/index.wxss b/pages/bookServices/examination/questionOptions/index.wxss new file mode 100644 index 0000000..baf2e8d --- /dev/null +++ b/pages/bookServices/examination/questionOptions/index.wxss @@ -0,0 +1,31 @@ +/* pages/bookServices/examination/questionOptions/index.wxss */ +.page-bottom { + display: flex; + justify-content: space-evenly; + align-items: center; + position: fixed; + bottom: 30rpx; + width: 100%; + height: 180rpx; + /* background-color: red; */ +} + +.li-option { + display: flex; + flex-direction: column; + align-items: center; + font-size: 24rpx; + color: #010101; +} + +.page-bottom image { + width: 36rpx; + height: 36rpx; +} + +.bottom-submit { + --td-button-primary-bg-color: #ff6c00; + --td-button-primary-border-color: #FF6C00; + --td-button-primary-active-bg-color: #ff984d; + --td-button-primary-active-border-color: #ff984d; +} \ No newline at end of file diff --git a/pages/bookServices/examination/questionSchedule/index.js b/pages/bookServices/examination/questionSchedule/index.js new file mode 100644 index 0000000..04dcf5d --- /dev/null +++ b/pages/bookServices/examination/questionSchedule/index.js @@ -0,0 +1,115 @@ + +// pages/bookServices/examination/questionSchedule/questionSchedule.js +Component({ + /** + * 缁勪欢鐨勫睘鎬у垪琛� + */ + properties: { + + }, + created() { + // if (props.answerType == 'option') { + // this.startCountdown() + this.setData({ + countdownTime: 2 * 60 * 60 * 1000 + }) + // } + }, + detached() { + if (this.data.countdownInterval !== null) { + clearInterval(this.data.countdownInterval) + } + }, + + /** + * 缁勪欢鐨勫垵濮嬫暟鎹� + */ + data: { + countdownInterval: null, // 璁℃椂鍣� + isCountdownRunning: true, // 鏄惁鍊掕鏃� + countdownTime: "", // 鏃堕棿 + showTime: '', + }, + observers: { + 'countdownTime': function (newValue, oldValue) { + const showTime = this.formatTime(this.data.countdownTime) + this.setData({ + showTime: showTime + }) + console.log(this.data.showTime); + } + }, + /** + * 缁勪欢鐨勬柟娉曞垪琛� + */ + methods: { + // 鏍煎紡鍖栨椂闂� + formatTime(ms) { + const hours = Math.floor((ms / (1000 * 60 * 60)) % 24) + .toString() + .padStart(2, '0') + const minutes = Math.floor((ms / (1000 * 60)) % 60) + .toString() + .padStart(2, '0') + const seconds = Math.floor((ms / 1000) % 60) + .toString() + .padStart(2, '0') + return `${hours}:${minutes}:${seconds}` + }, + // 鑾峰彇淇濆瓨鐨勫�掕鏃舵椂闂� + getSavedTime() { + const savedTime = wx.getStorageSync('countdownTime') + return savedTime ? parseInt(savedTime) : null + }, + // 淇濆瓨鍊掕鏃舵椂闂村埌鏈湴瀛樺偍 + saveTime() { + wx.setStorageSync('countdownTime', this.data.countdownTime.toString()) + }, + clearTime() { + this.setData({ + countdownTime: 2 * 60 * 60 * 1000 + }) + }, + // 鏆傚仠鎴栫户缁�掕鏃� + toggleCountdown() { + if (countdownInterval) { + clearInterval(this.data.countdownInterval) + this.setData({ + countdownInterval: null, + isCountdownRunning: false + }) + } else { + this.startCountdown() + this.setData({ + isCountdownRunning: true + }) + } + }, + // 寮�濮嬪�掕鏃� + startCountdown() { + // 濡傛灉璁℃椂鍣ㄥ凡缁忓瓨鍦紝鍏堟竻闄や箣鍓嶇殑璁℃椂鍣� + if (this.data.countdownInterval) { + clearInterval(this.data.countdownInterval) + this.setData({ + countdownInterval: null + }) + } + this.setData({ + countdownInterval: setInterval(() => { + this.setData({ + countdownTime: this.data.countdownTime - 1000 + }) + if (this.data.countdownTime <= 0) { + clearInterval(this.data.countdownInterval) + this.setData({ + countdownTime: 0, + isCountdownRunning: false + }) + } + this.saveTime() + }, 1000) + }) + + } + } +}) diff --git a/pages/bookServices/examination/questionSchedule/index.json b/pages/bookServices/examination/questionSchedule/index.json new file mode 100644 index 0000000..880ce46 --- /dev/null +++ b/pages/bookServices/examination/questionSchedule/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "t-progress": "tdesign-miniprogram/progress/progress" + } +} \ No newline at end of file diff --git a/pages/bookServices/examination/questionSchedule/index.wxml b/pages/bookServices/examination/questionSchedule/index.wxml new file mode 100644 index 0000000..59cd07d --- /dev/null +++ b/pages/bookServices/examination/questionSchedule/index.wxml @@ -0,0 +1,11 @@ +<!--pages/bookServices/examination/questionSchedule/questionSchedule.wxml--> +<view class="schedule"> + <view class="schedule-top"> + <view class="question-schedule">绛旈杩涘害<text class="parimary-color question-num">1</text> <text>/18</text></view> + <view class="remainder">鍓╀綑鏃堕棿 <text class="parimary-color">{{showTime}}</text></view> + </view> + <view class="schedule-progress"> + <t-progress percentage="80" color="#ff6c00" label="" /> + </view> + +</view> \ No newline at end of file diff --git a/pages/bookServices/examination/questionSchedule/index.wxss b/pages/bookServices/examination/questionSchedule/index.wxss new file mode 100644 index 0000000..c806b93 --- /dev/null +++ b/pages/bookServices/examination/questionSchedule/index.wxss @@ -0,0 +1,32 @@ +/* pages/bookServices/examination/questionSchedule/questionSchedule.wxss */ +.schedule { + background-color: #ffffff; + padding: 20rpx; + font-size: 28rpx; + border-radius: 20rpx; +} + +.schedule-top { + display: flex; + justify-content: space-between; +} + +.question-schedule { + color: #000; +} + +.schedule-progress { + margin-top: 20rpx; +} + +.remainder { + color: #545C63; +} + +.parimary-color { + color: #ff6c00; +} + +.question-num { + margin-left: 10rpx; +} \ No newline at end of file diff --git a/pages/bookServices/list/index.js b/pages/bookServices/list/index.js index 890c3b9..ccb63b6 100644 --- a/pages/bookServices/list/index.js +++ b/pages/bookServices/list/index.js @@ -9,7 +9,11 @@ searchValue: '', path: '', pathList: [], - page: 1, + pageCount: { + page: 1, + total: 0, + }, + isMore: null, assortCheck: { name: '', code: '', @@ -135,6 +139,24 @@ */ onReachBottom(e) { console.log('搴曢儴'); + const flag = this.data.bookList.length < this.data.pageCount.total + if (flag) { + this.setData({ + isMore: true, + "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('娌℃湁鏇村浜�'); + } }, /** @@ -299,8 +321,8 @@ height: 145, }, paging: { - start: (this.data.page - 1) * 16, - size: 16, + start: 0, + size: this.data.pageCount.page * 8, }, fields: { author: [], @@ -313,8 +335,10 @@ app.MG.store.getProductList(query).then((res) => { this.setData({ bookList: res.datas, - enable: false + enable: false, + "pageCount.total": res.total }); + console.log('鍥句功鍒楄〃', res, this.data.pageCount); }); }, // 涓�绾у垎绫诲垏鎹� diff --git a/pages/bookServices/list/index.json b/pages/bookServices/list/index.json index 8b16d4b..32e63d7 100644 --- a/pages/bookServices/list/index.json +++ b/pages/bookServices/list/index.json @@ -5,8 +5,8 @@ "t-icon": "tdesign-miniprogram/icon/icon", "t-image": "tdesign-miniprogram/image/image", "t-search": "tdesign-miniprogram/search/search", - "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh" + "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh", + "t-loading": "tdesign-miniprogram/loading/loading" }, - "navigationStyle": "custom", - "onReachBottomDistance": 250 + "navigationStyle": "custom" } \ No newline at end of file diff --git a/pages/bookServices/list/index.wxml b/pages/bookServices/list/index.wxml index 4082e4d..945b0d3 100644 --- a/pages/bookServices/list/index.wxml +++ b/pages/bookServices/list/index.wxml @@ -27,7 +27,7 @@ </view> </view> <t-pull-down-refresh value="{{enable}}" loadingProps="{{loadingProps}}" loadingTexts="{{['涓嬫媺鍒锋柊', '鏉炬墜鍒锋柊', '姝e湪鍒锋柊', '鍒锋柊瀹屾垚']}}" bind:refresh="onRefresh"> - <scroll-view scroll-y="{{true}}" class="list-container"> + <scroll-view scroll-y="{{true}}" class="list-container" bindrefresherrefresh="onPullDownRefresh" bindscrolltolower="onReachBottom"> <view class="assort-title"> <view class="title-box"></view> <view class="title-name">{{assortCheck.name}}</view> @@ -41,6 +41,10 @@ <view class="book-author book-color">{{item.author}}</view> </view> </view> + <view class="bottom-box"> + <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> + </view> </scroll-view> </t-pull-down-refresh> </view> \ No newline at end of file diff --git a/pages/bookServices/list/index.wxss b/pages/bookServices/list/index.wxss index 4e86439..f708171 100644 --- a/pages/bookServices/list/index.wxss +++ b/pages/bookServices/list/index.wxss @@ -39,7 +39,7 @@ .list-container { height: 80vh; margin-top: 20rpx; - background-color: #fff; + /* background-color: #fff; */ } .assort-title { @@ -69,7 +69,7 @@ .book-box { box-sizing: border-box; width: 48%; - background-color: #f7f7f7; + background-color: #fff; display: flex; flex-direction: column; align-items: center; @@ -93,6 +93,7 @@ .book-name { margin-top: 24rpx; + color: #333; width: 100%; font-size: 28rpx; font-weight: 700; @@ -101,15 +102,25 @@ -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; - text-align: center; + text-align: left; } .book-author { + color: #333; margin-top: 16rpx; width: 100%; font-size: 24rpx; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - text-align: center; + text-align: left; +} + +.bottom-box { + display: flex; + justify-content: center; + color: #999; + height: 80rpx; + font-size: 28rpx; + --td-loading-color: #ff6c00 } \ No newline at end of file diff --git a/static/images/bookService/detail/cart.png b/static/images/bookService/detail/cart.png new file mode 100644 index 0000000..7c47503 --- /dev/null +++ b/static/images/bookService/detail/cart.png Binary files differ diff --git a/static/images/bookService/detail/compliceHover.png b/static/images/bookService/detail/compliceHover.png new file mode 100644 index 0000000..b54b8d1 --- /dev/null +++ b/static/images/bookService/detail/compliceHover.png Binary files differ diff --git a/static/images/bookService/detail/cuoti.png b/static/images/bookService/detail/cuoti.png new file mode 100644 index 0000000..957f39b --- /dev/null +++ b/static/images/bookService/detail/cuoti.png Binary files differ diff --git a/static/images/bookService/detail/deleteHover.png b/static/images/bookService/detail/deleteHover.png new file mode 100644 index 0000000..508a5ca --- /dev/null +++ b/static/images/bookService/detail/deleteHover.png Binary files differ diff --git a/static/images/bookService/detail/edit.png b/static/images/bookService/detail/edit.png new file mode 100644 index 0000000..92eabc6 --- /dev/null +++ b/static/images/bookService/detail/edit.png Binary files differ diff --git a/static/images/bookService/detail/feedback.png b/static/images/bookService/detail/feedback.png new file mode 100644 index 0000000..666e540 --- /dev/null +++ b/static/images/bookService/detail/feedback.png Binary files differ diff --git a/static/images/bookService/detail/makeNote.png b/static/images/bookService/detail/makeNote.png new file mode 100644 index 0000000..a8656d1 --- /dev/null +++ b/static/images/bookService/detail/makeNote.png Binary files differ diff --git a/static/images/bookService/detail/note-icon.png b/static/images/bookService/detail/note-icon.png new file mode 100644 index 0000000..79983be --- /dev/null +++ b/static/images/bookService/detail/note-icon.png Binary files differ diff --git a/static/images/bookService/detail/practice-icon.png b/static/images/bookService/detail/practice-icon.png new file mode 100644 index 0000000..77fd505 --- /dev/null +++ b/static/images/bookService/detail/practice-icon.png Binary files differ diff --git a/static/images/bookService/detail/wodeshoucang.png b/static/images/bookService/detail/wodeshoucang.png new file mode 100644 index 0000000..7b11cda --- /dev/null +++ b/static/images/bookService/detail/wodeshoucang.png Binary files differ diff --git a/static/images/bookService/detail/zujuan.png b/static/images/bookService/detail/zujuan.png new file mode 100644 index 0000000..7105f1b --- /dev/null +++ b/static/images/bookService/detail/zujuan.png Binary files differ diff --git a/static/images/bookService/examination/collect.png b/static/images/bookService/examination/collect.png new file mode 100644 index 0000000..7a94c22 --- /dev/null +++ b/static/images/bookService/examination/collect.png Binary files differ diff --git a/static/images/bookService/examination/questionCard.png b/static/images/bookService/examination/questionCard.png new file mode 100644 index 0000000..3ba2376 --- /dev/null +++ b/static/images/bookService/examination/questionCard.png Binary files differ diff --git a/static/images/bookService/examination/reset.png b/static/images/bookService/examination/reset.png new file mode 100644 index 0000000..8787b21 --- /dev/null +++ b/static/images/bookService/examination/reset.png Binary files differ diff --git a/static/images/bookService/examination/setting.png b/static/images/bookService/examination/setting.png new file mode 100644 index 0000000..457c4f4 --- /dev/null +++ b/static/images/bookService/examination/setting.png Binary files differ -- Gitblit v1.9.1