From ccda9ec2fe70d8f51ef184eafc04b78d22dfbabd Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期三, 26 六月 2024 15:02:28 +0800 Subject: [PATCH] 小程序,教材,课程 --- pages/index/resourceCover.js | 153 ++ packageBookService/pages/bookServices/detail/index.wxml | 297 --- pages/digitalCourses/digitalCoursesDetails/index.wxml | 143 - packageDomain/pages/resourceDetails/myVideo/index.wxml | 124 - packageBookService/pages/bookServices/examination/examination.js | 19 packageBookService/pages/bookServices/detail/components/testResource/testResource.js | 13 pages/index/resourceCover.json | 3 packageBookService/pages/bookServices/detail/components/testTree/components/util.js | 27 packageBookService/pages/bookServices/detail/components/testTree/tree/index.js | 640 ++++++++++ packageBookService/pages/bookServices/detail/components/testResource/testResource.json | 3 pages/home/home.wxss | 14 pages/index/bookDetail.js | 66 + pages/test/testCover.wxml | 2 packageBookService/pages/bookServices/detail/components/testTree/tree/index.wxss | 115 + pages/digitalCourses/digitalCoursesDetails/index.js | 17 pages/index/resourceCover.wxml | 3 packageBookService/pages/bookServices/examination/questionSchedule/index.js | 2 packageBookService/pages/bookServices/detail/components/testTree/index.wxss | 115 + pages/digitalCourses/index.wxss | 25 pages/test/testCover.js | 95 + pages/index/bookDetail.wxss | 1 pages/specialDiscussion/index.wxml | 56 pages/digitalTextbooks/digitalTextbooksDetails/index.wxml | 302 ++-- pages/specialDiscussion/index.js | 77 packageBookService/pages/bookServices/detail/components/testTree/tree/index.json | 13 packageBookService/pages/bookServices/detail/components/testTree/index.js | 70 + pages/home/home.js | 16 pages/index/bookDetail.json | 3 packageBookService/pages/bookServices/detail/index.wxss | 1 assets/js/middleGround/api/store.js | 3 pages/digitalCourses/digitalCoursesDetails/index.wxss | 51 pages/digitalCourses/index.js | 74 + app.js | 4 assets/js/middleGround/api/resource.js | 89 + static/images/home/nav_icon_scan.png | 0 assets/js/config.js | 2 packageBookService/pages/bookServices/detail/index.js | 94 pages/digitalTextbooks/digitalTextbooksDetails/index.js | 39 pages/home/home.wxml | 318 ---- packageBookService/pages/bookServices/detail/components/testTree/tree/index.wxml | 322 +++++ pages/index/resourceCover.wxss | 1 pages/test/testCover.wxss | 1 packageDomain/pages/resourceDetails/myVideo/index.js | 14 packageBookService/pages/bookServices/detail/components/testTree/index.wxml | 55 packageBookService/pages/bookServices/detail/components/testTree/index.json | 13 pages/digitalCourses/index.wxml | 64 assets/js/middleGround/tool.js | 2 pages/index/bookDetail.wxml | 2 app.json | 5 pages/specialDiscussion/index.wxss | 23 pages/digitalTextbooks/digitalTextbooksDetails/index.wxss | 88 pages/test/testCover.json | 3 packageBookService/pages/bookServices/detail/components/testTree/tree/components/util.js | 27 packageBookService/pages/bookServices/detail/components/testResource/testResource.wxml | 103 - 54 files changed, 2,486 insertions(+), 1,326 deletions(-) diff --git a/app.js b/app.js index 1f62230..daf7726 100644 --- a/app.js +++ b/app.js @@ -4,8 +4,8 @@ App({ MG: MG, config: config, - onLaunch: function () { }, + onLaunch: function () {}, onShow: function () { updateManager(); }, -}); +}); \ No newline at end of file diff --git a/app.json b/app.json index 76e4b4d..3bfea2d 100644 --- a/app.json +++ b/app.json @@ -22,7 +22,10 @@ "pages/digitalCourses/index", "pages/digitalCourses/digitalCoursesDetails/index", "pages/specialDiscussion/index", - "pages/specialDiscussion/webView/index" + "pages/specialDiscussion/webView/index", + "pages/index/bookDetail", + "pages/index/resourceCover", + "pages/test/testCover" ], "subPackages": [ { diff --git a/assets/js/config.js b/assets/js/config.js index 4bf5cc6..99f07e7 100644 --- a/assets/js/config.js +++ b/assets/js/config.js @@ -16,6 +16,7 @@ export const digitalTextbooks = "jsek_digitalTextbooks"; //鏁板瓧鏁欐潗 export const seminar = "jsek_seminar"; //涓撻鐮旇 export const digitalRead = "jsek_digitalReading"; //鏁板瓧闃呰 +export const jslx = "jsek_jslx"; //涔愬 export const textReaderUrl = "https://jsek.bnuic.com/testBookReader/#/home"; //鏁板瓧鏁欐潗闃呰鍣� // export const seminar ="jsek_seminar";//涔﹀睍 @@ -34,6 +35,7 @@ digitalTextbooks, seminar, digitalRead, + jslx, reg_tel, reg_telphone, epubUrl, diff --git a/assets/js/middleGround/api/resource.js b/assets/js/middleGround/api/resource.js index afb1189..198c0d3 100644 --- a/assets/js/middleGround/api/resource.js +++ b/assets/js/middleGround/api/resource.js @@ -1,7 +1,14 @@ import request from "../../../request/index"; -import { publicStore, publicRepository } from "../../config"; -import { tokenKey } from "../../config"; -import { handleQueryResourceListData } from "../tool"; +import { + publicStore, + publicRepository +} from "../../config"; +import { + tokenKey +} from "../../config"; +import { + handleQueryResourceListData +} from "../tool"; import toolClass from "../../toolClass"; const resourceApi = { /* @@ -21,6 +28,8 @@ repositoryInfo = publicRepository, queryType, linkType, + RefCode, + CmsItemType, paging, sort, fields, @@ -30,14 +39,10 @@ coverSize, itemIdArr, SysType, + tourism_isHighQualityResources, }) => { if (!path) return Promise.reject("鎺ュ彛璇锋眰蹇呰鍙傛暟涓嶈兘涓虹┖锛�"); - - - - - const query = { AccessControl: { Path: path, @@ -57,14 +62,14 @@ Description: [], Name: [], Icon: [], - RefCode: [], + // RefCode: [], Type: [], TypeId: [], State: [], Tag: [], LinkInfo: [], LinkFile: [], - CmsItemType: [], + // CmsItemType: [], ChildrenFolderCount: [], ChildrenCount: [], ...fields, @@ -78,7 +83,15 @@ if (itemId) query["Id="] = [`${itemId}`]; if (itemIds) query["Id="] = itemIds; if (itemType) query["Type="] = [`${itemType}`]; - const body = { query: JSON.stringify({ Query: [{ Q1: query }] }) }; + if (RefCode) query["RefCode="] = [`${RefCode}`]; + if (CmsItemType) query["CmsItemType="] = [`${CmsItemType}`]; + const body = { + query: JSON.stringify({ + Query: [{ + Q1: query + }] + }) + }; let token = wx.getStorageSync('tokenKey'); return request({ url: token ? "/resource/api/ApiAppUserQuery" : "/resource/api/ApiQuery", @@ -95,14 +108,24 @@ repositoryInfo, coverSize, }); - return { datas, total: data.totalCount }; + return { + datas, + total: data.totalCount + }; } - return { datas: [], total: 0 }; + return { + datas: [], + total: 0 + }; }); }, // 妯$硦鎼滅储 EsQuery(query) { - let { params, path, paging } = query; + let { + params, + path, + paging + } = query; let queryBody = { Type: "*", Store: [], @@ -153,16 +176,20 @@ // 鍏ㄩ儴鎼滅储 - 鍗曠嫭鐨勬煇涓簱 if (path != "All") { let data = { - Path: [ - { - Repository: "tourism_tourismLawsAndRegulationsDatabase", - Path: path, - }, - ], + Path: [{ + Repository: "tourism_tourismLawsAndRegulationsDatabase", + Path: path, + }, ], }; Object.assign(queryBody, data); } - const body = { query: JSON.stringify({ Query: [{ Q1: queryBody }] }) }; + const body = { + query: JSON.stringify({ + Query: [{ + Q1: queryBody + }] + }) + }; return request({ url: "/resource/api/ApiEsQuery", @@ -176,9 +203,15 @@ datas: data.datas, path, }); - return { datas, total: data.totalCount }; + return { + datas, + total: data.totalCount + }; } - return { data: [], total: 0 }; + return { + data: [], + total: 0 + }; }); }, @@ -211,7 +244,13 @@ // 鑾峰彇cms鏀惰棌鍒楄〃 getCmsCollectList(data) { - const body = { query: JSON.stringify({ Query: [{ Q1: data }] }) }; + const body = { + query: JSON.stringify({ + Query: [{ + Q1: data + }] + }) + }; return request({ url: "/resource/api/ApiAppUserQuery", method: "post", @@ -220,4 +259,4 @@ }, }; -export default resourceApi; +export default resourceApi; \ No newline at end of file diff --git a/assets/js/middleGround/api/store.js b/assets/js/middleGround/api/store.js index 2626394..3a70e5a 100644 --- a/assets/js/middleGround/api/store.js +++ b/assets/js/middleGround/api/store.js @@ -288,8 +288,6 @@ } let token = wx.getStorageSync(tokenKey) ? wx.getStorageSync(tokenKey) : ''; - - let url = token ? '/store/api/ApiQueryProductByAppUser' : '/store/api/ApiQueryProduct' return request({ url: url, @@ -301,6 +299,7 @@ if (resp.length > 0) { const data = resp[0] if (data.datas.length) { + data.datas[0].subDatas = data.datas[0].cmsDatas const datas = handleDetailQueryRequestData({ item: data.datas[0], diff --git a/assets/js/middleGround/tool.js b/assets/js/middleGround/tool.js index dd46872..c9601b7 100644 --- a/assets/js/middleGround/tool.js +++ b/assets/js/middleGround/tool.js @@ -287,7 +287,7 @@ md5: linkItem.Md5, icon: linkItem.Icon, size: linkItem.Size, - metaData: JSON.parse(linkItem.MetaData ?? "{}"), + // metaData: JSON.parse(linkItem.MetaData ?? "{}"), order: linkItem.Order, protectType: linkItem.ProtectType, }; diff --git a/packageBookService/pages/bookServices/detail/components/testResource/testResource.js b/packageBookService/pages/bookServices/detail/components/testResource/testResource.js index 4081119..3bcfb6a 100644 --- a/packageBookService/pages/bookServices/detail/components/testResource/testResource.js +++ b/packageBookService/pages/bookServices/detail/components/testResource/testResource.js @@ -13,6 +13,14 @@ type: Object, value: "", }, + tab: { + type: String, + value: "", + }, + openIds: { + type: Array, + value: [], + }, mockData: { type: Object, value: {}, @@ -27,6 +35,8 @@ radioItem: "test", loading: false, }, + + ready() {}, /** * 缁勪欢鐨勬柟娉曞垪琛� @@ -43,7 +53,8 @@ }) }, async goTest(e) { - const value = e.currentTarget.dataset.value; + console.log(e, 666) + const value = e.detail.value.item; const token = wx.getStorageSync("jsek-token"); if (!token) { return wx.getUserProfile({ diff --git a/packageBookService/pages/bookServices/detail/components/testResource/testResource.json b/packageBookService/pages/bookServices/detail/components/testResource/testResource.json index d4a6209..b12d54f 100644 --- a/packageBookService/pages/bookServices/detail/components/testResource/testResource.json +++ b/packageBookService/pages/bookServices/detail/components/testResource/testResource.json @@ -5,6 +5,7 @@ "t-image": "tdesign-miniprogram/image/image", "t-radio": "tdesign-miniprogram/radio/radio", "t-radio-group": "tdesign-miniprogram/radio-group/radio-group", - "t-empty": "tdesign-miniprogram/empty/empty" + "t-empty": "tdesign-miniprogram/empty/empty", + "tree": "/packageBookService/pages/bookServices/detail/components/testTree/index" } } \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/testResource/testResource.wxml b/packageBookService/pages/bookServices/detail/components/testResource/testResource.wxml index 62e7239..f50f50d 100644 --- a/packageBookService/pages/bookServices/detail/components/testResource/testResource.wxml +++ b/packageBookService/pages/bookServices/detail/components/testResource/testResource.wxml @@ -2,27 +2,15 @@ <view class="test-resource"> <view class="top-btn"> <view class="test-radio"> - <view - class="test-btn card {{radioItem == 'test' ? 'card--active' : ''}}" - bind:tap="testBtn" - > + <view class="test-btn card {{radioItem == 'test' ? 'card--active' : ''}}" bind:tap="testBtn"> <view class="image-box"> - <image - class="test-icon" - src="{{ radioItem == 'test' ? '/static/images/bookService/detail/practice-icon.png' : '/static/images/bookService/detail/notest.png'}}" - mode="aspectFit" - ></image> + <image class="test-icon" src="{{ radioItem == 'test' ? '/static/images/bookService/detail/practice-icon.png' : '/static/images/bookService/detail/notest.png'}}" mode="aspectFit"></image> </view> <view class="btn-content-text">缁冧範</view> </view> - <view - class="test-btn card {{radioItem == 'mock' ? 'card--active' : ''}}" - bind:tap="mockBtn" - > + <view class="test-btn card {{radioItem == 'mock' ? 'card--active' : ''}}" bind:tap="mockBtn"> <view class="image-box"> - <image - src="{{ radioItem == 'mock' ? '/static/images/bookService/detail/checkpaper.png' : '/static/images/bookService/detail/zujuan.png'}}" - ></image> + <image src="{{ radioItem == 'mock' ? '/static/images/bookService/detail/checkpaper.png' : '/static/images/bookService/detail/zujuan.png'}}"></image> </view> <view class="btn-content-text">缁勫嵎</view> </view> @@ -60,45 +48,22 @@ </view> </t-radio-group> --> <view class="btn-box"> - <t-button - class="error-btn" - theme="default" - size="medium" - style="padding: 0 12rpx" - bind:tap="goMycollect" - data-answerType="errorQuestion" - > + <t-button class="error-btn" theme="default" size="medium" style="padding: 0 12rpx" bind:tap="goMycollect" data-answerType="errorQuestion"> <view slot="content" class="btn-content"> <image src="/static/images/bookService/detail/cuoti.png"></image> <text class="primary-color">鎴戠殑閿欓</text> </view> </t-button> - <t-button - class="collect-btn" - theme="default" - size="medium" - style="padding: 0 12rpx" - bind:tap="goMycollect" - data-answerType="collectQuestion" - > + <t-button class="collect-btn" theme="default" size="medium" style="padding: 0 12rpx" bind:tap="goMycollect" data-answerType="collectQuestion"> <view slot="content" class="btn-content"> - <image - src="/static/images/bookService/detail/wodeshoucang.png" - ></image> + <image src="/static/images/bookService/detail/wodeshoucang.png"></image> <text class="primary-color"> 鎴戠殑鏀惰棌</text> </view> </t-button> </view> </view> <!-- 缁冧範鍒楄〃 --> - <view - class="resource-list" - wx:for="{{list}}" - wx:key="id" - wx:if="{{radioItem == 'test'}}" - bind:tap="goTest" - data-value="{{item}}" - > + <!-- <view class="resource-list" wx:for="{{list}}" wx:key="id" wx:if="{{radioItem == 'test'}}" bind:tap="goTest" data-value="{{item}}"> <view class="list-title"> <image src="/static/images/bookService/detail/test-icon.png"></image> <text>{{item.name}}</text> @@ -106,16 +71,18 @@ <view class="practice"> <image src="/static/images/bookService/detail/lianxi-icon.png"></image> </view> + </view> --> + <!-- 缁冧範鍒楄〃鏍戠粨鏋� --> + <view wx:if="{{radioItem == 'test'}}"> + <tree id="test-tree" openIds="{{openIds}}" bookInfo="{{bookInfo}}" tab="{{tab}}" treeList="{{list}}" bind:goTest="goTest"></tree> + </view> + <view wx:if="{{noResources}}" class="noData" wx:if="{{radioItem == 'test' && !list.length}}"> + <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> </view> -<view - wx:if="{{noResources}}" - class="noData" - wx:if="{{radioItem == 'test' && !list.length}}" -> - <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> -</view> + + <!-- 缁勫嵎鍒楄〃 --> <view class="mock-data" wx:if="{{radioItem == 'mock'}}"> @@ -125,49 +92,29 @@ <t-button class="buy-mock-btn" bind:tap="buyMock">璐拱缁勫嵎</t-button> </view> <view class="mock-list" wx:if="{{mockData.mockList.length}}"> - <view - class="mock-list-box" - wx:for="{{mockData.mockList}}" - wx:key="id" - data-item="{{item}}" - bind:tap="goMackPaper" - > + <view class="mock-list-box" wx:for="{{mockData.mockList}}" wx:key="id" data-item="{{item}}" bind:tap="goMackPaper"> <view class="mock-title">{{item.name}}</view> <view class="mock-message"> <view class="message-box"> <view class="mack-state"> - <text wx:if="{{item.state == '3'}}" class="complete state-pad" - >宸插畬鎴�</text - > - <text - wx:elif="{{item.state == '2' || item.state == '1'}}" - class="Incomplete state-pad" - >鏈畬鎴�</text - > + <text wx:if="{{item.state == '3'}}" class="complete state-pad">宸插畬鎴�</text> + <text wx:elif="{{item.state == '2' || item.state == '1'}}" class="Incomplete state-pad">鏈畬鎴�</text> <text wx:else class="Incomplete state-pad">鏈紑濮�</text> </view> <view class="mock-time">{{item.createDate}}</view> </view> - <view class="mock-score" wx:if="{{item.state == '3'}}" - >{{item.report.userScore}}鍒�</view - > + <view class="mock-score" wx:if="{{item.state == '3'}}">{{item.report.userScore}}鍒�</view> </view> </view> </view> <view wx:else class="not-mock"> - <image - src="/static/images/bookService/examination/zhuangtai-icon.png" - ></image> - <view class="not-mock-message note-mock-text" - >缁勫嵎鏄敹璐瑰姛鑳斤紝璇疯喘涔板悗浣跨敤锛�</view - > - <view class="note-mock-price note-mock-text" - >浠锋牸锛�<text class="mock-price">锟{mockData.price}}</text> 鍏�/娆�</view - > + <image src="/static/images/bookService/examination/zhuangtai-icon.png"></image> + <view class="not-mock-message note-mock-text">缁勫嵎鏄敹璐瑰姛鑳斤紝璇疯喘涔板悗浣跨敤锛�</view> + <view class="note-mock-price note-mock-text">浠锋牸锛�<text class="mock-price">锟{mockData.price}}</text> 鍏�/娆�</view> <t-button class="buy-mock-btn" bind:tap="buyMock">璐拱缁勫嵎</t-button> </view> </view> <view class="loading-box" wx:if="{{}}"> <t-loading loading="{{}}" /> </view> -</view> +</view> \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/testTree/components/util.js b/packageBookService/pages/bookServices/detail/components/testTree/components/util.js new file mode 100644 index 0000000..c316097 --- /dev/null +++ b/packageBookService/pages/bookServices/detail/components/testTree/components/util.js @@ -0,0 +1,27 @@ +/* 鍔犺浇鍔ㄧ敾鐩稿叧 */ +const showLoading = (tips = '鍔犺浇涓�...') => { + wx.showNavigationBarLoading() + wx.showLoading({ + title: tips, + }) +} + +const hideLoading = () => { + wx.hideLoading() + wx.hideNavigationBarLoading() +} + +const hideLoadingWithErrorTips = (err = '璧勬簮涓嶅彲鐢紝璇疯仈绯荤鐞嗗憳') => { + hideLoading() + wx.showToast({ + title: err, + icon: 'error', + duration: 2000 + }) +} + +module.exports = { + showLoading: showLoading, + hideLoading: hideLoading, + hideLoadingWithErrorTips: hideLoadingWithErrorTips, +} \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/testTree/index.js b/packageBookService/pages/bookServices/detail/components/testTree/index.js new file mode 100644 index 0000000..ad201da --- /dev/null +++ b/packageBookService/pages/bookServices/detail/components/testTree/index.js @@ -0,0 +1,70 @@ +const util = require("./components/util"); // 寮曞叆灏佽杩囩殑鍔犺浇鎻愮ず +import { + loginInfo +} from "../../../../../../assets/js/login"; +const app = getApp(); +Component({ + properties: { + treeList: { + type: Array, + value: [], + }, + bookInfo: { + type: Object, + value: {}, + }, + tab: { + type: String, + value: "", + }, + openIds: { + type: Array, + value: [], + }, + }, + data: {}, + ready() {}, + + onLoad() { + console.log(this.properties.openIds, "1111") + }, + + methods: { + + // 鑺傜偣灞曞紑 + handleChange(e) { + console.log(e, 123) + this.setData({ + openIds: e.detail.value, + }); + }, + goTest(e) { + console.log(e, 234) + const value = e.currentTarget.dataset; + var myEventDetail = { + value, + }; + this.triggerEvent("goTest", myEventDetail); + + }, + // 璺宠浆闊宠棰戞挱鏀惧櫒 + goPlayer(e) { + // 妫�鏌ョ櫥褰曠姸鎬� + const token = wx.getStorageSync(app.config.tokenKey); + if (token) { + const item = e.currentTarget.dataset.item; + const parent = e.currentTarget.dataset.parent; + console.log('item', item); + const parentProductLinkPath = parent ? + parent.productLinkPath : + wx.getStorageSync("teachResourcesPath"); + const parentName = parent ? parent.name : "鏁欏璧勬簮"; + let url; + wx.navigateTo({ + url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parentProductLinkPath}&parentName=${parentName}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}&formPath=${this.properties.tab}&applyState=${this.properties.applyState}&deadline=${this.properties.deadline}`, + }); + + } + }, + }, +}); \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/testTree/index.json b/packageBookService/pages/bookServices/detail/components/testTree/index.json new file mode 100644 index 0000000..ae819a7 --- /dev/null +++ b/packageBookService/pages/bookServices/detail/components/testTree/index.json @@ -0,0 +1,13 @@ +{ + "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": "/packageBookService/pages/bookServices/detail/components/testTree/index", + "t-empty": "tdesign-miniprogram/empty/empty" + } +} \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/testTree/index.wxml b/packageBookService/pages/bookServices/detail/components/testTree/index.wxml new file mode 100644 index 0000000..a658307 --- /dev/null +++ b/packageBookService/pages/bookServices/detail/components/testTree/index.wxml @@ -0,0 +1,55 @@ +<view class="tree"> + <t-collapse default-value="{{openIds}}" catchchange="handleChange"> + <view wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" wx:if="{{!item.children }}"> + <view class="listItems" wx:if="{{!item.children}}"> + <view class="itemsInfo" data-item="{{item}}" data-index="{{index}}"> + <view class="contentBox" bind:tap="goTest" data-item="{{item}}" data-parent="{{''}}"> + <view class="box-image fl-cn" style="width: 80%"> + <!-- 娴嬭瘯棰� --> + <view class="teach-icon fl-cn"> + <image src="/static/images/bookService/detail/test-icon.png" mode="" /> + </view> + <!-- 鍚嶇О --> + <text class="name" style="width: 100%">{{item.name || '-'}}</text> + </view> + <view> + <image src="/static/images/bookService/detail/lianxi-icon.png" class="testSee"></image> + </view> + </view> + </view> + </view> + </view> + <t-collapse-panel wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" value="{{item.id}}" wx:if="{{item.children}}"> + <view slot="header" class="header-title"> + <view class="title-checkBox"> + <!-- 绔犺妭鍚� --> + <view class="title-box"> + <view class="title-name">{{item.name}} </view> + </view> + </view> + </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.children}}"> + <view class="itemsInfo" data-item="{{citem}}" data-index="{{cindex}}"> + <view class="contentBox" bind:tap="goTest" data-item="{{citem}}" data-parent="{{item}}"> + <view class="box-image fl-cn"> + <!-- 浜戞祴璇曞浘鏍� --> + <view class="teach-icon fl-cn"> + <image src="/static/images/bookService/detail/test-icon.png" mode="" /> + </view> + <!-- 鍚嶇О --> + <text class="name">{{citem.name || '-'}}</text> + </view> + <view> + <image src="/static/images/bookService/detail/lianxi-icon.png" class="testSee"></image> + </view> + </view> + </view> + </view> + <!-- // 鍒ゆ柇 涓嶆槸鍟嗗搧 鏈夊瓙椤� 閫掑綊缁勪欢 --> + <tree wx:if="{{ citem.children }}" bookInfo="{{bookInfo}}" treeList="{{[citem]}}" tab="{{tab}}" openIds="{{openIds}}"></tree> + </view> + </t-collapse-panel> + </t-collapse> +</view> \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/testTree/index.wxss b/packageBookService/pages/bookServices/detail/components/testTree/index.wxss new file mode 100644 index 0000000..fd8e1e5 --- /dev/null +++ b/packageBookService/pages/bookServices/detail/components/testTree/index.wxss @@ -0,0 +1,115 @@ +.tree { + --td-collapse-content-padding: 0rpx 12rpx 0rpx 12rpx; + --td-collapse-header-text-color: #ff6c00; + --td-collapse-icon-color: #ff6c00; + --td-collapse-header-height: min-content; +} + +.header-title { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + --td-checkbox-vertical-padding: 0; +} + +.title-box { + width: 100%; + display: flex; + align-items: center; +} + +.title-checkBox { + width: 100%; + display: flex; +} + +.title-name { + height: min-content; +} + +.t-class { + background-color: #f7f7f7; +} + +.t-class-content { + padding: 0; +} + +.download-image { + width: 32rpx; + height: 32rpx; +} + +.contentBox { + margin: 0 26rpx; + padding: 0 20rpx; + 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 { + 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; + height: 44rpx; +} + +.teach-btn { + display: flex; + align-items: center; +} + +.testSee, +.need-buy, +.shopCar { + width: 38rpx; + height: 38rpx; +} + +.testSee, +.shopCar { + margin-right: 20rpx; +} + +.list-icon { + width: 32rpx; + height: 18rpx; +} + +.listItems { + padding-bottom: 20rpx; +} + +/* .t-collapse-panel__content { + padding: var(--td-collapse-content-padding, 0rpx) !important; +} */ + +.fl-cn { + display: flex; + align-items: center; +} \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/testTree/tree/components/util.js b/packageBookService/pages/bookServices/detail/components/testTree/tree/components/util.js new file mode 100644 index 0000000..c316097 --- /dev/null +++ b/packageBookService/pages/bookServices/detail/components/testTree/tree/components/util.js @@ -0,0 +1,27 @@ +/* 鍔犺浇鍔ㄧ敾鐩稿叧 */ +const showLoading = (tips = '鍔犺浇涓�...') => { + wx.showNavigationBarLoading() + wx.showLoading({ + title: tips, + }) +} + +const hideLoading = () => { + wx.hideLoading() + wx.hideNavigationBarLoading() +} + +const hideLoadingWithErrorTips = (err = '璧勬簮涓嶅彲鐢紝璇疯仈绯荤鐞嗗憳') => { + hideLoading() + wx.showToast({ + title: err, + icon: 'error', + duration: 2000 + }) +} + +module.exports = { + showLoading: showLoading, + hideLoading: hideLoading, + hideLoadingWithErrorTips: hideLoadingWithErrorTips, +} \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/testTree/tree/index.js b/packageBookService/pages/bookServices/detail/components/testTree/tree/index.js new file mode 100644 index 0000000..f1caa20 --- /dev/null +++ b/packageBookService/pages/bookServices/detail/components/testTree/tree/index.js @@ -0,0 +1,640 @@ +const util = require("./components/util"); // 寮曞叆灏佽杩囩殑鍔犺浇鎻愮ず +import { + loginInfo +} from "../../../../../../assets/js/login"; +const app = getApp(); +Component({ + properties: { + treeList: { + type: Array, + value: [], + }, + learnList: { + type: Array, + value: [], + }, + bookInfo: { + type: Object, + value: {}, + }, + buyIds: { + type: Array, + value: [], + }, + tab: { + type: String, + value: "", + }, + applyState: { + type: String, + value: "", + }, + openIds: { + type: Array, + value: [], + }, + isShowCheck: { + type: Boolean, + value: false, + }, + paymentPage: { + type: Boolean, + value: false, + }, + superior: { + type: Boolean, + value: false, + }, + checkAllState: { + type: Boolean, + }, + deadline: { + type: String, + }, + }, + data: { + sonPurchaseSaleMethodId: "", + superiorPurchaseSaleMethodId: [], + activeValues: [1, 2], + webpageSrc: "", + cloudShoppingCart: [], + selectAll: [], + shoppingCart: true, + stop: false, + cart: true, + canExecute: true + }, + ready() {}, + + onLoad() { + this.setData({ + sonPurchaseSaleMethodId: [], + }); + }, + observers: { + treeList: function (newValue) { + const list = []; + let checked = ""; + this.properties.treeList.forEach((item) => { + if (item.children && item.children.length > 0) { + list.push(...this.flattenTree([item])); + } + }); + const flag = list.findIndex((item) => item.checked == true); + }, + }, + + methods: { + handleList(tree) { + for (let index = 0; index < tree.length; index++) { + const item = tree[index]; + if (item.sysType == "CmsItem" && !item.checked) {} + if (item.children && item.children.length > 0) { + this.handleList(item.children); + } + } + }, + // 鑺傜偣灞曞紑 + handleChange(e) { + this.setData({ + openIds: e.detail.value, + }); + }, + 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) { + 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) { + if (data.saleMethod[0].State == "Disable") return false; + const isSHow = this.properties.buyIds.some( + (item) => item == data.saleMethod[0].Id + ); + return !isSHow; + } else { + return false; + } + }, + // 璺宠浆闊宠棰戞挱鏀惧櫒 + goPlayer(e) { + // 妫�鏌ョ櫥褰曠姸鎬� + const token = wx.getStorageSync(app.config.tokenKey); + if (token) { + const item = e.currentTarget.dataset.item; + const parent = e.currentTarget.dataset.parent; + console.log('item', item); + const parentProductLinkPath = parent ? + parent.productLinkPath : + wx.getStorageSync("teachResourcesPath"); + const parentName = parent ? parent.name : "鏁欏璧勬簮"; + let url; + if (item.selectType == 'zip') { + if (this.properties.applyState == 'Normal') { + return wx.showToast({ + icon: 'error', + title: '璇峰墠寰�PC绔笅杞�', + }) + } else { + return wx.showToast({ + icon: 'error', + title: '璇峰厛鐢宠涓嬭浇', + }) + } + } + if (this.properties.isShowCheck && this.resourceIsBuy(item)) { + return false; + } + if (item.selectType == "video" || item.learnSelectType == "video") { + url = "/packageDomain/pages/resourceDetails/myVideo/index"; + } else if ( + item.selectType == "audio" || + item.learnSelectType == "audio" + ) { + url = "/packageDomain/pages/resourceDetails/myAudio/index"; + } else if (item.selectType == "picture" || item.selectType == "zip") { + url = "/packageDomain/pages/resourceDetails/document/index"; + } + if ( + this.properties.tab == "jsek_cloudLearning" && + this.resourceIsBuy(item) + ) { + return wx.showToast({ + icon: "error", + title: item.saleMethod[0].Price > 0 ? + "璇峰厛璐拱璇ヨ祫婧�" : "璇峰厛鐐瑰嚮棰嗗彇鏌ョ湅鎸夐挳", + }); + } + if ( + item.saleMethod.length == 0 && + item.sysType == "CmsItem" && + this.properties.tab == "jsek_cloudLearning" + ) { + return wx.showToast({ + icon: "error", + title: "鏆傛湭寮�濮嬮攢鍞紝璇疯仈绯荤鐞嗗憳", + }); + } + if (this.properties.tab == "jsek_teachingResources" && (item.file || item.freeFile)) { + let file = item.fileMap[item.file] ? item.fileMap[item.file] : item.fileMap[item.freeFile] + if (file && file.protectType !== "Public") { + return wx.showToast({ + icon: "error", + title: "璧勬簮涓嶅彲鐢紝璇疯仈绯荤鐞嗗憳", + }); + } + } else if ((this.properties.tab == "jsek_teachingResources" || this.properties.tab == "jsek_cloudLearning") && (!item.file && !item.freeFile && !item.protectedFile)) { + return wx.showToast({ + icon: 'error', + title: '鏆傛棤璧勬簮', + }) + } + wx.navigateTo({ + url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parentProductLinkPath}&parentName=${parentName}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}&formPath=${this.properties.tab}&applyState=${this.properties.applyState}&deadline=${this.properties.deadline}`, + }); + if (item.selectType == "pdf") { + const fileLink = item.file ? item.file : item.freeFile + console.log(fileLink); + wx.navigateTo({ + url: "/packageBookService/pages/components/webView/index?md5=" + + fileLink + + "&fileName=" + + item.name + + "&fileType=" + + item.selectType + "&bookBuy=true" + }); + } + if (item.selectType == "document") { + // freeFile + // if (item.selectType == "document") { + // item.selectType = "pptx"; + // } + const fileLink = item.file ? + app.config.requestCtx + "/file/api/ApiDownload?md5=" + item.file : + app.config.requestCtx + + "/file/api/ApiDownload?md5=" + + item.freeFile; + console.log(fileLink, "fileLink"); + //鎻愮ず鍔犺浇涓� + // 鍗曟涓嬭浇鍏佽鐨勬渶澶ф枃浠朵负 200MB + wx.downloadFile({ + url: fileLink, + // filePath: wx.env.USER_DATA_PATH + `/${item.name}.${item.selectType}`, + filePath: wx.env.USER_DATA_PATH + `/${item.name}.${item.selectType}`, + success: function (res) { + console.log(res, "wx.downloadFile success res"); + if (res.statusCode != 200) { + util.hideLoadingWithErrorTips(); + return false; + } + var Path = res.tempFilePath; //杩斿洖鐨勬枃浠朵复鏃跺湴鍧�锛岀敤浜庡悗闈㈡墦寮�鏈湴棰勮鎵�鐢� + let data = res.filePath; + wx.openDocument({ + filePath: data, + showMenu: true, + success: function (res) { + console.log("鎵撳紑鎴愬姛"); + util.hideLoading(); + }, + }); + }, + fail: function (err) { + console.log(err, "wx.downloadFile fail err"); + util.hideLoadingWithErrorTips(); + }, + }); + } + if (item.selectType == "webpage") { + this.setData({ + webpageSrc: item.jsek_link, + }); + } + } + }, + + // 鎷垮埌鎵�鏈夐」 + 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); + } + } + console.log(this.properties.treeList, "this.properties.treeList"); + 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); + }); + // console.log(result, 'result'); + return result; + }, + + // 鍙樹负true + findAndUpdateItemsByIds(tree, ids, state) { + function findAndUpdate(node) { + if (ids.includes(node.id)) { + // console.log(node, 'node'); + node.checked = state; // 灏嗙洰鏍囬」鐨� 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; // 杩斿洖淇敼鍚庣殑瀹屾暣鏁扮粍 + }, + + checkResoucrceInfo(tree, id) { + function findAndUpdate(node) { + if (node.sysType == "CmsFolder" && node.children.length > 0) { + for (let index = 0; index < node.children.length; index++) { + const element = node.children[index]; + findAndUpdate(element); + } + } else if (id == node.id && node.sysType == "CmsItem") { + node.checked = !node.checked; // 灏嗙洰鏍囬」鐨� check 灞炴�ц缃负 true + } + } + for (let node of tree) { + findAndUpdate(node); // 瀵规瘡涓《灞傝妭鐐规墽琛屾煡鎵惧拰鏇存柊鎿嶄綔 + } + return tree; // 杩斿洖淇敼鍚庣殑瀹屾暣鏁扮粍 + }, + // 鍏ㄩ�� + checkAll() { + const ids = []; + const list = []; + let checked = ""; + this.properties.treeList.forEach((item) => { + if (item.children && item.children.length > 0) { + list.push(...this.flattenTree([item])); + } + }); + list.forEach((item) => { + ids.push(item.id); + checked = item.checked; + }); + // const flag = + // list.findIndex((item) => item.checked == false) > -1 ? true : false; + const flag = this.properties.checkAllState; + // const updataList = this.findAndUpdateItemsByIds( + // this.properties.treeList, + // ids, + // flag + // ); + // this.setData({ + // treeList: updataList, + // }); + + var myEventDetail = { + ids, + flag, + }; // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟 + var myEventOption = { + bubbles: true, + composed: true, + }; // 瑙﹀彂浜嬩欢鐨勯�夐」 + this.triggerEvent("changeListChecked", myEventDetail, myEventOption); + + if (!checked) { + this.setData({ + selectAll: list, + }); + } + var myEventDetail = { + value: !flag, + }; // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟 + var myEventOption = { + bubbles: true, + composed: true, + }; // 瑙﹀彂浜嬩欢鐨勯�夐」 + this.triggerEvent("changeCheckAll", myEventDetail, myEventOption); + }, + + // 绔犺妭鍕鹃�� + checkResourceTitle(e) { + const flag = e.detail.checked; + // 杩欎釜鏃跺�檆hecked鐨勫�兼槸fals + let checkResourceTitleList = []; + const item = e.currentTarget.dataset.item; + const parent = this.findParentById(this.properties.learnList, item.id); + let childrenList; + let flagNum; + if (parent) + childrenList = parent.children.filter((citem) => citem.id !== item.id); + if (childrenList) + flagNum = childrenList.findIndex((item) => item.checked == false); + let list = this.flattenTree([item]); + let ids = []; + list.forEach((item) => { + if ( + item.sysType == "CmsFolder" || + (item.sysType == "CmsItem" && item.saleMethod.length) + ) + ids.push(item.id); + }); + var myEventDetail = { + ids, + flag, + }; // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟 + var myEventOption = { + bubbles: true, + composed: true, + }; // 瑙﹀彂浜嬩欢鐨勯�夐」 + this.triggerEvent("changeListChecked", myEventDetail, myEventOption); + if (flagNum == -1) { + let checkedState; + var myEventDetail = { + ids: [parent.id], + flag, + }; // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟 + var myEventOption = { + bubbles: true, + composed: true, + }; // 瑙﹀彂浜嬩欢鐨勯�夐」 + this.triggerEvent("changeListChecked", myEventDetail, myEventOption); + } + if (!list.checked) { + this.setData({ + superiorPurchaseSaleMethodId: list, + }); + } + list.forEach((items) => { + console.log(items.checked, "itesasd"); + if (!items.checked) { + this.setData({ + cloudShoppingCart: items, + }); + } + }); + this.setData({ + openIds: this.data.openIds, + }); + }, + // 瀛愰」鍕鹃�� + checkResource(e) { + const citem = e.currentTarget.dataset.item; + const parent = e.currentTarget.dataset.parent; + let outermost; + if (parent) + outermost = this.findParentById(this.properties.learnList, parent.id); + const childrenList = parent.children.filter( + (item) => item.id !== citem.id && item.saleMethod.length + ); + const flag = childrenList.findIndex((item) => item.checked == false); + // 鏀瑰彉璇ラ」checked + var myEventDetail = { + id: citem.id, + }; + var myEventOption = { + bubbles: true, + composed: true, + }; + this.triggerEvent("changeResourceChecked", myEventDetail, myEventOption); + // 閫氳繃鍒ゆ柇,鑱旈�氱埗绾hecked + if (flag == -1) { + let checkedState; + citem.checked == false ? (checkedState = true) : (checkedState = false); + var myEventDetail = { + ids: [parent.id], + flag: checkedState, + }; + var myEventOption = { + bubbles: true, + composed: true, + }; + this.triggerEvent("changeListChecked", myEventDetail, myEventOption); + } + // 鑱旈�氭渶澶栧眰绾hecked ,濡傛灉鏈変竴涓彇娑堝嬀閫�,涓斿綋鍓嶆渶澶栧眰鍕鹃��,鍒欏彇娑堟渶澶栧眰鐨勫嬀閫� + if (citem.checked && outermost && outermost.checked) { + var myEventDetail = { + ids: [outermost.id], + flag: false, + }; + var myEventOption = { + bubbles: true, + composed: true, + }; + this.triggerEvent("changeListChecked", myEventDetail, myEventOption); + } + // 鑱旈�氭渶澶栧眰绾hecked, 濡傛灉鎵�鏈夊瓙椤瑰嬀閫�, 涓斿綋鍓嶆渶澶栧眰鏈嬀閫�, 鍒欏姞涓婃渶澶栧眰鐨勫嬀閫� + if (!citem.checked && outermost) { + let allchildren = this.flattenTree([outermost]); + allchildren = allchildren.filter( + (item) => + item.sysType == "CmsItem" && + item.id !== citem.id && + item.saleMethod.length + ); + const satate = allchildren.findIndex((item) => item.checked == false); + if (satate == -1) { + var myEventDetail = { + ids: [outermost.id], + flag: true, + }; + var myEventOption = { + bubbles: true, + composed: true, + }; + this.triggerEvent("changeListChecked", myEventDetail, myEventOption); + } + } + if (!citem.checked) { + //閫変腑鐨勬椂鍊欐坊鍔爄d + let sonPurchaseSaleMethodId = this.data.sonPurchaseSaleMethodId || []; + if (this.properties.paymentPage) { + sonPurchaseSaleMethodId = []; + this.properties.paymentPage = false; + } + if (!this.properties.paymentPage) { + sonPurchaseSaleMethodId.push(citem.saleMethod[0].Id); + } + this.setData({ + sonPurchaseSaleMethodId: sonPurchaseSaleMethodId, + }); + } else { + // 鍙栨秷閫変腑鐨勬椂鍊欏垹闄d + } + }, + // 鍔犲叆璐墿杞� + async onCloudShoppingCart(e) { + let shoppingCartGetId = []; + + const item = e.currentTarget.dataset.item; + console.log(item.isShopCar); + const saleMethodId = e.currentTarget.dataset.item.saleMethod[0].Id; + console.log(saleMethodId); + let query = { + start: 0, + size: 999, + filterList: [], + searchList: [], + }; + const res = await app.MG.store.getShoppingCartProductList(query); + res.datas.forEach((item) => { + shoppingCartGetId.push(item.saleMethod.id); + }); + if (shoppingCartGetId.includes(saleMethodId)) { + // this.data.updateShoppingCartHidden(); + // this.data.updateCloudLearning(); + wx.showToast({ + icon: "error", + title: "宸叉坊鍔�", + }); + this.setData({ + shoppingCart: false, + }); + } else { + let query = { + requests: [{ + saleMethodId: saleMethodId, + storeEventId: null, + // agentCode: '鐢靛瓙涔�' + }, ], + }; + const addRes = await app.MG.store.addShoppingCart(query); + console.log(addRes, "addRes"); + if (addRes) { + wx.showToast({ + icon: "success", + title: "娣诲姞鎴愬姛", + }); + item.isShopCar = false; + this.triggerEvent("updateCloudLearning"); + } + } + }, + sadd() { + this.triggerEvent("updateShoppingCartHidden"); + this.triggerEvent("updateCloudLearning"); + }, + findParentById(arr, id) { + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + // 妫�鏌ュ綋鍓嶉」鏄惁鍖归厤锛堝嵆瀹冩槸涓嶆槸鎴戜滑瑕佹壘鐨勯」锛� + if (item.id === id) { + // 濡傛灉褰撳墠椤瑰氨鏄垜浠鎵剧殑椤癸紝鍒欏畠娌℃湁鐖剁骇锛岃繑鍥� null + return null; + } + // 閫掑綊鏌ユ壘褰撳墠椤圭殑瀛愰」 + const child = this.findChildById(item.children, id); + if (child) { + // 濡傛灉鍦ㄥ瓙椤逛腑鎵惧埌鍖归厤鐨勯」锛岃繑鍥炲綋鍓嶉」浣滀负鐖剁骇 + return item; + } + } + // 濡傛灉娌℃湁鎵惧埌鍖归厤鐨勭埗椤癸紝杩斿洖 null + return null; + }, + // 杈呭姪鍑芥暟锛岀敤浜庨�掑綊鏌ユ壘瀛愰」 + findChildById(children, id) { + if (!children) { + return null; + } + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child.id === id) { + // 濡傛灉鎵惧埌鍖归厤鐨勯」锛岃繑鍥炲畠 + return child; + } + // 閫掑綊妫�鏌ュ瓙椤圭殑瀛愰」 + const subChild = this.findChildById(child.children, id); + if (subChild) { + return subChild; + } + } + // 濡傛灉娌℃湁鎵惧埌鍖归厤鐨勯」锛岃繑鍥� null + return null; + }, + }, +}); \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/testTree/tree/index.json b/packageBookService/pages/bookServices/detail/components/testTree/tree/index.json new file mode 100644 index 0000000..a3c8a81 --- /dev/null +++ b/packageBookService/pages/bookServices/detail/components/testTree/tree/index.json @@ -0,0 +1,13 @@ +{ + "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": "/packageBookService/pages/bookServices/detail/components/tree/index", + "t-empty": "tdesign-miniprogram/empty/empty" + } +} \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/testTree/tree/index.wxml b/packageBookService/pages/bookServices/detail/components/testTree/tree/index.wxml new file mode 100644 index 0000000..6f8344d --- /dev/null +++ b/packageBookService/pages/bookServices/detail/components/testTree/tree/index.wxml @@ -0,0 +1,322 @@ +<view class="tree"> + <t-collapse default-value="{{openIds}}" catchchange="handleChange"> + <view + wx:for="{{treeList}}" + wx:for-item="item" + wx:for-index="index" + wx:key="id" + wx:if="{{item.sysType== 'CmsItem' }}" + > + <view + class="listItems" + wx:if="{{item.childrenFolderCount <= 0 && item.sysType == 'CmsItem'}}" + > + <view class="itemsInfo" data-item="{{item}}" data-index="{{index}}"> + <view + class="contentBox" + bind:tap="goPlayer" + data-item="{{item}}" + data-parent="{{''}}" + > + <!-- 鏁欏璧勬簮 浜戝涔� 鍥炬爣 --> + <view class="box-image fl-cn" style="width: 80%"> + <view + class="checkBox" + wx:if="{{isShowCheck}}" + catchtap="catchTap" + > + <!-- checked="{{citem.checked}}" --> + <!-- <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}}" /> --> + <t-checkbox + disabled="{{!citem.saleMethod[0].Id}}" + icon="rectangle" + checked="{{item.checked}}" + data-item="{{item}}" + data-parent="{{item}}" + catch:change="checkResource" + /> + </view> + <!-- 鏁欏璧勬簮鍥炬爣 --> + <view class="teach-icon fl-cn"> + <image + wx:if="{{item.selectType == 'audio' || item.learnSelectType == 'audio'}}" + src="/static/images/bookService/detail/audioIcon.png" + mode="aspectFill" + /> + <image + wx:elif="{{item.selectType == 'video' || item.learnSelectType == 'video'}}" + src="/static/images/bookService/detail/video.png" + mode="aspectFill" + /> + <image + wx:elif="{{item.selectType == 'pdf'}}" + src="/static/images/bookService/detail/pdf.png" + mode="aspectFill" + /> + <image + wx:elif="{{item.selectType == 'webpage'}}" + src="/static/images/bookService/detail/net.png" + mode="aspectFill" + /> + <image + wx:elif="{{item.selectType == 'picture'}}" + src="/static/images/bookService/detail/picture.png" + mode="aspectFill" + /> + <image + wx:elif="{{item.selectType == 'zip'}}" + src="/static/images/bookService/detail/zip.png" + mode="aspectFill" + /> + <image + wx:elif="{{ item.fileMap[item.file].extension == 'doc' || item.fileMap[item.file].extension == 'docx'}}" + src="/static/images/bookService/detail/word.png" + mode="aspectFill" + /> + <image + wx:elif="{{ item.fileMap[item.file].extension == 'xlsx' || item.fileMap[item.file].extension == 'xlsx'}}" + src="/static/images/bookService/detail/excel.png" + mode="aspectFill" + /> + <image + wx:elif="{{ item.fileMap[item.file].extension == 'ppt' || item.fileMap[item.file].extension == 'pptx'}}" + src="/static/images/bookService/detail/PPT.png" + mode="aspectFill" + /> + <!-- 璧勬簮鏃犳枃浠跺唴瀹瑰浘鏍� --> + <image + wx:else + src="/static/images/bookService/detail/word.png" + mode="" + /> + </view> + <!-- 浜戝涔犲浘鏍� --> + <view> </view> + <!-- 鍚嶇О --> + <text class="name" style="width: 100%">{{item.name || '-'}}</text> + </view> + <!-- 鏁欏璧勬簮绫诲瀷 --> + <view class="teachClass fl-cn"> {{item.resourceClass}} </view> + <view class="teach-btn" wx:if="{{tab == 'jsek_teachingResources'}}"> + <!-- 涓嬭浇鎸夐挳 --> + <!-- <image + src="/static/images/bookService/detail/download-icon.png" + class="download-image" + data-value="{{citem}}" + catchtap="downloadTeach" + ></image> --> + </view> + <view wx:if="{{tab == 'jsek_cloudLearning'}}"> + <!-- 浜戝涔犺瘯鐪嬪浘鏍� --> + <image + src="/static/images/bookService/detail/shikan.png" + class="testSee" + wx:if="{{!item.isbuy ? false : item.freeFile ? true : false}}" + ></image> + <!-- 浜戝涔犲姞鍏ヨ喘鐗╄溅鍥炬爣 --> + <image + src="/static/images/bookService/detail/cart@2x.png" + wx:if="{{item.isShopCar}}" + class="shopCar" + data-item="{{item}}" + catch:tap="onCloudShoppingCart" + ></image> + <!-- 浜戝涔犺喘涔板浘鏍� --> + <image + src="/static/images/bookService/detail/need-buy.png" + class="need-buy" + wx:if="{{item.isbuy }}" + ></image> + </view> + </view> + </view> + </view> + </view> + <t-collapse-panel + wx:for="{{treeList}}" + wx:for-item="item" + wx:for-index="index" + wx:key="id" + value="{{item.id}}" + wx:if="{{item.sysType == 'CmsFolder' }}" + > + <view slot="header" class="header-title"> + <view class="title-checkBox" catchtap="catchTap"> + <t-checkbox + style="align-items: center" + icon="rectangle" + checked="{{item.checked}}" + data-item="{{item}}" + catchchange="checkResourceTitle" + wx:if="{{isShowCheck}}" + /> + <!-- 绔犺妭鍚� --> + <view class="title-box"> + <view class="title-name">{{item.name}} </view> + <view wx:if="{{item.sysType =='CmsFolder'}}" class="title-num"> + 锛坽{item.childrenItem}}锛� + </view> + </view> + </view> + </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.sysType == 'CmsItem'}}" + > + <view class="itemsInfo" data-item="{{citem}}" data-index="{{cindex}}"> + <view + class="contentBox" + bind:tap="goPlayer" + data-item="{{citem}}" + data-parent="{{item}}" + > + <!-- 鏁欏璧勬簮 浜戝涔� 鍥炬爣 --> + <view class="box-image fl-cn"> + <view + class="checkBox" + wx:if="{{isShowCheck}}" + catchtap="catchTap" + > + <!-- checked="{{citem.checked}}" --> + <!-- <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}}" /> --> + <t-checkbox + disabled="{{!citem.saleMethod[0].Id}}" + icon="rectangle" + checked="{{citem.checked}}" + data-item="{{citem}}" + data-parent="{{item}}" + catch:change="checkResource" + /> + </view> + <!-- 鏁欏璧勬簮鍥炬爣 --> + <view class="teach-icon fl-cn"> + <image + wx:if="{{citem.selectType == 'audio' || citem.learnSelectType == 'audio'}}" + src="/static/images/bookService/detail/audioIcon.png" + mode="aspectFill" + /> + <image + wx:elif="{{citem.selectType == 'video' || citem.learnSelectType == 'video'}}" + src="/static/images/bookService/detail/video.png" + mode="aspectFill" + /> + <image + wx:elif="{{citem.selectType == 'pdf'}}" + src="/static/images/bookService/detail/pdf.png" + mode="aspectFill" + /> + <image + wx:elif="{{citem.selectType == 'webpage'}}" + src="/static/images/bookService/detail/net.png" + mode="aspectFill" + /> + <image + wx:elif="{{citem.selectType == 'picture'}}" + src="/static/images/bookService/detail/picture.png" + mode="aspectFill" + /> + <image + wx:elif="{{citem.selectType == 'zip'}}" + src="/static/images/bookService/detail/zip.png" + mode="aspectFill" + /> + <image + wx:elif="{{ citem.fileMap[citem.file].extension == 'doc' || citem.fileMap[citem.file].extension == 'docx'}}" + src="/static/images/bookService/detail/word.png" + mode="aspectFill" + /> + <image + wx:elif="{{ citem.fileMap[citem.file].extension == 'xlsx' || citem.fileMap[citem.file].extension == 'xlsx'}}" + src="/static/images/bookService/detail/excel.png" + mode="aspectFill" + /> + <image + wx:elif="{{ citem.fileMap[citem.file].extension == 'ppt' || citem.fileMap[citem.file].extension == 'pptx'}}" + src="/static/images/bookService/detail/PPT.png" + mode="aspectFill" + /> + <!-- 璧勬簮鏃犳枃浠跺唴瀹瑰浘鏍� --> + <image + wx:else + src="/static/images/bookService/detail/word.png" + mode="" + /> + </view> + <!-- 浜戝涔犲浘鏍� --> + <view> </view> + <!-- 鍚嶇О --> + <text + class="name" + style="{{ tab == 'jsek_teachingResources' ? citem.resourceClass ? 'width: 420rpx' : 'width: 560rpx;' : (citem.isShopCar &&citem.isbuy ) ? 'width: 400rpx;' : (citem.isShopCar ||citem.isbuy) ? 'width:520rpx' : 'width:560rpx'}}" + >{{citem.name || '-'}}</text + > + </view> + <!-- 鏁欏璧勬簮绫诲瀷 --> + <view + class="teachClass fl-cn" + wx:if="{{citem.resourceClass && tab == 'jsek_teachingResources'}}" + > + {{citem.resourceClass}} + </view> + <view wx:if="{{tab == 'jsek_cloudLearning'}}"> + <!-- 浜戝涔犺瘯鐪嬪浘鏍� --> + <image + src="/static/images/bookService/detail/shikan.png" + class="testSee" + wx:if="{{!citem.isbuy ? false : citem.freeFile ? true : false}}" + ></image> + <!-- 浜戝涔犲姞鍏ヨ喘鐗╄溅鍥炬爣 --> + <image + src="/static/images/bookService/detail/cart@2x.png" + wx:if="{{citem.isShopCar}}" + class="shopCar" + data-item="{{citem}}" + catch:tap="onCloudShoppingCart" + ></image> + <!-- 浜戝涔犺喘涔板浘鏍� --> + <image + src="/static/images/bookService/detail/need-buy.png" + class="need-buy" + wx:if="{{citem.isbuy }}" + ></image> + </view> + </view> + </view> + </view> + <!-- // 鍒ゆ柇 涓嶆槸鍟嗗搧 鏈夊瓙椤� 閫掑綊缁勪欢 --> + <tree + wx:if="{{ citem.sysType == 'CmsFolder' }}" + isShowCheck="{{isShowCheck}}" + bookInfo="{{bookInfo}}" + treeList="{{[citem]}}" + learnList="{{learnList}}" + itemId="{{itemId}}" + tab="{{tab}}" + buyIds="{{buyIds}}" + openIds="{{openIds}}" + ></tree> + </view> + <!-- 鏆傛棤鏁版嵁 --> + <view wx:if="{{!item.children || !item.children.length}}" class="noData"> + <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> + </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> + +<web-view wx:if="{{webpageSrc}}" src="{{webpageSrc}}"></web-view> +<!-- <button bind:tap="sadd"> 65498</button> --> diff --git a/packageBookService/pages/bookServices/detail/components/testTree/tree/index.wxss b/packageBookService/pages/bookServices/detail/components/testTree/tree/index.wxss new file mode 100644 index 0000000..fd8e1e5 --- /dev/null +++ b/packageBookService/pages/bookServices/detail/components/testTree/tree/index.wxss @@ -0,0 +1,115 @@ +.tree { + --td-collapse-content-padding: 0rpx 12rpx 0rpx 12rpx; + --td-collapse-header-text-color: #ff6c00; + --td-collapse-icon-color: #ff6c00; + --td-collapse-header-height: min-content; +} + +.header-title { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + --td-checkbox-vertical-padding: 0; +} + +.title-box { + width: 100%; + display: flex; + align-items: center; +} + +.title-checkBox { + width: 100%; + display: flex; +} + +.title-name { + height: min-content; +} + +.t-class { + background-color: #f7f7f7; +} + +.t-class-content { + padding: 0; +} + +.download-image { + width: 32rpx; + height: 32rpx; +} + +.contentBox { + margin: 0 26rpx; + padding: 0 20rpx; + 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 { + 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; + height: 44rpx; +} + +.teach-btn { + display: flex; + align-items: center; +} + +.testSee, +.need-buy, +.shopCar { + width: 38rpx; + height: 38rpx; +} + +.testSee, +.shopCar { + margin-right: 20rpx; +} + +.list-icon { + width: 32rpx; + height: 18rpx; +} + +.listItems { + padding-bottom: 20rpx; +} + +/* .t-collapse-panel__content { + padding: var(--td-collapse-content-padding, 0rpx) !important; +} */ + +.fl-cn { + display: flex; + align-items: center; +} \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index fe3d06d..57f03e7 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -16,6 +16,7 @@ options: { id: "", name: "", + storeInfo: '', }, bookDetail: {}, bookClass: [], @@ -179,6 +180,7 @@ options: { id: options.id, name: options.name, + storeInfo: options.storeInfo, }, }); wx.setNavigationBarTitle({ @@ -348,6 +350,7 @@ "mockData.count": 0, }); const query = { + storeInfo: this.data.options.storeInfo, path: "*", queryType: "*", productId: id, @@ -770,7 +773,7 @@ }, // 鎵佸钩鍖栨暟鎹浆鎹ree - getTreeList(rootList, pathLength, newArr, path) { + getTreeList(rootList, pathLength, newArr, path, addNum) { for (const item of rootList) { // 姝ゅ鍘熸湰 item.productLinkPath.length == pathLength 浣� productLinkPath 闀垮害涓埆涔﹀瓨鍦�4銆�5浣嶄氦閿� if ((pathLength - item.productLinkPath.length >= 0 && pathLength - item.productLinkPath.length <= 3) && item.productLinkPath.includes(path)) { @@ -788,13 +791,13 @@ } // newArr.push(item) // 鍦ㄦ彃鍏ヨ繃绋嬩腑瀵规暟鎹繘琛屾帓搴� - newArr = this.insertAndSortObjectsByProductLinkPath(newArr, item) + newArr = this.insertAndSortObjectsByProductLinkPath(newArr, item, addNum) } } //缁欐暟缁勯噷闈㈠啀娣诲姞涓�涓猚hildren鐨勭┖鏁扮粍 for (const i of newArr) { i.children = [] - this.getTreeList(rootList, pathLength + 6, i.children, i.productLinkPath) + this.getTreeList(rootList, pathLength + addNum, i.children, i.productLinkPath, addNum) if (i.children.length == 0) { delete i.children } @@ -819,9 +822,9 @@ }, // 鎺掑簭鏁扮粍 鎸夌収productLinkPath - insertAndSortObjectsByProductLinkPath(array, newObj) { + insertAndSortObjectsByProductLinkPath(array, newObj, addNum) { // 鏌ユ壘鏂板璞″簲璇ユ彃鍏ョ殑浣嶇疆 - let insertIndex = array.findIndex(obj => Number(newObj.productLinkPath.substring(newObj.productLinkPath.length - 6, newObj.productLinkPath.length)) < Number(obj.productLinkPath.substring(obj.productLinkPath.length - 6, obj.productLinkPath.length))); + let insertIndex = array.findIndex(obj => Number(newObj.productLinkPath.substring(newObj.productLinkPath.length - addNum, newObj.productLinkPath.length)) < Number(obj.productLinkPath.substring(obj.productLinkPath.length - addNum, obj.productLinkPath.length))); // 濡傛灉娌℃湁鎵惧埌鍚堥�傜殑浣嶇疆锛屽垯鏀惧湪鏁扮粍鏈熬 if (insertIndex === -1) { @@ -832,10 +835,10 @@ // 娴嬭瘯6 姝e紡5 // 瀵规暟缁勮繘琛屾帓搴� array.sort((a, b) => { - if (Number(a.productLinkPath.substring(a.productLinkPath.length - 5, a.productLinkPath.length)) < Number(b.productLinkPath.substring(b.productLinkPath.length - 5, b.productLinkPath.length))) { + if (Number(a.productLinkPath.substring(a.productLinkPath.length - addNum, a.productLinkPath.length)) < Number(b.productLinkPath.substring(b.productLinkPath.length - addNum, b.productLinkPath.length))) { return -1; } - if (Number(a.productLinkPath.substring(a.productLinkPath.length - 5, a.productLinkPath.length)) > Number(b.productLinkPath.substring(b.productLinkPath.length - 5, b.productLinkPath.length))) { + if (Number(a.productLinkPath.substring(a.productLinkPath.length - addNum, a.productLinkPath.length)) > Number(b.productLinkPath.substring(b.productLinkPath.length - addNum, b.productLinkPath.length))) { return 1; } // a must be equal to b @@ -854,6 +857,7 @@ let query = { path: '*', queryType: '*', + storeInfo: this.data.options.storeInfo, productId: this.data.bookDetail.id, cmsPath: type.productLinkPath, cmsType: '*', @@ -920,8 +924,9 @@ }) } } - const num = query.cmsPath.length + 6 - this.getTreeList(res.datas.cmsDatas[0].datas, num, list, '\\') + const addNum = query.cmsPath.length > 12 ? 7 : query.cmsPath.length > 14 ? 8 : 6 + const num = query.cmsPath.length + addNum + this.getTreeList(res.datas.cmsDatas[0].datas, num, list, '\\', addNum) list = this.ensureTreeConsistency(list) list = this.changeResourceChildren(list) console.log('淇敼鍚庝簯', list); @@ -963,8 +968,10 @@ let query = { path: "*", queryType: "*", + storeInfo: this.data.options.storeInfo, productId: this.data.bookDetail.id, cmsPath: type.productLinkPath, + cmsType: '*', itemFields: { SysType: "CmsFolder", // 璧勬簮绫诲瀷锛岃瘯璇绘枃浠讹紝鏄惁鍏佽涓嬭浇绛夊弬鏁� @@ -993,59 +1000,24 @@ } // 浜戞祴璇曪紝閫掑綊璇锋眰閲屽眰鏁版嵁 if (type.refCode == "questionBank") { - const data = res.datas.cmsDatas[0].datas.filter( - (item) => item.refCode == "jsek_questionBank" - ); - if (data.length) return this.getResourceData(data[0]); - } - //鏁欏璧勬簮 浜戝涔� - if ( - type.refCode == "jsek_teachingResources" || - type.refCode == "jsek_cloudLearning" - ) { - if (res.datas.cmsDatas[0].datas.length > 0) { - res.datas.cmsDatas[0].datas.forEach((item) => { - item.checked = false; - }); - const list = await this.getAllResource(res.datas.cmsDatas[0].datas); + const data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder' && item.childrenFolderCount > 0); + if (data.length > 0) { + let list = [] + console.log(query.cmsPath, query.cmsPath.length) + // 娴嬭瘯 6浣�// 姝e紡 5浣�// 娴嬭瘯璋冪敤浼�20锛屽唴閮�7 姝e紡璋冪敤浼�17 鍐呴儴浼�6 + const addNum = query.cmsPath.length > 12 ? 7 : query.cmsPath.length > 14 ? 8 : 6 + const num = query.cmsPath.length + addNum + this.getTreeList(data, num, list, '\\', addNum) + list = this.ensureTreeConsistency(list) let result = []; - if (type.refCode == "jsek_teachingResources") { - this.findChildIds(list, result); - this.setData({ - teach: list, - loading: false, - openTeachids: result, - }); - } else if (type.refCode == "jsek_cloudLearning") { - let arr = this.handleTreeData(list).filter( - (item) => item.saleMethod[0] - ); - let freeIds = arr.filter((item) => { - return item.saleMethod[0].Price == 0; - }); - if (!freeIds.length) - this.setData({ - isshowDrawBtn: false, - }); - this.findChildIds(list, result); - this.setData({ - learn: list, - loading: false, - openLearnids: result, - }); - } - console.log(list, '浜戝缈�789'); - } else { - // 鏃犳暟鎹� + this.findChildIds(list[0].children, result); + this.setData({ + test: list[0].children, + loading: false, + openTeachids: result, + }); + console.log(this.data.test, "test") } - } else if (type.refCode == "jsek_questionBank") { - // const list = await this.getAllResource(res.datas.cmsDatas[0].datas) - this.setData({ - test: res.datas.cmsDatas[0].datas, - loading: false, - }); - } else { - console.log("鍏朵粬"); } }) .catch((e) => { @@ -1070,6 +1042,7 @@ let query = { path: "*", queryType: "*", + storeInfo: this.data.options.storeInfo, productId: this.data.bookDetail.id, cmsPath: path, itemFields: { @@ -1234,7 +1207,6 @@ // 鍙戣捣璁㈠崟鍒濆鍖栬姹傚苟绛夊緟缁撴灉 const res = await app.MG.store.initOrder(query); // 鑾峰彇璁㈠崟鍙峰苟璧嬪�肩粰 orderNumber.value - console.log(res, 'res456'); bookOrdersId = res.orderNumber; // 妫�鏌ヨ鍗曞彿鏄惁瀛樺湪 if (bookOrdersId) { diff --git a/packageBookService/pages/bookServices/detail/index.wxml b/packageBookService/pages/bookServices/detail/index.wxml index 0dd9e4d..e4f2ca0 100644 --- a/packageBookService/pages/bookServices/detail/index.wxml +++ b/packageBookService/pages/bookServices/detail/index.wxml @@ -4,12 +4,7 @@ <!-- pageLoading --> <!--瀵艰埅鍖哄煙 --> -<suggest-dialog - class="suggest-dialog" - showIndex="{{showIndex}}" - bookIcon="{{bookDetail.icon}}" - bookName="{{bookDetail.name}}" -></suggest-dialog> +<suggest-dialog class="suggest-dialog" showIndex="{{showIndex}}" bookIcon="{{bookDetail.icon}}" bookName="{{bookDetail.name}}"></suggest-dialog> <!-- <popup showIndex="{{showIndex}}"></popup> --> <view class="page-bookService" wx:if="{{!pageLoading}}"> <!-- <view style="width: 100%; height: {{barHeight}}px; "></view> @@ -28,45 +23,25 @@ </view> --> <t-toast id="t-toast" /> <movable-area class="movable-area"> - <scroll-view - scroll-y="{{true}}" - class="book" - bindscrolltolower="onReachBottom" - > + <scroll-view scroll-y="{{true}}" class="book" bindscrolltolower="onReachBottom"> <!-- 鍥句功璇︽儏 --> <view class="book-box"> <view class="book-detail" id="book-detail"> <view class="detail-left"> <view class="book-img"> - <image - loading="" - src="{{bookDetail.icon ? bookDetail.icon : '/static/images/default-book-img.png'}}" - mode="aspectFit" - aria-label="{{bookDetail.name}}" - /> + <image loading="" src="{{bookDetail.icon ? bookDetail.icon : '/static/images/default-book-img.png'}}" mode="aspectFit" aria-label="{{bookDetail.name}}" /> </view> <view class="book-use"> <view class="collect" bind:tap="setCollect"> <view> - <image - loading="" - src="/static/images/bookService/detail/collect.png" - wx:if="{{!bookDetail.isFavourite}}" - /> - <image - loading="" - src="/static/images/bookService/detail/collecting.png" - wx:if="{{bookDetail.isFavourite}}" - /> + <image loading="" src="/static/images/bookService/detail/collect.png" wx:if="{{!bookDetail.isFavourite}}" /> + <image loading="" src="/static/images/bookService/detail/collecting.png" wx:if="{{bookDetail.isFavourite}}" /> </view> <view class="use-title">鏀惰棌</view> </view> <view class="suggest" bind:tap="suggestBtn"> <view> - <image - loading="" - src="/static/images/bookService/detail/suggest.png" - /> + <image loading="" src="/static/images/bookService/detail/suggest.png" /> </view> <view class="use-title">鎴戣寤鸿</view> </view> @@ -91,19 +66,12 @@ <view class="li-title">鍑虹増鏃堕棿锛�</view> <view class="li-content">{{bookDetail.publicationDate}}</view> </view> - <view - class="message-li" - wx:if="{{bookClass.length}}" - style="height: 80rpx" - > + <view class="message-li" wx:if="{{bookClass.length}}" style="height: 80rpx"> <view class="li-title">鍥句功鍒嗙被锛�</view> <view class="class-name showTow">{{bookClass}}</view> </view> </view> - <image - src="/static/images/bookService/detail/square.png" - class="right-background" - /> + <image src="/static/images/bookService/detail/square.png" class="right-background" /> </view> </view> <!-- 閿�鍞俊鎭� --> @@ -112,19 +80,12 @@ <!-- 鐢靛瓙涔﹀敭浠� --> <view class="electron-price" wx:if="{{bookDetail.price}}"> <view> - <image - src="/static/images/bookService/detail/electon-price.png" - /> + <image src="/static/images/bookService/detail/electon-price.png" /> </view> <view class="price"> - <view class="price-text" - >{{bookDetail.price == '0.00' ? '鍏嶈垂' : '楼'+ - bookDetail.price}}</view - > - <view - class="price-old" - wx:if="{{bookDetail.oldPrice != '0.00'}}" - >楼{{bookDetail.oldPrice}} + <view class="price-text">{{bookDetail.price == '0.00' ? '鍏嶈垂' : '楼'+ + bookDetail.price}}</view> + <view class="price-old" wx:if="{{bookDetail.oldPrice != '0.00'}}">楼{{bookDetail.oldPrice}} </view> </view> <view> </view> @@ -132,71 +93,27 @@ <!-- 绾歌川涔﹀敭浠� --> <view class="paper-price" wx:if="{{bookDetail.paperPrice}}"> <view> - <image - src="/static/images/bookService/detail/paper-price.png" - /> + <image src="/static/images/bookService/detail/paper-price.png" /> </view> - <view class="price" - >{{bookDetail.paperPrice == '0.00' ? '鍏嶈垂' : - '楼'+bookDetail.paperPrice}}</view - > + <view class="price">{{bookDetail.paperPrice == '0.00' ? '鍏嶈垂' : + '楼'+bookDetail.paperPrice}}</view> </view> </view> <!-- 缃戝簵 --> <view class="book-web"> - <image - src="/static/images/bookService/detail/jd.png" - wx:if="{{bookDetail.JDLink}}" - bind:tap="goShop" - data-link="{{bookDetail.JDLink}}" - data-type="jd" - /> - <image - class="tmall-image" - src="/static/images/bookService/detail/tmall.png" - bind:tap="goShop" - data-link="{{bookDetail.tmallLink}}" - wx:if="{{bookDetail.tmallLink}}" - /> - <image - src="/static/images/bookService/detail/dangdang.png" - bind:tap="goShop" - data-link="{{bookDetail.dangdangLink}}" - wx:if="{{bookDetail.dangdangLink}}" - /> - <image - src="/static/images/bookService/detail/weidian.png" - bind:tap="goShop" - data-link="{{bookDetail.weidianLink}}" - wx:if="{{bookDetail.weidianLink}}" - /> + <image src="/static/images/bookService/detail/jd.png" wx:if="{{bookDetail.JDLink}}" bind:tap="goShop" data-link="{{bookDetail.JDLink}}" data-type="jd" /> + <image class="tmall-image" src="/static/images/bookService/detail/tmall.png" bind:tap="goShop" data-link="{{bookDetail.tmallLink}}" wx:if="{{bookDetail.tmallLink}}" /> + <image src="/static/images/bookService/detail/dangdang.png" bind:tap="goShop" data-link="{{bookDetail.dangdangLink}}" wx:if="{{bookDetail.dangdangLink}}" /> + <image src="/static/images/bookService/detail/weidian.png" bind:tap="goShop" data-link="{{bookDetail.weidianLink}}" wx:if="{{bookDetail.weidianLink}}" /> </view> </view> </view> <view class="book-resource"> - <t-tabs - value="{{tabValue}}" - bind:change="onTabsChange" - t-class="custom-tabs" - t-class-content="custom-panel" - class="tab-class" - > - <t-tab-panel - label="鍥句功绠�浠�" - icon="{{ tabValue == 'brief' ? briefIconClick : briefIcon}}" - value="brief" - style="{{tabPanelstyle}}" - > - <book-brief - content="{{bookDetail.content}}" - authorIntroduction="{{bookDetail.authorIntroduction}}" - wx:if="{{bookDetail.content || bookDetail.authorIntroduction}}" - ></book-brief> - <view - wx:if="{{!bookDetail.content && !bookDetail.authorIntroduction && !loading}}" - class="noData" - > + <t-tabs value="{{tabValue}}" bind:change="onTabsChange" t-class="custom-tabs" t-class-content="custom-panel" class="tab-class"> + <t-tab-panel label="鍥句功绠�浠�" icon="{{ tabValue == 'brief' ? briefIconClick : briefIcon}}" value="brief" style="{{tabPanelstyle}}"> + <book-brief content="{{bookDetail.content}}" authorIntroduction="{{bookDetail.authorIntroduction}}" wx:if="{{bookDetail.content || bookDetail.authorIntroduction}}"></book-brief> + <view wx:if="{{!bookDetail.content && !bookDetail.authorIntroduction && !loading}}" class="noData"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> </t-tab-panel> @@ -207,37 +124,10 @@ style="{{tabPanelstyle}}" > </t-tab-panel> --> - <t-tab-panel - label="鏁欏璧勬簮" - icon="{{tabValue == 'jsek_teachingResources' ? teachResourcesClickIcon : teachResourcesIcon}}" - value="jsek_teachingResources" - class="{{loading ? 'loading': ''}}" - > - <view - wx:if="{{!loading && teach.length && !noResources && applyState}}" - > - <teach-resource - applyState="{{applyState}}" - rejectCause="{{rejectCause}}" - deadline="{{deadline}}" - bind:applyResource="applyResource" - applyResourceLoading="{{applyResourceLoading}}" - ></teach-resource> - <tree - id="teach-tree" - openIds="{{openTeachids}}" - bookInfo="{{bookDetail}}" - treeList="{{teach}}" - tab="{{tabValue}}" - applyState="{{applyState}}" - deadline="{{deadline}}" - bind:downloadTeach="downloadTeach" - bind:handleTree="handleTree" - openTeachids="{{openTeachids}}" - wx:if="{{teach.length}}" - isShoppingCart="isShoppingCart" - bind:updateCloudLearning="updateCloudLearning" - ></tree> + <t-tab-panel label="鏁欏璧勬簮" icon="{{tabValue == 'jsek_teachingResources' ? teachResourcesClickIcon : teachResourcesIcon}}" value="jsek_teachingResources" class="{{loading ? 'loading': ''}}"> + <view wx:if="{{!loading && teach.length && !noResources && applyState}}"> + <teach-resource applyState="{{applyState}}" rejectCause="{{rejectCause}}" deadline="{{deadline}}" bind:applyResource="applyResource" applyResourceLoading="{{applyResourceLoading}}"></teach-resource> + <tree id="teach-tree" openIds="{{openTeachids}}" bookInfo="{{bookDetail}}" treeList="{{teach}}" tab="{{tabValue}}" applyState="{{applyState}}" deadline="{{deadline}}" bind:downloadTeach="downloadTeach" bind:handleTree="handleTree" openTeachids="{{openTeachids}}" wx:if="{{teach.length}}" isShoppingCart="isShoppingCart" bind:updateCloudLearning="updateCloudLearning"></tree> </view> <!-- <t-loading theme="circular" @@ -246,87 +136,32 @@ loading="{{loading }}" /> --> <view wx:if="{{loading}}" style="width: 100%; height: min-content"> - <t-skeleton - row-col="{{rowCol}}" - theme="paragraph" - animation="gradient" - loading="{{loading}}" - ></t-skeleton> + <t-skeleton row-col="{{rowCol}}" theme="paragraph" animation="gradient" loading="{{loading}}"></t-skeleton> </view> <view wx:if="{{noResources && !loading}}" class="noData"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> </t-tab-panel> - <t-tab-panel - label="浜戝涔�" - icon="{{tabValue == 'jsek_cloudLearning' ? learnResourceClickIcon : learnResourceIcon}}" - value="jsek_cloudLearning" - style="{{tabPanelstyle}}" - > + <t-tab-panel label="浜戝涔�" icon="{{tabValue == 'jsek_cloudLearning' ? learnResourceClickIcon : learnResourceIcon}}" value="jsek_cloudLearning" style="{{tabPanelstyle}}"> <view wx:if="{{!loading && learn.length}}"> - <learn-resource - bind:getFreeResource="getFreeResource" - bind:allAddShoppiingCar="allAddShoppiingCar" - id="learn-resource" - buyResourceData="{{buyResourceData}}" - bookId="{{bookDetail.id}}" - isshowDrawBtn="{{isshowDrawBtn}}" - successOrderNumber="{{successOrderNumber}}" - isGoBuyResource="{{isGoBuyResource}}" - ></learn-resource> + <learn-resource bind:getFreeResource="getFreeResource" bind:allAddShoppiingCar="allAddShoppiingCar" id="learn-resource" buyResourceData="{{buyResourceData}}" bookId="{{bookDetail.id}}" isshowDrawBtn="{{isshowDrawBtn}}" successOrderNumber="{{successOrderNumber}}" isGoBuyResource="{{isGoBuyResource}}"></learn-resource> - <tree - id="tree" - openIds="{{openLearnids}}" - bookInfo="{{bookDetail}}" - tab="{{tabValue}}" - treeList="{{learn}}" - buyIds="{{buyIdList}}" - openLearnids="{{openLearnids}}" - bind:updateShoppingCartHidden="updateShoppingCartHidden" - bind:updateCloudLearning="updateCloudLearning" - ></tree> + <tree id="tree" openIds="{{openLearnids}}" bookInfo="{{bookDetail}}" tab="{{tabValue}}" treeList="{{learn}}" buyIds="{{buyIdList}}" openLearnids="{{openLearnids}}" bind:updateShoppingCartHidden="updateShoppingCartHidden" bind:updateCloudLearning="updateCloudLearning"></tree> </view> <view wx:if="{{noResources && !loading}}" class="noData"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> </t-tab-panel> - <t-tab-panel - label="浜戞祴璇�" - icon="{{tabValue == 'questionBank' ? testResourceClickIocn : testResourceIocn}}" - value="questionBank" - style="{{tabPanelstyle}}" - > + <t-tab-panel label="浜戞祴璇�" icon="{{tabValue == 'questionBank' ? testResourceClickIocn : testResourceIocn}}" value="questionBank" style="{{tabPanelstyle}}"> <view wx:if="{{!loading}}"> - <test-resource - id="test-resource" - list="{{test}}" - bookInfo="{{bookDetail}}" - mockData="{{mockData}}" - bind:buyMock="buyMock" - ></test-resource> + <test-resource id="test-resource" list="{{test}}" bookInfo="{{bookDetail}}" openIds="{{openLearnids}}" mockData="{{mockData}}" tab="{{tabValue}}" bind:buyMock="buyMock"></test-resource> </view> </t-tab-panel> - <t-tab-panel - label="浜戠瑪璁�" - icon="{{tabValue == 'jsek_note' ? noteClickIcon: noteIcon}}" - value="jsek_note" - style="{{tabPanelstyle}}" - > + <t-tab-panel label="浜戠瑪璁�" icon="{{tabValue == 'jsek_note' ? noteClickIcon: noteIcon}}" value="jsek_note" style="{{tabPanelstyle}}"> <note bookInfo="{{bookDetail}}" id="note" class="note-list"></note> </t-tab-panel> - <t-tab-panel - label="鐩稿叧鍥句功" - icon="{{tabValue == 'related_books' ? linkClickIcon: linkIcon}}" - value="related_books" - style="{{tabPanelstyle}}" - > - <related-books - relatedBookData="{{relatedBookData}}" - relatedBookLoading="{{relatedBookLoading}}" - noRelatedBookData="{{noRelatedBookData}}" - bind:goBookDetails="goBookDetails" - ></related-books> + <t-tab-panel label="鐩稿叧鍥句功" icon="{{tabValue == 'related_books' ? linkClickIcon: linkIcon}}" value="related_books" style="{{tabPanelstyle}}"> + <related-books relatedBookData="{{relatedBookData}}" relatedBookLoading="{{relatedBookLoading}}" noRelatedBookData="{{noRelatedBookData}}" bind:goBookDetails="goBookDetails"></related-books> </t-tab-panel> </t-tabs> </view> @@ -334,84 +169,44 @@ <movable-view class="movable-view" :x="{{x}}" :y="{{y}}" direction="all"> <view class="applyBox" bindtap="goApply"> <view class="box"> - <t-image - src="/static/images/home/yangshuForm1.png" - mode="heightFix" - class="img" - /> + <t-image src="/static/images/home/yangshuForm1.png" mode="heightFix" class="img" /> <view class="num" wx:if="{{num > 0}}">{{num}}</view> </view> </view> </movable-view> </movable-area> <!-- 鎴戣寤鸿寮圭獥 --> - <suggest - class="suggest-component" - id="suggest-component" - bookIcon="{{bookDetail.icon}}" - bookName="{{bookDetail.name}}" - ></suggest> + <suggest class="suggest-component" id="suggest-component" bookIcon="{{bookDetail.icon}}" bookName="{{bookDetail.name}}"></suggest> <!-- 鏁欏璧勬簮涓嬭浇鎻愮ず寮圭獥 --> - <t-dialog - class="teachDownloadDialog" - visible="{{isShowTeachDownload}}" - title="鎻愮ず" - content="璇峰墠寰�PC绔笅杞�" - confirm-btn="{{ confirmBtn }}" - bind:confirm="closeTeachDownload" - /> + <t-dialog class="teachDownloadDialog" visible="{{isShowTeachDownload}}" title="鎻愮ず" content="璇峰墠寰�PC绔笅杞�" confirm-btn="{{ confirmBtn }}" bind:confirm="closeTeachDownload" /> <!-- 璐拱鎸夐挳 --> <view class="box-bottom"> <view class="bottom-btn" bind:tap="appplyElectronicBook"> <view> - <t-image - loading="" - src="/static/images/bookService/detail/ebook.png" - ></t-image> + <t-image loading="" src="/static/images/bookService/detail/ebook.png"></t-image> </view> <view class="btn-text">鐢靛瓙鏍蜂功鐢宠</view> </view> <view class="bottom-btn" bind:tap="appplyPaperBook"> <view> - <t-image - src="/static/images/bookService/detail/paper-book.png" - ></t-image> + <t-image src="/static/images/bookService/detail/paper-book.png"></t-image> </view> <view class="btn-text">绾歌川鏍蜂功鐢宠</view> </view> - <view - class="{{!bookBuy && bookDetail.isSell ? 'bottom-btn tryRead' : 'bottom-btn try'}}" - bind:tap="goRead" - wx:if="{{!bookBuy}}" - > + <view class="{{!bookBuy && bookDetail.isSell ? 'bottom-btn tryRead' : 'bottom-btn try'}}" bind:tap="goRead" wx:if="{{!bookBuy}}"> <view> <t-image src="/static/images/bookService/detail/shidu.png"></t-image> </view> <view class="btn-text">璇曡</view> </view> - <view - class="shopCar shopCarColor" - bind:tap="addBookShopcCar" - wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell == '1'}}" - >鍔犲叆璐墿杞�</view - > - <view - class="buy buyColor" - bind:tap="buyBtn" - wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell == '1'}}" - >绔嬪嵆璐拱</view - > - <view - class="buy receiveColor" - bind:tap="buyBtn" - wx:if="{{!bookBuy && bookDetail.price == '0.00' && bookDetail.isSell == '1'}}" - >鍏嶈垂棰嗗彇</view - > + <view class="shopCar shopCarColor" bind:tap="addBookShopcCar" wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell == '1'}}">鍔犲叆璐墿杞�</view> + <view class="buy buyColor" bind:tap="buyBtn" wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell == '1'}}">绔嬪嵆璐拱</view> + <view class="buy receiveColor" bind:tap="buyBtn" wx:if="{{!bookBuy && bookDetail.price == '0.00' && bookDetail.isSell == '1'}}">鍏嶈垂棰嗗彇</view> <view class="buy read" bind:tap="goRead" wx:if="{{bookBuy}}">绔嬪嵆鏌ョ湅</view> </view> </view> <!-- <view class="loading" wx:if="{{pageLoading}}"> <t-loading loading="{{pageLoading}}" size="40"></t-loading> -</view> --> +</view> --> \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/index.wxss b/packageBookService/pages/bookServices/detail/index.wxss index 81b4630..41d633d 100644 --- a/packageBookService/pages/bookServices/detail/index.wxss +++ b/packageBookService/pages/bookServices/detail/index.wxss @@ -410,7 +410,6 @@ } .t-tabs .t-tabs__item--active { - background-repeat: no-repeat; background-size: 35%; background-position: 50% 40%; diff --git a/packageBookService/pages/bookServices/examination/examination.js b/packageBookService/pages/bookServices/examination/examination.js index 19c8ee5..a8121dc 100644 --- a/packageBookService/pages/bookServices/examination/examination.js +++ b/packageBookService/pages/bookServices/examination/examination.js @@ -14,6 +14,7 @@ countdownInterval: null, // 璁℃椂鍣� isCountdownRunning: true, // 鏄惁鍊掕鏃� countdownTime: 0, // 鍊掕鏃舵椂闂� + storeInfo: '', bookId: "", productLinkPath: "", rootCmsItemId: "", @@ -68,6 +69,7 @@ rootCmsItemId: options.rootCmsItemId, idPathList: options.idPathList ? JSON.parse(options.idPathList) : [], answerType: options.answerType, + storeInfo: options.storeInfo, }); wx.setNavigationBarTitle({ title: options.answerTitle, @@ -818,6 +820,7 @@ let query = { path: "*", queryType: "*", + storeInfo: this.data.storeInfo, productId: this.data.bookId, cmsPath: pathitem.productLinkPath, itemFields: { @@ -853,6 +856,19 @@ }); } res.datas.cmsDatas[0].datas.forEach((item, index) => { + if (this.data.storeInfo) { + if (item.Embedded_QuestionBank_QuestionType == 'singleChoice') { + pathitem.name = "鍗曢�夐" + } else if (item.Embedded_QuestionBank_QuestionType == 'shortAnswer') { + pathitem.name = "绠�绛旈" + } else if (item.Embedded_QuestionBank_QuestionType == "completion") { + pathitem.name = "濉┖棰�"; + } else if (item.Embedded_QuestionBank_QuestionType == "multipleChoice") { + pathitem.name = "澶氶�夐"; + } else if (item.Embedded_QuestionBank_QuestionType == "judge") { + pathitem.name = "鍒ゆ柇棰�"; + } + } let oldObj = ""; if (oldList) oldObj = oldList.find((oldItem) => oldItem.id == item.id); @@ -1339,6 +1355,7 @@ for (let qindex = 0; qindex < this.data.collectList.length; qindex++) { const qitem = this.data.collectList[qindex]; let query = { + storeInfo: this.data.storeInfo, path: "*", cmsPath: this.data.rootCmsItemId, cmsType: "*", @@ -1586,6 +1603,7 @@ let multipleChoiceArr = []; // 澶氶�� let completionArr = []; // 濉┖ let query = { + storeInfo: this.data.storeInfo, path: "*", cmsPath: this.data.rootCmsItemId, cmsType: "*", @@ -1871,6 +1889,7 @@ itemIds.push(item.id + ""); }); let query = { + storeInfo: this.data.storeInfo, path: "*", cmsPath: this.data.rootCmsItemId, cmsType: "*", diff --git a/packageBookService/pages/bookServices/examination/questionSchedule/index.js b/packageBookService/pages/bookServices/examination/questionSchedule/index.js index 2c91db6..49b5931 100644 --- a/packageBookService/pages/bookServices/examination/questionSchedule/index.js +++ b/packageBookService/pages/bookServices/examination/questionSchedule/index.js @@ -103,6 +103,8 @@ } else { return false } + } else if (typeof data == 'number') { + return true } else { return false } diff --git a/packageDomain/pages/resourceDetails/myVideo/index.js b/packageDomain/pages/resourceDetails/myVideo/index.js index 5311e4f..588d5d8 100644 --- a/packageDomain/pages/resourceDetails/myVideo/index.js +++ b/packageDomain/pages/resourceDetails/myVideo/index.js @@ -16,6 +16,7 @@ dialogKey: false, style: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx;', activeId: '', + storeInfo: '', bookId: '', bookName: '', cmsId: '', @@ -38,10 +39,10 @@ startTime: "", //杩涘叆椤甸潰褰撳墠鏃堕棿 pauseTime: 0, //鏆傚仠鏃堕棿 formPath: '', - loading: true, + loading: false, hidden: true, videoError: false, - videoLoaidng: false + videoLoading: false }, // 鏍煎紡鍖栫瑪璁版椂闂� convertTimestamp(timestamp) { @@ -69,6 +70,7 @@ navBarHeight: navBarHeight, barHeight: systInfo.statusBarHeight, activeId: options.activeId, + storeInfo: options.storeInfo, bookId: options.bookId, bookName: options.bookName, cmsId: options.cmsId, @@ -202,9 +204,10 @@ }, resourceDetailsData() { this.setData({ - videoLoaidng: true + // videoLoaidng: true }) let query = { + storeInfo: this.data.storeInfo, path: '*', queryType: '*', productId: this.data.bookId, @@ -229,7 +232,9 @@ } } app.MG.store.getProductDetail(query).then(res => { + console.log(this.data.productLinkPath, 345) res.datas.cmsDatas[0].datas.forEach((item) => { + console.log(item, 222) if (item.selectType === "video" || item.learnSelectType === "video") { this.data.threeLeveData.push(item) this.setData({ @@ -237,6 +242,7 @@ }) this.data.threeLeveData.forEach((items, index) => { // 淇敼姝ゅ娣诲姞index鍙傛暟 if (this.data.productLinkPath == items.productLinkPath) { + console.log(items, 5678) if (this.data.formPath === "jsek_cloudLearning") { let file items.protectedFile ? file = items.protectedFile : file = items.freeFile @@ -270,7 +276,7 @@ this.setData({ videoLoaidng: true, selectedId: e.currentTarget.dataset.index, - showData: '', + // showData: '', titleName: item.name }) if (item.selectType == "video" || item.learnSelectType === "video") { diff --git a/packageDomain/pages/resourceDetails/myVideo/index.wxml b/packageDomain/pages/resourceDetails/myVideo/index.wxml index 9209bd8..7c79ffc 100644 --- a/packageDomain/pages/resourceDetails/myVideo/index.wxml +++ b/packageDomain/pages/resourceDetails/myVideo/index.wxml @@ -14,18 +14,9 @@ <!-- autoplay='false' 鏄惁鑷姩鎾斁 --> <!-- <video binderror="videoErrorCallback" src="{{showData}}" play-btn-position='center' object-fit='fill' controls enable-play-gesture enable-auto-rotation></video> --> <view wx:if="{{videoLoaidng}}" class="video-loading"> - <t-loading - theme="circular" - size="60rpx" - class="wrapper" - loading="{{videoLoaidng}}" - /> + <t-loading theme="circular" size="60rpx" class="wrapper" loading="{{videoLoaidng}}" /> </view> - <video - show-center-play-btn="{{false}}" - src="{{showData}}" - bindloadedmetadata="loadedmetadata" - ></video> + <video show-center-play-btn="{{false}}" src="{{showData}}" bindloadedmetadata="loadedmetadata"></video> </view> <view wx:if="{{!videoChange}}" class="videoSubsidiaryBox"> @@ -35,37 +26,14 @@ <!-- 鏍囬 --> <view class="titleBox">{{titleName}}</view> <view class="contentBox"> - <t-tabs - defaultValue="{{0}}" - bind:change="onTabsChange" - bind:click="onTabsClick" - t-class="custom-tabs" - t-class-content="custom-panel" - split="{{false}}" - > + <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" t-class-content="custom-panel" split="{{false}}"> <!-- 璧勬簮鍒楄〃 --> - <t-tab-panel - label="璧勬簮鍒楄〃" - value="0" - style="{{tabPanelstyle}}" - style="width: 750rpx" - > + <t-tab-panel label="璧勬簮鍒楄〃" value="0" style="{{tabPanelstyle}}" style="width: 750rpx"> <view class="wrapper"> <view class="outsideDetailsName"> <view class="titleBox">{{parentName}}</view> - <view - class="detailsName" - wx:for="{{threeLeveData}}" - wx:key="index" - wx:for-item="item" - wx:for-index="index" - bind:tap="onVideo" - data-item="{{item}}" - data-index="{{index}}" - > - <view style="color: {{selectedId == index ? '#ff6c00' : '#000'}}" - >{{item.name}}</view - > + <view class="detailsName" wx:for="{{threeLeveData}}" wx:key="index" wx:for-item="item" wx:for-index="index" bind:tap="onVideo" data-item="{{item}}" data-index="{{index}}"> + <view style="color: {{selectedId == index ? '#ff6c00' : '#000'}}">{{item.name}}</view> </view> </view> </view> @@ -77,17 +45,9 @@ <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> <t-collapse value="{{activeValues}}" bind:change="handleChange"> - <t-collapse-panel - value="{{item.id}}" - expandIcon - wx:for="{{noteList}}" - wx:key="id" - > + <t-collapse-panel value="{{item.id}}" expandIcon wx:for="{{noteList}}" wx:key="id"> <view slot="header" class="collapse-header"> - <t-image - class="note-icon" - src="/static/images/bookService/detail/note-icon.png" - ></t-image> + <t-image class="note-icon" src="/static/images/bookService/detail/note-icon.png"></t-image> <view class="header-name">{{item.name}}</view> </view> <view> @@ -95,19 +55,9 @@ <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/compliceHover.png" class="complice" bind:tap="editNote" data-note="{{item}}"></t-image> <view></view> - <t-image - src="/static/images/bookService/detail/deleteHover.png" - class="delete" - bind:tap="deleteNote" - data-id="{{item.id}}" - ></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> @@ -120,10 +70,7 @@ <!-- 璁扮瑪璁� --> <view class="takeNotes" data-key="showCloseBtn" bind:tap="showDialog"> <view class="takeNotesLining"> - <image - src="/static/images/resourceDetails/jibiji锛廼con@2x.png" - mode="" - /> + <image src="/static/images/resourceDetails/jibiji锛廼con@2x.png" mode="" /> 璁扮瑪璁� </view> </view> @@ -131,62 +78,27 @@ </view> <!-- 璁扮瑪璁板脊绐� --> - <t-popup - visible="{{dialogKey}}" - bind:visible-change="onVisibleChange" - placement="center" - > + <t-popup visible="{{dialogKey}}" 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> + <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}}" - style="{{inputStyle}}" - data-value="{{false}}" - bind:enter="changeTitle" - bind:blur="changeTitle" - maxlength="{{50}}" - bind:change="inputChange" - ></t-input> + <t-input value="{{submitTitle}}" style="{{inputStyle}}" data-value="{{false}}" bind:enter="changeTitle" bind:blur="changeTitle" maxlength="{{50}}" bind:change="inputChange"></t-input> </view> </view> <view slot="content"> <view class="textarea-example"> <text class="textarea-example__label">鍐呭:</text> - <t-textarea - value="{{textvalue}}" - t-class="external-class" - placeholder="璇疯緭鍏ユ枃瀛�" - bordered - maxlength="500" - disableDefaultPadding="{{true}}" - indicator - style="{{inputStyle}}" - bind:change="textareaChange" - /> + <t-textarea value="{{textvalue}}" t-class="external-class" placeholder="璇疯緭鍏ユ枃瀛�" bordered maxlength="500" disableDefaultPadding="{{true}}" indicator style="{{inputStyle}}" bind:change="textareaChange" /> </view> <view class="submit-btn"> - <t-button theme="primary" size="large" block bind:tap="confirmSuggest" - >鎻愪氦</t-button - > + <t-button theme="primary" size="large" block bind:tap="confirmSuggest">鎻愪氦</t-button> </view> </view> </view> - <t-icon - t-class="close-btn" - name="close-circle" - size="32" - color="#fff" - bind:tap="closeDialog" - /> + <t-icon t-class="close-btn" name="close-circle" size="32" color="#fff" bind:tap="closeDialog" /> </t-popup> -</view> +</view> \ No newline at end of file diff --git a/pages/digitalCourses/digitalCoursesDetails/index.js b/pages/digitalCourses/digitalCoursesDetails/index.js index 5444f63..4c3d661 100644 --- a/pages/digitalCourses/digitalCoursesDetails/index.js +++ b/pages/digitalCourses/digitalCoursesDetails/index.js @@ -7,7 +7,6 @@ * 椤甸潰鐨勫垵濮嬫暟鎹� */ data: { - scrollJudge: true, loading: true, digitalsData: [], tabValue: 0, @@ -43,7 +42,20 @@ name: "/static/images/digitalCourses/tiwen-click@2x.png" }, - dialogBox: false + dialogBox: false, + lecturerList: [{ + icon: '', + name: '鏋楀磭寰�', + title: '璁插笀', + introduce: '涓浗瀛︾敓鍙戝睍鏍稿績绱犲吇鐮斿埗棣栧腑涓撳锛屽洿缁曞ぇ涓皬瀛︽暀鏉愬缓璁惧紑灞曚簡涓�绯诲垪寮�鍒涙�с�佸鍩烘�у伐浣溿�傚缓绔嬪畬鍠勪簡鎴戝浗鍙戝睍蹇冪悊瀛︽暀鏉愪綋绯汇��' + }, + { + icon: '', + name: '鏋楀磭寰�', + title: '鏁欐巿', + introduce: '涓浗瀛︾敓鍙戝睍鏍稿績绱犲吇鐮斿埗棣栧腑涓撳锛屽洿缁曞ぇ涓皬瀛︽暀鏉愬缓璁惧紑灞曚簡涓�绯诲垪寮�鍒涙�с�佸鍩烘�у伐浣溿�傚缓绔嬪畬鍠勪簡鎴戝浗鍙戝睍蹇冪悊瀛︽暀鏉愪綋绯汇�備腑鍥藉鐢熷彂灞曟牳蹇冪礌鍏荤爺鍒堕甯笓瀹讹紝鍥寸粫澶т腑灏忓鏁欐潗寤鸿寮�灞曚簡涓�绯诲垪寮�鍒涙�с�佸鍩烘�у伐浣溿�傚缓绔嬪畬鍠勪簡鎴戝浗鍙戝睍蹇冪悊瀛︽暀鏉愪綋绯�' + } + ] }, formatDate(dateString) { @@ -202,7 +214,6 @@ }) }, onTabsChange(event) { - const value = event.detail.value this.setData({ tabValue: value diff --git a/pages/digitalCourses/digitalCoursesDetails/index.wxml b/pages/digitalCourses/digitalCoursesDetails/index.wxml index 212532e..cf6b740 100644 --- a/pages/digitalCourses/digitalCoursesDetails/index.wxml +++ b/pages/digitalCourses/digitalCoursesDetails/index.wxml @@ -1,24 +1,14 @@ <import src="index.skeleton.wxml" /> <template is="skeleton" wx:if="{{loading}}" /> - - -<scroll-view scroll-y="{{scrollJudge}}" wx:else class="outsideContentBox"> - - <view> - - - +<view wx:else> + <scroll-view scroll-y="{{true}}" class="outsideContentBox"> <view class="digital"> <view class="book-box"> <view class="digitalCoursesDetailsTitle"> - <view class="imageBox"> <image src="{{digitalsData.icon}}" mode="aspectFit" /> </view> - <view class="nameBox">{{digitalsData.name}}</view> - - <view> <viwe class="styleCssBox"> <view style="width: 170rpx;"> ISBN锛� </view> @@ -47,142 +37,99 @@ </viwe> <image src="/static/images/bookService/detail/square.png" class="right-background" /> </view> - </view> - <view class="certificate"> - <view style="margin-left: 30rpx;">浠锋牸锛� <text>锟{digitalsData.price}}</text></view> - <view style="margin-right: 30rpx;">鍏�<text>{{ digitalsData.classHours}}</text>璇炬椂</view> - + <view style="margin-right: 30rpx;">鍏�<text>{{ digitalsData.classHours ? digitalsData.classHours : '0'}}</text>璇炬椂</view> </view> </view> - - - - - - </view> - - <view class="tabBox"> <t-tabs defaultValue="{{tabValue}}" bind:change="onTabsChange" t-class="custom-tabs" t-class-content="custom-panel"> - <t-tab-panel icon="{{ tabValue == '0' ? briefIconClick : briefIcon}}" label="鍩烘湰淇℃伅" value="0" style="{{tabPanelstyle}}"> - <!-- <scroll-view scroll-y="{{true}}" class="outsideContentBox"> --> - + <t-tab-panel icon="{{ tabValue == '0' ? briefIconClick : briefIcon}}" label="鍩烘湰淇℃伅" value="0"> <view class="rubricBox"> <view class="rubricimgBox"> <image src="/static/images/bookService/detail/label.png" mode="" /> </view> <view class="basic"> 璇剧▼浠嬬粛</view> </view> - <view style="margin: 30rpx; margin-bottom: 130rpx; min-height:260rpx ;"> - <rich-text wx:if="{{digitalsData.content}}" nodes="{{digitalsData.content}}" style="{{richStyle}}"></rich-text> - - - + <view class="course-content"> + <rich-text wx:if="{{digitalsData.content}}" nodes="{{digitalsData.content}}"></rich-text> <view wx:else="" class="noDataBox"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> </view> - - </view> - <view class="rubricBox"> <view class="rubricimgBox"> <image src="/static/images/bookService/detail/label.png" mode="" /> </view> <view class="basic"> 涓昏鑰佸笀</view> </view> - - <view class="lecturer"> - <view class="lecturerImangBox"> - <image src="" mode="" /> - </view> - <view class="lecturerInformation"> - - <view class="lecturerName"> - <view style="font-weight: bold; font-size: 29rpx; color: #333333;"> - - 鏋楀磭寰� - - </view> - <view style="font-weight: 400; font-size: 25rpx; color: #949494;">璁插笀</view> + <view class="course-content"> + <view class="lecturer" wx:for="{{lecturerList}}" wx:key="index" wx:for-item="item"> + <view class="lecturerImangBox"> + <image src="{{item.icon}}" mode="" /> </view> - <view class="lecturerContent">涓浗瀛︾敓鍙戝睍鏍稿績绱犲吇鐮斿埗棣栧腑涓撳锛屽洿缁曞ぇ涓皬瀛︽暀鏉愬缓璁惧紑灞曚簡涓�绯诲垪寮�鍒涙�с�佸鍩烘�у伐浣溿�傚缓绔嬪畬鍠勪簡鎴戝浗鍙戝睍蹇冪悊瀛︽暀鏉愪綋绯汇��</view> - - + <view class="lecturerInformation"> + <view class="lecturerName"> + <view class="name"> + {{item.name}} + </view> + <view class="title" style="font-weight: 400; font-size: 25rpx; color: #949494;">{{item.title}}</view> + </view> + <view class="lecturerContent">{{item.introduce}}</view> + </view> </view> - </view> - - - - <!-- </scroll-view> --> - - </t-tab-panel> - <t-tab-panel icon="{{ tabValue == '1' ? learnResourceClickIcon : learnResourceIcon}}" label="璇佷功淇℃伅" value="1" style="{{tabPanelstyle}}"> - + <t-tab-panel icon="{{ tabValue == '1' ? learnResourceClickIcon : learnResourceIcon}}" label="璇佷功淇℃伅" value="1"> <view class="rubricBox"> <view class="rubricimgBox"> <image src="/static/images/digitalTextbooks/zhengshu@2x.png" mode="" /> </view> <view class="basic"> 璇佷功淇℃伅</view> </view> - - - <view class="certificateChart"> - <view class="chart"> - <image src="" mode="" /> - </view> - <view class="chart"> - <image src="" mode="" /> + <view class="course-content"> + <view class="certificateChart"> + <view class="chart"> + <image src="" mode="" /> + </view> + <view class="chart"> + <image src="" mode="" /> + </view> </view> </view> - - <!-- - <view class="noDataBox"> - <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> - - </view> --> - - - </t-tab-panel> - <t-tab-panel icon="{{ tabValue == '2' ? courseLearningClick : courseLearning}}" label="璇剧▼瀛︿範" value="2" style="{{tabPanelstyle}}">閫夐」涓夊唴瀹�</t-tab-panel> - <t-tab-panel icon="{{ tabValue == '3' ? learningNotesClick : learningNotes}}" label="瀛︿範绗旇" value="3" style="{{tabPanelstyle}}">閫夐」鍥涘唴瀹�</t-tab-panel> - <t-tab-panel icon="{{ tabValue == '4' ? onlineQuestioningClick : onlineQuestioning}}" label="鍦ㄧ嚎鎻愰棶" value="4" style="{{tabPanelstyle}}">閫夐」浜斿唴瀹�</t-tab-panel> + <t-tab-panel icon="{{ tabValue == '2' ? courseLearningClick : courseLearning}}" label="璇剧▼瀛︿範" value="2"> + <view class="course-content"> + + </view> + </t-tab-panel> + <t-tab-panel icon="{{ tabValue == '3' ? learningNotesClick : learningNotes}}" label="瀛︿範绗旇" value="3"> + <view class="course-content"> + + </view> + </t-tab-panel> + <t-tab-panel icon="{{ tabValue == '4' ? onlineQuestioningClick : onlineQuestioning}}" label="鍦ㄧ嚎鎻愰棶" value="4"> + <view class="course-content"> + + </view> + </t-tab-panel> </t-tabs> - </view> - - <view class="box-bottom"> - - - <view class="application" bind:tap="onCertificate"> <view class="applicationImageBox"> <image src="/static/images/digitalCourses/zhengshushenqing@2x.png" mode="" /> </view> <view>璇佷功鐢宠</view> </view> - <view class="shopCarColor" bind:tap="addBookShopcCar" wx:if="{{!isBuy}}">鍔犲叆璐墿杞�</view> <view class="buyColor" bind:tap="buyBtn" wx:if="{{!isBuy}}">绔嬪嵆璐拱</view> - - - - - </view> <t-toast id="t-toast" /> - </view> -</scroll-view> - - + </scroll-view> +</view> <!-- 寮圭獥 --> <view wx:if="{{dialogBox}}"> <view class="popup-box" bindtap="closeDialog"></view> diff --git a/pages/digitalCourses/digitalCoursesDetails/index.wxss b/pages/digitalCourses/digitalCoursesDetails/index.wxss index 9e8523c..e036714 100644 --- a/pages/digitalCourses/digitalCoursesDetails/index.wxss +++ b/pages/digitalCourses/digitalCoursesDetails/index.wxss @@ -15,8 +15,10 @@ } .imageBox { - width: 690rpx; + /* width: 100%; */ height: 400rpx; + border-radius: 20rpx; + overflow: hidden; } .nameBox { @@ -52,7 +54,6 @@ .digital { background-color: #F2F3F8; - padding-bottom: 20rpx; } .right-background { @@ -64,26 +65,37 @@ z-index: 0; } + +.tabBox { + min-height: calc(100% - 800rpx); + margin-top: 20rpx; + background-color: #fff; + --td-tab-item-height: 140rpx; +} + .t-tabs__item--active { color: #FF6C00 !important; + background-repeat: no-repeat; + background-size: 30%; + background-position: 50% 40%; + background-image: url(https://jsek.bnuic.com/home/image/click-icon.png); } .t-tabs__track { background-color: #FF6C00 !important; } -.tabBox { - background-color: #fff; - border-radius: 18rpx 18rpx 0rpx 0rpx; -} - .t-tabs__item-inner { flex-direction: column; - } -.t-tabs__track { - /* bottom: -20rpx !important; */ +.t-tabs__item-inner .t-icon { + margin-bottom: 20rpx; +} + +.t-tabs__item-inner .t-icon__image { + width: 36rpx !important; + height: 44rpx !important; } .rubricBox { @@ -106,10 +118,13 @@ font-weight: bold; } -.lecturer { +.course-content { padding: 30rpx; +} + +.lecturer { display: flex; - margin-bottom: 170rpx; + margin-bottom: 30rpx } @@ -121,7 +136,7 @@ .lecturerInformation { width: 518rpx; - height: 143rpx; + /* height: 143rpx; */ margin-left: 30rpx; } @@ -139,7 +154,10 @@ } .outsideContentBox { - height: calc(100vh - 120rpx); + /* height: calc(100vh - 120rpx); */ + position: relative; + height: calc(100vh - env(safe-area-inset-bottom) - 60px); + background-color: #F2F3F8; } .box-bottom { @@ -151,7 +169,7 @@ margin-bottom: env(safe-area-inset-bottom); display: flex; flex-direction: row; - background-color: #ccc; + border: 1px solid #DDD; } .shopCarColor { @@ -212,8 +230,7 @@ } .custom-panel { - min-height: 400px; - + /* min-height: 400px; */ } diff --git a/pages/digitalCourses/index.js b/pages/digitalCourses/index.js index a07e0b7..45505fc 100644 --- a/pages/digitalCourses/index.js +++ b/pages/digitalCourses/index.js @@ -18,7 +18,8 @@ courseList: [], searchValue: '', activeItem: null, - loading: false + loading: false, + shoppingCartGetId: [] }, /** @@ -34,6 +35,7 @@ navBarHeight: navBarHeight, }); this.getCourseTypeListList() + this.getShoppingCartList() }, /** @@ -212,6 +214,74 @@ url: '/pages/digitalCourses/digitalCoursesDetails/index?id=' + item.id, }) - } + }, + getShoppingCartList() { + let query = { + start: 0, + size: 999, + filterList: [], + searchList: [] + } + app.MG.store.getShoppingCartProductList(query).then((res) => { + let idList = []; + res.datas.forEach((item) => { + idList.push(item.saleMethod.id) + }) + this.setData({ + shoppingCartGetId: idList + }) + }) + }, + addCart(e) { + const { + item + } = e.currentTarget.dataset; + wx.showToast({ + title: "寤鸿涓�", + icon: 'none', + duration: 1000 + }) + if (wx.getStorageSync(app.config.tokenKey)) { + let query = { + start: 0, + size: 999, + filterList: [], + searchList: [] + } + try { + if ( + this.data.shoppingCartGetId.includes( + item.defaultSaleMethodId + ) + ) { + wx.showToast({ + title: "璇ヤ功宸插湪璐墿杞︼紝璇峰嬁閲嶅娣诲姞绌�", + icon: 'none', + duration: 1000 + }) + } else { + let query = { + requests: [{ + saleMethodId: item.defaultSaleMethodId, + storeEventId: null, + agentCode: '鏁板瓧璇剧▼' + }] + } + const addRes = app.MG.store.addShoppingCart(query) + if (addRes) { + wx.showToast({ + title: "娣诲姞鎴愬姛", + icon: 'success', + duration: 1000 + }) + } + this.getShoppingCartList() + } + } catch (error) { + console.error('鍑洪敊浜嗭細', error) + } + } + + }, }) \ No newline at end of file diff --git a/pages/digitalCourses/index.wxml b/pages/digitalCourses/index.wxml index a6c4a62..54a25ce 100644 --- a/pages/digitalCourses/index.wxml +++ b/pages/digitalCourses/index.wxml @@ -1,12 +1,6 @@ <import src="index.skeleton.wxml" /> <template is="skeleton" wx:if="{{loading}}" /> - - <view wx:else=""> - - - - <view style="width: 100%; height: {{barHeight}}px;"></view> <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> <view> @@ -14,54 +8,42 @@ </view> <t-search model:value="{{searchValue}}" shape="round" placeholder="璇疯緭鍏ュ叧閿瘝/涔﹀悕/ISBN/浣滆��" class="navBar-search" style="width: 464rpx" bind:submit="searchBook" /> </view> - - - <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" t-class="custom-tabs" t-class-content="custom-panel"> - <t-tab-panel wx:for="{{tabList}}" wx:key="index" wx:for-item="item" wx:for-index="index" label="{{item.name}}" value="{{index}}" style="{{tabPanelstyle}}"> - + <t-tab-panel wx:for="{{tabList}}" wx:key="index" wx:for-item="item" wx:for-index="index" label="{{item.name}}" value="{{index}}"> <view class="contentBox"> - <view class="titleBox"> <view class="frameBox"></view> <view class="titleTextBox"> <image src="/static/images/digitalCourses/zhuantitaolun@2x.png" mode="aspectFit" /> - - <!-- <view>鏁板瓧璇剧▼鍒楄〃</view> --> - - - </view> </view> - <scroll-view scroll-y="{{true}}" class="outsideContentBox" bindscrolltolower="onScrollToLower"> <view class="ExternalInformationBox"> - <view class="informationBox" wx:for="{{courseList}}" wx:key="index" wx:for-item="item" data-item="{{item}}" bind:tap="courseDetail"> - - <view class="book-img"> + <view class="informationBox" wx:for="{{courseList}}" wx:key="index" wx:for-item="item" data-item="{{item}}"> + <view class="book-img" bind:tap="courseDetail" data-item="{{item}}"> <image src="{{item.icon}}" mode="aspectFit" /> </view> - - <view class="book-name"> - {{item.name}} - </view> - <view class="viewCount"> - {{item.viewCount }}娆$偣鍑� - - </view> - <view class="author"> - <view> - {{ item.courseLeader}} + <view class="book-Info"> + <view class="book-name" bind:tap="courseDetail" data-item="{{item}}"> + {{item.name}} </view> - <view> - {{ item.classHours}}璇炬椂 + <view class="viewCount"> + {{item.viewCount }}娆$偣鍑� </view> - </view> - <view class="money"> - <view wx:if="{{item.price != 0}}">锟{item.price }}</view> - <view wx:else> 鍏嶈垂</view> - <view> - <t-icon name="cart" size="16" /> + <view class="author"> + <view> + {{ item.courseLeader}} + </view> + <view> + {{ item.classHours}}璇炬椂 + </view> + </view> + <view class="money"> + <view wx:if="{{item.price != 0}}">锟{item.price }}</view> + <view wx:else> 鍏嶈垂</view> + <view bind:tap="addCart" data-item="{{item}}"> + <t-icon name="cart" size="16" /> + </view> </view> </view> </view> @@ -73,6 +55,4 @@ </view> </t-tab-panel> </t-tabs> - - </view> \ No newline at end of file diff --git a/pages/digitalCourses/index.wxss b/pages/digitalCourses/index.wxss index dac367f..24f4226 100644 --- a/pages/digitalCourses/index.wxss +++ b/pages/digitalCourses/index.wxss @@ -30,6 +30,10 @@ color: var(--td-text-color-primary); } +.t-tabs .t-tabs__track { + display: none; +} + .t-tabs__item--active { color: #FF6C00 !important; } @@ -57,7 +61,6 @@ .titleBox { display: flex; align-items: center; - margin: 10px; margin-left: 0; padding-top: 30rpx; } @@ -83,8 +86,9 @@ } .informationBox { - width: 340rpx; - min-height: 470rpx; + width: calc(100%/2 - 15rpx); + min-height: 450rpx; + overflow: hidden; border-radius: 9rpx 9rpx 9rpx 9rpx; background-color: #fff; margin-bottom: 40rpx; @@ -93,13 +97,16 @@ .book-img { width: 100%; - height: 250rpx; + height: 194rpx; margin: 0 auto; /* box-shadow: 0px 3px 6px 1px rgba(0, 0, 0, 0.16); */ } +.book-Info { + padding: 20rpx; +} + .book-name { - margin: 15rpx 30rpx; color: #333; font-size: 28rpx; font-weight: 700; @@ -113,11 +120,10 @@ } .author { - margin: 0 30rpx; display: flex; flex-direction: row; justify-content: space-between; - margin-bottom: 15rpx; + margin-bottom: 20rpx; font-weight: bold; font-weight: 400; font-size: 25rpx; @@ -125,13 +131,10 @@ } .money { - margin: 0 30rpx; display: flex; flex-direction: row; justify-content: space-between; color: #ff6c00; - margin-bottom: 30rpx; - } .ExternalInformationBox { @@ -152,7 +155,7 @@ } .viewCount { - margin: 10rpx 30rpx; + margin: 16rpx 0; font-weight: 400; font-size: 22rpx; color: #AEAFC0; diff --git a/pages/digitalTextbooks/digitalTextbooksDetails/index.js b/pages/digitalTextbooks/digitalTextbooksDetails/index.js index ba85f02..68b6c40 100644 --- a/pages/digitalTextbooks/digitalTextbooksDetails/index.js +++ b/pages/digitalTextbooks/digitalTextbooksDetails/index.js @@ -10,15 +10,10 @@ * 椤甸潰鐨勫垵濮嬫暟鎹� */ data: { - - type: 'basicInformation', - - digitalTextId: '', digitalsData: {}, - - richStyle: 'font-size: 28rpx;color: #333; line-height: 48rpx;text-align: justify;margin: 20rpx; ', + expire: false, //鍟嗗搧鎴栧瓙鍟嗗搧閿�鍞柟寮忔槸鍚﹁繃鏈� tabValue: "brief", relatedBookData: [], publicationDate: '', @@ -208,14 +203,10 @@ } } app.MG.store.getProductDetail(query).then(res => { - - // console.log(res); if (res.datas.purchasedSaleMethodIdList.includes(res.datas.defaultSaleMethodId)) { - this.setData({ isBuy: true }) - } else { this.setData({ isBuy: false @@ -233,13 +224,22 @@ this.setData({ digitalsData: res.datas }) - + let times = new Date(res.datas.defaultSaleMethod.endDate).getTime() + let startTime = new Date(res.datas.defaultSaleMethod.beginDate).getTime() + if (times < new Date().getTime() || new Date().getTime() < startTime) { + this.setData({ + expire: true + }) + } else { + this.setData({ + expire: res.false + }) + } wx.setNavigationBarTitle({ title: res.datas.name, }) this.getAboutBook(res.datas.productLinkInfo[res.datas.productLinkInfo.length - 1].LinkPath) - console.log(this.data.isBuy); this.setData({ loading: false, @@ -251,21 +251,16 @@ }) }, - onTabsChange(event) { - this.setData({ tabValue: event.detail.value, }) - - console.log(this.data.tabValue); }, onTabsClick(event) { // console.log(`Click tab, tab-panel value is ${event.detail.value}.`); }, - // 鑾峰彇鐩稿叧鏁欐潗 getAboutBook(path) { let query = { @@ -299,7 +294,6 @@ } else { bookArr = Arr } - bookArr.forEach(item => { if (item.icon == '') { item.icon = '/static/images/default-book-img.png' @@ -317,10 +311,7 @@ }) }, onCorrelationBook(e) { - const item = e.currentTarget.dataset.item - - console.log(item); // const event = { // detail: { // value: "brief" @@ -331,9 +322,6 @@ this.onLoad({ id: item.id }) - - - }, // 鍥句功娣诲姞璐墿杞� async addBookShopcCar() { @@ -391,7 +379,6 @@ //璐拱鎸夐挳 - async buyBtn() { if (!this.data.expire) { let bookOrdersId = ""; @@ -446,7 +433,6 @@ // console.log(item, app.config.textReaderUrl); // console.log(token); goRead() { - // 棣栭〉娴嬭瘯鐧诲綍鍔熻兘锛屽悗缁敞閲� // 妫�鏌ョ櫥褰曠姸鎬� const token = wx.getStorageSync(app.config.tokenKey) @@ -455,7 +441,6 @@ // 濡傛灉涓嶆槸绗竴娆$櫥褰曪紝浼氭墽琛屽洖璋� if (data) { // 鐧诲綍鎴愬姛锛岃嚜鍔ㄨ褰晅oken鍜岀敤鎴蜂俊鎭紝骞惰繑鍥瀟rue - const item = this.data.digitalsData wx.navigateTo({ url: '/pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index?refCode=' + item.refCode + "&tryPageCount=" + item.probationPage diff --git a/pages/digitalTextbooks/digitalTextbooksDetails/index.wxml b/pages/digitalTextbooks/digitalTextbooksDetails/index.wxml index b2cc5af..3d8dcd9 100644 --- a/pages/digitalTextbooks/digitalTextbooksDetails/index.wxml +++ b/pages/digitalTextbooks/digitalTextbooksDetails/index.wxml @@ -1,103 +1,95 @@ <!--pages/digitalTextbooks/digitalTextbooksDetails/index.wxml--> <import src="index.skeleton.wxml" /> <template is="skeleton" wx:if="{{loading}}" /> - - <view wx:if="{{!loading}}"> <view class="page-bookService"> - - <view class="digital"> - <view class="book-box"> - - - <view class="textbookDetails"> - <view class="book-img"> - <view class="imageBox"> - <image src="{{digitalsData.icon}}" mode="" /> - </view> - <!-- <view class="setCoolect"> + <scroll-view scroll-y="{{true}}" class="book" bindscrolltolower="onReachBottom"> + <view class="digital"> + <view class="book-box"> + <view class="textbookDetails"> + <view class="book-img"> + <view class="imageBox"> + <image src="{{digitalsData.icon}}" mode="" /> + </view> + <!-- <view class="setCoolect"> <image src="/static/images/bookService/detail/collect.png" style="width: 50rpx;" bind:tap="setCoolect" wx:if="{{isFavourite}}" /> <image src="/static/images/bookService/detail/collecting.png" style="width: 50rpx;" bind:tap="setCoolect" wx:else="" /> </view> --> - </view> - <view class="bookContent"> - <view class="headerText"> - {{digitalsData.name}} </view> - <view class="content"> - <view class="styleCssBox"> - <view style="width: 150rpx;"> 浣滆�咃細 </view> - <view class="authorBox">{{ digitalsData.author}}</view> + <view class="bookContent"> + <view class="headerText"> + {{digitalsData.name}} </view> - <view class="styleCssBox"> - <view style="width: 150rpx;">ISBN锛�</view> - <view>{{ digitalsData.isbn}}</view> + <view class="content"> + <view class="styleCssBox"> + <view style="width: 150rpx;"> 浣滆�咃細 </view> + <view class="authorBox">{{ digitalsData.author}}</view> + </view> + <view class="styleCssBox"> + <view style="width: 150rpx;">ISBN锛�</view> + <view>{{ digitalsData.isbn}}</view> + </view> + <view class="styleCssBox"> + <view style="width: 150rpx;"> 鍑虹増鏃堕棿锛� </view> + <view>{{ publicationDate}}</view> + </view> </view> - <view class="styleCssBox"> - <view style="width: 150rpx;"> 鍑虹増鏃堕棿锛� </view> - <view>{{ publicationDate}}</view> - </view> + <image src="/static/images/bookService/detail/square.png" class="right-background" /> </view> - <image src="/static/images/bookService/detail/square.png" class="right-background" /> </view> - - - - </view> - <view class="certificate"> - <view class="proposal" bind:tap="suggestBtn"> - <view class="suggestion"> - <image src="/static/images/digitalTextbooks/Suggestion@2x.png" mode="" /> - </view> - <view class="proposalText">鎴戣寤鸿</view> - </view> - <view class="frame"></view> - <view class="information"> - <view class="proposal"> + <view class="certificate"> + <view class="proposal" bind:tap="suggestBtn"> <view class="suggestion"> - <image src="/static/images/digitalTextbooks/shengshu-t@2x.png" mode="" /> + <image src="/static/images/digitalTextbooks/Suggestion@2x.png" mode="" /> </view> - <view class="proposalText">璇佷功鐢宠</view> + <view class="proposalText">鎴戣寤鸿</view> </view> - <view class="informationPrice"> - <view wx:if="{{digitalsData.price != 0}}" class="fixedPrice"> - <view> 瀹氫环锛� </view> - <view>锟{ digitalsData.price}}</view> + <view class="frame"></view> + <view class="information"> + <view class="proposal"> + <view class="suggestion"> + <image src="/static/images/digitalTextbooks/shengshu-t@2x.png" mode="" /> + </view> + <view class="proposalText">璇佷功鐢宠</view> </view> - <view wx:else>鍏嶈垂</view> + <view class="informationPrice"> + <view wx:if="{{digitalsData.price != 0}}" class="fixedPrice"> + <view> 瀹氫环锛� </view> + <view>锟{ digitalsData.price}}</view> + </view> + <view wx:else>鍏嶈垂</view> + </view> </view> </view> </view> </view> - </view> - - <view style="margin-top: 20rpx;"> - <t-tabs defaultValue="{{tabValue}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" t-class-content="custom-panel"> - <t-tab-panel icon="{{ tabValue == 'brief' ? briefIconClick : briefIcon}}" value="brief" label="鍩烘湰淇℃伅" style="{{tabPanelstyle}}"> - <view class="rubricBox"> - <view class="rubricimgBox"> - <image src="/static/images/bookService/detail/label.png" mode="" /> + <view class="book-resource"> + <t-tabs defaultValue="{{tabValue}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" t-class-content="custom-panel" class="tab-class"> + <t-tab-panel icon="{{ tabValue == 'brief' ? briefIconClick : briefIcon}}" value="brief" label="鍩烘湰淇℃伅" style="{{tabPanelstyle}}"> + <view class="rubricBox"> + <view class="rubricimgBox"> + <image src="/static/images/bookService/detail/label.png" mode="" /> + </view> + <view class="basic"> 鍩烘湰淇℃伅</view> </view> - <view class="basic"> 鍩烘湰淇℃伅</view> - </view> - <view style="margin: 30rpx; margin-bottom: 130rpx;" wx:if="{{digitalsData.content}}"> - <rich-text nodes="{{digitalsData.content}}" style="{{richStyle}}"></rich-text> - </view> - <view class="noDataBox" wx:else> - <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> - - </view> - </t-tab-panel> - <t-tab-panel icon="{{tabValue == 'jsek_cloudLearning' ? learnResourceClickIcon : learnResourceIcon}}" value="jsek_cloudLearning" label="璇佷功淇℃伅" style="{{tabPanelstyle}}"> - <view class="rubricBox"> - <view class="rubricimgBox"> - <image src="/static/images/digitalTextbooks/zhengshu@2x.png" mode="" /> + <view class="basic-content" wx:if="{{digitalsData.content}}"> + <rich-text nodes="{{digitalsData.content}}"></rich-text> </view> - <view class="basic"> 璇佷功淇℃伅</view> - </view> + <view class="noDataBox" wx:else> + <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> + + </view> + </t-tab-panel> + <t-tab-panel icon="{{tabValue == 'jsek_cloudLearning' ? learnResourceClickIcon : learnResourceIcon}}" value="jsek_cloudLearning" label="璇佷功淇℃伅" style="{{tabPanelstyle}}"> + <view class="rubricBox"> + <view class="rubricimgBox"> + <image src="/static/images/digitalTextbooks/zhengshu@2x.png" mode="" /> + </view> + <view class="basic"> 璇佷功淇℃伅</view> + </view> - <!-- <view class="certificateChart"> + <!-- <view class="certificateChart"> <view class="chart"> <image src="" mode="" /> </view> @@ -107,115 +99,93 @@ </view> --> - <view class="noDataBox"> - <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> + <view class="noDataBox"> + <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> - </view> - </t-tab-panel> - <t-tab-panel icon="{{tabValue == 'jsek_teachingResources' ? teachResourcesClickIcon : teachResourcesIcon}}" value="jsek_teachingResources" label="浣滆�呬俊鎭�" style="{{tabPanelstyle}}"> - <view class="rubricBox"> - <view class="rubricimgBox"> - <image src="/static/images/bookService/detail/author.png" mode="" /> </view> - <view class="basic"> 浣滆�呬俊鎭�</view> - </view> - <view style="margin: 30rpx; margin-bottom: 130rpx;" wx:if="{{digitalsData.authorIntroduction}}"> - <rich-text nodes="{{digitalsData.authorIntroduction}}" style="{{richStyle}}"></rich-text> - </view> - - - <view class="noDataBox" wx:else> - <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> - - </view> - </t-tab-panel> - <t-tab-panel icon="{{tabValue == 'catalogue' ? catalogueClickIcon : catalogue}}" value="catalogue" label="鐩綍" style="{{tabPanelstyle}}"> - - <view class="rubricBox"> - <view class="rubricimgBox"> - <image src="/static/images/digitalTextbooks/mulu@3x.png" mode="" /> - </view> - <view class="basic"> 鐩綍</view> - </view> - <view style="margin: 30rpx; margin-bottom: 130rpx;" wx:if="{{digitalsData.catalogue}}"> - <rich-text nodes="{{digitalsData.catalogue}}" style="{{richStyle}}"></rich-text> - </view> - - - <view class="noDataBox" wx:else> - <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> - - </view> - </t-tab-panel> - <t-tab-panel icon="{{tabValue == 'questionBank' ? testResourceClickIocn : testResourceIocn}}" value="questionBank" label="鐩稿叧鏁欐潗" style="{{tabPanelstyle}}"> - - <view class="rubricBox"> - <view class="rubricimgBox"> - <image src="/static/images/digitalTextbooks/Link@3x.png" mode="" /> - </view> - <view class="basic"> 鐩稿叧鏁欐潗</view> - </view> - <view class="noDataBox" wx:if="{{relatedBookData.length <= 0}}"> - <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> - - </view> - - - <view class="correlation" wx:else> - - <view style="margin-bottom: 30rpx;" wx:for="{{relatedBookData}}" wx:key="index" wx:for-item="item" wx:for-index="index" data-item="{{item}}" bind:tap="onCorrelationBook"> - - <view class="correlationImage"> - <image src="{{item.icon}}" mode="" /> - <img wx:if="{{item.icon == ''}}" src="/static/images/default-book-img.png" alt="" /> + </t-tab-panel> + <t-tab-panel icon="{{tabValue == 'jsek_teachingResources' ? teachResourcesClickIcon : teachResourcesIcon}}" value="jsek_teachingResources" label="浣滆�呬俊鎭�" style="{{tabPanelstyle}}"> + <view class="rubricBox"> + <view class="rubricimgBox"> + <image src="/static/images/bookService/detail/author.png" mode="" /> </view> - <view class="correlationName">{{item.name}}</view> - <view class="correlationAuthor">{{digitalsData.author}}</view> + <view class="basic"> 浣滆�呬俊鎭�</view> </view> - </view> - </t-tab-panel> - </t-tabs> + <view class="basic-content" wx:if="{{digitalsData.authorIntroduction}}"> + <rich-text nodes="{{digitalsData.authorIntroduction}}"></rich-text> + </view> + <view class="noDataBox" wx:else> + <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> + </view> + </t-tab-panel> + <t-tab-panel icon="{{tabValue == 'catalogue' ? catalogueClickIcon : catalogue}}" value="catalogue" label="鐩綍" style="{{tabPanelstyle}}"> - </view> + <view class="rubricBox"> + <view class="rubricimgBox"> + <image src="/static/images/digitalTextbooks/mulu@3x.png" mode="" /> + </view> + <view class="basic"> 鐩綍</view> + </view> + <view class="basic-content" wx:if="{{digitalsData.catalogue}}"> + <rich-text nodes="{{digitalsData.catalogue}}"></rich-text> + </view> + <view class="noDataBox" wx:else> + <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> + + </view> + </t-tab-panel> + <t-tab-panel icon="{{tabValue == 'questionBank' ? testResourceClickIocn : testResourceIocn}}" value="questionBank" label="鐩稿叧鏁欐潗" style="{{tabPanelstyle}}"> + <view class="rubricBox"> + <view class="rubricimgBox"> + <image src="/static/images/digitalTextbooks/Link@3x.png" mode="" /> + </view> + <view class="basic"> 鐩稿叧鏁欐潗</view> + </view> + <view class="noDataBox" wx:if="{{relatedBookData.length <= 0}}"> + <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> + </view> + <view class="correlation" wx:else> + <view style="margin-bottom: 30rpx;" wx:for="{{relatedBookData}}" wx:key="index" wx:for-item="item" wx:for-index="index" data-item="{{item}}" bind:tap="onCorrelationBook"> + <view class="correlationImage"> + <image src="{{item.icon}}" mode="" /> + <img wx:if="{{item.icon == ''}}" src="/static/images/default-book-img.png" alt="" /> + </view> + <view class="correlationName">{{item.name}}</view> + <view class="correlationAuthor">{{digitalsData.author}}</view> + </view> + </view> + </t-tab-panel> + </t-tabs> + + </view> + </scroll-view> <!-- 鎴戣寤鸿寮圭獥 --> <suggest class="suggest-component" id="suggest-component" bookIcon="{{bookDetail.icon}}" bookName="{{bookDetail.name}}"></suggest> <view class="box-bottom"> - <view style="border-top: 1rpx solid #DDDDDD; display: flex;"> - <view class="collection" bind:tap="setCoolect"> - <view class="collectionImage"> - <image wx:if="{{!digitalsData.isFavourite}}" src="/static/images/digitalTextbooks/wodeshoucang@2x.png" mode="" /> - <image wx:else src="/static/images/bookService/detail/collecting.png" mode="" /> - </view> - <view> - 鏀惰棌 - </view> + <view class="collection" bind:tap="setCoolect"> + <view class="collectionImage"> + <image wx:if="{{!digitalsData.isFavourite}}" src="/static/images/digitalTextbooks/wodeshoucang@2x.png" mode="" /> + <image wx:else src="/static/images/bookService/detail/collecting.png" mode="" /> </view> - <view class="trialReading" bind:tap="goRead" wx:if="{{!isBuy}}"> - <view class="collectionImage"> - <image src="/static/images/digitalTextbooks/shidu@2x.png"></image> - </view> - <view class="btn-text">璇曡</view> + <view class="btn-text"> + 鏀惰棌 </view> - - </view> - - - - + <view class="trialReading" bind:tap="goRead" wx:if="{{!isBuy}}"> + <view class="collectionImage"> + <image src="/static/images/digitalTextbooks/shidu@2x.png"></image> + </view> + <view class="btn-text">璇曡</view> + </view> <view class="shopCarColor" bind:tap="addBookShopcCar" wx:if="{{!isBuy}}">鍔犲叆璐墿杞�</view> - <view class="buyColor" bind:tap="buyBtn" wx:if="{{!isBuy}}">绔嬪嵆璐拱</view> - <!-- <view class="buyColor" bind:tap="buyBtn" wx:if="{{digitalsData.price == 0}} ">鍏嶈垂棰嗗彇</view> --> + <view class="buyColor" bind:tap="buyBtn" wx:if="{{!isBuy && digitalsData.price != 0}}">绔嬪嵆璐拱</view> + <view class="buyColor" bind:tap="buyBtn" wx:if="{{!isBuy && digitalsData.price == 0}} ">鍏嶈垂棰嗗彇</view> <view class="{{!isBuy ? 'buyColor' :'reading'}}" bind:tap="goRead" wx:if="{{isBuy}}"> 绔嬪嵆闃呰 </view> - - - - </view> </view> </view> diff --git a/pages/digitalTextbooks/digitalTextbooksDetails/index.wxss b/pages/digitalTextbooks/digitalTextbooksDetails/index.wxss index 1a37fc0..730ec39 100644 --- a/pages/digitalTextbooks/digitalTextbooksDetails/index.wxss +++ b/pages/digitalTextbooks/digitalTextbooksDetails/index.wxss @@ -7,6 +7,11 @@ height: 100%; } +.book { + position: relative; + height: calc(100vh - env(safe-area-inset-bottom) - 60px); + background-color: #F2F3F8; +} @@ -84,39 +89,35 @@ border-radius: 0 0 20rpx 20rpx; } - - - - .digital { background-color: #F2F3F8; - padding-bottom: 20rpx; } +.custom-tabs { + --td-tab-item-active-color: #FF6C00; + --td-tab-font-size: 28rpx; +} - - +.tab-class { + --td-loading-color: #ff6c00; + --td-tab-nav-bg-color: #fff; + --td-tab-track-color: #ff6c00 +} .t-tabs__item-inner { flex-direction: column; - /* color: #ff6c00; */ } -.t-tabs__item--active { - color: #FF6C00 !important; +.t-tabs .t-tabs__item--active { + background-repeat: no-repeat; + background-size: 35%; + background-position: 50% 40%; + background-image: url(https://jsek.bnuic.com/home/image/click-icon.png); + } -.t-tabs__track { - background-color: #FF6C00 !important; - bottom: -20rpx !important; -} - -.t-tabs__scroll--split { - height: 120rpx !important; -} - -.t-tabs__item-inner .t-icon { - margin-bottom: 10rpx; +.t-tabs__item--evenly { + flex: 1 0 auto !important; } .t-tabs__item-inner .t-icon { @@ -142,21 +143,10 @@ overflow-x: auto; } -.t-tabs__item--evenly { - flex: 1 0 auto !important; -} - -.t-tabs .t-tabs__item--active { - background-repeat: no-repeat; - background-size: 35%; - background-position: 50% 40%; - background-image: url(https://jsek.bnuic.com/home/image/click-icon.png); -} - .rubricBox { display: flex; flex-direction: row; - margin: 50rpx; + margin: 40rpx; margin-bottom: 0; } @@ -170,6 +160,10 @@ font-size: 32rpx; color: #333; font-weight: bold; +} + +.basic-content { + padding: 30rpx 40rpx; } .correlationImage { @@ -214,6 +208,7 @@ margin-bottom: env(safe-area-inset-bottom); display: flex; flex-direction: row; + border: 1px solid #DDD; } .trialReading { @@ -226,7 +221,6 @@ align-items: center; flex-direction: column; border-left: 1rpx solid #DDDDDD; - } .shopCarColor { @@ -327,25 +321,6 @@ height: 100%; } -.view-color1 { - /* background-color: palegoldenrod; */ -} - -.view-color2 { - /* background-color: palegreen; */ -} - -.view-color3 { - /* background-color: paleturquoise; */ -} - -.view-color4 { - /* background-color: #ccc; */ -} - -.view-color5 { - /* background-color: gold; */ -} .top-label-sel { font-weight: bold; @@ -365,6 +340,13 @@ overflow: scroll; } +.book-resource { + min-height: calc(100% - 515rpx); + margin-top: 20rpx; + background-color: #fff !important; + --td-tab-item-height: 140rpx; +} + .certificateChart { display: flex; flex-direction: row; diff --git a/pages/home/home.js b/pages/home/home.js index 0feef1c..9bd1189 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -592,6 +592,22 @@ }, + // 鎵竴鎵� + onIconScanTap() { + wx.scanCode({ + success(res) { + console.log(res); + if (res.errMsg == "scanCode:ok" && res.path) { + console.log(res.path, 2) + wx.redirectTo({ + url: '/' + res.path, + }) + } + } + }) + }, + + // 鐩戝惉婊氬姩鏉� onScroll(e) { diff --git a/pages/home/home.wxml b/pages/home/home.wxml index 3688e7a..d53e7ba 100644 --- a/pages/home/home.wxml +++ b/pages/home/home.wxml @@ -1,61 +1,22 @@ <view class="container"> - <t-pull-down-refresh - value="{{baseRefresh.value}}" - loadingTexts="{{['涓嬫媺鍒锋柊', '鏉炬墜鍒锋柊', '姝e湪鍒锋柊', '鍒锋柊瀹屾垚']}}" - bind:refresh="onPullDownRefresh" - wx:if="{{!loading}}" - bind:scroll="onScroll" - > - <view - class="background {{ isWhite ? 'white':''}}" - style="padding-top: {{barHeight}}px" - > + <t-pull-down-refresh value="{{baseRefresh.value}}" loadingTexts="{{['涓嬫媺鍒锋柊', '鏉炬墜鍒锋柊', '姝e湪鍒锋柊', '鍒锋柊瀹屾垚']}}" bind:refresh="onPullDownRefresh" wx:if="{{!loading}}" bind:scroll="onScroll"> + <view class="background {{ isWhite ? 'white':''}}" style="padding-top: {{barHeight}}px"> <text class="text">浜笀E璇�</text> </view> <view class="home-page-header"> <view class="bg"> - <image - src="/static/images/home/home-bg.png" - mode="heightFix" - class="image" - /> + <image src="/static/images/home/home-bg.png" mode="heightFix" class="image" /> </view> <view class="search"> - <t-search - t-class-input="t-search__input" - t-class-input-container="t-search__input-container" - placeholder="璇疯緭鍏ュ叧閿瘝/涔﹀悕/ISBN/浣滆��" - leftIcon="" - bind:submit="onRetrievalPage" - model:value="{{searchVal}}" - > - <t-icon - slot="left-icon" - prefix="wr" - name="search" - size="40rpx" - color="#bbb" - bind:tap="navToSearchPage" - /> - + <image class="icon" src="/static/images/home/nav_icon_scan.png" bindtap="onIconScanTap" /> + <t-search t-class-input="t-search__input" t-class-input-container="t-search__input-container" placeholder="璇疯緭鍏ュ叧閿瘝/涔﹀悕/ISBN/浣滆��" leftIcon="" bind:submit="onRetrievalPage" model:value="{{searchVal}}"> + <t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" bind:tap="navToSearchPage" /> </t-search> </view> <view class="swiper-wrap"> <!-- <t-swiper wx:if="{{bannerList.length > 0}}" list="{{bannerList}}" autoplay="{{autoplay}}" duration="{{duration}}" interval="{{interval}}" navigation="{{ { type: 'dots' } }}" height="380rpx" bind:click="navToActivityDetail" /> --> - <swiper - interval="5000" - indicator-dots="true" - autoplay="true" - circular="true" - class="swiper" - > - <swiper-item - wx:for="{{bannerList}}" - wx:for-index="index" - wx:key="index" - data-info="{{item}}" - bindtap="navToActivityDetail" - > + <swiper interval="5000" indicator-dots="true" autoplay="true" circular="true" class="swiper"> + <swiper-item wx:for="{{bannerList}}" wx:for-index="index" wx:key="index" data-info="{{item}}" bindtap="navToActivityDetail"> <view class="swiperItem"> <image src="{{item.value}}" mode="widthFix" class="img" /> </view> @@ -64,78 +25,36 @@ </view> </view> <view class="home-page-menu"> - <t-grid - class="t-grid-block" - theme="card" - border="{{border}}" - column="{{5}}" - > - <t-grid-item - wx:for="{{tabList}}" - wx:for-index="index" - wx:key="index" - text="{{item.text}}" - image="{{item.icon}}" - data-info="{{item}}" - bindtap="toPages" - /> + <t-grid class="t-grid-block" theme="card" border="{{border}}" column="{{5}}"> + <t-grid-item wx:for="{{tabList}}" wx:for-index="index" wx:key="index" text="{{item.text}}" image="{{item.icon}}" data-info="{{item}}" bindtap="toPages" /> </t-grid> </view> <view class="home-page-container"> <view class="home-page-list"> <view class="tabCardPublic iconOne"> <view class="icon"> - <image - src="/static/images/home/zhuantitaolun2.png" - mode="aspectFit" - class="iconImage" - /> + <image src="/static/images/home/zhuantitaolun2.png" mode="aspectFit" class="iconImage" /> </view> - <view - data-info="{{'zhuantitaolun'}}" - bindtap="onMoreGuide" - class="flex" - style="align-items: center" - > + <view data-info="{{'zhuantitaolun'}}" bindtap="onMoreGuide" class="flex" style="align-items: center"> <text class="more">鏇村</text> <t-icon name="chevron-right" size="32rpx" color="#ff6d00" /> </view> </view> <view class="listBox"> - <view - wx:for="{{specialSubjectList}}" - wx:for-item="item" - wx:for-index="index" - wx:key="index" - class="listItemBox" - > - <view - class="listItem" - bindtap="goSubjectDetail" - data-book="{{item}}" - > + <view wx:for="{{specialSubjectList}}" wx:for-item="item" wx:for-index="index" wx:key="index" class="listItemBox"> + <view class="listItem" bindtap="goSubjectDetail" data-book="{{item}}"> <view class="specialSubject-img"> <image src="{{item.icon}}" mode="aspectFill" class="img" /> </view> <view class="body-info"> <view class="name">{{item.name}}</view> - <view class="time" wx:if="{{item.liveTime}}" - >鐩存挱鏃堕棿锛歿{item.liveTime}}</view - > - <view class="time" wx:if="{{item.startTime}}" - >寮�鎾椂闂达細{{ item.startTime }}</view - > - <view class="time" wx:if="{{!item.liveTime && !item.startTime}}" - >寮�鎾椂闂达細<text class="grey">寰呭畾</text></view - > + <view class="time" wx:if="{{item.liveTime}}">鐩存挱鏃堕棿锛歿{item.liveTime}}</view> + <view class="time" wx:if="{{item.startTime}}">寮�鎾椂闂达細{{ item.startTime }}</view> + <view class="time" wx:if="{{!item.liveTime && !item.startTime}}">寮�鎾椂闂达細<text class="grey">寰呭畾</text></view> <view class="flex jc-sb"> - <text class="author" - >{{item.lecturer}} {{item.position}}</text - > + <text class="author">{{item.lecturer}} {{item.position}}</text> <text class="price" wx:if="{{item.price == 0}}">鍏嶈垂</text> - <text class="price" wx:if="{{item.price !== 0}}" - >锟{item.price}}</text - > + <text class="price" wx:if="{{item.price !== 0}}">锟{item.price}}</text> </view> </view> </view> @@ -143,77 +62,35 @@ </view> <view class="tabCardPublic iconTwo"> <view class="icon"> - <image - src="/static/images/home/jingxuankecheng2.png" - mode="aspectFit" - class="iconImage" - /> + <image src="/static/images/home/jingxuankecheng2.png" mode="aspectFit" class="iconImage" /> </view> - <view - data-info="{{'jingxuankecheng'}}" - bindtap="onMoreGuide" - class="flex" - > + <view data-info="{{'jingxuankecheng'}}" bindtap="onMoreGuide" class="flex"> <text class="more">鏇村</text> <t-icon name="chevron-right" size="32rpx" color="#ff6d00" /> </view> </view> <view class="home-page-tabs"> - <t-tabs - t-class="t-tabs" - split="{{false}}" - defaultValue="{{activeItem}}" - bind:change="tabChangeHandle" - > - <t-tab-panel - wx:for="{{courseTypeList}}" - wx:for-index="index" - wx:key="index" - label="{{item.name}}" - value="{{index}}" - /> + <t-tabs t-class="t-tabs" split="{{false}}" defaultValue="{{activeItem}}" bind:change="tabChangeHandle"> + <t-tab-panel wx:for="{{courseTypeList}}" wx:for-index="index" wx:key="index" label="{{item.name}}" value="{{index}}" /> </t-tabs> </view> <view class="listBox1"> <view wx:if="{{courseList.length>0}}"> - <view - wx:for="{{courseList}}" - wx:for-item="item" - wx:for-index="index" - wx:key="index" - class="listItemBox" - > + <view wx:for="{{courseList}}" wx:for-item="item" wx:for-index="index" wx:key="index" class="listItemBox"> <view class="listItem flex"> - <view - class="specialSubject-img" - data-book="{{item}}" - bindtap="goCourseDetail" - > + <view class="specialSubject-img" data-book="{{item}}" bindtap="goCourseDetail"> <image src="{{item.icon}}" mode="aspectFill" class="img" /> </view> <view class="body-info"> - <view - class="name" - data-book="{{item}}" - bindtap="goCourseDetail" - >{{item.name}}</view - > + <view class="name" data-book="{{item}}" bindtap="goCourseDetail">{{item.name}}</view> <view class="flex jc-sb"> <text class="author">{{item.courseLeader}}</text> <text class="classHours">{{item.classHours}}璇炬椂</text> </view> <view class="priceBox flex jc-sb"> <text class="price" wx:if="{{item.price == 0}}">鍏嶈垂</text> - <text class="price" wx:if="{{item.price !== 0}}" - >锟{item.price}}</text - > - <image - src="/static/images/home/home-cart.png" - mode="aspectFit" - class="addCartImg" - bind:tap="addCart" - data-info="{{item}}" - /> + <text class="price" wx:if="{{item.price !== 0}}">锟{item.price}}</text> + <image src="/static/images/home/home-cart.png" mode="aspectFit" class="addCartImg" bind:tap="addCart" data-info="{{item}}" /> </view> </view> </view> @@ -225,11 +102,7 @@ </view> <view class="tabCardPublic iconTwo"> <view class="icon"> - <image - src="/static/images/home/tushufuwu2.png" - mode="aspectFit" - class="iconImage" - /> + <image src="/static/images/home/tushufuwu2.png" mode="aspectFit" class="iconImage" /> </view> <view data-info="{{'tushufuwu'}}" bindtap="onMoreGuide" class="flex"> <text class="more">鏇村</text> @@ -237,39 +110,16 @@ </view> </view> <view class="home-page-tabs"> - <t-tabs - t-class="t-tabs" - split="{{false}}" - position="{{'home'}}" - defaultValue="{{activeItem1}}" - bind:change="tabBookClick" - > - <t-tab-panel - wx:for="{{bookTypeList}}" - wx:for-index="index" - wx:key="index" - label="{{item.name}}" - value="{{index}}" - /> + <t-tabs t-class="t-tabs" split="{{false}}" position="{{'home'}}" defaultValue="{{activeItem1}}" bind:change="tabBookClick"> + <t-tab-panel wx:for="{{bookTypeList}}" wx:for-index="index" wx:key="index" label="{{item.name}}" value="{{index}}" /> </t-tabs> </view> <view class="listBox2"> <view wx:if="{{booksList.length > 0}}" class="flex"> - <view - wx:for="{{booksList}}" - wx:for-item="item" - wx:for-index="index" - wx:key="index" - class="booksListItemBox" - > + <view wx:for="{{booksList}}" wx:for-item="item" wx:for-index="index" wx:key="index" class="booksListItemBox"> <view class="listItem" bind:tap="goDetail" data-book="{{item}}"> <view class="specialSubject-img"> - <image - src="{{item.icon ? item.icon : '/static/images/default-book-img.png'}}" - mode="aspectFit" - class="img" - aria-label="{{item.name}}" - /> + <image src="{{item.icon ? item.icon : '/static/images/default-book-img.png'}}" mode="aspectFit" class="img" aria-label="{{item.name}}" /> </view> <view class="body-info"> <view class="name">{{item.name}}</view> @@ -284,11 +134,7 @@ </view> <view class="tabCardPublic iconTwo"> <view class="icon"> - <image - src="/static/images/home/shuziyuedu2.png" - mode="aspectFit" - class="iconImage" - /> + <image src="/static/images/home/shuziyuedu2.png" mode="aspectFit" class="iconImage" /> </view> <view data-info="{{'shuziyuedu'}}" bindtap="onMoreGuide" class="flex"> <text class="more">鏇村</text> @@ -296,18 +142,8 @@ </view> </view> <view class="listBox2 flex"> - <view - wx:for="{{readBookList}}" - wx:for-item="item" - wx:for-index="index" - wx:key="index" - class="booksListItemBox" - > - <view - class="listItem" - bind:tap="goReadBookDetail" - data-book="{{item}}" - > + <view wx:for="{{readBookList}}" wx:for-item="item" wx:for-index="index" wx:key="index" class="booksListItemBox"> + <view class="listItem" bind:tap="goReadBookDetail" data-book="{{item}}"> <view class="specialSubject-img"> <image src="{{item.icon}}" mode="aspectFit" class="img" /> </view> @@ -320,64 +156,28 @@ </view> <view class="tabCardPublic iconTwo"> <view class="icon"> - <image - src="/static/images/home/shuzijiaocai2.png" - mode="aspectFit" - class="iconImage" - /> + <image src="/static/images/home/shuzijiaocai2.png" mode="aspectFit" class="iconImage" /> </view> - <view - data-info="{{'shuzijiaocai'}}" - bindtap="onMoreGuide" - class="flex" - > + <view data-info="{{'shuzijiaocai'}}" bindtap="onMoreGuide" class="flex"> <text class="more">鏇村</text> <t-icon name="chevron-right" size="32rpx" color="#ff6d00" /> </view> </view> <view class="listBox3"> <view wx:if="{{textbookList.length > 0}}"> - <view - wx:for="{{textbookList}}" - wx:for-item="item" - wx:for-index="index" - wx:key="index" - class="textbooksItemBox" - > + <view wx:for="{{textbookList}}" wx:for-item="item" wx:for-index="index" wx:key="index" class="textbooksItemBox"> <view class="listItem flex"> - <view - class="specialSubject-img" - bind:tap="goTextBookDetail" - data-book="{{item}}" - > + <view class="specialSubject-img" bind:tap="goTextBookDetail" data-book="{{item}}"> <image src="{{item.icon}}" mode="aspectFit" class="img" /> </view> <view class="body-info"> - <view - class="name" - bind:tap="goTextBookDetail" - data-book="{{item}}" - >{{item.name}}</view - > - <view - class="introduction" - bind:tap="goTextBookDetail" - data-book="{{item}}" - >{{item.description}}</view - > + <view class="name" bind:tap="goTextBookDetail" data-book="{{item}}">{{item.name}}</view> + <view class="introduction" bind:tap="goTextBookDetail" data-book="{{item}}">{{item.description}}</view> <view class="author">{{item.author}}</view> <view class="priceBox flex jc-sb"> <text class="price" wx:if="{{item.price == 0}}">鍏嶈垂</text> - <text class="price" wx:if="{{item.price !== 0}}" - >锟{item.price}}</text - > - <image - src="/static/images/home/home-cart.png" - mode="aspectFit" - class="addCartImg" - bind:tap="addCart" - data-info="{{item}}" - /> + <text class="price" wx:if="{{item.price !== 0}}">锟{item.price}}</text> + <image src="/static/images/home/home-cart.png" mode="aspectFit" class="addCartImg" bind:tap="addCart" data-info="{{item}}" /> </view> </view> </view> @@ -389,37 +189,17 @@ </view> <view class="tabCardPublic"> <view class="icon"> - <image - src="/static/images/home/paihangbang2.png" - mode="" - class="iconImage" - /> + <image src="/static/images/home/paihangbang2.png" mode="" class="iconImage" /> </view> </view> <view class="rankingList"> <scroll-view class="srcolbox" scroll-x scroll-with-animation="true"> <view class="booksListBox"> - <view - wx:for="{{rankingList}}" - wx:for-item="item" - wx:for-index="index" - wx:key="index" - class="booksListItemBox" - > + <view wx:for="{{rankingList}}" wx:for-item="item" wx:for-index="index" wx:key="index" class="booksListItemBox"> <view class="listItem" bind:tap="goDetail" data-book="{{item}}"> <view class="specialSubject-img"> - <image - src="{{item.icon}}" - mode="aspectFit" - class="img" - wx:if="{{item.icon}}" - /> - <image - src="/static/images/default-book-img.png" - mode="aspectFit" - class="img" - wx:else - /> + <image src="{{item.icon}}" mode="aspectFit" class="img" wx:if="{{item.icon}}" /> + <image src="/static/images/default-book-img.png" mode="aspectFit" class="img" wx:else /> </view> <view class="body-info"> <view class="name">{{item.name}}</view> @@ -435,4 +215,4 @@ </t-pull-down-refresh> </view> <import src="home.skeleton.wxml" /> -<template is="skeleton" wx:if="{{loading}}" /> +<template is="skeleton" wx:if="{{loading}}" /> \ No newline at end of file diff --git a/pages/home/home.wxss b/pages/home/home.wxss index c7c1732..dd34c3e 100644 --- a/pages/home/home.wxss +++ b/pages/home/home.wxss @@ -45,10 +45,24 @@ height: 100%; } +.home-page-header .search { + display: flex; + align-items: center; +} + .home-page-header .search .t-search__input-container { height: 96rpx; background: #fff !important; font-size: 28rpx !important; + flex: 1; + width: 85vw; + margin-left: 20rpx; +} + +.home-page-header .search .icon { + width: 40rpx; + height: 40rpx; + } .home-page-header .t-search__input { diff --git a/pages/index/bookDetail.js b/pages/index/bookDetail.js new file mode 100644 index 0000000..ac1a9b6 --- /dev/null +++ b/pages/index/bookDetail.js @@ -0,0 +1,66 @@ +// pages/index/bookDetail.js +const app = getApp() +Page({ + + /** + * 椤甸潰鐨勫垵濮嬫暟鎹� + */ + data: { + refcode: 0 + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 + */ + onLoad(options) { + if (options.scene) { + this.setData({ + refcode: options.scene, + }) + this.getBookList() + } + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 + */ + onReady() { + + }, + getBookList() { + const obj = { + storeInfo: app.config.jslx, + path: "*", + queryType: '*', + coverSize: { + width: 150 + }, + paging: { + start: 0, + size: 6 + }, + filterList: [{ + value: 'Normal', + field: 'state' + }], + fields: { + author: [], + 'RefCodes': [this.data.refcode] + } + } + app.MG.store.getProductList(obj).then((res) => { + console.log(res.datas, '鍥句功淇℃伅') + let book = res.datas[0] + wx.redirectTo({ + url: `/packageBookService/pages/bookServices/detail/index?id=${book.id}&name=${book.name}&storeInfo=${app.config.jslx}`, + }); + }) + }, + + /** + * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/index/bookDetail.json b/pages/index/bookDetail.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/index/bookDetail.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/index/bookDetail.wxml b/pages/index/bookDetail.wxml new file mode 100644 index 0000000..fa5234e --- /dev/null +++ b/pages/index/bookDetail.wxml @@ -0,0 +1,2 @@ +<!--pages/index/bookDetail.wxml--> +<view></view> \ No newline at end of file diff --git a/pages/index/bookDetail.wxss b/pages/index/bookDetail.wxss new file mode 100644 index 0000000..c0d1ef0 --- /dev/null +++ b/pages/index/bookDetail.wxss @@ -0,0 +1 @@ +/* pages/index/bookDetail.wxss */ \ No newline at end of file diff --git a/pages/index/resourceCover.js b/pages/index/resourceCover.js new file mode 100644 index 0000000..79f79e8 --- /dev/null +++ b/pages/index/resourceCover.js @@ -0,0 +1,153 @@ +// pages/index/resourceCover.js +const app = getApp() +Page({ + + /** + * 椤甸潰鐨勫垵濮嬫暟鎹� + */ + data: { + webpageSrc: "", + bookId: 0, + bookName: '', + cmsId: '', + productLinkPath: '', + parentProductLinkPath: '', + formPath: '' + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 + */ + onLoad(options) { + if (options.scene) { + this.getBookInfo(options.scene) + } + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 + */ + onReady() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず + */ + onShow() { + + }, + + getBookInfo(refcode) { + const obj = { + storeInfo: app.config.jslx, + path: app.config.jslx, + queryType: 'ProductCmsItem', + SysType: "CmsItem", + RefCode: refcode, + // CmsItemType: 'jsek_resource', + paging: { + start: 0, + size: 99, + }, + coverSize: { + width: 260 + }, + fields: { + ProductLinkInfo: [], + productLinkPath: [], + selectType: [], + freeFile: [], + file: [], + protectedFile: [], + resourcesClassification: [], + isDownload: [], + jsek_resourceBrief: [], + jsek_link: [], + jsek_questionBank: [], + learnSelectType: [], + } + } + app.MG.resource.getItem(obj).then((res) => { + let book = res.datas.length > 0 ? res.datas[0] : {} + console.log(book, '璧勬簮淇℃伅') + let url; + if (book.selectType == "video" || book.learnSelectType == "video") { + url = "/packageDomain/pages/resourceDetails/myVideo/index"; + } else if ( + book.selectType == "audio" || + book.learnSelectType == "audio" + ) { + url = "/packageDomain/pages/resourceDetails/myAudio/index"; + } else if (book.selectType == "picture" || book.selectType == "zip") { + url = "/packageDomain/pages/resourceDetails/document/index"; + } + this.setData({ + bookId: book.productLinkInfo.ProductId, + bookName: book.productLinkInfo.Name, + productLinkPath: book.productLinkInfo.LinkPath + "\\" + book.id, + parentProductLinkPath: book.productLinkInfo.LinkPath, + cmsId: book.id, + formPath: book.learnSelectType ? 'jsek_cloudLearning' : '' + }) + wx.redirectTo({ + url: `${url}?productLinkPath=${this.data.productLinkPath}&parentProductLinkPath=${this.data.parentProductLinkPath}&bookId=${book.productLinkInfo.ProductId}&bookName=${book.productLinkInfo.Name}&cmsId=${book.id}&storeInfo=${book.storeInfo}&formPath=${this.data.formPath}`, + }); + + if (book.selectType == "pdf") { + const fileLink = book.file ? book.file : book.freeFile + console.log(fileLink); + wx.navigateTo({ + url: "/packageBookService/pages/components/webView/index?md5=" + + fileLink + + "&fileName=" + + book.name + + "&fileType=" + + book.selectType + "&bookBuy=true" + }); + } + if (book.selectType == 'document') { + const fileLink = book.file ? + app.config.requestCtx + "/file/api/ApiDownload?md5=" + book.file : + app.config.requestCtx + + "/file/api/ApiDownload?md5=" + + book.freeFile; + console.log(fileLink, "fileLink"); + //鎻愮ず鍔犺浇涓� + // 鍗曟涓嬭浇鍏佽鐨勬渶澶ф枃浠朵负 200MB + wx.downloadFile({ + url: fileLink, + filePath: wx.env.USER_DATA_PATH + `/${book.name}.${book.selectType}`, + success: function (res) { + console.log(res, "wx.downloadFile success res"); + if (res.statusCode != 200) { + util.hideLoadingWithErrorTips(); + return false; + } + var Path = res.tempFilePath; //杩斿洖鐨勬枃浠朵复鏃跺湴鍧�锛岀敤浜庡悗闈㈡墦寮�鏈湴棰勮鎵�鐢� + let data = res.filePath; + wx.openDocument({ + filePath: data, + showMenu: true, + success: function (res) { + console.log("鎵撳紑鎴愬姛"); + util.hideLoading(); + }, + }); + }, + fail: function (err) { + console.log(err, "wx.downloadFile fail err"); + util.hideLoadingWithErrorTips(); + }, + }); + } + }) + }, + + /** + * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/index/resourceCover.json b/pages/index/resourceCover.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/index/resourceCover.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/index/resourceCover.wxml b/pages/index/resourceCover.wxml new file mode 100644 index 0000000..f0d2162 --- /dev/null +++ b/pages/index/resourceCover.wxml @@ -0,0 +1,3 @@ +<!--pages/index/resourceCover.wxml--> +<text></text> +<web-view wx:if="{{webpageSrc}}" src="{{webpageSrc}}"></web-view> \ No newline at end of file diff --git a/pages/index/resourceCover.wxss b/pages/index/resourceCover.wxss new file mode 100644 index 0000000..f969e0c --- /dev/null +++ b/pages/index/resourceCover.wxss @@ -0,0 +1 @@ +/* pages/index/resourceCover.wxss */ \ No newline at end of file diff --git a/pages/specialDiscussion/index.js b/pages/specialDiscussion/index.js index d41a268..40429ee 100644 --- a/pages/specialDiscussion/index.js +++ b/pages/specialDiscussion/index.js @@ -17,7 +17,6 @@ }], tabIndex: 0, specialSubjectList: [], - now: new Date(), // 鍋囪杩欐槸褰撳墠鏃堕棿 formattedDate: '', // 鐢ㄤ簬瀛樺偍鏍煎紡鍖栧悗鐨勬棩鏈熸椂闂村瓧绗︿覆 batList: [], @@ -41,11 +40,7 @@ navBarHeight: navBarHeight, }); this.ceShiList() - - this.getCourseTypeListList() - - }, /** @@ -106,10 +101,7 @@ this.setData({ batListValue: value }) - this.specialDiscussionGet(this.data.batList[value]) - - }, onTabsTap(event) { const index = event.currentTarget.dataset.index @@ -123,7 +115,7 @@ this.specialDiscussionGet(this.data.batList[0]) }, - // 鑾峰彇鍥剧墖鏂囧瓧鍒楄〃 + // 鑾峰彇鍗冲皢寮�鎾垪琛� ceShiList() { this.setData({ loading: true @@ -132,21 +124,17 @@ if (this.data.searchValue) { searchObj = { 'Name*': this.data.searchValue.trim() - // '||subtitle*': searchInputValue.value.trim() } } - - app.MG.store .getProductList({ - storeInfo: 'jsek_seminar', + storeInfo: app.config.seminar, path: '*', queryType: '*', paging: { start: 0, size: 99 }, - fields: { content: [], subtitle: [], @@ -154,7 +142,7 @@ author: [], viewCount: [], startTime: [], //寮�鎾椂闂� - // "liveTime>=": [formattedDate.value], //鐩存挱鏃堕棿 + endTime: [], liveTime: [], lecturer: [], position: [], @@ -167,25 +155,12 @@ const specialSubjectList = [] res.datas.forEach((item) => { item.price = item.price.toFixed(2) - - const date1 = new Date(this.data.formattedDate) - const date2 = new Date(item.liveTime) - - // 姣旇緝涓や釜鏃ユ湡 - if (date1 > date2) { - // console.log('鐩存挱缁撴潫锛岃鐪嬪洖鏀�') - } else if (date1 < date2) { - // console.log('鐩存挱杩樻病寮�濮嬶紝璇风湅鍗冲皢寮�鎾�') - + const date2 = new Date(item.endTime) + if (date1 < date2) { specialSubjectList.push(item) - - console.log(specialSubjectList); - } else { - // console.log('涓や釜鏃堕棿鐩稿悓锛�') } }) - this.setData({ specialSubjectList, loading: false, @@ -208,16 +183,13 @@ }); }, onLink(e) { - const item = e.currentTarget.dataset.item console.log(item.jsek_link); wx.navigateTo({ url: '/pages/specialDiscussion/webView/index?link=' + item.jsek_link }); }, - async getCourseTypeListList() { - const quer = { path: '*', filterList: [{ @@ -233,30 +205,23 @@ type: 'Asc', field: 'LinkOrder' }, - } const data = await app.MG.store.getStoreChannelList(quer) - let dataList = data.datas - - // data.datas.forEach(item => { - // if (item.refCode != "jsek_homepageSeminar") { - // console.log(item); - // dataList.push(item) - // } - // }) + let dataList = [] + data.datas.forEach(item => { + if (item.refCode != "jsek_homepageSeminar") { + console.log(item); + dataList.push(item) + } + }) this.setData({ batList: dataList }) - - this.specialDiscussionGet(data.datas[0]) - - }, - + // 鑾峰彇鐩存挱鍥炴斁 specialDiscussionGet(item) { - let searchObj = {} if (this.data.searchValue) { searchObj = { @@ -274,7 +239,6 @@ start: 0, size: 99 }, - fields: { content: [], subtitle: [], @@ -282,6 +246,7 @@ author: [], viewCount: [], startTime: [], + endTime: [], liveTime: [], lecturer: [], position: [], @@ -291,28 +256,18 @@ }) .then((res) => { res.datas.forEach((item) => { + item.price = item.price.toFixed(2) const date1 = new Date(this.data.formattedDate) - const date2 = new Date(item.liveTime) - + const date2 = new Date(item.endTime) // 姣旇緝涓や釜鏃ユ湡 if (date1 > date2) { - // console.log('鐩存挱缁撴潫锛岃鐪嬪洖鏀�') data.push(item) - } else if (date1 < date2) { - // console.log('鐩存挱杩樻病寮�濮嬶紝璇风湅鍗冲皢寮�鎾�') - } else { - // console.log('涓や釜鏃堕棿鐩稿悓锛�') } }) - this.setData({ specialDiscussionList: data, "tabList[1].amount": data.length, - - - }) - console.log(this.data.specialDiscussionList); }) }, diff --git a/pages/specialDiscussion/index.wxml b/pages/specialDiscussion/index.wxml index 0cbb81a..5cb1159 100644 --- a/pages/specialDiscussion/index.wxml +++ b/pages/specialDiscussion/index.wxml @@ -1,9 +1,6 @@ <import src="index.skeleton.wxml" /> <template is="skeleton" wx:if="{{loading}}" /> - - <view wx:else> - <view style="width: 100%; height: {{barHeight}}px;"></view> <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> <view> @@ -11,24 +8,16 @@ </view> <t-search model:value="{{searchValue}}" shape="round" placeholder="璇疯緭鍏ュ叧閿瘝/涔﹀悕/浣滆��" class="navBar-search" style="width: 464rpx" bind:submit="searchBook" /> </view> - - <view class="tabsBox"> <view wx:for="{{tabList}}" wx:key="index" wx:for-item="item" data-index="{{index}}" bind:tap="onTabsTap" class="{{ index == tabIndex ?' tabsSelect ' : 'tabsNameBox'}}"> <view class="{{ index == tabIndex ?' tabsNameSelect ' : 'tabsName'}}">{{item.name}} ({{item.amount}})</view> - <view class="{{index == tabIndex ? 'selectLine' :''}}"></view> </view> </view> - - - <view wx:if="{{tabIndex == 0}}"> - - + <view wx:if="{{tabIndex == 0}}" class="list-box"> <view wx:for="{{specialSubjectList}}" wx:key="index" wx:for-item="item" data-item="{{item}}" bind:tap="onLink" class="displayContent"> <view class="imageBox"> <image src="{{item.icon}}" mode="aspectFit" /> </view> - <view class="tltieBox"> <view class="nameTltieBox"> {{item.name}} @@ -36,7 +25,6 @@ <view class="directSeeding"> 鐩存挱鏃堕棿锛歿{ item.liveTime }} </view> - <view class="position"> <view style="color: #333;"> {{item.lecturer }}</view> <view wx:if="{{item.price == 0}}" style="color: #FF6C00;">鍏嶈垂</view> @@ -44,44 +32,38 @@ </view> </view> </view> - <view wx:if="{{specialSubjectList.length <= 0}}" class="noDataBox"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> </view> - - </view> <view wx:else> <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" t-class="custom-tabs" t-class-content="custom-panel"> - <t-tab-panel wx:for="{{batList}}" wx:key="index" wx:for-item="item" data-item="{{item}}" label="{{item.name}}" value="{{index}}" style="{{tabPanelstyle}}"> - - - <view wx:for="{{specialDiscussionList}}" wx:key="index" wx:for-item="item" data-item="{{item}}" bind:tap="onLink" class="displayContent"> - <view class="imageBox"> - <image src="{{item.icon}}" mode="aspectFit" /> - </view> - - <view class="tltieBox"> - <view class="nameTltieBox"> - {{item.name}} - </view> - <view class="directSeeding"> - 鐩存挱鏃堕棿锛歿{ item.liveTime }} + <t-tab-panel wx:for="{{batList}}" wx:key="index" wx:for-item="item" data-item="{{item}}" label="{{item.name}}" value="{{index}}"> + <view class="list-box"> + <view wx:for="{{specialDiscussionList}}" wx:key="index" wx:for-item="item" data-item="{{item}}" bind:tap="onLink" class="displayContent"> + <view class="imageBox"> + <image src="{{item.icon}}" mode="aspectFit" /> </view> - <view class="position"> - <view style="color: #333;"> {{item.lecturer }}</view> - <view wx:if="{{item.price == 0}}" style="color: #FF6C00;">鍏嶈垂</view> - <view wx:else="" style="color: #FF6C00;">锟{item.price}}</view> + <view class="tltieBox"> + <view class="nameTltieBox"> + {{item.name}} + </view> + <view class="directSeeding"> + 鐩存挱鏃堕棿锛歿{ item.liveTime }} + </view> + + <view class="position"> + <view style="color: #333;"> {{item.lecturer }}</view> + <view wx:if="{{item.price == 0}}" style="color: #FF6C00;">鍏嶈垂</view> + <view wx:else="" style="color: #FF6C00;">锟{item.price}}</view> + </view> </view> </view> </view> - <view wx:if="{{specialDiscussionList.length <= 0}}" class="noDataBox"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> </view> - - </t-tab-panel> </t-tabs> </view> diff --git a/pages/specialDiscussion/index.wxss b/pages/specialDiscussion/index.wxss index 00c6af4..99c196e 100644 --- a/pages/specialDiscussion/index.wxss +++ b/pages/specialDiscussion/index.wxss @@ -31,20 +31,19 @@ width: 100%; display: flex; justify-content: flex-start; - border-bottom: 1rpx solid #ccc; + padding: 40rpx 40rpx 20rpx 40rpx; } .tabsNameBox { - margin: 0 50rpx; + width: 200rpx; } .tabsSelect { - margin: 0 50rpx; color: #FF6C00; + width: 200rpx; } .tabsNameSelect { - min-width: 170rpx; height: 40rpx; background-repeat: no-repeat; background-image: url(https://jsek.bnuic.com/home/image/click-icon.png); @@ -74,8 +73,11 @@ margin-bottom: 1rpx; } +.list-box { + padding: 0 30rpx; +} + .displayContent { - width: 692rpx; height: 250rpx; background: #FFFFFF; box-shadow: 0rpx 0rpx 18rpx 2rpx rgba(0, 0, 0, 0.08); @@ -87,16 +89,17 @@ } .imageBox { - width: 464rpx; height: 100%; background: #EAEAEA; border-radius: 9rpx 0rpx 0rpx 9rpx; object-fit: contain; + flex: 1; } .tltieBox { margin: 15rpx; + flex: 1; } .nameTltieBox { @@ -137,6 +140,14 @@ /* 灏嗚儗鏅浘鐗囦綅缃缃负闈犲彸 */ } +.t-tabs__item { + padding: 0px 20rpx !important; +} + +.t-sticky__content { + padding: 0 20rpx !important; +} + .noDataBox { width: 100%; /* margin-top: 200rpx; */ diff --git a/pages/test/testCover.js b/pages/test/testCover.js new file mode 100644 index 0000000..b426d38 --- /dev/null +++ b/pages/test/testCover.js @@ -0,0 +1,95 @@ +// pages/test/testCover.js +const app = getApp() +Page({ + + /** + * 椤甸潰鐨勫垵濮嬫暟鎹� + */ + data: { + bookId: 0, + bookName: '', + cmsId: '', + productLinkPath: '', + rootCmsItemId: '', + answerTitle: '', + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 + */ + onLoad(options) { + if (options.scene) { + this.getBookInfo(options.scene) + } + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 + */ + onReady() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず + */ + onShow() { + + }, + + getBookInfo(refcode) { + const obj = { + storeInfo: app.config.jslx, + path: app.config.jslx, + queryType: 'ProductCmsItem', + SysType: "CmsFolder", + RefCode: refcode, + paging: { + start: 0, + size: 99, + }, + coverSize: { + width: 260 + }, + fields: { + ProductLinkInfo: [], + productLinkPath: [], + } + } + app.MG.resource.getItem(obj).then((res) => { + console.log(res.datas, '鍥句功淇℃伅') + let idPathList = []; + let book = res.datas[0] + this.setData({ + bookId: book.productLinkInfo.ProductId, + bookName: book.productLinkInfo.Name, + productLinkPath: book.productLinkInfo.LinkPath + "\\" + book.id, + rootCmsItemId: book.productLinkInfo.LinkPath, + cmsId: book.id, + answerTitle: book.name + }) + idPathList.push({ + id: book.id, + name: book.name, + productLinkPath: this.data.productLinkPath, + type: book.type, + }) + wx.redirectTo({ + url: `/packageBookService/pages/bookServices/examination/examination?bookId=${ + this.data.bookId + }&productLinkPath=${this.data.productLinkPath}& =${ + this.data.rootCmsItemId + }&idPathList=${JSON.stringify(idPathList)}&answerTitle=${ + this.data.answerTitle + }&answerType=${"option"}&storeInfo=${book.storeInfo}`, + }); + }) + }, + /** + * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/test/testCover.json b/pages/test/testCover.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/test/testCover.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/test/testCover.wxml b/pages/test/testCover.wxml new file mode 100644 index 0000000..6ae8123 --- /dev/null +++ b/pages/test/testCover.wxml @@ -0,0 +1,2 @@ +<!--pages/test/testCover.wxml--> +<text></text> \ No newline at end of file diff --git a/pages/test/testCover.wxss b/pages/test/testCover.wxss new file mode 100644 index 0000000..8f3bb37 --- /dev/null +++ b/pages/test/testCover.wxss @@ -0,0 +1 @@ +/* pages/test/testCover.wxss */ \ No newline at end of file diff --git a/static/images/home/nav_icon_scan.png b/static/images/home/nav_icon_scan.png new file mode 100644 index 0000000..21d2d63 --- /dev/null +++ b/static/images/home/nav_icon_scan.png Binary files differ -- Gitblit v1.9.1