| | |
| | | const app = getApp(); |
| | | import { getPublicImage } from "../../assets/js/middleGround/tool.js"; |
| | | import { |
| | | getPublicImage |
| | | } from "../../assets/js/middleGround/tool.js"; |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | isBackTop: false, |
| | | setScrollValue: 0, |
| | | skeletonLoding: true, |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad() { |
| | | this.getStaticsSum(); |
| | | this.getDataList(false); |
| | | }, |
| | | |
| | |
| | | active: 2 |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | getStaticsSum() { |
| | | const data = { |
| | | start: 0, |
| | | size: 10, |
| | | filterList: [{ |
| | | value: "LearningTime", |
| | | field: "type", |
| | | }], |
| | | }; |
| | | app.MG.app.getStaticsSum(data).then((res) => { |
| | | if (res) { |
| | | let minutes = Number(res) / (1000 * 60) |
| | | let hours = Number(res) / (1000 * 60 * 60) |
| | | if (minutes > 0 && minutes < 60) { |
| | | this.setData({ |
| | | learningDuration: Math.round(minutes) + "分钟" |
| | | }) |
| | | } else if (minutes > 60) { |
| | | this.setData({ |
| | | learningDuration: Math.round(hours) + "小时" |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | learningDuration: "0小时" |
| | | }) |
| | | } |
| | | |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | tabClick(item) { |
| | |
| | | } else if (this.data.active == '2') { |
| | | keywords = "jsek_digitalTextbooks"; |
| | | } |
| | | let searchData = [ |
| | | { |
| | | keywords: keywords, |
| | | field: "ProductType", |
| | | }, |
| | | ]; |
| | | let searchData = [{ |
| | | keywords: keywords, |
| | | field: "ProductType", |
| | | }, ]; |
| | | let data = { |
| | | Size: this.data.limit, |
| | | Start: this.data.page * this.data.limit - this.data.limit, |
| | |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | goBookDetails(e) { |
| | | const { |
| | | book |
| | | } = e.currentTarget.dataset; |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/index?id=${book.product.id}&name=${book.product.name}`, |
| | | }); |
| | | }, |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |