| | |
| | | "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": [ |
| | | { |
| | |
| | | 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";//书展 |
| | | |
| | |
| | | digitalTextbooks, |
| | | seminar, |
| | | digitalRead, |
| | | jslx, |
| | | reg_tel, |
| | | reg_telphone, |
| | | epubUrl, |
| | |
| | | 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 = { |
| | | /* |
| | |
| | | repositoryInfo = publicRepository, |
| | | queryType, |
| | | linkType, |
| | | RefCode, |
| | | CmsItemType, |
| | | paging, |
| | | sort, |
| | | fields, |
| | |
| | | coverSize, |
| | | itemIdArr, |
| | | SysType, |
| | | |
| | | tourism_isHighQualityResources, |
| | | }) => { |
| | | if (!path) return Promise.reject("接口请求必要参数不能为空!"); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | const query = { |
| | | AccessControl: { |
| | | Path: path, |
| | |
| | | Description: [], |
| | | Name: [], |
| | | Icon: [], |
| | | RefCode: [], |
| | | // RefCode: [], |
| | | Type: [], |
| | | TypeId: [], |
| | | State: [], |
| | | Tag: [], |
| | | LinkInfo: [], |
| | | LinkFile: [], |
| | | CmsItemType: [], |
| | | // CmsItemType: [], |
| | | ChildrenFolderCount: [], |
| | | ChildrenCount: [], |
| | | ...fields, |
| | |
| | | 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", |
| | |
| | | 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: [], |
| | |
| | | // 全部搜索 - 单独的某个库 |
| | | if (path != "All") { |
| | | let data = { |
| | | 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", |
| | |
| | | datas: data.datas, |
| | | path, |
| | | }); |
| | | return { datas, total: data.totalCount }; |
| | | return { |
| | | datas, |
| | | total: data.totalCount |
| | | }; |
| | | } |
| | | return { data: [], total: 0 }; |
| | | return { |
| | | data: [], |
| | | total: 0 |
| | | }; |
| | | }); |
| | | }, |
| | | |
| | |
| | | |
| | | // 获取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", |
| | |
| | | } |
| | | |
| | | let token = wx.getStorageSync(tokenKey) ? wx.getStorageSync(tokenKey) : ''; |
| | | |
| | | |
| | | let url = token ? '/store/api/ApiQueryProductByAppUser' : '/store/api/ApiQueryProduct' |
| | | return request({ |
| | | url: url, |
| | |
| | | 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], |
| | |
| | | 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, |
| | | }; |
| | |
| | | type: Object, |
| | | value: "", |
| | | }, |
| | | tab: { |
| | | type: String, |
| | | value: "", |
| | | }, |
| | | openIds: { |
| | | type: Array, |
| | | value: [], |
| | | }, |
| | | mockData: { |
| | | type: Object, |
| | | value: {}, |
| | |
| | | radioItem: "test", |
| | | loading: false, |
| | | }, |
| | | |
| | | ready() {}, |
| | | |
| | | /** |
| | | * 组件的方法列表 |
| | |
| | | }) |
| | | }, |
| | | 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({ |
| | |
| | | "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" |
| | | } |
| | | } |
| | |
| | | <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> |
| | |
| | | </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> |
| | |
| | | <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'}}"> |
| | |
| | | <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> |
New file |
| | |
| | | /* 加载动画相关 */ |
| | | 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, |
| | | } |
New file |
| | |
| | | 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}`, |
| | | }); |
| | | |
| | | } |
| | | }, |
| | | }, |
| | | }); |
New file |
| | |
| | | { |
| | | "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" |
| | | } |
| | | } |
New file |
| | |
| | | <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> |
New file |
| | |
| | | .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; |
| | | } |
New file |
| | |
| | | /* 加载动画相关 */ |
| | | 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, |
| | | } |
New file |
| | |
| | | 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; |
| | | // 这个时候checked的值是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); |
| | | // 通过判断,联通父级checked |
| | | 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); |
| | | } |
| | | // 联通最外层级checked ,如果有一个取消勾选,且当前最外层勾选,则取消最外层的勾选 |
| | | if (citem.checked && outermost && outermost.checked) { |
| | | var myEventDetail = { |
| | | ids: [outermost.id], |
| | | flag: false, |
| | | }; |
| | | var myEventOption = { |
| | | bubbles: true, |
| | | composed: true, |
| | | }; |
| | | this.triggerEvent("changeListChecked", myEventDetail, myEventOption); |
| | | } |
| | | // 联通最外层级checked, 如果所有子项勾选, 且当前最外层未勾选, 则加上最外层的勾选 |
| | | 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) { |
| | | //选中的时候添加id |
| | | 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 { |
| | | // 取消选中的时候删除id |
| | | } |
| | | }, |
| | | // 加入购物车 |
| | | 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; |
| | | }, |
| | | }, |
| | | }); |
New file |
| | |
| | | { |
| | | "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" |
| | | } |
| | | } |
New file |
| | |
| | | <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> --> |
New file |
| | |
| | | .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; |
| | | } |
| | |
| | | options: { |
| | | id: "", |
| | | name: "", |
| | | storeInfo: '', |
| | | }, |
| | | bookDetail: {}, |
| | | bookClass: [], |
| | |
| | | options: { |
| | | id: options.id, |
| | | name: options.name, |
| | | storeInfo: options.storeInfo, |
| | | }, |
| | | }); |
| | | wx.setNavigationBarTitle({ |
| | |
| | | "mockData.count": 0, |
| | | }); |
| | | const query = { |
| | | storeInfo: this.data.options.storeInfo, |
| | | path: "*", |
| | | queryType: "*", |
| | | productId: id, |
| | |
| | | }, |
| | | |
| | | // 扁平化数据转换tree |
| | | 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)) { |
| | |
| | | } |
| | | // newArr.push(item) |
| | | // 在插入过程中对数据进行排序 |
| | | newArr = this.insertAndSortObjectsByProductLinkPath(newArr, item) |
| | | newArr = this.insertAndSortObjectsByProductLinkPath(newArr, item, addNum) |
| | | } |
| | | } |
| | | //给数组里面再添加一个children的空数组 |
| | | 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 |
| | | } |
| | |
| | | }, |
| | | |
| | | // 排序数组 按照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) { |
| | |
| | | // 测试6 正式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 |
| | |
| | | let query = { |
| | | path: '*', |
| | | queryType: '*', |
| | | storeInfo: this.data.options.storeInfo, |
| | | productId: this.data.bookDetail.id, |
| | | cmsPath: type.productLinkPath, |
| | | cmsType: '*', |
| | |
| | | }) |
| | | } |
| | | } |
| | | 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); |
| | |
| | | let query = { |
| | | path: "*", |
| | | queryType: "*", |
| | | storeInfo: this.data.options.storeInfo, |
| | | productId: this.data.bookDetail.id, |
| | | cmsPath: type.productLinkPath, |
| | | cmsType: '*', |
| | | itemFields: { |
| | | SysType: "CmsFolder", |
| | | // 资源类型,试读文件,是否允许下载等参数 |
| | |
| | | } |
| | | // 云测试,递归请求里层数据 |
| | | 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位// 正式 5位// 测试调用传20,内部7 正式调用传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.findChildIds(list[0].children, result); |
| | | this.setData({ |
| | | teach: list, |
| | | test: list[0].children, |
| | | 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(this.data.test, "test") |
| | | } |
| | | console.log(list, '云學習789'); |
| | | } else { |
| | | // 无数据 |
| | | } |
| | | } 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) => { |
| | |
| | | let query = { |
| | | path: "*", |
| | | queryType: "*", |
| | | storeInfo: this.data.options.storeInfo, |
| | | productId: this.data.bookDetail.id, |
| | | cmsPath: path, |
| | | itemFields: { |
| | |
| | | // 发起订单初始化请求并等待结果 |
| | | const res = await app.MG.store.initOrder(query); |
| | | // 获取订单号并赋值给 orderNumber.value |
| | | console.log(res, 'res456'); |
| | | bookOrdersId = res.orderNumber; |
| | | // 检查订单号是否存在 |
| | | if (bookOrdersId) { |
| | |
| | | <!-- 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> |
| | |
| | | </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> |
| | |
| | | <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> |
| | | <!-- 销售信息 --> |
| | |
| | | <!-- 电子书售价 --> |
| | | <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> |
| | |
| | | <!-- 纸质书售价 --> |
| | | <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> |
| | |
| | | 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" |
| | |
| | | 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> |
| | |
| | | <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> |
| | |
| | | } |
| | | |
| | | .t-tabs .t-tabs__item--active { |
| | | |
| | | background-repeat: no-repeat; |
| | | background-size: 35%; |
| | | background-position: 50% 40%; |
| | |
| | | countdownInterval: null, // 计时器 |
| | | isCountdownRunning: true, // 是否倒计时 |
| | | countdownTime: 0, // 倒计时时间 |
| | | storeInfo: '', |
| | | bookId: "", |
| | | productLinkPath: "", |
| | | rootCmsItemId: "", |
| | |
| | | rootCmsItemId: options.rootCmsItemId, |
| | | idPathList: options.idPathList ? JSON.parse(options.idPathList) : [], |
| | | answerType: options.answerType, |
| | | storeInfo: options.storeInfo, |
| | | }); |
| | | wx.setNavigationBarTitle({ |
| | | title: options.answerTitle, |
| | |
| | | let query = { |
| | | path: "*", |
| | | queryType: "*", |
| | | storeInfo: this.data.storeInfo, |
| | | productId: this.data.bookId, |
| | | cmsPath: pathitem.productLinkPath, |
| | | itemFields: { |
| | |
| | | }); |
| | | } |
| | | 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); |
| | |
| | | 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: "*", |
| | |
| | | let multipleChoiceArr = []; // 多选 |
| | | let completionArr = []; // 填空 |
| | | let query = { |
| | | storeInfo: this.data.storeInfo, |
| | | path: "*", |
| | | cmsPath: this.data.rootCmsItemId, |
| | | cmsType: "*", |
| | |
| | | itemIds.push(item.id + ""); |
| | | }); |
| | | let query = { |
| | | storeInfo: this.data.storeInfo, |
| | | path: "*", |
| | | cmsPath: this.data.rootCmsItemId, |
| | | cmsType: "*", |
| | |
| | | } else { |
| | | return false |
| | | } |
| | | } else if (typeof data == 'number') { |
| | | return true |
| | | } else { |
| | | return false |
| | | } |
| | |
| | | dialogKey: false, |
| | | style: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx;', |
| | | activeId: '', |
| | | storeInfo: '', |
| | | bookId: '', |
| | | bookName: '', |
| | | cmsId: '', |
| | |
| | | startTime: "", //进入页面当前时间 |
| | | pauseTime: 0, //暂停时间 |
| | | formPath: '', |
| | | loading: true, |
| | | loading: false, |
| | | hidden: true, |
| | | videoError: false, |
| | | videoLoaidng: false |
| | | videoLoading: false |
| | | }, |
| | | // 格式化笔记时间 |
| | | convertTimestamp(timestamp) { |
| | |
| | | navBarHeight: navBarHeight, |
| | | barHeight: systInfo.statusBarHeight, |
| | | activeId: options.activeId, |
| | | storeInfo: options.storeInfo, |
| | | bookId: options.bookId, |
| | | bookName: options.bookName, |
| | | cmsId: options.cmsId, |
| | |
| | | }, |
| | | resourceDetailsData() { |
| | | this.setData({ |
| | | videoLoaidng: true |
| | | // videoLoaidng: true |
| | | }) |
| | | let query = { |
| | | storeInfo: this.data.storeInfo, |
| | | path: '*', |
| | | queryType: '*', |
| | | productId: this.data.bookId, |
| | |
| | | } |
| | | } |
| | | 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({ |
| | |
| | | }) |
| | | 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 |
| | |
| | | this.setData({ |
| | | videoLoaidng: true, |
| | | selectedId: e.currentTarget.dataset.index, |
| | | showData: '', |
| | | // showData: '', |
| | | titleName: item.name |
| | | }) |
| | | if (item.selectType == "video" || item.learnSelectType === "video") { |
| | |
| | | <!-- 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"> |
| | |
| | | <!-- 标题 --> |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <!-- 记笔记 --> |
| | | <view class="takeNotes" data-key="showCloseBtn" bind:tap="showDialog"> |
| | | <view class="takeNotesLining"> |
| | | <image |
| | | src="/static/images/resourceDetails/jibiji/icon@2x.png" |
| | | mode="" |
| | | /> |
| | | <image src="/static/images/resourceDetails/jibiji/icon@2x.png" mode="" /> |
| | | 记笔记 |
| | | </view> |
| | | </view> |
| | |
| | | </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> |
| | |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | scrollJudge: true, |
| | | loading: true, |
| | | digitalsData: [], |
| | | tabValue: 0, |
| | |
| | | name: "/static/images/digitalCourses/tiwen-click@2x.png" |
| | | }, |
| | | |
| | | dialogBox: false |
| | | dialogBox: false, |
| | | lecturerList: [{ |
| | | icon: '', |
| | | name: '林崇德', |
| | | title: '讲师', |
| | | introduce: '中国学生发展核心素养研制首席专家,围绕大中小学教材建设开展了一系列开创性、奠基性工作。建立完善了我国发展心理学教材体系。' |
| | | }, |
| | | { |
| | | icon: '', |
| | | name: '林崇德', |
| | | title: '教授', |
| | | introduce: '中国学生发展核心素养研制首席专家,围绕大中小学教材建设开展了一系列开创性、奠基性工作。建立完善了我国发展心理学教材体系。中国学生发展核心素养研制首席专家,围绕大中小学教材建设开展了一系列开创性、奠基性工作。建立完善了我国发展心理学教材体系' |
| | | } |
| | | ] |
| | | |
| | | }, |
| | | formatDate(dateString) { |
| | |
| | | }) |
| | | }, |
| | | onTabsChange(event) { |
| | | |
| | | const value = event.detail.value |
| | | this.setData({ |
| | | tabValue: value |
| | |
| | | <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> |
| | |
| | | </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="course-content"> |
| | | <view class="lecturer" wx:for="{{lecturerList}}" wx:key="index" wx:for-item="item"> |
| | | <view class="lecturerImangBox"> |
| | | <image src="" mode="" /> |
| | | <image src="{{item.icon}}" mode="" /> |
| | | </view> |
| | | <view class="lecturerInformation"> |
| | | |
| | | <view class="lecturerName"> |
| | | <view style="font-weight: bold; font-size: 29rpx; color: #333333;"> |
| | | |
| | | 林崇德 |
| | | |
| | | <view class="name"> |
| | | {{item.name}} |
| | | </view> |
| | | <view style="font-weight: 400; font-size: 25rpx; color: #949494;">讲师</view> |
| | | <view class="title" style="font-weight: 400; font-size: 25rpx; color: #949494;">{{item.title}}</view> |
| | | </view> |
| | | <view class="lecturerContent">中国学生发展核心素养研制首席专家,围绕大中小学教材建设开展了一系列开创性、奠基性工作。建立完善了我国发展心理学教材体系。</view> |
| | | |
| | | |
| | | <view class="lecturerContent">{{item.introduce}}</view> |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | |
| | | |
| | | <!-- </scroll-view> --> |
| | | |
| | | |
| | | </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="course-content"> |
| | | <view class="certificateChart"> |
| | | <view class="chart"> |
| | | <image src="" mode="" /> |
| | |
| | | <image src="" mode="" /> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- |
| | | <view class="noDataBox"> |
| | | <t-empty icon="folder-open" description="暂无数据" font-size="80" /> |
| | | |
| | | </view> --> |
| | | |
| | | |
| | | |
| | | </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-tabs> |
| | | <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> |
| | | |
| | | |
| | | </view> |
| | | <!-- 弹窗 --> |
| | | <view wx:if="{{dialogBox}}"> |
| | | <view class="popup-box" bindtap="closeDialog"></view> |
| | |
| | | } |
| | | |
| | | .imageBox { |
| | | width: 690rpx; |
| | | /* width: 100%; */ |
| | | height: 400rpx; |
| | | border-radius: 20rpx; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .nameBox { |
| | |
| | | |
| | | .digital { |
| | | background-color: #F2F3F8; |
| | | padding-bottom: 20rpx; |
| | | } |
| | | |
| | | .right-background { |
| | |
| | | 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 { |
| | |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .lecturer { |
| | | .course-content { |
| | | padding: 30rpx; |
| | | } |
| | | |
| | | .lecturer { |
| | | display: flex; |
| | | margin-bottom: 170rpx; |
| | | margin-bottom: 30rpx |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | .lecturerInformation { |
| | | width: 518rpx; |
| | | height: 143rpx; |
| | | /* height: 143rpx; */ |
| | | margin-left: 30rpx; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | .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 { |
| | |
| | | margin-bottom: env(safe-area-inset-bottom); |
| | | display: flex; |
| | | flex-direction: row; |
| | | background-color: #ccc; |
| | | border: 1px solid #DDD; |
| | | } |
| | | |
| | | .shopCarColor { |
| | |
| | | } |
| | | |
| | | .custom-panel { |
| | | min-height: 400px; |
| | | |
| | | /* min-height: 400px; */ |
| | | } |
| | | |
| | | |
| | |
| | | courseList: [], |
| | | searchValue: '', |
| | | activeItem: null, |
| | | loading: false |
| | | loading: false, |
| | | shoppingCartGetId: [] |
| | | }, |
| | | |
| | | /** |
| | |
| | | navBarHeight: navBarHeight, |
| | | }); |
| | | this.getCourseTypeListList() |
| | | this.getShoppingCartList() |
| | | }, |
| | | |
| | | /** |
| | |
| | | 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) |
| | | } |
| | | } |
| | | |
| | | }, |
| | | |
| | | }) |
| | |
| | | <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> |
| | |
| | | </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"> |
| | | <view class="book-Info"> |
| | | <view class="book-name" bind:tap="courseDetail" data-item="{{item}}"> |
| | | {{item.name}} |
| | | </view> |
| | | <view class="viewCount"> |
| | | {{item.viewCount }}次点击 |
| | | |
| | | </view> |
| | | <view class="author"> |
| | | <view> |
| | |
| | | <view class="money"> |
| | | <view wx:if="{{item.price != 0}}">¥{{item.price }}</view> |
| | | <view wx:else> 免费</view> |
| | | <view> |
| | | <view bind:tap="addCart" data-item="{{item}}"> |
| | | <t-icon name="cart" size="16" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | </view> |
| | | </t-tab-panel> |
| | | </t-tabs> |
| | | |
| | | |
| | | </view> |
| | |
| | | color: var(--td-text-color-primary); |
| | | } |
| | | |
| | | .t-tabs .t-tabs__track { |
| | | display: none; |
| | | } |
| | | |
| | | .t-tabs__item--active { |
| | | color: #FF6C00 !important; |
| | | } |
| | |
| | | .titleBox { |
| | | display: flex; |
| | | align-items: center; |
| | | margin: 10px; |
| | | margin-left: 0; |
| | | padding-top: 30rpx; |
| | | } |
| | |
| | | } |
| | | |
| | | .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; |
| | |
| | | |
| | | .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; |
| | |
| | | } |
| | | |
| | | .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; |
| | |
| | | } |
| | | |
| | | .money { |
| | | margin: 0 30rpx; |
| | | display: flex; |
| | | flex-direction: row; |
| | | justify-content: space-between; |
| | | color: #ff6c00; |
| | | margin-bottom: 30rpx; |
| | | |
| | | } |
| | | |
| | | .ExternalInformationBox { |
| | |
| | | } |
| | | |
| | | .viewCount { |
| | | margin: 10rpx 30rpx; |
| | | margin: 16rpx 0; |
| | | font-weight: 400; |
| | | font-size: 22rpx; |
| | | color: #AEAFC0; |
| | |
| | | * 页面的初始数据 |
| | | */ |
| | | 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: '', |
| | |
| | | } |
| | | } |
| | | 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 |
| | |
| | | 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, |
| | |
| | | |
| | | }) |
| | | }, |
| | | |
| | | 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 = { |
| | |
| | | } else { |
| | | bookArr = Arr |
| | | } |
| | | |
| | | bookArr.forEach(item => { |
| | | if (item.icon == '') { |
| | | item.icon = '/static/images/default-book-img.png' |
| | |
| | | }) |
| | | }, |
| | | onCorrelationBook(e) { |
| | | |
| | | const item = e.currentTarget.dataset.item |
| | | |
| | | console.log(item); |
| | | // const event = { |
| | | // detail: { |
| | | // value: "brief" |
| | |
| | | this.onLoad({ |
| | | id: item.id |
| | | }) |
| | | |
| | | |
| | | |
| | | }, |
| | | // 图书添加购物车 |
| | | async addBookShopcCar() { |
| | |
| | | |
| | | |
| | | //购买按钮 |
| | | |
| | | async buyBtn() { |
| | | if (!this.data.expire) { |
| | | let bookOrdersId = ""; |
| | |
| | | // console.log(item, app.config.textReaderUrl); |
| | | // console.log(token); |
| | | goRead() { |
| | | |
| | | // 首页测试登录功能,后续注释 |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | |
| | | // 如果不是第一次登录,会执行回调 |
| | | if (data) { |
| | | // 登录成功,自动记录token和用户信息,并返回true |
| | | |
| | | const item = this.data.digitalsData |
| | | wx.navigateTo({ |
| | | url: '/pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index?refCode=' + item.refCode + "&tryPageCount=" + item.probationPage |
| | |
| | | <!--pages/digitalTextbooks/digitalTextbooksDetails/index.wxml--> |
| | | <import src="index.skeleton.wxml" /> |
| | | <template is="skeleton" wx:if="{{loading}}" /> |
| | | |
| | | |
| | | <view wx:if="{{!loading}}"> |
| | | <view class="page-bookService"> |
| | | |
| | | <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"> |
| | |
| | | </view> |
| | | <image src="/static/images/bookService/detail/square.png" class="right-background" /> |
| | | </view> |
| | | |
| | | |
| | | |
| | | </view> |
| | | <view class="certificate"> |
| | | <view class="proposal" bind:tap="suggestBtn"> |
| | |
| | | </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"> |
| | | <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"> |
| | |
| | | </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 class="basic-content" wx:if="{{digitalsData.content}}"> |
| | | <rich-text nodes="{{digitalsData.content}}"></rich-text> |
| | | </view> |
| | | <view class="noDataBox" wx:else> |
| | | <t-empty icon="folder-open" description="暂无数据" font-size="80" /> |
| | |
| | | </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 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="basic"> 目录</view> |
| | | </view> |
| | | <view style="margin: 30rpx; margin-bottom: 130rpx;" wx:if="{{digitalsData.catalogue}}"> |
| | | <rich-text nodes="{{digitalsData.catalogue}}" style="{{richStyle}}"></rich-text> |
| | | <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="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-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 class="btn-text"> |
| | | 收藏 |
| | | </view> |
| | | </view> |
| | |
| | | </view> |
| | | <view class="btn-text">试读</view> |
| | | </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> |
| | |
| | | height: 100%; |
| | | } |
| | | |
| | | .book { |
| | | position: relative; |
| | | height: calc(100vh - env(safe-area-inset-bottom) - 60px); |
| | | background-color: #F2F3F8; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | 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 { |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | font-size: 32rpx; |
| | | color: #333; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .basic-content { |
| | | padding: 30rpx 40rpx; |
| | | } |
| | | |
| | | .correlationImage { |
| | |
| | | margin-bottom: env(safe-area-inset-bottom); |
| | | display: flex; |
| | | flex-direction: row; |
| | | border: 1px solid #DDD; |
| | | } |
| | | |
| | | .trialReading { |
| | |
| | | align-items: center; |
| | | flex-direction: column; |
| | | border-left: 1rpx solid #DDDDDD; |
| | | |
| | | } |
| | | |
| | | .shopCarColor { |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | |
| | | }, |
| | | |
| | | // 扫一扫 |
| | | 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) { |
| | |
| | | <view class="container"> |
| | | <t-pull-down-refresh |
| | | value="{{baseRefresh.value}}" |
| | | loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}" |
| | | 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="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}" 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> |
| | |
| | | </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> |
| | |
| | | </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> |
| | |
| | | </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> |
| | |
| | | </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> |
| | |
| | | </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> |
| | |
| | | </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> |
| | |
| | | </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> |
| | |
| | | </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> |
| | |
| | | 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 { |
New file |
| | |
| | | // 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() { |
| | | |
| | | } |
| | | }) |
New file |
| | |
| | | { |
| | | "usingComponents": {} |
| | | } |
New file |
| | |
| | | <!--pages/index/bookDetail.wxml--> |
| | | <view></view> |
New file |
| | |
| | | /* pages/index/bookDetail.wxss */ |
New file |
| | |
| | | // 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() { |
| | | |
| | | } |
| | | }) |
New file |
| | |
| | | { |
| | | "usingComponents": {} |
| | | } |
New file |
| | |
| | | <!--pages/index/resourceCover.wxml--> |
| | | <text></text> |
| | | <web-view wx:if="{{webpageSrc}}" src="{{webpageSrc}}"></web-view> |
New file |
| | |
| | | /* pages/index/resourceCover.wxss */ |
| | |
| | | }], |
| | | tabIndex: 0, |
| | | specialSubjectList: [], |
| | | |
| | | now: new Date(), // 假设这是当前时间 |
| | | formattedDate: '', // 用于存储格式化后的日期时间字符串 |
| | | batList: [], |
| | |
| | | navBarHeight: navBarHeight, |
| | | }); |
| | | this.ceShiList() |
| | | |
| | | |
| | | this.getCourseTypeListList() |
| | | |
| | | |
| | | }, |
| | | |
| | | /** |
| | |
| | | this.setData({ |
| | | batListValue: value |
| | | }) |
| | | |
| | | this.specialDiscussionGet(this.data.batList[value]) |
| | | |
| | | |
| | | }, |
| | | onTabsTap(event) { |
| | | const index = event.currentTarget.dataset.index |
| | |
| | | this.specialDiscussionGet(this.data.batList[0]) |
| | | |
| | | }, |
| | | // 获取图片文字列表 |
| | | // 获取即将开播列表 |
| | | ceShiList() { |
| | | this.setData({ |
| | | loading: true |
| | |
| | | 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: [], |
| | |
| | | author: [], |
| | | viewCount: [], |
| | | startTime: [], //开播时间 |
| | | // "liveTime>=": [formattedDate.value], //直播时间 |
| | | endTime: [], |
| | | liveTime: [], |
| | | lecturer: [], |
| | | position: [], |
| | |
| | | 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, |
| | |
| | | }); |
| | | }, |
| | | 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: [{ |
| | |
| | | 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 = { |
| | |
| | | start: 0, |
| | | size: 99 |
| | | }, |
| | | |
| | | fields: { |
| | | content: [], |
| | | subtitle: [], |
| | |
| | | author: [], |
| | | viewCount: [], |
| | | startTime: [], |
| | | endTime: [], |
| | | liveTime: [], |
| | | lecturer: [], |
| | | position: [], |
| | |
| | | }) |
| | | .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); |
| | | }) |
| | | }, |
| | |
| | | <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> |
| | |
| | | </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}} |
| | |
| | | <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> |
| | | </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}}"> |
| | | |
| | | |
| | | <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> |
| | | </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> |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | } |
| | | |
| | | .imageBox { |
| | | width: 464rpx; |
| | | height: 100%; |
| | | background: #EAEAEA; |
| | | border-radius: 9rpx 0rpx 0rpx 9rpx; |
| | | object-fit: contain; |
| | | flex: 1; |
| | | } |
| | | |
| | | |
| | | .tltieBox { |
| | | margin: 15rpx; |
| | | flex: 1; |
| | | } |
| | | |
| | | .nameTltieBox { |
| | |
| | | /* 将背景图片位置设置为靠右 */ |
| | | } |
| | | |
| | | .t-tabs__item { |
| | | padding: 0px 20rpx !important; |
| | | } |
| | | |
| | | .t-sticky__content { |
| | | padding: 0 20rpx !important; |
| | | } |
| | | |
| | | .noDataBox { |
| | | width: 100%; |
| | | /* margin-top: 200rpx; */ |
New file |
| | |
| | | // 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() { |
| | | |
| | | } |
| | | }) |
New file |
| | |
| | | { |
| | | "usingComponents": {} |
| | | } |
New file |
| | |
| | | <!--pages/test/testCover.wxml--> |
| | | <text></text> |
New file |
| | |
| | | /* pages/test/testCover.wxss */ |