| | |
| | | isTest: false, |
| | | userInfo: { |
| | | fullName: '' //名称 |
| | | } |
| | | }, |
| | | publishingUnit: '' |
| | | }, |
| | | formatDate(dateString) { |
| | | if (!dateString) { |
| | |
| | | //epub试读百分比 |
| | | } |
| | | } |
| | | app.MG.store.getProductDetail(query).then(res => { |
| | | app.MG.store.getProductDetail(query).then(async res => { |
| | | console.log(res); |
| | | if (res.datas.purchasedSaleMethodIdList.includes(res.datas.defaultSaleMethodId)) { |
| | | this.setData({ |
| | |
| | | expire: res.false |
| | | }) |
| | | } |
| | | res.datas.publicationDate = this.formatDate(res.datas.publicationDate) |
| | | res.datas.publicationDate = moment(res.datas.publicationDate).format('YYYY年MM月DD日') |
| | | res.datas.price = res.datas.price.toFixed(2) |
| | | |
| | | wx.setNavigationBarTitle({ |
| | | title: res.datas.name, |
| | | }) |
| | | if (res.datas.publishingUnit) { |
| | | await this.getBookPublishUnit(res.datas.publishingUnit) |
| | | } |
| | | let lecturer = [] |
| | | if (res.datas.datas.speaker && res.datas.datas.speaker.length > 0) { |
| | | res.datas.datas.speaker.forEach(item => { |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | //获取图书出版单位 |
| | | async getBookPublishUnit(listStr) { |
| | | let query = { |
| | | refCodes: ['publishingUnit'] |
| | | } |
| | | await app.MG.store.getProductTypeField(query).then((res) => { |
| | | const list = JSON.parse(listStr) |
| | | let dataList = [] |
| | | list.forEach((unit) => { |
| | | JSON.parse(res[0].config).option.forEach((item) => { |
| | | if (item.value == unit) { |
| | | dataList.push(item.name) |
| | | } |
| | | }) |
| | | }) |
| | | if (dataList.length == list.length) { |
| | | this.setData({ |
| | | publishingUnit: dataList.join(' '), |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | onTabsChange(event) { |
| | | const value = event.detail.value |
| | | this.setData({ |
| | |
| | | <view class="nameBox">{{digitalsData.name}}</view> |
| | | <view> |
| | | <viwe class="styleCssBox"> |
| | | <view style="width: 170rpx;"> ISBN: </view> |
| | | <view style="width: 200rpx;"> ISBN: </view> |
| | | <view wx:if="{{digitalsData.isbn}}"> {{digitalsData.isbn}} </view> |
| | | <view wx:else="">-</view> |
| | | <view wx:else>-</view> |
| | | </viwe> |
| | | |
| | | <viwe class="styleCssBox"> |
| | | <view style="width: 170rpx;">出版时间:</view> |
| | | <view wx:if="{{digitalsData.publicationDate}}">{{digitalsData.publicationDate}} </view> |
| | | <view wx:else="">-</view> |
| | | </viwe> |
| | | <viwe class="styleCssBox"> |
| | | <view style="width: 170rpx;">课题负责人:</view> |
| | | <view style="width: 200rpx;">课程负责人:</view> |
| | | <view wx:if="{{digitalsData.courseLeader}}"> {{digitalsData.courseLeader }}</view> |
| | | <view wx:else="">-</view> |
| | | <view wx:else>-</view> |
| | | </viwe> |
| | | <viwe class="styleCssBox"> |
| | | <view style="width: 170rpx;">所属单位:</view> |
| | | <view style="width: 200rpx;">课程负责人单位:</view> |
| | | <view wx:if="{{digitalsData.affiliatedUnit}}"> {{ digitalsData.affiliatedUnit}}</view> |
| | | <view wx:else="">-</view> |
| | | <view wx:else>-</view> |
| | | </viwe> |
| | | <viwe class="styleCssBox"> |
| | | <view style="width: 170rpx;">出版单位:</view> |
| | | <view wx:if="{{digitalsData.publishingUnit}}">{{digitalsData.publishingUnit}} </view> |
| | | <view wx:else="">-</view> |
| | | <view style="width: 200rpx;">出版单位:</view> |
| | | <view wx:if="{{digitalsData.publishingUnit}}"> {{publishingUnit}} </view> |
| | | <view wx:else>-</view> |
| | | </viwe> |
| | | <viwe class="styleCssBox"> |
| | | <view style="width: 200rpx;">出版时间:</view> |
| | | <view wx:if="{{digitalsData.publicationDate}}">{{digitalsData.publicationDate}} </view> |
| | | <view wx:else>-</view> |
| | | </viwe> |
| | | <image src="/static/images/bookService/detail/square.png" class="right-background" /> |
| | | </view> |
| | |
| | | // pages/digitalTextbooks/digitalTextbooksDetails/index.js |
| | | import Toast from "tdesign-miniprogram/toast"; |
| | | import moment from 'moment' |
| | | import { |
| | | loginInfo |
| | | } from '../../../assets/js/login'; |
| | |
| | | isCertificate: {}, |
| | | isLearn: false, |
| | | isTest: false, |
| | | publishingUnit: '' |
| | | }, |
| | | |
| | | /** |
| | |
| | | seriesName: [], |
| | | author: [], |
| | | isbn: [], |
| | | editorUnit: [], |
| | | publicationDate: [], |
| | | publishingUnit: [], |
| | | bookClassification: [], |
| | | paperPrice: [], |
| | | JDLink: [], |
| | |
| | | //epub试读百分比 |
| | | } |
| | | } |
| | | app.MG.store.getProductDetail(query).then(res => { |
| | | app.MG.store.getProductDetail(query).then(async res => { |
| | | if (res.datas.purchasedSaleMethodIdList.includes(res.datas.defaultSaleMethodId)) { |
| | | this.setData({ |
| | | isBuy: true |
| | |
| | | isBuy: false |
| | | }) |
| | | } |
| | | // res.datas.publicationDate = |
| | | res.datas.publicationDate = moment(res.datas.publicationDate).format('YYYY年MM月DD日') |
| | | if (res.datas.icon == '') { |
| | | res.datas.icon = '/static/images/default-book-img.png' |
| | | } |
| | | this.setData({ |
| | | publicationDate: this.formatDate(res.datas.publicationDate) |
| | | }) |
| | | res.datas.price = res.datas.price.toFixed(2) |
| | | |
| | | this.setData({ |
| | |
| | | wx.setNavigationBarTitle({ |
| | | title: res.datas.name, |
| | | }) |
| | | if (res.datas.publishingUnit) { |
| | | await this.getBookPublishUnit(res.datas.publishingUnit) |
| | | } |
| | | |
| | | this.getAboutBook(res.datas.productLinkInfo[res.datas.productLinkInfo.length - 1].LinkPath) |
| | | console.log(this.data.isBuy); |
| | |
| | | |
| | | }) |
| | | }, |
| | | //获取图书出版单位 |
| | | async getBookPublishUnit(listStr) { |
| | | let query = { |
| | | refCodes: ['publishingUnit'] |
| | | } |
| | | await app.MG.store.getProductTypeField(query).then((res) => { |
| | | const list = JSON.parse(listStr) |
| | | let dataList = [] |
| | | list.forEach((unit) => { |
| | | JSON.parse(res[0].config).option.forEach((item) => { |
| | | if (item.value == unit) { |
| | | dataList.push(item.name) |
| | | } |
| | | }) |
| | | }) |
| | | if (dataList.length == list.length) { |
| | | this.setData({ |
| | | publishingUnit: dataList.join(' '), |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | onTabsChange(event) { |
| | | this.setData({ |
| | | tabValue: event.detail.value, |
| | |
| | | </view> |
| | | <view class="content"> |
| | | <view class="styleCssBox"> |
| | | <view style="width: 150rpx;"> 作者: </view> |
| | | <view style="width: 150rpx;"> 主编: </view> |
| | | <view class="authorBox">{{ digitalsData.author}}</view> |
| | | </view> |
| | | <view class="styleCssBox"> |
| | | <view style="width: 150rpx;"> 编者单位: </view> |
| | | <view class="authorBox">{{ digitalsData.editorUnit || '-'}}</view> |
| | | </view> |
| | | <view class="styleCssBox"> |
| | | <view style="width: 150rpx;">ISBN:</view> |
| | |
| | | </view> |
| | | <view class="styleCssBox"> |
| | | <view style="width: 150rpx;"> 出版时间: </view> |
| | | <view>{{ publicationDate}}</view> |
| | | <view>{{ digitalsData.publicationDate}}</view> |
| | | </view> |
| | | <view class="styleCssBox"> |
| | | <view style="width: 150rpx;"> 出版单位: </view> |
| | | <view>{{ publishingUnit || '-'}}</view> |
| | | </view> |
| | | </view> |
| | | <image src="/static/images/bookService/detail/square.png" class="right-background" /> |
| | |
| | | border-radius: 0 0 20rpx 20rpx; |
| | | } |
| | | |
| | | .book-img { |
| | | border: 1rpx solid #ccc; |
| | | } |
| | | |
| | | .setCoolect { |
| | | display: flex; |
| | |
| | | .imageBox { |
| | | width: 220rpx; |
| | | height: 310rpx; |
| | | border: 1rpx solid #ccc; |
| | | } |
| | | |
| | | .bookContent { |
| | |
| | | this.getUserInfo() |
| | | this.getStaticsSum(); |
| | | this.getDataList(false); |
| | | this.getListCount() |
| | | } |
| | | }) |
| | | } else { |
| | | this.getUserInfo() |
| | | this.getStaticsSum(); |
| | | this.getDataList(false); |
| | | |
| | | this.getListCount() |
| | | } |
| | | |
| | | }, |
| | |
| | | } |
| | | }) |
| | | }, |
| | | getListCount() { |
| | | let that = this; |
| | | let data = { |
| | | Size: 9999, |
| | | Start: 0, |
| | | sort: { |
| | | type: "Desc", |
| | | field: "CreateDate", |
| | | }, |
| | | searchList: [{ |
| | | keywords: 'jsek_mediaBook', |
| | | field: "ProductType", |
| | | }], |
| | | } |
| | | app.MG.store.getPurchasedProductList(data).then((res) => { |
| | | that.setData({ |
| | | titleBook: "图书(" + res.totalSize + "本)", |
| | | }) |
| | | }) |
| | | let data1 = { |
| | | Size: 9999, |
| | | Start: 0, |
| | | sort: { |
| | | type: "Desc", |
| | | field: "CreateDate", |
| | | }, |
| | | searchList: [{ |
| | | keywords: 'jsek_digitalCourses', |
| | | field: "ProductType", |
| | | }], |
| | | } |
| | | app.MG.store.getPurchasedProductList(data1).then((res) => { |
| | | that.setData({ |
| | | titleCourse: "课程(" + res.totalSize + "门)", |
| | | }) |
| | | }) |
| | | let data2 = { |
| | | Size: 9999, |
| | | Start: 0, |
| | | sort: { |
| | | type: "Desc", |
| | | field: "CreateDate", |
| | | }, |
| | | searchList: [{ |
| | | keywords: 'jsek_digitalTextbooks', |
| | | field: "ProductType", |
| | | }], |
| | | } |
| | | app.MG.store.getPurchasedProductList(data2).then((res) => { |
| | | that.setData({ |
| | | titleTextBook: "数字教材(" + res.totalSize + "本)", |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | |
| | | tabClick(item) { |
| | | let that = this; |
| | |
| | | this.setData({ |
| | | list: dataList, |
| | | pageTotalCount: res.totalSize, |
| | | titleBook: "图书(" + res.totalSize + "本)", |
| | | bottomLoading: false, |
| | | isMoreData: dataList.length > 0 ? false : true, |
| | | skeletonLoding: false, |
| | |
| | | </view> |
| | | <view class="tabOne" wx:if="{{!skeletonLoding}}"> |
| | | <t-tabs t-class="t-tabs" value="{{active}}" split="{{false}}" bind:change="tabClick"> |
| | | <t-tab-panel label="{{titleBook}}" value="0" class="{{active == '2' ? 'oneBorder' : ''}}" /> |
| | | <t-tab-panel label="{{titleBook}}" value="0" /> |
| | | <t-tab-panel label="{{titleCourse}}" value="1" /> |
| | | <t-tab-panel label="{{titleTextBook}}" value="2" /> |
| | | </t-tabs> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="list" wx:if="{{list.length > 0}}"> |
| | | <view wx:if="{{active == '0'}}" class="listBox"> |
| | | <view class="content-item" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"> |
| | | <view class="listBox"> |
| | | <view class="{{active == '1' ? 'class--tem' : 'content-item'}}" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"> |
| | | <view class="book-img" bind:tap="goBookDetails" data-book="{{item}}"> |
| | | <t-image src="{{item.product.icon}}" width="105" height="145" aria-label="{{item.product.name}}" wx:if="{{item.product.icon}}" mode="aspectFit" /> |
| | | <t-image src="{{item.product.icon}}" width="{{active == '1' ? 150 : 105}}" height="{{active == '1' ? 90 : 145}}" aria-label="{{item.product.name}}" wx:if="{{item.product.icon}}" mode="aspectFit" /> |
| | | <t-image src="/static/images/default-book-img.png" width="105" height="145" aria-label="{{item.product.name}}" wx:else mode="aspectFit" /> |
| | | </view> |
| | | <view class="body-info" data-book="{{item}}" bindtap="goBookDetails"> |
| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view wx:else class="empyt"> |
| | | <empty /> |
| | | </view> |
| | | <!-- <view wx:if="{{activeName == 'Favoriteclass'}}"> |
| | | <view class="content-item" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"> |
| | | <view class="item-con"> |
| | | <view class="titleBox"> |
| | | <view class="item-title">{{item.name}}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> --> |
| | | </view> |
| | | <view wx:if="{{list.length == 0}}" class="empyt"> |
| | | <!-- <t-empty icon="folder-open" description="暂无数据" /> --> |
| | | <empty /> |
| | | </view> |
| | | <view class="bottom-loading" wx:if="{{bottomLoading}}"> |
| | |
| | | padding-top: 30rpx; |
| | | } |
| | | |
| | | .content-item { |
| | | .content-item, |
| | | .class--tem { |
| | | background: #F7F7F7; |
| | | border-radius: 10rpx; |
| | | box-sizing: border-box; |