From 14de3e90ae29af2ccfd51b08c6a11ab02fe8f8e7 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期二, 05 三月 2024 19:02:35 +0800 Subject: [PATCH] feat(合并代码): 和冰帝阿 --- pages/bookServices/detail/components/learnResource/learnResource.js | 23 static/images/bookService/detail/pdf.png | 0 static/images/bookService/detail/download-icon.png | 0 pages/bookServices/detail/components/learnResource/learnResource.json | 7 pages/bookServices/list/index.wxml | 70 -- pages/bookServices/detail/components/teachResource/index.wxml | 31 + static/images/bookService/detail/net.png | 0 pages/bookServices/assort/index.js | 12 pages/bookServices/detail/components/teachResource/index.wxss | 77 +++ static/images/bookService/detail/PPT.png | 0 pages/bookServices/list/index.js | 54 + static/images/bookService/detail/video.png | 0 static/images/bookService/detail/word.png | 0 pages/bookServices/detail/components/suggest/suggest.wxss | 59 ++ pages/bookServices/detail/index.js | 552 ++++++++++++++++++++++ pages/bookServices/detail/components/suggest/suggest.wxml | 10 static/images/bookService/detail/need-buy.png | 0 pages/bookServices/detail/components/tree/index.wxss | 61 ++ pages/bookServices/detail/components/tree/index.wxml | 65 ++ static/images/bookService/detail/picture.png | 0 pages/bookServices/detail/components/suggest/suggest.json | 9 static/images/bookService/detail/renwudan/icon.png | 0 pages/bookServices/detail/components/learnResource/learnResource.wxss | 24 + pages/bookServices/detail/index.wxml | 100 +-- static/images/bookService/detail/yijiangoumai.png | 0 pages/bookServices/detail/components/learnResource/learnResource.wxml | 15 pages/bookServices/detail/index.wxss | 36 + static/images/bookService/detail/shikan.png | 0 static/images/bookService/detail/upload.png | 0 static/images/bookService/detail/zip.png | 0 pages/bookServices/detail/components/teachResource/index.js | 37 + static/images/bookService/detail/yijianlingqu.png | 0 pages/bookServices/list/index.json | 8 pages/bookServices/detail/components/teachResource/index.json | 8 pages/bookServices/detail/components/suggest/suggest.js | 38 + pages/bookServices/detail/components/brief/index.wxml | 16 pages/bookServices/detail/components/brief/index.wxss | 2 static/images/bookService/detail/download.png | 0 pages/bookServices/detail/index.json | 11 static/images/bookService/detail/excel.png | 0 pages/bookServices/detail/components/tree/index.json | 12 static/images/bookService/detail/audioIcon.png | 0 pages/bookServices/detail/components/tree/index.js | 67 ++ 43 files changed, 1,234 insertions(+), 170 deletions(-) diff --git a/pages/bookServices/assort/index.js b/pages/bookServices/assort/index.js index 024fe3d..dd4b99b 100644 --- a/pages/bookServices/assort/index.js +++ b/pages/bookServices/assort/index.js @@ -27,7 +27,7 @@ /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 */ - onReady() {}, + onReady() { }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず @@ -39,27 +39,27 @@ /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌 */ - onHide() {}, + onHide() { }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇 */ - onUnload() {}, + onUnload() { }, /** * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔 */ - onPullDownRefresh() {}, + onPullDownRefresh() { }, /** * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� */ - onReachBottom() {}, + onReachBottom() { }, /** * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� */ - onShareAppMessage() {}, + onShareAppMessage() { }, // 鑾峰彇渚ц竟鏍忓垪琛� getAssortList() { diff --git a/pages/bookServices/detail/components/brief/index.wxml b/pages/bookServices/detail/components/brief/index.wxml index 77b7c89..4f3471a 100644 --- a/pages/bookServices/detail/components/brief/index.wxml +++ b/pages/bookServices/detail/components/brief/index.wxml @@ -1,17 +1,14 @@ <view class="message"> - <view class="basic"> + <view class="basic" wx:if="{{content}}"> <view class="basic-title"> <view> <t-image src="/static/images/bookService/detail/label.png"></t-image> </view> <view class="title-name">鍩烘湰淇℃伅</view> </view> - <rich-text - nodes="{{content}}" - style="font-size: 28rpx; color: #333; line-height: 48rpx; text-align: justify" - ></rich-text> + <rich-text nodes="{{content}}" style="font-size: 28rpx; color: #333; line-height: 48rpx; text-align: justify"></rich-text> </view> - <view class="basic"> + <view class="basic" wx:if="{{authorIntroduction}}"> <view class="basic-title"> <view> <t-image src="/static/images/bookService/detail/author.png"></t-image> @@ -19,8 +16,5 @@ <view class="title-name">浣滆�呯畝浠�</view> </view> </view> - <rich-text - nodes="{{authorIntroduction}}" - style="font-size: 28rpx; color: #333; line-height: 48rpx; text-align: justify" - /> -</view> + <rich-text nodes="{{authorIntroduction}}" style="font-size: 28rpx; color: #333; line-height: 48rpx; text-align: justify" /> +</view> \ No newline at end of file diff --git a/pages/bookServices/detail/components/brief/index.wxss b/pages/bookServices/detail/components/brief/index.wxss index 57980bf..5d5235f 100644 --- a/pages/bookServices/detail/components/brief/index.wxss +++ b/pages/bookServices/detail/components/brief/index.wxss @@ -1,8 +1,10 @@ /* pages/bookServices/detail/components/brief/index.wxss */ .message { padding: 0 40rpx 40rpx 40rpx; + min-height: 550rpx; } + .message image { width: 42rpx; height: 48rpx; diff --git a/pages/bookServices/detail/components/learnResource/learnResource.js b/pages/bookServices/detail/components/learnResource/learnResource.js new file mode 100644 index 0000000..8d30b76 --- /dev/null +++ b/pages/bookServices/detail/components/learnResource/learnResource.js @@ -0,0 +1,23 @@ +// pages/bookServices/detail/components/learnResource/learnResource.js +Component({ + /** + * 缁勪欢鐨勫睘鎬у垪琛� + */ + properties: { + + }, + + /** + * 缁勪欢鐨勫垵濮嬫暟鎹� + */ + data: { + + }, + + /** + * 缁勪欢鐨勬柟娉曞垪琛� + */ + methods: { + + } +}) diff --git a/pages/bookServices/detail/components/learnResource/learnResource.json b/pages/bookServices/detail/components/learnResource/learnResource.json new file mode 100644 index 0000000..b28dd89 --- /dev/null +++ b/pages/bookServices/detail/components/learnResource/learnResource.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "t-image": "tdesign-miniprogram/image/image", + "t-button": "tdesign-miniprogram/button/button" + } +} \ No newline at end of file diff --git a/pages/bookServices/detail/components/learnResource/learnResource.wxml b/pages/bookServices/detail/components/learnResource/learnResource.wxml new file mode 100644 index 0000000..3a76308 --- /dev/null +++ b/pages/bookServices/detail/components/learnResource/learnResource.wxml @@ -0,0 +1,15 @@ +<!--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-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-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-image src="/static/images/bookService/detail/renwudan锛廼con.png"></t-image> + 瀛︿範浠诲姟鍗� + </t-button> +</view> \ No newline at end of file diff --git a/pages/bookServices/detail/components/learnResource/learnResource.wxss b/pages/bookServices/detail/components/learnResource/learnResource.wxss new file mode 100644 index 0000000..03e91bf --- /dev/null +++ b/pages/bookServices/detail/components/learnResource/learnResource.wxss @@ -0,0 +1,24 @@ +/* pages/bookServices/detail/components/learnResource/learnResource.wxss */ +.learnResource { + padding: 40rpx 0; + width: 100%; + display: flex; + justify-content: space-evenly; + border-bottom: 1px solid #EFF0F1; +} + +.btn { + width: 232rpx; + font-size: 28rpx; + --td-button-primary-bg-color: #fff; + --td-button-primary-border-color: #FF6C00; + --td-button-primary-color: #ff6c00; + padding: 0; + display: flex; + align-items: center; +} + +.btn image { + width: 28rpx; + height: 32rpx; +} \ No newline at end of file diff --git a/pages/bookServices/detail/components/suggest/suggest.js b/pages/bookServices/detail/components/suggest/suggest.js new file mode 100644 index 0000000..d74c397 --- /dev/null +++ b/pages/bookServices/detail/components/suggest/suggest.js @@ -0,0 +1,38 @@ +// pages/bookServices/detail/components/suggest/suggest.js +Component({ + /** + * 缁勪欢鐨勫睘鎬у垪琛� + */ + properties: { + + }, + + data: { + dialogKey: '', + showWithInput: false, + showTextAndTitleWithInput: false, + inputvalue: '', + textvalue: '', + ratevalue: 0, + }, + methods: { + showDialog(e) { + this.setData({ + showWithInput: true + }) + }, + + closeDialog() { + this.setData({ + showWithInput: false + }) + }, + // 璇勫垎鏀瑰彉 + onChangeRate(e) { + const { value } = e.detail; + this.setData({ + ratevalue: value + }); + }, + }, +}) diff --git a/pages/bookServices/detail/components/suggest/suggest.json b/pages/bookServices/detail/components/suggest/suggest.json new file mode 100644 index 0000000..941c25a --- /dev/null +++ b/pages/bookServices/detail/components/suggest/suggest.json @@ -0,0 +1,9 @@ +{ + "component": true, + "usingComponents": { + "t-dialog": "tdesign-miniprogram/dialog/dialog", + "t-input": "tdesign-miniprogram/input/input", + "t-textarea": "tdesign-miniprogram/textarea/textarea", + "t-rate": "tdesign-miniprogram/rate/rate" + } +} \ No newline at end of file diff --git a/pages/bookServices/detail/components/suggest/suggest.wxml b/pages/bookServices/detail/components/suggest/suggest.wxml new file mode 100644 index 0000000..c567a62 --- /dev/null +++ b/pages/bookServices/detail/components/suggest/suggest.wxml @@ -0,0 +1,10 @@ +<t-dialog visible="{{showWithInput}}" title="鎴戣寤鸿" confirm-btn="纭畾" cancel-btn="鍙栨秷" bind:confirm="closeDialog" bind:cancel="closeDialog" class="suggest-dialog"> + <view slot="content"> + <view class="demo-rate"> + <view class="demo-rate__title">瀹炲績璇勫垎</view> + <t-rate value="{{ratevalue}}" bind:change="onChangeRate" /> + </view> + <t-input clearable value="{{inputvalue}}" slot="content" label="鑱旂郴鏂瑰紡" placeholder="璇疯緭鍏ヨ仈绯绘柟寮�" placeholder-class="placeholder" /> + <t-textarea value="{{textvalue}}" t-class="external-class" label="鏍囩鏂囧瓧" placeholder="璁剧疆鏈�澶у瓧绗︿釜鏁帮紝涓�涓眽瀛楄〃绀轰袱涓瓧绗�" maxcharacter="200" disableDefaultPadding="{{true}}" indicator /> + </view> +</t-dialog> \ No newline at end of file diff --git a/pages/bookServices/detail/components/suggest/suggest.wxss b/pages/bookServices/detail/components/suggest/suggest.wxss new file mode 100644 index 0000000..0f1b799 --- /dev/null +++ b/pages/bookServices/detail/components/suggest/suggest.wxss @@ -0,0 +1,59 @@ +/* pages/bookServices/detail/components/suggest/suggest.wxss */ +.suggest-dialog { + --td-dialog-close-color: #666 +} + +.t-class-content { + height: 400px; +} + + +.wrapper { + margin-bottom: 32rpx; +} + +.placeholder { + color: rgba(0, 0, 0, 0.26); + line-height: 96rpx; + height: 96rpx !important; + display: flex; + align-items: center; +} + +.dialog-input { + padding-top: 12px; + padding-bottom: 12px; + text-align: left; + margin-top: 32rpx; + border-radius: 8rpx; + background-color: #f3f3f3; + box-sizing: border-box; +} + +.placeholder { + color: rgba(0, 0, 0, 0.4); + 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; +} + +.demo-rate__transparent { + background-color: transparent; + padding-left: 32rpx; + border: 0; +} \ No newline at end of file diff --git a/pages/bookServices/detail/components/teachResource/index.js b/pages/bookServices/detail/components/teachResource/index.js new file mode 100644 index 0000000..37b0645 --- /dev/null +++ b/pages/bookServices/detail/components/teachResource/index.js @@ -0,0 +1,37 @@ +Component({ + properties: { + applyState: { + type: String, + value: 'none' + }, + rejectCause: { + type: String, + value: '' + } + }, + data: { + showRejectDialog: false, + confirmBtn: { content: '鐭ラ亾浜�', variant: 'base' }, + }, + methods: { + applyResource() { + var myEventDetail = {} // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟 + var myEventOption = { + bubbles: true, + composed: true, + // capturePhase: true, + } // 瑙﹀彂浜嬩欢鐨勯�夐」 + this.triggerEvent('applyResource', myEventDetail, myEventOption) + }, + showDialog() { + this.setData({ + showRejectDialog: true + }) + }, + closeDialog() { + this.setData({ + showRejectDialog: false + }) + } + } +}) \ No newline at end of file diff --git a/pages/bookServices/detail/components/teachResource/index.json b/pages/bookServices/detail/components/teachResource/index.json new file mode 100644 index 0000000..338cd87 --- /dev/null +++ b/pages/bookServices/detail/components/teachResource/index.json @@ -0,0 +1,8 @@ +{ + "component": true, + "usingComponents": { + "t-image": "tdesign-miniprogram/image/image", + "t-button": "tdesign-miniprogram/button/button", + "t-dialog": "tdesign-miniprogram/dialog/dialog" + } +} \ No newline at end of file diff --git a/pages/bookServices/detail/components/teachResource/index.wxml b/pages/bookServices/detail/components/teachResource/index.wxml new file mode 100644 index 0000000..3f589f2 --- /dev/null +++ b/pages/bookServices/detail/components/teachResource/index.wxml @@ -0,0 +1,31 @@ +<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> + 涓婁紶璧勬簮 + </t-button> + <t-button theme="primary" style="width: 120px; height: 36px;"> + <t-image src="/static/images/bookService/detail/download.png"></t-image> + 鎵归噺涓嬭浇 + </t-button> +</view> +<view class="applyResult {{applyState == 'none' ? 'applyNone' : applyState == 'Normal' ? 'applyPass' : applyState == 'WaitAudit' ? 'applying' :applyState == 'Reject' ? 'applyReject' :'' }}"> + <view wx:if="{{applyState == 'WaitAudit'}}">璧勬簮涓嬭浇鐢宠姝e湪瀹℃牳涓紝璇疯�愬績绛夊緟锛�</view> + <view wx:if="{{applyState == 'Normal'}}"> + 璧勬簮涓嬭浇鐢宠宸查�氳繃<text wx:if="{{deadline}}">锛屾湁鏁堟棩鏈熸埅鑷筹細{{ deadline }}</text> + </view> + <view wx:if="{{applyState == 'Reject'}}">璧勬簮涓嬭浇闇�瑕佺敵璇凤紝璇峰厛鐢宠骞剁瓑寰呭鏍搁�氳繃鍚庢柟鍙笅杞�</view> + <view wx:if="{{applyState == 'none'}}"> + 璧勬簮涓嬭浇闇�瑕佺敵璇凤紝璇峰厛鐢宠骞剁瓑寰呭鏍搁�氳繃鍚庢柟鍙笅杞� + </view> + <view class="btn-box"> + <t-button wx:if="{{applyState == 'Reject'}}" bind:tap="checkCause" style="height: 50rpx;" class="rejectBtn" bind:tap="showDialog">鏌ョ湅鍘熷洜</t-button> + <t-button wx:if="{{applyState == 'none' || applyState == 'Reject'}}" theme="primary" bind:tap="applyResource" class="applyBtn" style="height: 50rpx;">鐢宠</t-button> + </view> +</view> +<!-- 鏈�氳繃鍘熷洜 --> +<t-dialog visible="{{showRejectDialog}}" title="鎻愮ず" confirm-btn="{{ confirmBtn }}" bind:confirm="closeDialog"> + <view slot="content"> + <text class="cause-title">璧勬簮涓嬭浇鐢宠鏈�氳繃锛岃В鍐抽棶棰樺悗鍙偣鍑烩�滅敵璇封�濇寜閽噸鏂版彁浜ょ敵璇�</text> + <view class="cause-content">鍘熷洜:{{ rejectCause }}</view> + </view> +</t-dialog> \ No newline at end of file diff --git a/pages/bookServices/detail/components/teachResource/index.wxss b/pages/bookServices/detail/components/teachResource/index.wxss new file mode 100644 index 0000000..42a38a2 --- /dev/null +++ b/pages/bookServices/detail/components/teachResource/index.wxss @@ -0,0 +1,77 @@ +.teach-btn { + display: flex; + justify-content: flex-end; + align-items: center; + height: 134rpx; + --td-button-primary-bg-color: #fff; + --td-button-primary-border-color: #FF6C00; + --td-button-primary-color: #ff6c00; +} + +.teach-btn image { + width: 32rpx; + height: 32rpx; + margin-right: 6rpx; +} + +.teach-btn .t-button__content { + display: flex; + align-items: center; +} + +.applyResult { + padding: 0 10rpx; + width: 740rpx; + height: 80rpx; + display: flex; + align-items: center; + margin: 0 auto; + font-size: 24rpx; +} + +.applyNone { + background-color: rgba(255, 108, 0, 0.06); + color: #ff6C00; +} + +.applyReject { + background-color: rgba(238, 24, 24, 0.16); + border: 1px solid #ee1818; +} + +.applyPass { + background-color: rgba(0, 128, 0, 0.16); + border: 1px solid green; +} + +.applying { + background-color: #fff2e9; + border: 1px solid #ff6c00; +} + +.btn-box { + display: flex; +} + +.applyBtn { + margin-left: 20rpx; + width: 92rpx; + height: 50rpx; + --td-button-font-size: 24rpx; + --td-button-border-radius: 10rpx; + --td-button-primary-bg-color: #ff6c00; + --td-button-primary-border-color: #FF6C00; + --td-button-primary-text-active-bg-color: #000锛� +} + +.rejectBtn { + width: 150rpx; +} + +.cause-title { + color: #FF6C00; +} + +.cause-content { + line-height: 40rpx; +} \ No newline at end of file diff --git a/pages/bookServices/detail/components/tree/index.js b/pages/bookServices/detail/components/tree/index.js new file mode 100644 index 0000000..b0107f9 --- /dev/null +++ b/pages/bookServices/detail/components/tree/index.js @@ -0,0 +1,67 @@ +import Message from 'tdesign-miniprogram/message/message'; +const app = getApp() +Component({ + properties: { + treeList: { + type: Array, + value: [] + }, + buyIds: { + type: Array, + value: [] + }, + tab: { + type: String, + value: '' + }, + applyState: { + type: String, + value: '' + } + }, + data: { + activeValues: [0] + }, + onShow() { + + }, + methods: { + // 鑺傜偣灞曞紑 + handleChange(e) { + this.setData({ + activeValues: e.detail.value, + }); + console.log('浼犻��', this.properties.buyIds); + }, + handleCheck(data) { + for (let index = 0; index < data.length; index++) { + const element = data[index]; + element.checked = true + if (element.childrenCount && element.type == "productFolder") { + handleCheck(element.children) + } + } + }, + downloadTeach(e) { + console.log('鐐瑰嚮浜�', e); + const value = e.currentTarget.dataset.value + var myEventDetail = { + value, + } // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟 + var myEventOption = { + bubbles: true, + composed: true + } // 瑙﹀彂浜嬩欢鐨勯�夐」 + this.triggerEvent('downloadTeach', myEventDetail, myEventOption) + }, + // 鍒ゆ柇璧勬簮鏄惁璐拱 +resourceIsBuy (data) { + if (data.saleMethod && data.saleMethod.length) { + const isSHow = buyIdList.value.some((item) => item == data.saleMethod[0].Id) + return !isSHow + } else { + return false + } +} + } +}) \ No newline at end of file diff --git a/pages/bookServices/detail/components/tree/index.json b/pages/bookServices/detail/components/tree/index.json new file mode 100644 index 0000000..d1ab1ff --- /dev/null +++ b/pages/bookServices/detail/components/tree/index.json @@ -0,0 +1,12 @@ +{ + "component": true, + "usingComponents": { + "t-icon": "tdesign-miniprogram/icon/icon", + "t-image": "tdesign-miniprogram/image/image", + "t-collapse": "tdesign-miniprogram/collapse/collapse", + "t-collapse-panel": "tdesign-miniprogram/collapse-panel/collapse-panel", + "t-button": "tdesign-miniprogram/button/button", + "t-checkbox": "tdesign-miniprogram/checkbox/checkbox", + "tree": "/pages/bookServices/detail/components/tree/index" + } +} \ No newline at end of file diff --git a/pages/bookServices/detail/components/tree/index.wxml b/pages/bookServices/detail/components/tree/index.wxml new file mode 100644 index 0000000..d58d148 --- /dev/null +++ b/pages/bookServices/detail/components/tree/index.wxml @@ -0,0 +1,65 @@ +<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> + <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> + <text>{{item.name}}</text> + </view> + <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"> + <!-- 鏁欏璧勬簮 浜戝涔� 鍥炬爣 --> + <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> + <!-- 鏁欏璧勬簮鍥炬爣 --> + <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" /> + </view> + <!-- 浜戝涔犲浘鏍� --> + <view> + + </view> + <!-- 鍚嶇О --> + <text class="name">{{citem.name}}</text> + </view> + <!-- 鏁欏璧勬簮绫诲瀷 --> + <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> + </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> + </view> + </view> + </view> + </view> + <!-- // 鍒ゆ柇 涓嶆槸鍟嗗搧 鏈夊瓙椤� 閫掑綊缁勪欢 --> + <tree wx:else treeList="{{[citem]}}" itemId="{{itemId}}"></tree> + </view> + <view class="listItems" wx:if="{{children.length <= 0 && !loading}}"> + 鏆傛棤鏁版嵁 + </view> + <view class="loading" wx:if="{{loading}}"> + <t-loading theme="circular" size="40rpx" class="wrapper" /> + </view> + </t-collapse-panel> + </t-collapse> +</view> \ No newline at end of file diff --git a/pages/bookServices/detail/components/tree/index.wxss b/pages/bookServices/detail/components/tree/index.wxss new file mode 100644 index 0000000..26aebde --- /dev/null +++ b/pages/bookServices/detail/components/tree/index.wxss @@ -0,0 +1,61 @@ +.tree { + --td-collapse-content-padding: 32rpx 12rpx 32rpx 32rpx; +} + +.header-title { + display: flex; + align-items: center; + --td-checkbox-vertical-padding: 0 +} + +.t-class-content { + padding: 0; +} + +.contentBox { + padding: 0 26rpx; + height: 88rpx; + background-color: #FFF6F0; + margin-top: 24rpx; + display: flex; + align-items: center; + justify-content: space-between; +} + +.contentBox .checkBox { + --td-checkbox-vertical-padding: 0; + --td-checkbox-bg-color: #FFF6F0; +} + +.box-image { + width: 350rpx; + display: flex; +} + +.box-image image { + width: 44rpx; + height: 44rpx; + margin-right: 8rpx; +} + +.contentBox .box-image .name { + width: 300rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.teachClass { + color: #949494; +} + +.teach-btn { + display: flex; + align-items: center; +} + +.testSee, +.need-buy { + width: 38rpx; + height: 38rpx; +} \ No newline at end of file diff --git a/pages/bookServices/detail/index.js b/pages/bookServices/detail/index.js index 324478a..e99bb9c 100644 --- a/pages/bookServices/detail/index.js +++ b/pages/bookServices/detail/index.js @@ -1,5 +1,5 @@ // pages/bookServices/detail/index.js -import Message from 'tdesign-miniprogram/message/index'; +import Message from 'tdesign-miniprogram/message/index.js'; const app = getApp(); Page({ /** @@ -19,8 +19,30 @@ dang: '', micro: '', }, + tabValue: 'brief', + cmsDatas: [], // 璧勬簮refCode鍒楄〃 + ids: [1], + list: [], + teachResources: [], + teach: [], + learn: [], + openTeachids: [], + openLearnids: [], + resourceClassList: [], // 璧勬簮鎵�灞炲垎绫� + applyState: "", // 鏁欏璧勬簮鐢宠鐘舵�� + deadline: "", // 鏁欏璧勬簮鐢宠鏈夋晥鏃ユ湡 + rejectCause: "", // 涓嬭浇鎷掔粷鍘熷洜 + buyIdList: [], + shoppingCartGetId: [], // 宸茶喘涔癷d鍒楄〃 + shoppingList: [] }, + resetTree: function (e) { + this.setData({ + currentCheck: e.detail.checkedItem, + list: e.detail.changeList + }) + }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ @@ -39,42 +61,49 @@ }, }); this.getBookInfo(options.id); + this.getResourceClass() // 鑾峰彇璧勬簮鎵�灞炲垎绫� + this.getApplyInfo(options.id) + if (wx.getAccountInfoSync('jsek-token')) { + this.getShoppingCartProductGet() + } }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 */ - onReady() {}, + onReady() { + + }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず */ - onShow() {}, + onShow() { }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌 */ - onHide() {}, + onHide() { }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇 */ - onUnload() {}, + onUnload() { }, /** * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔 */ - onPullDownRefresh() {}, + onPullDownRefresh() { }, /** * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� */ - onReachBottom() {}, + onReachBottom() { }, /** * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� */ - onShareAppMessage() {}, + onShareAppMessage() { }, // 鏍煎紡鍖栨棩鏈� formatDate(dateString) { if (!dateString) { @@ -169,8 +198,9 @@ app.MG.store.getProductDetail(query).then((res) => { this.setData({ bookDetail: res.datas, + cmsDatas: res.datas.cmsDatas[0].datas, + buyIdList: res.datas.purchasedSaleMethodIdList }); - console.log('璇︽儏', res.datas); // 鑾峰彇鍥句功鍒嗙被 const iconType = JSON.parse(res.datas.bookClassification)[0][0]; const classType = JSON.parse(res.datas.bookClassification)[0][1]; @@ -211,12 +241,14 @@ linkType: 'FavoriteBookCity', }) .then(() => { - this.data.bookDetail.isFavourite = false; + this.setData({ + 'bookDetail.isFavourite': false + }) Message.success({ context: this, - offset: ['20rpx', '32rpx'], - duration: 2000, - content: '鍙栨秷鏀惰棌', + offset: [20, 32], + duration: 5000, + content: '杩欐槸涓�鏉℃垚鍔熺殑鎻愮ず娑堟伅', }); }); } else { @@ -225,8 +257,9 @@ linkType: 'FavoriteBookCity', }; app.MG.store.addProductLink(params).then((res) => { - console.log(res); - this.data.bookDetail.isFavourite = true; + this.setData({ + 'bookDetail.isFavourite': true + }) Message.success({ context: this, offset: ['20rpx', '32rpx'], @@ -236,6 +269,11 @@ }); } }, + // 鎴戣寤鸿 + suggestBtn() { + const child = this.selectComponent('#suggest-component') + child.showDialog() + }, // 璺宠浆缃戝簵 goShop(e) { const { link } = e.currentTarget.dataset; @@ -243,4 +281,486 @@ url: link, }); }, -}); + onTabsChange(e) { + this.setData({ + tabValue: e.detail.value + }) + if (e.detail.label == '鏁欏璧勬簮' || e.detail.label == '浜戝涔�' || e.detail.label == '浜戞祴璇�') { + const checkData = this.data.cmsDatas.find(item => item.refCode == e.detail.value) + if (checkData) { + if ((e.detail.value == 'jsek_teachingResources' && !this.data.teach.length) + || (e.detail.value == 'jsek_cloudLearning' && !this.data.learn.length) + || (e.detail.value == 'questionBank' && !this.data.test.length)) { + this.getResourceData(checkData) + } + } + } + console.log('鍒囨崲', this.data.tabValue); + }, + // 鑾峰彇璧勬簮鎵�灞炲垎绫� + getResourceClass() { + let query = { + refCodes: ['resourcesClassification'] + } + app.MG.store.getProductTypeField(query).then((res) => { + this.setData({ + resourceClassList: JSON.parse(res[0].config).option + }) + }) + }, + // 鑾峰彇鏁欏璧勬簮 浜戝涔� 浜戞祴璇� + getResourceData(type) { + let query = { + path: '*', + queryType: '*', + productId: this.data.bookDetail.id, + cmsPath: type.productLinkPath, + itemFields: { + SysType: 'CmsFolder', + // 璧勬簮绫诲瀷锛岃瘯璇绘枃浠讹紝鏄惁鍏佽涓嬭浇绛夊弬鏁� + selectType: [], + freeFile: [], + file: [], + resourcesClassification: [], + isDownload: [], + jsek_resourceBrief: [], + jsek_link: [], + jsek_questionBank: [] + }, + pading: { + start: 0, + size: 999 + }, + } + app.MG.store + .getProductDetail(query) + .then(async (res) => { + // 浜戞祴璇曪紝閫掑綊璇锋眰閲屽眰鏁版嵁 + if (type.refCode == 'questionBank') { + const data = res.datas.cmsDatas[0].datas.filter( + (item) => item.refCode == 'jsek_questionBank' + ) + if (data.length) return getResourceData(data[0]) + } + //鏁欏璧勬簮 浜戝涔� + if (type.refCode == 'jsek_teachingResources' || type.refCode == 'jsek_cloudLearning') { + if (res.datas.cmsDatas[0].datas.length > 0) { + if (type.refCode == 'jsek_teachingResources') { + res.datas.cmsDatas[0].datas.forEach(item => { + item.checked = false + }) + const list = await this.getAllResource(res.datas.cmsDatas[0].datas) + this.setData({ + teachResources: list, + teach: list + }) + this.findChildIds(this.data.teachResources, this.data.openTeachids = []) + } else if (type.refCode == 'jsek_cloudLearning') { + const list = await this.getAllResource(res.datas.cmsDatas[0].datas) + this.setData({ + learn: list + }) + console.log('浜戝涔�', this.data.learn); + this.findChildIds(this.data.teachResources, this.data.openLearnids = []) + } + } else { + // 鏃犳暟鎹� + } + } else if (type.refCode == 'jsek_questionBank') { + console.log('浜戞祴璇�'); + } else { + console.log('鍏朵粬'); + } + }) + .catch((e) => { + console.log(e) + }) + console.log('淇℃伅', this.data); + }, + // 鑾峰彇tag涓嬫墍鏈夎祫婧� + async getAllResource(data) { + if (!data.length) return false + for (let i = 0; i < data.length; i++) { + let item = data[i] + if (item.sysType == 'CmsFolder' && item.childrenCount > 0) { + item.children = [] + item.children = await this.getFolderItem(item.productLinkPath) + await this.getAllResource(item.children) + } + } + return data + }, + // 鑾峰彇璧勬簮鎺ュ彛 + async getFolderItem(path) { + let query = { + path: '*', + queryType: '*', + productId: this.data.bookDetail.id, + cmsPath: path, + itemFields: { + SysType: 'CmsFolder', + // 璧勬簮绫诲瀷锛岃瘯璇绘枃浠讹紝鏄惁鍏佽涓嬭浇绛夊弬鏁� + selectType: [], + freeFile: [], + file: [], + protectedFile: [], + resourcesClassification: [], + isDownload: [], + jsek_resourceBrief: [], + jsek_link: [], + accessType: [] + }, + pading: { + start: 0, + size: 999 + }, + } + const data = await app.MG.store.getProductDetail(query) + data.datas.cmsDatas[0].datas.forEach((item) => { + this.data.resourceClassList.forEach((type) => { + if (type.value == item.resourcesClassification) item.resourceClass = type.name + }) + // 缃戦〉 涓嶈兘涓嬭浇 绉佹湁鏂囦欢 + if (item.sysType == 'CmsItem') { + if (item.selectType == 'webpage') { + item.disabled = true + } else { + if (item.isDownload != 1) { + item.disabled = true + } + } + if (item.file) { + if (item.fileMap[item.file].protectType == 'Private') item.disabled = true + } + } + }) + data.datas.cmsDatas[0].datas.forEach(item => { + if (this.data.tabValue == 'jsek_teachingResources') { + item.checked = false + } else if (this.data.tabValue == 'jsek_cloudLearning') { + item.isbuy = this.resourceIsBuy(item) + item.isShopCar = this.isShoppingCart(item) + } + }) + return data.datas.cmsDatas[0].datas + }, + // 鑾峰彇灞曞紑椤� + findChildIds(data, result) { + let index = 0 + for (let i = 0; i < data.length; i++) { + if (index < 3) { + const item = data[i] + if (item.childrenFolderCount > 0) { + result.push(item.id) + for (let j = 0; j < item.children.length; j++) { + if (index < 3) { + const childrenItme = item.children[j] + if (item.childrenCount > 0) { + result.push(childrenItme.id) + index += 1 + } + } else { + break + } + } + } else if (item.childrenCount > 0) { + result.push(item.id) + index += 1 + } + } else { + break + } + } + }, + + // 鍥句功娣诲姞璐墿杞� + addBookShopcCar() { + let query = { + requests: [ + { + saleMethodId: this.data.bookDetail.defaultSaleMethodId, + storeEventId: null, + agentCode: '鐢靛瓙涔�' + } + ] + } + const addRes = app.MG.store.addShoppingCart(query) + }, + // 鑾峰彇鏁欏璧勬簮涓嬭浇鏄惁鐢宠閫氳繃 + getApplyInfo(id) { + // 鑾峰彇褰撳墠鏃堕棿 + const currentDate = new Date() + let query = { + sort: { + type: 'Desc', + field: 'CreateDate' + }, + start: 0, + size: 99999, + appRefCode: app.config.appRefCode, + topicIdOrRefCode: 'productDownLoad' + } + app.MG.ugc.getTopicMessageList(query).then((res) => { + const applyResource = res.datas.find((item) => { + let content = [] + try { + content = JSON.parse(item.content) + } catch (error) { + content = [] + } + if (Array.isArray(content)) return content.find((citem) => citem.id == id) + return false + }) + // 鏈夌敵璇疯褰� + if (applyResource) { + if (applyResource.state == 'Reject') { + this.setData({ + rejectCause: JSON.parse(applyResource.feedBack).reason, + applyState: 'Reject' + }) + } else if (applyResource.state == 'Normal') { + 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: '姘镐箙', + }) + } else { + let endTime = new Date(endDate + ' 23:59:59').getTime() + // deadline.value = endDate + ' 23:59:59' + this.setData({ + deadline: endDate + ' 23:59:59' + }) + if (currentDate.getTime() < endTime) { + // 鏈秴鏃� + this.setData({ + applyState: 'Normal' + }) + } else { + this.setData({ + applyState: 'none' + }) + } + } + } else { + this.setData({ + applyState: applyResource.state + }) + } + } else { + this.setData({ + applyState: 'none' + }) + } + console.log('鐢宠閫氳繃', this.data.applyState); + }) + + }, + // 鐢宠鏁欏璧勬簮 + applyResource() { + // let role = userStore.userInfo ? userStore.userInfo.role : null + // if (role) { + // if (role == 'Teacher') { + // 鐢宠鏁欏璧勬簮 + let query = { + topicIdOrRefCode: 'productDownLoad', + type: 'applyForDownload', + state: 'WaitAudit', + cmsTypeRefCode: '', + newDataListRequest: [], + name: this.data.bookDetail.name, // name涓虹敵璇风殑涔︽湰鍚嶇О + content: JSON.stringify([ + { + name: this.data.bookDetail.name, + id: this.data.bookDetail.id, + // defaultSaleMethodId: bookData.value.defaultSaleMethodId, + icon: this.data.bookDetail.icon + } + ]) + } + app.MG.ugc.newTopicMessage(query).then((res) => { + if (res) { + Message.success('鐢宠宸叉彁浜わ紝璇峰緟瀹℃牳閫氳繃鍚庝笅杞�') + } + this.getApplyInfo(this.data.bookDetail.id) + }) + // } else { + // ElMessageBox.confirm('璇峰厛杩涜鏁欏笀璁よ瘉锛�', '灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�', { + // confirmButtonText: '鍘昏璇�', + // cancelButtonText: '鍙栨秷', + // type: 'warning' + // }) + // .then(() => { + // isShow.value = true + // }) + // .catch(() => { }) + // } + // } else { + // // logIn() + // } + }, + 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 + // }) + // .catch(() => { }) + // } + // } else { + // logIn() + // } + }, + downloadFile(url) { + wx.downloadFile({ + url: url, + success: function (res) { + // 涓嬭浇鎴愬姛鍚庯紝璋冪敤saveImageToPhotosAlbum鍑芥暟淇濆瓨鍥剧墖鍒版湰鍦� + wx.saveFile({ + tempFilePath: res.tempFilePath, + success: function (res) { + wx.showToast({ + title: '涓嬭浇鎴愬姛', + icon: 'success' + }) + }, + fail: function (res) { + wx.showToast({ + title: '涓嬭浇澶辫触', + icon: 'none' + }) + } + }) + }, + fail: function (res) { + wx.showToast({ + title: '涓嬭浇澶辫触', + icon: 'none' + }) + } + }) + }, + // 鍒ゆ柇璧勬簮鏄惁璐拱 + resourceIsBuy(data) { + if (data.saleMethod && data.saleMethod.length) { + const isSHow = this.data.buyIdList.some((item) => item == data.saleMethod[0].Id) + return !isSHow + } else { + return false + } + }, + getShoppingCartProductGet() { + let query = { + start: 0, + size: 999, + filterList: [], + searchList: [] + } + app.MG.store.getShoppingCartProductList(query).then((res) => { + const list = [] + res.datas.forEach((item) => { + list.push(item.saleMethod.id) + }) + this.setData({ + shoppingList: res.datas, + shoppingCartGetId: list + }) + console.log('璐拱', this.data); + }) + }, + // 鍒ゆ柇璧勬簮鍔犲叆璐墿杞︽寜閽槸鍚︽樉绀� + isShoppingCart(data) { + if (data.saleMethod && data.saleMethod.length) { + if (data.saleMethod[0].Price <= 0) return false + // 鍐嶅垽鏂槸鍚﹁喘涔� + const isBuy = this.data.buyIdList.some((item) => item == data.saleMethod[0].Id) + if (isBuy) { + // 璐拱浜� + return false + } else { + // 鍒ゆ柇鏄惁鍔犲叆璐墿杞� + const isSHow = this.data.shoppingCartGetId.some((item) => item == data.saleMethod[0].Id) + return !isSHow + } + } else { + return false + } + } +}) diff --git a/pages/bookServices/detail/index.json b/pages/bookServices/detail/index.json index 09e62ae..7f5888d 100644 --- a/pages/bookServices/detail/index.json +++ b/pages/bookServices/detail/index.json @@ -4,7 +4,14 @@ "t-image": "tdesign-miniprogram/image/image", "t-tabs": "tdesign-miniprogram/tabs/tabs", "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", - "book-brief": "/pages/bookServices/detail/components/brief/index" + "t-button": "tdesign-miniprogram/button/button", + "t-message": "tdesign-miniprogram/message/message", + "book-brief": "/pages/bookServices/detail/components/brief/index", + "teach-resource": "/pages/bookServices/detail/components/teachResource/index", + "learn-resource": "/pages/bookServices/detail/components/learnResource/learnResource", + "tree": "/pages/bookServices/detail/components/tree/index", + "suggest": "/pages/bookServices/detail/components/suggest/suggest", + "t-loading": "tdesign-miniprogram/loading/loading" }, "navigationStyle": "custom" -} +} \ No newline at end of file diff --git a/pages/bookServices/detail/index.wxml b/pages/bookServices/detail/index.wxml index 9788ffb..9b67d3c 100644 --- a/pages/bookServices/detail/index.wxml +++ b/pages/bookServices/detail/index.wxml @@ -13,33 +13,21 @@ <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>鏀惰棌</view> + <view class="use-title">鏀惰棌</view> </view> - <view class="suggest"> + <view class="suggest" bind:tap="suggestBtn"> <view> <t-image src="/static/images/bookService/detail/suggest.png"></t-image> </view> - <view>鎴戣寤鸿</view> + <view class="use-title">鎴戣寤鸿</view> </view> </view> </view> @@ -78,8 +66,9 @@ <t-image src="/static/images/bookService/detail/electon-price.png"></t-image> </view> <view class="price"> - <view>楼{{bookDetail.price}}</view> - <view class="price-old">楼{{bookDetail.oldPrice}} <view class="line"></view> </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> </view> @@ -88,58 +77,35 @@ <view> <t-image src="/static/images/bookService/detail/paper-price.png"></t-image> </view> - <view class="price">楼{{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="{{0}}" - bind:change="onTabsChange" - bind:click="onTabsClick" - t-class="custom-tabs" - t-class-content="custom-panel" - > - <t-tab-panel label="鍥句功绠�浠�" value="0" style="{{tabPanelstyle}}"> - <book-brief - content="{{bookDetail.content}}" - authorIntroduction="{{bookDetail.authorIntroduction}}" - ></book-brief> + <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> </t-tab-panel> - <t-tab-panel label="鐢靛瓙涔�" value="1" style="{{tabPanelstyle}}">閫夐」浜屽唴瀹�</t-tab-panel> - <t-tab-panel label="浜戝涔�" value="2" style="{{tabPanelstyle}}">閫夐」涓夊唴瀹�</t-tab-panel> - <t-tab-panel label="浜戞祴璇�" value="3" style="{{tabPanelstyle}}">閫夐」鍥涘唴瀹�</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 treeList="{{teach}}" tab="{{tabValue}}" applyState="{{applyState}}" bind:downloadTeach="downloadTeach"></tree> + </t-tab-panel> + <t-tab-panel label="浜戝涔�" value="jsek_cloudLearning" style="{{tabPanelstyle}}"> + <learn-resource></learn-resource> + <tree tab="{{tabValue}}" treeList="{{learn}}" buyIds="{{buyIdList}}"></tree> + </t-tab-panel> + <t-tab-panel label="浜戞祴璇�" value="questionBank" style="{{tabPanelstyle}}">閫夐」鍥涘唴瀹�</t-tab-panel> </t-tabs> </view> <!-- 璐拱鎸夐挳 --> @@ -148,15 +114,17 @@ <view> <t-image src="/static/images/bookService/detail/ebook.png"></t-image> </view> - <view>鐢靛瓙鏍蜂功鐢宠</view> + <view class="btn-text">鐢靛瓙鏍蜂功鐢宠</view> </view> <view class="bottom-btn"> <view> <t-image src="/static/images/bookService/detail/paper-book.png"></t-image> </view> - <view>绾歌川鏍蜂功鐢宠</view> + <view class="btn-text">绾歌川鏍蜂功鐢宠</view> </view> - <view class="shopCar">鍔犲叆璐墿杞�</view> + <view class="shopCar" bind:tap="addBookShopcCar">鍔犲叆璐墿杞�</view> <view class="buy">绔嬪嵆璐拱</view> </view> </scroll-view> +<!-- 鎴戣寤鸿寮圭獥 --> +<suggest class="suggest-component" id="suggest-component"></suggest> \ No newline at end of file diff --git a/pages/bookServices/detail/index.wxss b/pages/bookServices/detail/index.wxss index 30834df..35cea5c 100644 --- a/pages/bookServices/detail/index.wxss +++ b/pages/bookServices/detail/index.wxss @@ -43,7 +43,6 @@ } .message-li { - font-size: 28rpx; color: #333333; display: flex; height: 40rpx; @@ -52,14 +51,26 @@ .li-title { width: 140rpx; + font-size: 28rpx; +} + +.li-content { + width: 280rpx; + font-size: 28rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .book-use { margin-top: 16rpx; display: flex; justify-content: space-evenly; - font-size: 24rpx; color: #949494; +} + +.use-title { + font-size: 24rpx; } .collect, @@ -120,6 +131,10 @@ color: #fff; } +.price-text { + font-size: 34rpx; +} + .price-old { margin-left: 10rpx; position: relative; @@ -152,13 +167,16 @@ /* 鍥句功璧勬簮 */ .book-resource { + min-height: 640rpx; margin-top: 20rpx; + background-color: #fff !important; } + .custom-tabs { - --td-tab-item-active-color: #FF6C00 + --td-tab-item-active-color: #FF6C00; + --td-tab-font-size: 28rpx; } - /* 搴曢儴 */ .box-bottom { @@ -167,7 +185,6 @@ bottom: 40rpx; width: 100%; height: 110rpx; - } .box-bottom { @@ -187,9 +204,12 @@ align-items: center; justify-content: center; flex-direction: column; + box-sizing: border-box; +} + +.btn-text { font-size: 24rpx; color: #010101; - box-sizing: border-box; } .bottom-btn image { @@ -215,4 +235,8 @@ .buy { background-color: #F14B3B; +} + +.tab-box { + min-height: 550rpx; } \ No newline at end of file diff --git a/pages/bookServices/list/index.js b/pages/bookServices/list/index.js index 7388ef4..890c3b9 100644 --- a/pages/bookServices/list/index.js +++ b/pages/bookServices/list/index.js @@ -39,6 +39,10 @@ stairCode: '', // 涓�绾у垎绫婚�変腑椤� secondCode: '', // 浜岀骇鍒嗙被閫変腑椤� sort: '', // 鎺掑簭 + enable: false, + loadingProps: { + size: '50rpx', + }, }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 @@ -74,10 +78,20 @@ this.setData({ 'stairList.value': options.stairCode, stairCode: options.stairCode, - secondCode: options.secondCode, - 'secondList.value': options.secondCode, path: `${options.assortCode}\\${options.stairCode}`, }); + } + // 浜岀骇鍒嗙被璧嬪�� + if (options.secondCode) { + this.setData({ + secondCode: options.secondCode, + pathList: [{ + Path: options.secondCode, + Type: '*', + StoreRefCode: app.config.goodsStore, + } + ], + }) } // 鑾峰彇浜岀骇鍒嗙被 this.getSecondList(`${options.assortCode}\\${options.stairCode}`); @@ -90,37 +104,43 @@ /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 */ - onReady() {}, + onReady() { + }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず */ - onShow() {}, + onShow() { + }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌 */ - onHide() {}, + onHide() { }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇 */ - onUnload() {}, + onUnload() { }, /** * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔 */ - onPullDownRefresh() {}, + onPullDownRefresh() { + console.log('涓嬫媺'); + }, /** * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� */ - onReachBottom() {}, + onReachBottom(e) { + console.log('搴曢儴'); + }, /** * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� */ - onShareAppMessage() {}, + onShareAppMessage() { }, goBack() { wx.navigateBack(); }, @@ -179,8 +199,11 @@ } this.setData({ 'secondList.options': options, - 'secondList.value': this.data.secondCode, }); + const second = [this.data.secondCode] + this.setData({ + 'secondList.value': second + }) }); }, // 鑾峰彇閲嶇偣椤圭洰 @@ -290,6 +313,7 @@ app.MG.store.getProductList(query).then((res) => { this.setData({ bookList: res.datas, + enable: false }); }); }, @@ -299,6 +323,7 @@ ? `${this.data.assortCheck.code}\\${e.detail.value}` : this.data.assortCheck.code; this.setData({ + pathList: [], stairCode: e.detail.value, secondCode: '', path: path, @@ -309,7 +334,6 @@ }, // 浜岀骇鍒嗙被鍒囨崲 onChangeSecond(e) { - console.log(e); const pathList = []; for (let index = 0; index < e.detail.value.length; index++) { const element = e.detail.value[index]; @@ -323,6 +347,10 @@ pathList: pathList, 'secondList.value': e.detail.value, }); + + }, + // + onConfirmSecond() { this.getBookList(this.data.path); }, // 閲嶇偣椤圭洰鏀瑰彉 @@ -394,4 +422,8 @@ url: `/pages/bookServices/detail/index?id=${book.id}&name=${book.name}`, }); }, + onRefresh() { + this.setData({ enable: true }); + this.getBookList(this.data.path) + }, }); diff --git a/pages/bookServices/list/index.json b/pages/bookServices/list/index.json index c1b8601..8b16d4b 100644 --- a/pages/bookServices/list/index.json +++ b/pages/bookServices/list/index.json @@ -4,7 +4,9 @@ "t-dropdown-item": "tdesign-miniprogram/dropdown-item/dropdown-item", "t-icon": "tdesign-miniprogram/icon/icon", "t-image": "tdesign-miniprogram/image/image", - "t-search": "tdesign-miniprogram/search/search" + "t-search": "tdesign-miniprogram/search/search", + "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh" }, - "navigationStyle": "custom" -} + "navigationStyle": "custom", + "onReachBottomDistance": 250 +} \ No newline at end of file diff --git a/pages/bookServices/list/index.wxml b/pages/bookServices/list/index.wxml index 20900a8..4082e4d 100644 --- a/pages/bookServices/list/index.wxml +++ b/pages/bookServices/list/index.wxml @@ -5,14 +5,7 @@ <view> <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> </view> - <t-search - model:value="{{searchValue}}" - shape="round" - placeholder="璇疯緭鍏ュ叧閿瘝/涔﹀悕/ISBN/浣滆��" - class="navBar-search" - style="width: 464rpx" - bind:submit="searchBook" - /> + <t-search model:value="{{searchValue}}" shape="round" placeholder="璇疯緭鍏ュ叧閿瘝/涔﹀悕/ISBN/浣滆��" class="navBar-search" style="width: 464rpx" bind:submit="searchBook" /> </view> <view class="bookServices-list"> @@ -20,32 +13,9 @@ <scroll-view scroll-x="{{true}}" class="header-scroll"> <t-dropdown-menu> <t-dropdown-item options="{{stairList.options}}" value="{{stairList.value}}" bindchange="onChangeStair" /> - <t-dropdown-item - label="浜岀骇" - options="{{secondList.options}}" - optionsColumns="2" - multiple - defaultValue="{{secondList.value}}" - bind:confirm="onChangeSecond" - /> - <t-dropdown-item - label="閲嶇偣椤圭洰" - options="{{majorProjectList.options}}" - optionsColumns="2" - multiple - defaultValue="{{majorProjectList.value}}" - bind:confirm="changeMajorProject" - bind:reset="resetMajorProject" - /> - <t-dropdown-item - label="鏂板舰鎬佹暀鏉�" - options="{{newTextBook.options}}" - optionsColumns="2" - multiple - defaultValue="{{newTextBook.value}}" - bind:confirm="changeNewText" - bind:reset="resetNewText" - /> + <t-dropdown-item label="浜岀骇" options="{{secondList.options}}" optionsColumns="2" multiple value="{{secondList.value}}" bind:confirm="onConfirmSecond" bind:change="onChangeSecond" /> + <t-dropdown-item label="閲嶇偣椤圭洰" options="{{majorProjectList.options}}" optionsColumns="2" multiple defaultValue="{{majorProjectList.value}}" bind:confirm="changeMajorProject" bind:reset="resetMajorProject" /> + <t-dropdown-item label="鏂板舰鎬佹暀鏉�" options="{{newTextBook.options}}" optionsColumns="2" multiple defaultValue="{{newTextBook.value}}" bind:confirm="changeNewText" bind:reset="resetNewText" /> </t-dropdown-menu> </scroll-view> <view class="header-sort" bind:tap="sortClick"> @@ -56,19 +26,21 @@ </view> </view> </view> - <scroll-view scroll-y="{{true}}" class="list-container"> - <view class="assort-title"> - <view class="title-box"></view> - <view class="title-name">{{assortCheck.name}}</view> - </view> - <view class="book-list"> - <view class="book-box" wx:for="{{bookList}}" wx:key="id" bind:tap="goDetail" data-book="{{item}}"> - <view class="book-img"> - <t-image src="{{item.icon}}" width="105" height="145" aria-label="{item.name{}}" /> - </view> - <view class="book-name book-color">{{ item.name}}</view> - <view class="book-author book-color">{{item.author}}</view> + <t-pull-down-refresh value="{{enable}}" loadingProps="{{loadingProps}}" loadingTexts="{{['涓嬫媺鍒锋柊', '鏉炬墜鍒锋柊', '姝e湪鍒锋柊', '鍒锋柊瀹屾垚']}}" bind:refresh="onRefresh"> + <scroll-view scroll-y="{{true}}" class="list-container"> + <view class="assort-title"> + <view class="title-box"></view> + <view class="title-name">{{assortCheck.name}}</view> </view> - </view> - </scroll-view> -</view> + <view class="book-list"> + <view class="book-box" wx:for="{{bookList}}" wx:key="id" bind:tap="goDetail" data-book="{{item}}"> + <view class="book-img"> + <t-image src="{{item.icon}}" width="105" height="145" aria-label="{item.name{}}" /> + </view> + <view class="book-name book-color">{{ item.name}}</view> + <view class="book-author book-color">{{item.author}}</view> + </view> + </view> + </scroll-view> + </t-pull-down-refresh> +</view> \ No newline at end of file diff --git a/static/images/bookService/detail/PPT.png b/static/images/bookService/detail/PPT.png new file mode 100644 index 0000000..ea67401 --- /dev/null +++ b/static/images/bookService/detail/PPT.png Binary files differ diff --git a/static/images/bookService/detail/audioIcon.png b/static/images/bookService/detail/audioIcon.png new file mode 100644 index 0000000..7df9620 --- /dev/null +++ b/static/images/bookService/detail/audioIcon.png Binary files differ diff --git a/static/images/bookService/detail/download-icon.png b/static/images/bookService/detail/download-icon.png new file mode 100644 index 0000000..a726f45 --- /dev/null +++ b/static/images/bookService/detail/download-icon.png Binary files differ diff --git a/static/images/bookService/detail/download.png b/static/images/bookService/detail/download.png new file mode 100644 index 0000000..2a28472 --- /dev/null +++ b/static/images/bookService/detail/download.png Binary files differ diff --git a/static/images/bookService/detail/excel.png b/static/images/bookService/detail/excel.png new file mode 100644 index 0000000..5070dcb --- /dev/null +++ b/static/images/bookService/detail/excel.png Binary files differ diff --git a/static/images/bookService/detail/need-buy.png b/static/images/bookService/detail/need-buy.png new file mode 100644 index 0000000..0811893 --- /dev/null +++ b/static/images/bookService/detail/need-buy.png Binary files differ diff --git a/static/images/bookService/detail/net.png b/static/images/bookService/detail/net.png new file mode 100644 index 0000000..792a5f6 --- /dev/null +++ b/static/images/bookService/detail/net.png Binary files differ diff --git a/static/images/bookService/detail/pdf.png b/static/images/bookService/detail/pdf.png new file mode 100644 index 0000000..f205ef8 --- /dev/null +++ b/static/images/bookService/detail/pdf.png Binary files differ diff --git a/static/images/bookService/detail/picture.png b/static/images/bookService/detail/picture.png new file mode 100644 index 0000000..45e143a --- /dev/null +++ b/static/images/bookService/detail/picture.png Binary files differ diff --git "a/static/images/bookService/detail/renwudan\357\274\217icon.png" "b/static/images/bookService/detail/renwudan\357\274\217icon.png" new file mode 100644 index 0000000..527f137 --- /dev/null +++ "b/static/images/bookService/detail/renwudan\357\274\217icon.png" Binary files differ diff --git a/static/images/bookService/detail/shikan.png b/static/images/bookService/detail/shikan.png new file mode 100644 index 0000000..8f088d8 --- /dev/null +++ b/static/images/bookService/detail/shikan.png Binary files differ diff --git a/static/images/bookService/detail/upload.png b/static/images/bookService/detail/upload.png new file mode 100644 index 0000000..7e04024 --- /dev/null +++ b/static/images/bookService/detail/upload.png Binary files differ diff --git a/static/images/bookService/detail/video.png b/static/images/bookService/detail/video.png new file mode 100644 index 0000000..52ee0b9 --- /dev/null +++ b/static/images/bookService/detail/video.png Binary files differ diff --git a/static/images/bookService/detail/word.png b/static/images/bookService/detail/word.png new file mode 100644 index 0000000..2d925cd --- /dev/null +++ b/static/images/bookService/detail/word.png Binary files differ diff --git a/static/images/bookService/detail/yijiangoumai.png b/static/images/bookService/detail/yijiangoumai.png new file mode 100644 index 0000000..64e6d46 --- /dev/null +++ b/static/images/bookService/detail/yijiangoumai.png Binary files differ diff --git a/static/images/bookService/detail/yijianlingqu.png b/static/images/bookService/detail/yijianlingqu.png new file mode 100644 index 0000000..40d8ee3 --- /dev/null +++ b/static/images/bookService/detail/yijianlingqu.png Binary files differ diff --git a/static/images/bookService/detail/zip.png b/static/images/bookService/detail/zip.png new file mode 100644 index 0000000..497f440 --- /dev/null +++ b/static/images/bookService/detail/zip.png Binary files differ -- Gitblit v1.9.1