| | |
| | | }, |
| | | resourceDetailsData() { |
| | | this.setData({ |
| | | videoLoaidng: true |
| | | videoLoaidng: true, |
| | | loading: true |
| | | }) |
| | | let query = { |
| | | storeInfo: this.data.storeInfo, |
| | |
| | | }, |
| | | // 获取笔记列表 |
| | | async getNoteList() { |
| | | // this.setData({ |
| | | // loading: true |
| | | // }) |
| | | this.setData({ |
| | | loading: true |
| | | }) |
| | | let topicId |
| | | await app.MG.ugc |
| | | .getProductUserSubmitTopic({ |
| | |
| | | <import src="index.skeleton.wxml" /> |
| | | <template is="skeleton" wx:if="{{loading}}" /> |
| | | |
| | | <view wx:if="{{!loading}}"> |
| | | <view> |
| | | <!-- <view style="width: 100%; height: {{barHeight}}px; "></view> |
| | | <view class="nacigationBar" style="width: 100%; height: {{navBarHeight}}px;"> |
| | | <view> |
| | |
| | | <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"> |
| | | <view class="wrapper"> |
| | | <view class="demo-section__content" wx:if="{{loading}}"> |
| | | <t-skeleton theme="paragraph" animation="gradient" loading="true"></t-skeleton> |
| | | </view> |
| | | <view class="wrapper" wx:if="{{!loading}}"> |
| | | <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> |
| | | </view> |
| | | </view> |
| | | |
| | | </t-tab-panel> |
| | | <!-- 笔记展示 --> |
| | | <t-tab-panel label="笔记" value="1" style="{{tabPanelstyle}}"> |
| | |
| | | /* pages/resourceDetails/index.wxss */ |
| | | @import "./index.skeleton.wxss"; |
| | | |
| | | .nacigationBar { |
| | | background-color: #fff; |
| | | display: flex; |
| | |
| | | overflow-y: scroll; |
| | | overflow-x: hidden; |
| | | height: 50vh; |
| | | } |
| | | |
| | | .demo-section__content { |
| | | margin: 40rpx; |
| | | } |
| | |
| | | // pages/bibliographyList/index.js |
| | | import Toast from 'tdesign-miniprogram/toast/index'; |
| | | const app = getApp() |
| | | const config = |
| | | Page({ |
| | | import { |
| | | loginInfo |
| | | } from '../../assets/js/login'; |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | personalDataEmail: '', |
| | | hiddenmodalput: false, |
| | | name: "", |
| | | phoneNum: '', |
| | | input: '', |
| | | dialogKey: '', |
| | | showWithInput: false, |
| | | showTextAndTitleWithInput: false, |
| | | downloadLoadin: false, |
| | | isMore: null, |
| | | higherList: [], |
| | | vocationalList: [], |
| | | teacherList: [], |
| | | higherTotal: 0, |
| | | vocationalTotal: 0, |
| | | teacherTotal: 0, |
| | | value: '', |
| | | BarHeight: '', |
| | | navBarHeight: '', |
| | | start: 1, |
| | | tabValue: '', |
| | | keyword: '', |
| | | Md5: '', |
| | | emailError: false, |
| | | loading: true, //开启骨架屏加载 |
| | | hidden: true, //是否展示内容 |
| | | height: '', |
| | | dialogBox: false, |
| | | inputStyle: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding: 0 0 0 16rpx;height:70rpx', |
| | | }, |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | personalDataEmail: '', |
| | | hiddenmodalput: false, |
| | | name: "", |
| | | phoneNum: '', |
| | | input: '', |
| | | dialogKey: '', |
| | | showWithInput: false, |
| | | showTextAndTitleWithInput: false, |
| | | downloadLoadin: false, |
| | | isMore: null, |
| | | higherList: [], |
| | | vocationalList: [], |
| | | teacherList: [], |
| | | higherTotal: 0, |
| | | vocationalTotal: 0, |
| | | teacherTotal: 0, |
| | | value: '', |
| | | BarHeight: '', |
| | | navBarHeight: '', |
| | | start: 1, |
| | | tabValue: '', |
| | | keyword: '', |
| | | Md5: '', |
| | | emailError: false, |
| | | loading: true, //开启骨架屏加载 |
| | | hidden: true, //是否展示内容 |
| | | height: '', |
| | | dialogBox: false, |
| | | inputStyle: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding: 0 0 0 16rpx;height:70rpx', |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | this.higherGet() |
| | | this.vocationalGet() |
| | | this.teacherGet() |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | | this.setData({ |
| | | navBarHeight: navBarHeight, |
| | | barHeight: systInfo.statusBarHeight, |
| | | }) |
| | | let event = { |
| | | detail: { |
| | | value: "0" |
| | | } |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | this.higherGet() |
| | | this.vocationalGet() |
| | | this.teacherGet() |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | | this.setData({ |
| | | navBarHeight: navBarHeight, |
| | | barHeight: systInfo.statusBarHeight, |
| | | }) |
| | | let event = { |
| | | detail: { |
| | | value: "0" |
| | | } |
| | | this.onTabsChange(event) |
| | | var that = this; |
| | | // 动态获取屏幕高度 |
| | | wx.getSystemInfo({ |
| | | success: (result) => { |
| | | that.setData({ |
| | | height: result.windowHeight |
| | | }); |
| | | }, |
| | | }) |
| | | |
| | | this.ceShi() |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | // console.log(this.data.value); |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面卸载 |
| | | */ |
| | | onUnload() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | onPullDownRefresh() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | | onShareAppMessage() { |
| | | |
| | | }, |
| | | onTabsChange(event) { |
| | | const value = event.detail.value |
| | | this.setData({ |
| | | isMore: null, |
| | | tabValue: value, |
| | | }) |
| | | if (value == '0') { |
| | | this.higherGet() |
| | | } else if (value == '1') { |
| | | this.vocationalGet() |
| | | } else if (value == '2') { |
| | | this.teacherGet() |
| | | } |
| | | }, |
| | | //高等教育 |
| | | higherGet(keyword) { |
| | | let searchObj = { |
| | | 'Name*': keyword, |
| | | '||author*': keyword, |
| | | '||isbn*': keyword |
| | | } |
| | | app.MG.resource.getItem({ |
| | | path: 'jsek_biblioClassification\\jsek_bCHigherEducation', |
| | | queryType: '*', |
| | | paging: { |
| | | start: '0', |
| | | size: this.data.start * 9 |
| | | }, |
| | | coverSize: { |
| | | width: 260 |
| | | }, |
| | | fields: { |
| | | jsek_link: [], |
| | | subtitle: [], |
| | | content: [], |
| | | fileType: [], |
| | | jsek_resource: [], |
| | | freeFile: [], |
| | | ...searchObj, |
| | | }, |
| | | SysType: 'CmsItem' |
| | | }).then(res => { |
| | | res.datas.forEach(item => { |
| | | item.determine = true |
| | | }) |
| | | this.setData({ |
| | | higherList: res.datas, |
| | | higherTotal: res.total |
| | | }) |
| | | this.setData({ |
| | | loading: false, //开启骨架屏加载 |
| | | hidden: false, //是否展示内容 |
| | | }) |
| | | if (res.datas.length < 7 && res.datas.length > 0) { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | } |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | | |
| | | //教师教育 |
| | | vocationalGet(keyword) { |
| | | let searchObj = { |
| | | 'Name*': keyword, |
| | | '||author*': keyword, |
| | | '||isbn*': keyword |
| | | } |
| | | app.MG.resource.getItem({ |
| | | path: 'jsek_biblioClassification\\jsek_bCVocationalEducation', |
| | | queryType: '*', |
| | | paging: { |
| | | start: '0', |
| | | size: this.data.start * 9 |
| | | }, |
| | | coverSize: { |
| | | width: 260 |
| | | }, |
| | | fields: { |
| | | jsek_link: [], |
| | | content: [], |
| | | subtitle: [], |
| | | fileType: [], |
| | | jsek_resource: [], |
| | | freeFile: [], |
| | | ...searchObj |
| | | }, |
| | | SysType: 'CmsItem' |
| | | }).then(res => { |
| | | console.log(res); |
| | | res.datas.forEach(item => { |
| | | item.determine = true |
| | | }) |
| | | this.setData({ |
| | | vocationalList: res.datas, |
| | | vocationalTotal: res.total |
| | | }) |
| | | if (res.datas.length < 7 && this.datas.length > 0) { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | } |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | | // 职业教育 |
| | | teacherGet(keyword) { |
| | | let searchObj = { |
| | | 'Name*': keyword, |
| | | '||author*': keyword, |
| | | '||isbn*': keyword |
| | | } |
| | | app.MG.resource.getItem({ |
| | | path: 'jsek_biblioClassification\\jsek_bCTeacherEducation', |
| | | queryType: '*', |
| | | paging: { |
| | | start: '0', |
| | | size: this.data.start * 9 |
| | | }, |
| | | coverSize: { |
| | | width: 260 |
| | | }, |
| | | fields: { |
| | | jsek_link: [], |
| | | content: [], |
| | | subtitle: [], |
| | | fileType: [], |
| | | jsek_resource: [], |
| | | freeFile: [], |
| | | bookshelf_freeEpub: [], //epub试读百分比 |
| | | bookshelf_probationPage: [], //pdf试读页数 |
| | | ...searchObj |
| | | }, |
| | | SysType: 'CmsItem' |
| | | }).then(res => { |
| | | res.datas.forEach(item => { |
| | | item.determine = true |
| | | }) |
| | | this.setData({ |
| | | teacherList: res.datas, |
| | | teacherTotal: res.total |
| | | }) |
| | | if (res.datas.length < 7 && this.datas.length > 0) { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | } |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | | // downloadData(event) { |
| | | // this.setData({ |
| | | // downloadLoadin: true |
| | | // }) |
| | | // console.log(111); |
| | | // const item = event.currentTarget.dataset.item; |
| | | // // console.log(item.datas.freeFile.Value); |
| | | // const URL = app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.datas.freeFile.Value |
| | | // item.determine = false |
| | | // console.log(URL, 'URL'); |
| | | // setTimeout(() => { |
| | | // if (URL) { |
| | | // item.determine = true |
| | | // } |
| | | // }, 600) |
| | | // wx.downloadFile({ |
| | | // url: URL, |
| | | // success: function (res) { |
| | | // const filePath = res.tempFilePath; |
| | | // wx.openDocument({ |
| | | // filePath: filePath, |
| | | // success: function (res) { |
| | | // console.log('打开文档成功'); |
| | | // }, |
| | | // fail: function (res) { |
| | | // console.log('打开文档失败', res); |
| | | // } |
| | | // }); |
| | | // }, |
| | | // fail: function (res) { |
| | | // console.log('下载文件失败', res); |
| | | // } |
| | | // }); |
| | | // setTimeout(() => { |
| | | // this.setData({ |
| | | // downloadLoadin: false |
| | | // }); |
| | | // }, 2000); |
| | | // }, |
| | | downloadData(event) { |
| | | const item = event.currentTarget.dataset.item |
| | | if (item.fileType == "pdf") { |
| | | wx.navigateTo({ |
| | | url: "/packageBookService/pages/components/webView/index?md5=" + |
| | | item.freeFile + |
| | | "&fileName=" + |
| | | item.name + |
| | | "&fileType=" + |
| | | item.fileType + "&bookBuy=true" |
| | | // "&freePage=" + |
| | | // this.data.fileInfo.freePage + |
| | | |
| | | + |
| | | "&bookId=" + |
| | | item.id, |
| | | }); |
| | | } else { |
| | | Toast({ |
| | | context: this, |
| | | selector: '#t-toast', |
| | | message: '此书不能查看', |
| | | theme: 'warning', |
| | | direction: 'column', |
| | | }); |
| | | } |
| | | }, |
| | | onSearchSubmit: function (e) { |
| | | const keyword = e.detail.value; |
| | | // 处理搜索逻辑,例如发送搜索请求等 |
| | | console.log('搜索关键词:', keyword); |
| | | this.higherGet(keyword) |
| | | this.vocationalGet(keyword) |
| | | this.teacherGet(keyword) |
| | | }, |
| | | goBack() { |
| | | wx.navigateBack(); |
| | | }, |
| | | onReachBottom(e) { |
| | | if (this.data.tabValue == 0) { |
| | | if (this.data.higherList.length < this.data.higherTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | start: this.data.start + 1 |
| | | }) |
| | | this.higherGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | } |
| | | } else if (this.data.tabValue == 2) { |
| | | if (this.data.teacherList.length < this.data.teacherTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | start: this.data.start + 1 |
| | | }) |
| | | this.teacherGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | } |
| | | } else if (this.data.tabValue == 1) { |
| | | console.log(this.data.vocationalList.length); |
| | | console.log(this.data.vocationalTotal); |
| | | if (this.data.vocationalList.length < this.data.vocationalTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | start: this.data.start + 1 |
| | | }) |
| | | this.vocationalGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | } |
| | | } |
| | | }, |
| | | |
| | | onPullDownRefresh() { |
| | | let keyword = this.data.value |
| | | this.setData({ |
| | | start: 1, |
| | | }) |
| | | this.higherGet(keyword) |
| | | this.vocationalGet(keyword) |
| | | this.teacherGet(keyword) |
| | | }, |
| | | // 邮箱点击 |
| | | mailbox(e) { |
| | | const key = e.currentTarget.dataset.key; |
| | | const item = e.currentTarget.dataset.item; |
| | | this.setData({ |
| | | Md5: item.datas.freeFile.FileList[0].Md5, |
| | | dialogBox: true |
| | | }) |
| | | // wx.scanCode({ |
| | | // success: res => { |
| | | // console.log(res); |
| | | // } |
| | | // }) |
| | | }, |
| | | // 弹窗取消 |
| | | closeDialog() { |
| | | this.setData({ |
| | | dialogBox: false, |
| | | // input: '' |
| | | }) |
| | | }, |
| | | //提交 |
| | | confirmM(e) { |
| | | wx.showLoading({ |
| | | title: '发送中...', |
| | | }) |
| | | const isEmailValid = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(this.data.input); |
| | | if (isEmailValid && this.data.input) { |
| | | this.setData({ |
| | | dialogBox: false |
| | | }) |
| | | let query = { |
| | | eMail: this.data.input, |
| | | md5s: [this.data.Md5] |
| | | } |
| | | app.MG.file.sendFileWithEmail(query).then(res => { |
| | | wx.hideLoading() |
| | | if (res) { |
| | | wx.showToast({ |
| | | icon: 'success', |
| | | title: '邮件已发送', |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | // 校验不通过,给出错误提示 |
| | | wx.showToast({ |
| | | title: '邮箱格式不正确', |
| | | icon: 'none', |
| | | }); |
| | | } |
| | | }, |
| | | inputChange(e) { |
| | | this.setData({ |
| | | input: e.detail.value |
| | | }) |
| | | }, |
| | | ceShi() { |
| | | let that = this; |
| | | // 获取Storage中的数据 |
| | | wx.getStorage({ |
| | | key: 'website-front-userInfo', |
| | | success(res) { |
| | | let datas = JSON.parse(res.data) |
| | | console.log(datas.Email); |
| | | let personalData = JSON.parse(datas.data) |
| | | |
| | | that.setData({ |
| | | input: datas.Email |
| | | }) |
| | | console.log(that.data.value); |
| | | }, |
| | | fail(err) { |
| | | console.error(err); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | }) |
| | | this.onTabsChange(event) |
| | | var that = this; |
| | | // 动态获取屏幕高度 |
| | | wx.getSystemInfo({ |
| | | success: (result) => { |
| | | that.setData({ |
| | | height: result.windowHeight |
| | | }); |
| | | }, |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | // console.log(this.data.value); |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.getUserInfo() |
| | | } |
| | | }) |
| | | } else { |
| | | this.getUserInfo() |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面卸载 |
| | | */ |
| | | onUnload() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | onPullDownRefresh() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | | onShareAppMessage() { |
| | | |
| | | }, |
| | | // 获取登录用户身份 |
| | | getUserInfo() { |
| | | app.MG.identity.getCurrentAppUser().then(res => { |
| | | // 用户信息优先级:教师认证 > 微信 > 学生(注册时默认) |
| | | if (res) { |
| | | //获取用户类型 |
| | | let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher') |
| | | let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo') |
| | | let eMailData = res.secretList.find(i => i.type == 'EMail') |
| | | if (eMailData) { |
| | | this.setData({ |
| | | input: eMailData.credential |
| | | }) |
| | | } else if (teacherRole && teacherInfos) { |
| | | this.setData({ |
| | | input: JSON.parse(teacherInfos.data).email |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | input: '' |
| | | }) |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | onTabsChange(event) { |
| | | const value = event.detail.value |
| | | this.setData({ |
| | | isMore: null, |
| | | tabValue: value, |
| | | }) |
| | | if (value == '0') { |
| | | this.higherGet() |
| | | } else if (value == '1') { |
| | | this.vocationalGet() |
| | | } else if (value == '2') { |
| | | this.teacherGet() |
| | | } |
| | | }, |
| | | //高等教育 |
| | | higherGet(keyword) { |
| | | let searchObj = { |
| | | 'Name*': keyword, |
| | | '||author*': keyword, |
| | | '||isbn*': keyword |
| | | } |
| | | app.MG.resource.getItem({ |
| | | path: 'jsek_biblioClassification\\jsek_bCHigherEducation', |
| | | queryType: '*', |
| | | paging: { |
| | | start: '0', |
| | | size: this.data.start * 9 |
| | | }, |
| | | coverSize: { |
| | | width: 260 |
| | | }, |
| | | fields: { |
| | | jsek_link: [], |
| | | subtitle: [], |
| | | content: [], |
| | | fileType: [], |
| | | jsek_resource: [], |
| | | freeFile: [], |
| | | ...searchObj, |
| | | }, |
| | | SysType: 'CmsItem' |
| | | }).then(res => { |
| | | res.datas.forEach(item => { |
| | | item.determine = true |
| | | }) |
| | | this.setData({ |
| | | higherList: res.datas, |
| | | higherTotal: res.total |
| | | }) |
| | | this.setData({ |
| | | loading: false, //开启骨架屏加载 |
| | | hidden: false, //是否展示内容 |
| | | }) |
| | | if (res.datas.length < 7 && res.datas.length > 0) { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | } |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | | |
| | | //教师教育 |
| | | vocationalGet(keyword) { |
| | | let searchObj = { |
| | | 'Name*': keyword, |
| | | '||author*': keyword, |
| | | '||isbn*': keyword |
| | | } |
| | | app.MG.resource.getItem({ |
| | | path: 'jsek_biblioClassification\\jsek_bCVocationalEducation', |
| | | queryType: '*', |
| | | paging: { |
| | | start: '0', |
| | | size: this.data.start * 9 |
| | | }, |
| | | coverSize: { |
| | | width: 260 |
| | | }, |
| | | fields: { |
| | | jsek_link: [], |
| | | content: [], |
| | | subtitle: [], |
| | | fileType: [], |
| | | jsek_resource: [], |
| | | freeFile: [], |
| | | ...searchObj |
| | | }, |
| | | SysType: 'CmsItem' |
| | | }).then(res => { |
| | | console.log(res); |
| | | res.datas.forEach(item => { |
| | | item.determine = true |
| | | }) |
| | | this.setData({ |
| | | vocationalList: res.datas, |
| | | vocationalTotal: res.total |
| | | }) |
| | | if (res.datas.length < 7 && this.datas.length > 0) { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | } |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | | // 职业教育 |
| | | teacherGet(keyword) { |
| | | let searchObj = { |
| | | 'Name*': keyword, |
| | | '||author*': keyword, |
| | | '||isbn*': keyword |
| | | } |
| | | app.MG.resource.getItem({ |
| | | path: 'jsek_biblioClassification\\jsek_bCTeacherEducation', |
| | | queryType: '*', |
| | | paging: { |
| | | start: '0', |
| | | size: this.data.start * 9 |
| | | }, |
| | | coverSize: { |
| | | width: 260 |
| | | }, |
| | | fields: { |
| | | jsek_link: [], |
| | | content: [], |
| | | subtitle: [], |
| | | fileType: [], |
| | | jsek_resource: [], |
| | | freeFile: [], |
| | | bookshelf_freeEpub: [], //epub试读百分比 |
| | | bookshelf_probationPage: [], //pdf试读页数 |
| | | ...searchObj |
| | | }, |
| | | SysType: 'CmsItem' |
| | | }).then(res => { |
| | | res.datas.forEach(item => { |
| | | item.determine = true |
| | | }) |
| | | this.setData({ |
| | | teacherList: res.datas, |
| | | teacherTotal: res.total |
| | | }) |
| | | if (res.datas.length < 7 && this.datas.length > 0) { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | } |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | | // downloadData(event) { |
| | | // this.setData({ |
| | | // downloadLoadin: true |
| | | // }) |
| | | // console.log(111); |
| | | // const item = event.currentTarget.dataset.item; |
| | | // // console.log(item.datas.freeFile.Value); |
| | | // const URL = app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.datas.freeFile.Value |
| | | // item.determine = false |
| | | // console.log(URL, 'URL'); |
| | | // setTimeout(() => { |
| | | // if (URL) { |
| | | // item.determine = true |
| | | // } |
| | | // }, 600) |
| | | // wx.downloadFile({ |
| | | // url: URL, |
| | | // success: function (res) { |
| | | // const filePath = res.tempFilePath; |
| | | // wx.openDocument({ |
| | | // filePath: filePath, |
| | | // success: function (res) { |
| | | // console.log('打开文档成功'); |
| | | // }, |
| | | // fail: function (res) { |
| | | // console.log('打开文档失败', res); |
| | | // } |
| | | // }); |
| | | // }, |
| | | // fail: function (res) { |
| | | // console.log('下载文件失败', res); |
| | | // } |
| | | // }); |
| | | // setTimeout(() => { |
| | | // this.setData({ |
| | | // downloadLoadin: false |
| | | // }); |
| | | // }, 2000); |
| | | // }, |
| | | downloadData(event) { |
| | | const item = event.currentTarget.dataset.item |
| | | if (item.fileType == "pdf") { |
| | | wx.navigateTo({ |
| | | url: "/packageBookService/pages/components/webView/index?md5=" + |
| | | item.freeFile + |
| | | "&fileName=" + |
| | | item.name + |
| | | "&fileType=" + |
| | | item.fileType + "&bookBuy=true" |
| | | // "&freePage=" + |
| | | // this.data.fileInfo.freePage + |
| | | |
| | | + |
| | | "&bookId=" + |
| | | item.id, |
| | | }); |
| | | } else { |
| | | Toast({ |
| | | context: this, |
| | | selector: '#t-toast', |
| | | message: '此书不能查看', |
| | | theme: 'warning', |
| | | direction: 'column', |
| | | }); |
| | | } |
| | | }, |
| | | onSearchSubmit: function (e) { |
| | | const keyword = e.detail.value; |
| | | // 处理搜索逻辑,例如发送搜索请求等 |
| | | console.log('搜索关键词:', keyword); |
| | | this.higherGet(keyword) |
| | | this.vocationalGet(keyword) |
| | | this.teacherGet(keyword) |
| | | }, |
| | | goBack() { |
| | | wx.navigateBack(); |
| | | }, |
| | | onReachBottom(e) { |
| | | if (this.data.tabValue == 0) { |
| | | if (this.data.higherList.length < this.data.higherTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | start: this.data.start + 1 |
| | | }) |
| | | this.higherGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | } |
| | | } else if (this.data.tabValue == 2) { |
| | | if (this.data.teacherList.length < this.data.teacherTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | start: this.data.start + 1 |
| | | }) |
| | | this.teacherGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | } |
| | | } else if (this.data.tabValue == 1) { |
| | | console.log(this.data.vocationalList.length); |
| | | console.log(this.data.vocationalTotal); |
| | | if (this.data.vocationalList.length < this.data.vocationalTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | start: this.data.start + 1 |
| | | }) |
| | | this.vocationalGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | } |
| | | } |
| | | }, |
| | | |
| | | onPullDownRefresh() { |
| | | let keyword = this.data.value |
| | | this.setData({ |
| | | start: 1, |
| | | }) |
| | | this.higherGet(keyword) |
| | | this.vocationalGet(keyword) |
| | | this.teacherGet(keyword) |
| | | }, |
| | | // 邮箱点击 |
| | | mailbox(e) { |
| | | const key = e.currentTarget.dataset.key; |
| | | const item = e.currentTarget.dataset.item; |
| | | this.setData({ |
| | | Md5: item.datas.freeFile.FileList[0].Md5, |
| | | dialogBox: true |
| | | }) |
| | | // wx.scanCode({ |
| | | // success: res => { |
| | | // console.log(res); |
| | | // } |
| | | // }) |
| | | }, |
| | | // 弹窗取消 |
| | | closeDialog() { |
| | | this.setData({ |
| | | dialogBox: false, |
| | | // input: '' |
| | | }) |
| | | }, |
| | | //提交 |
| | | confirmM(e) { |
| | | wx.showLoading({ |
| | | title: '发送中...', |
| | | }) |
| | | const isEmailValid = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(this.data.input); |
| | | if (isEmailValid && this.data.input) { |
| | | this.setData({ |
| | | dialogBox: false |
| | | }) |
| | | let query = { |
| | | eMail: this.data.input, |
| | | md5s: [this.data.Md5] |
| | | } |
| | | app.MG.file.sendFileWithEmail(query).then(res => { |
| | | wx.hideLoading() |
| | | if (res) { |
| | | wx.showToast({ |
| | | icon: 'success', |
| | | title: '邮件已发送', |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | // 校验不通过,给出错误提示 |
| | | wx.showToast({ |
| | | title: '邮箱格式不正确', |
| | | icon: 'none', |
| | | }); |
| | | } |
| | | }, |
| | | inputChange(e) { |
| | | this.setData({ |
| | | input: e.detail.value |
| | | }) |
| | | }, |
| | | |
| | | }) |
| | |
| | | }); |
| | | console.log(this.data.searchVal) |
| | | this.loadHomePage(); |
| | | this.getBannerList() |
| | | |
| | | }, |
| | | |
| | | onLoad() { |
| | | this.getBannerList() |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | |
| | | }, |
| | | getBookList() { |
| | | const obj = { |
| | | storeInfo: app.config.jslx, |
| | | // storeInfo: app.config.jslx, |
| | | path: "*", |
| | | queryType: '*', |
| | | coverSize: { |
| | |
| | | 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}`, |
| | | url: `/packageBookService/pages/bookServices/detail/index?id=${book.id}&name=${book.name}`, |
| | | }); |
| | | }) |
| | | }, |
| | |
| | | { |
| | | "usingComponents": { |
| | | "t-loading": "tdesign-miniprogram/loading/loading" |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-skeleton": "tdesign-miniprogram/skeleton/skeleton" |
| | | } |
| | | } |
| | |
| | | <!--pages/index/bookDetail.wxml--> |
| | | <view class="box"> |
| | | <t-loading theme="circular" size="60rpx" text="加载中" layout="vertical" class="wrapper" /> |
| | | <t-skeleton theme="paragraph" animation="gradient" loading="true"></t-skeleton> |
| | | </view> |
| | |
| | | height: 100vh; |
| | | padding: 200rpx 0; |
| | | text-align: center; |
| | | margin: 40rpx; |
| | | } |
| | |
| | | |
| | | getBookInfo(refcode) { |
| | | const obj = { |
| | | storeInfo: app.config.jslx, |
| | | path: app.config.jslx, |
| | | storeInfo: app.config.goodsStore, |
| | | path: app.config.goodsStore, |
| | | queryType: 'ProductCmsItem', |
| | | SysType: "CmsItem", |
| | | RefCode: refcode, |
| | |
| | | formPath: book.learnSelectType ? 'jsek_cloudLearning' : '' |
| | | }) |
| | | wx.redirectTo({ |
| | | url: `${url}?productLinkPath=${this.data.productLinkPath}&parentProductLinkPath=${this.data.parentProductLinkPath}&bookId=${book.productLinkInfo.ProductId}&activeId=${book.id}&bookName=${book.productLinkInfo.Name}&cmsId=${book.id}&storeInfo=${book.storeInfo}&formPath=${this.data.formPath}`, |
| | | url: `${url}?productLinkPath=${this.data.productLinkPath}&parentProductLinkPath=${this.data.parentProductLinkPath}&bookId=${book.productLinkInfo.ProductId}&activeId=${book.id}&bookName=${book.productLinkInfo.Name}&cmsId=${book.id}&formPath=${this.data.formPath}`, |
| | | }); |
| | | |
| | | if (book.selectType == "pdf" || book.selectType == 'document') { |
| | |
| | | { |
| | | "usingComponents": { |
| | | "t-loading": "tdesign-miniprogram/loading/loading" |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-skeleton": "tdesign-miniprogram/skeleton/skeleton" |
| | | } |
| | | } |
| | |
| | | </view> |
| | | <web-view wx:if="{{webpageSrc}}" src="{{webpageSrc}}"></web-view> |
| | | <view class="box" wx:if='{{!copyUrl && !webpageSrc}}'> |
| | | <t-loading theme="circular" size="60rpx" text="加载中" layout="vertical" class="wrapper" /> |
| | | <t-skeleton theme="paragraph" animation="gradient" loading="true"></t-skeleton> |
| | | </view> |
| | |
| | | height: 100vh; |
| | | padding: 200rpx 0; |
| | | text-align: center; |
| | | margin: 40rpx; |
| | | } |
| | |
| | | this.data.rootCmsItemId |
| | | }&idPathList=${JSON.stringify(idPathList)}&answerTitle=${ |
| | | this.data.answerTitle |
| | | }&answerType=${"option"}&storeInfo=${book.storeInfo}`, |
| | | }&answerType=${"option"}`, |
| | | }); |
| | | }) |
| | | }, |
| | |
| | | { |
| | | "usingComponents": { |
| | | "t-loading": "tdesign-miniprogram/loading/loading" |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-skeleton": "tdesign-miniprogram/skeleton/skeleton" |
| | | } |
| | | } |
| | |
| | | <!--pages/test/testCover.wxml--> |
| | | <view class="box"> |
| | | <t-loading theme="circular" size="60rpx" text="加载中" layout="vertical" class="wrapper" /> |
| | | <t-skeleton theme="paragraph" animation="gradient" loading="true"></t-skeleton> |
| | | </view> |
| | |
| | | height: 100vh; |
| | | padding: 200rpx 0; |
| | | text-align: center; |
| | | margin: 40rpx; |
| | | } |