| | |
| | | // pages/bookServices/detail/components/learnResource/learnResource.js |
| | | import { |
| | | loginInfo |
| | | } from "../../../../../../assets/js/login"; |
| | | Component({ |
| | | /** |
| | | * 组件的属性列表 |
| | |
| | | }, |
| | | // 跳转资源购买页 |
| | | goBuyResource() { |
| | | if (!this.properties.isGoBuyResource) { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '暂无可购买资源', |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | gotoPageFun() |
| | | } else { |
| | | loginInfo(app, (data) => { |
| | | }) |
| | | } |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/buyResource/index?productLinkPath=${this.properties.buyResourceData.productLinkPath}&refCode=${this.properties.buyResourceData.refCode}&bookId=${this.properties.bookId}`, |
| | | }) |
| | | const gotoPageFun = () => { |
| | | if (!this.properties.isGoBuyResource) { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '暂无可购买资源', |
| | | }) |
| | | } |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/buyResource/index?productLinkPath=${this.properties.buyResourceData.productLinkPath}&refCode=${this.properties.buyResourceData.refCode}&bookId=${this.properties.bookId}`, |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | changeReceive(type) { |
| | |
| | | }) |
| | | }, |
| | | goLearnTask() { |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/components/learnTask/index?bookId=${this.properties.bookId}&cmsPath=${this.properties.learnTaskData?.productLinkPath}`, |
| | | }) |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | gotoPageFun() |
| | | } else { |
| | | loginInfo(app, (data) => { |
| | | if (data) gotoPageFun() |
| | | }) |
| | | } |
| | | const gotoPageFun = () => { |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/components/learnTask/index?bookId=${this.properties.bookId}&cmsPath=${this.properties.learnTaskData?.productLinkPath}`, |
| | | }) |
| | | } |
| | | }, |
| | | buyCloudLearnClass() { |
| | | var myEventDetail = {} // detail对象,提供给事件监听函数 |
| | |
| | | <!--pages/bookServices/detail/components/learnResource/learnResource.wxml--> |
| | | <view class="learnResource" theme="primary" style="justify-content: {{!isshowDrawBtn ? 'flex-end' : ''}};"> |
| | | <view |
| | | class="learnResource" |
| | | theme="primary" |
| | | style="justify-content: {{!isshowDrawBtn ? 'flex-end' : ''}};" |
| | | > |
| | | <!-- <t-button |
| | | wx:if="{{isshowDrawBtn}}" |
| | | loading="{{receive}}" |
| | |
| | | <text>领取查看</text> |
| | | </view> |
| | | </t-button> --> |
| | | <t-button wx:if="{{isShowBuyCloundBtn}}" loading="{{buy}}" class="btn" theme="primary" bind:tap="goBuyResource" style="height: 72rpx; font-size: 28rpx;margin: {{!isshowDrawBtn ? '0 20rpx' : ''}}"> |
| | | <t-button |
| | | wx:if="{{isShowBuyCloundBtn}}" |
| | | loading="{{buy}}" |
| | | class="btn" |
| | | theme="primary" |
| | | bind:tap="goBuyResource" |
| | | style="height: 72rpx; font-size: 28rpx;margin: {{!isshowDrawBtn ? '0 20rpx' : ''}}" |
| | | > |
| | | <view slot="content" class="btn-content"> |
| | | <image src="/static/images/bookService/detail/yijiangoumai.png" /> |
| | | <text>资源购买</text> |
| | | </view> |
| | | </t-button> |
| | | <t-button theme="primary" class="btn" style="height: 72rpx; font-size: 28rpx" bind:tap="buyCloudLearnClass" wx:if="{{isShowBuyCloundMenu}}"> |
| | | <t-button |
| | | theme="primary" |
| | | class="btn" |
| | | style="height: 72rpx; font-size: 28rpx" |
| | | bind:tap="buyCloudLearnClass" |
| | | wx:if="{{isShowBuyCloundMenu}}" |
| | | > |
| | | <view slot="content" class="btn-content"> |
| | | <image src="/static/images/bookService/detail/yijiangoumai.png" /> |
| | | <text>全部购买</text> |
| | | </view> |
| | | </t-button> |
| | | <t-button class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx; margin: 0 20rpx" bind:tap="goLearnTask" wx:if="{{learnTaskData.name}}"> |
| | | <t-button |
| | | class="btn" |
| | | theme="primary" |
| | | style="height: 72rpx; font-size: 28rpx; margin: 0 20rpx" |
| | | bind:tap="goLearnTask" |
| | | wx:if="{{learnTaskData.name}}" |
| | | > |
| | | <view slot="content" class="btn-content"> |
| | | <image src="/static/images/bookService/detail/renwudan/icon.png" /> |
| | | <text>学习任务单</text> |
| | | </view> |
| | | </t-button> |
| | | </view> |
| | | </view> |
| | |
| | | // pages/bookServices/detail/components/note/note.js |
| | | const app = getApp(); |
| | | import { |
| | | loginInfo |
| | | } from "../../../../../../assets/js/login"; |
| | | Component({ |
| | | /** |
| | | * 组件的属性列表 |
| | |
| | | }); |
| | | }, |
| | | openDialog() { |
| | | loginInfo(app, (data) => {}) |
| | | this.setData({ |
| | | submitTitle: this.properties.bookInfo.name, |
| | | showNoteDialog: true, |
| | |
| | | // pages/bookServices/detail/components/testResource/testResource.js |
| | | import { |
| | | loginInfo |
| | | } from "../../../../../../assets/js/login"; |
| | | const app = getApp(); |
| | | Component({ |
| | | /** |
| | |
| | | goMycollect(e) { |
| | | const answertype = e.currentTarget.dataset.answertype; |
| | | const token = wx.getStorageSync("jsek-token"); |
| | | if (!token) { |
| | | return wx.getUserProfile({ |
| | | desc: "用户登录", |
| | | success: (res) => { |
| | | console.log(res); |
| | | }, |
| | | if (token) { |
| | | gotoPage() |
| | | } else { |
| | | loginInfo(app, (data) => { |
| | | if (data) gotoPage() |
| | | }) |
| | | } |
| | | const gotoPage = () => { |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/examination/examination?bookId=${ |
| | | this.properties.bookInfo.id |
| | | }&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${ |
| | | answertype == "collectQuestion" ? "我的收藏" : "我的错题" |
| | | }&answerType=${answertype}`, |
| | | }); |
| | | } |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/examination/examination?bookId=${ |
| | | this.properties.bookInfo.id |
| | | }&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${ |
| | | answertype == "collectQuestion" ? "我的收藏" : "我的错题" |
| | | }&answerType=${answertype}`, |
| | | }); |
| | | }, |
| | | // 练习 组件切换 |
| | | onRadioChange(e) { |
| | |
| | | <view class="btn-content-text">组卷</view> |
| | | </view> |
| | | </view> |
| | | <!-- <t-radio-group |
| | | class="test-radio" |
| | | t-class="horizontal-box" |
| | | value="{{radioItem}}" |
| | | bind:change="onRadioChange" |
| | | style="margin: 0" |
| | | > |
| | | <view class="card {{radioItem == 'test' ? 'card--active' : ''}}"> |
| | | <t-radio value="test" icon="none" borderless style="height: 80rpx"> |
| | | <view class="radio-content" slot="content"> |
| | | <image |
| | | src="{{ radioItem == 'test' ? '/static/images/bookService/detail/practice-icon.png' : '/static/images/bookService/detail/notest.png'}}" |
| | | ></image> |
| | | <text style="color: {{radioItem == 'test' ? '#fff':'#ff6c00'}};" |
| | | >练习</text |
| | | > |
| | | </view> |
| | | </t-radio> |
| | | </view> |
| | | <view class="card {{radioItem == 'mock' ? 'card--active' : ''}}"> |
| | | <t-radio value="mock" icon="none" borderless style="height: 80rpx"> |
| | | <view class="radio-content" slot="content"> |
| | | <image |
| | | src="{{ radioItem == 'mock' ? '/static/images/bookService/detail/checkpaper.png' : '/static/images/bookService/detail/zujuan.png'}}" |
| | | ></image> |
| | | <text style="color: {{radioItem == 'mock' ? '#fff':'#ff6c00'}};" |
| | | >组卷</text |
| | | > |
| | | </view> |
| | | </t-radio> |
| | | </view> |
| | | </t-radio-group> --> |
| | | <view class="btn-box"> |
| | | <t-button |
| | | class="error-btn" |
| | |
| | | // 跳转音视频播放器 |
| | | goPlayer(e) { |
| | | // 检查登录状态 |
| | | console.log(e.currentTarget.dataset.item) |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (!token) return false |
| | | const item = e.currentTarget.dataset.item; |
| | | const parent = e.currentTarget.dataset.parent; |
| | | const parentProductLinkPath = parent ? |
| | | parent.productLinkPath : |
| | | wx.getStorageSync("teachResourcesPath"); |
| | | const parentName = parent ? parent.name : "教学资源"; |
| | | // 资源购买页面(只展示未购买资源) 点击不跳转 |
| | | if (this.properties.isShowCheck) return false; |
| | | if (item.selectType == "webpage" || item.learnSelectType == "webpage") { |
| | | // 网页类型跳转到网址复制页,因为url传参不能传 带参数的网络地址,所以此处要把网络地址里的传参摘出来,放到url里 |
| | | let urlData = '' |
| | | const flags = item.jsek_link.indexOf("?") |
| | | if (flags > -1) { |
| | | urlData = item.jsek_link.slice(flags + 1, item.jsek_link.length) |
| | | const goPlayerFun = () => { |
| | | const item = e.currentTarget.dataset.item; |
| | | const parent = e.currentTarget.dataset.parent; |
| | | const parentProductLinkPath = parent ? |
| | | parent.productLinkPath : |
| | | wx.getStorageSync("teachResourcesPath"); |
| | | const parentName = parent ? parent.name : "教学资源"; |
| | | // 资源购买页面(只展示未购买资源) 点击不跳转 |
| | | if (this.properties.isShowCheck) return false; |
| | | if (item.selectType == "webpage" || item.learnSelectType == "webpage") { |
| | | // 网页类型跳转到网址复制页,因为url传参不能传 带参数的网络地址,所以此处要把网络地址里的传参摘出来,放到url里 |
| | | let urlData = '' |
| | | const flags = item.jsek_link.indexOf("?") |
| | | if (flags > -1) { |
| | | urlData = item.jsek_link.slice(flags + 1, item.jsek_link.length) |
| | | } |
| | | url = '/packageBookService/pages/bookServices/linkPage/index' |
| | | return wx.navigateTo({ |
| | | url: urlData ? url + `?path=${item.jsek_link.slice(0,flags)}` + '&' + urlData : url + `?path=${item.jsek_link}` |
| | | }) |
| | | } |
| | | url = '/packageBookService/pages/bookServices/linkPage/index' |
| | | return wx.navigateTo({ |
| | | url: urlData ? url + `?path=${item.jsek_link.slice(0,flags)}` + '&' + urlData : url + `?path=${item.jsek_link}` |
| | | }) |
| | | } |
| | | if (!item.file && !item.freeFile && !item.protectedFile) { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '暂无资源', |
| | | }) |
| | | } |
| | | if (item.selectType == 'zip' || item.learnSelectType == 'zip') { |
| | | // if (this.properties.applyState == 'Normal') { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请前往PC端下载', |
| | | }) |
| | | // } else { |
| | | // 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") { |
| | | if (!item.file && !item.freeFile && !item.protectedFile) { |
| | | return wx.showToast({ |
| | | icon: "none", |
| | | title: "资源不可用,请联系管理员", |
| | | }); |
| | | icon: 'error', |
| | | title: '暂无资源', |
| | | }) |
| | | } |
| | | } |
| | | if (this.properties.tab == "jsek_cloudLearning") { |
| | | |
| | | // 1.找出所有父级目录和本身(有销售方式) 和 云学习本身(有销售方式) 放到一个数组 为空则暂未开放销售 |
| | | let learn = [] |
| | | if (this.properties.isCloundHaveSaleMethod) { |
| | | // 1.1 云学习有销售方式,加入父级数组 |
| | | learn.push(this.properties.learnMenu) |
| | | } else { |
| | | // 1.2 云学习无销售方式,将父级目录和本身加入数组 |
| | | learn = this.handleTreeData(this.properties.learnList).filter( |
| | | (citem) => citem.saleMethod && |
| | | citem.saleMethod.find((ditem) => ditem.SaleType == 'Normal' && ditem.Price > 0) && |
| | | new Date(citem.saleMethod.find((ditem) => ditem.SaleType == 'Normal').EndDate).getTime() >= new Date().getTime() && |
| | | new Date(citem.saleMethod.find((ditem) => ditem.SaleType == 'Normal').BeginDate).getTime() <= new Date().getTime() && |
| | | item.productLinkPath.includes(citem.productLinkPath) |
| | | ) |
| | | if (item.selectType == 'zip' || item.learnSelectType == 'zip') { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请前往PC端下载', |
| | | }) |
| | | } |
| | | // 2.找出这个数组里已购买的 形成新数组 为空则未购买 |
| | | let buyList = [] |
| | | if (learn.length) buyList = learn.filter((item) => this.properties.buyIds.includes(item.saleMethod.find((citem) => citem.SaleType == 'Normal').Id)) |
| | | // 有父级(包含销售方式),且未购买 |
| | | if (learn.length && !buyList.length) return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请先购买该资源', |
| | | }) |
| | | if (item.protectedFile || item.freeFile) { |
| | | let file = item.fileMap[item.protectedFile] ? item.fileMap[item.protectedFile] : item.fileMap[item.freeFile] |
| | | 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: 'none', |
| | | icon: "none", |
| | | title: "资源不可用,请联系管理员", |
| | | }); |
| | | } |
| | | } |
| | | if (this.properties.tab == "jsek_cloudLearning") { |
| | | // 1.找出所有父级目录和本身(有销售方式) 和 云学习本身(有销售方式) 放到一个数组 为空则暂未开放销售 |
| | | let learn = [] |
| | | if (this.properties.isCloundHaveSaleMethod) { |
| | | // 1.1 云学习有销售方式,加入父级数组 |
| | | learn.push(this.properties.learnMenu) |
| | | } else { |
| | | // 1.2 云学习无销售方式,将父级目录和本身加入数组 |
| | | learn = this.handleTreeData(this.properties.learnList).filter( |
| | | (citem) => citem.saleMethod && |
| | | citem.saleMethod.find((ditem) => ditem.SaleType == 'Normal' && ditem.Price > 0) && |
| | | new Date(citem.saleMethod.find((ditem) => ditem.SaleType == 'Normal').EndDate).getTime() >= new Date().getTime() && |
| | | new Date(citem.saleMethod.find((ditem) => ditem.SaleType == 'Normal').BeginDate).getTime() <= new Date().getTime() && |
| | | item.productLinkPath.includes(citem.productLinkPath) |
| | | ) |
| | | } |
| | | // 2.找出这个数组里已购买的 形成新数组 为空则未购买 |
| | | let buyList = [] |
| | | if (learn.length) buyList = learn.filter((item) => this.properties.buyIds.includes(item.saleMethod.find((citem) => citem.SaleType == 'Normal').Id)) |
| | | // 有父级(包含销售方式),且未购买 |
| | | if (learn.length && !buyList.length) return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请先购买该资源', |
| | | }) |
| | | if (item.protectedFile || item.freeFile) { |
| | | let file = item.fileMap[item.protectedFile] ? item.fileMap[item.protectedFile] : item.fileMap[item.freeFile] |
| | | if (file && file.protectType !== "Public") { |
| | | return wx.showToast({ |
| | | icon: 'none', |
| | | title: "资源不可用,请联系管理员", |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | let url; |
| | | if (item.selectType == "video" || item.learnSelectType == "video") { |
| | | url = "/packageDomain/pages/resourceDetails/myVideo/index"; |
| | | } |
| | | if ( |
| | | item.selectType == "audio" || |
| | | item.learnSelectType == "audio" |
| | | ) { |
| | | url = "/packageDomain/pages/resourceDetails/myAudio/index"; |
| | | } |
| | | if (item.selectType == "picture" || item.selectType == 'document' || item.selectType == 'pdf' || item.learnSelectType == "picture" || item.learnSelectType == 'document' || item.learnSelectType == 'pdf') { |
| | | url = "/packageDomain/pages/resourceDetails/document/index"; |
| | | } |
| | | 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}`, |
| | | }); |
| | | } |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (!token && this.data.tab != 'jsek_teachingResources') { |
| | | loginInfo(app, (data) => { |
| | | if (data) goPlayerFun() |
| | | }) |
| | | } else { |
| | | goPlayerFun() |
| | | } |
| | | |
| | | } |
| | | let url; |
| | | if (item.selectType == "video" || item.learnSelectType == "video") { |
| | | url = "/packageDomain/pages/resourceDetails/myVideo/index"; |
| | | } |
| | | if ( |
| | | item.selectType == "audio" || |
| | | item.learnSelectType == "audio" |
| | | ) { |
| | | url = "/packageDomain/pages/resourceDetails/myAudio/index"; |
| | | } |
| | | if (item.selectType == "picture" || item.selectType == 'document' || item.selectType == 'pdf' || item.learnSelectType == "picture" || item.learnSelectType == 'document' || item.learnSelectType == 'pdf') { |
| | | url = "/packageDomain/pages/resourceDetails/document/index"; |
| | | } |
| | | 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}`, |
| | | }); |
| | | }, |
| | | |
| | | // 拿到所有项 |
| | |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | // 进页面默认切换 展开的id |
| | | // defaultactiveTeachid 教学资源 |
| | | // defaultactiveLearnid 云学习 |
| | | bookId: "", |
| | | barHeight: "", |
| | | navBarHeight: "", |
| | |
| | | learnPath: '', |
| | | applyResourceState: false, // 申请教学资源按钮防抖 |
| | | resourceClassList: [], // 资源所属分类 |
| | | applyState: "", // 教学资源申请状态 |
| | | applyState: "1", // 教学资源申请状态 |
| | | deadline: "", // 教学资源申请有效日期, |
| | | isShowBuyCloundBtn: false, |
| | | isshowDrawBtn: true, // 云学习领取查看按钮是否显示 |
| | |
| | | list: e.detail.changeList, |
| | | }); |
| | | }, |
| | | |
| | | logInFun(callback) { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.getShoppingCartProductGet(); |
| | | this.getApplyInfo(this.data.options.id); |
| | | this.getAlreadyPBookList(); |
| | | this.getAlreadyEBookList(); |
| | | if (wx.getStorageSync(app.config.userInfoKey)) { |
| | | this.setData({ |
| | | userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)), |
| | | }); |
| | | // 获取申请次数 |
| | | this.getSelectPaperBookCount(); |
| | | this.getSelectBookCount(); |
| | | } |
| | | callback() |
| | | } |
| | | }) |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | |
| | | wx.setNavigationBarTitle({ |
| | | title: decodeURI(options.name), |
| | | }) |
| | | let token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) {} else {} |
| | | }) |
| | | } |
| | | this.getBookInfo(options.id); |
| | | // this.getResourceClass(); // 获取资源所属分类 |
| | | token = wx.getStorageSync(app.config.tokenKey) |
| | | if (token) { |
| | | this.getShoppingCartProductGet(); |
| | | this.getApplyInfo(options.id); |
| | | this.getAlreadyPBookList(); |
| | | this.getAlreadyEBookList(); |
| | | } |
| | | if (wx.getStorageSync(app.config.userInfoKey)) { |
| | | this.setData({ |
| | | userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)), |
| | | }); |
| | | // 获取申请次数 |
| | | this.getSelectPaperBookCount(); |
| | | this.getSelectBookCount(); |
| | | } |
| | | if (options.tabValue) { |
| | | this.setData({ |
| | | tabValue: options.tabValue, |
| | | }); |
| | | } |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | this.getShoppingCartProductGet(); |
| | | this.getApplyInfo(this.data.options.id); |
| | | this.getAlreadyPBookList(); |
| | | this.getAlreadyEBookList(); |
| | | if (wx.getStorageSync(app.config.userInfoKey)) { |
| | | this.setData({ |
| | | userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)), |
| | | }); |
| | | // 获取申请次数 |
| | | this.getSelectPaperBookCount(); |
| | | this.getSelectBookCount(); |
| | | } |
| | | } |
| | | }, |
| | | |
| | |
| | | setCollect() { |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (!token) { |
| | | // 检查登录状态 |
| | | loginInfo(app, (data) => { |
| | | // 如果不是第一次登录,会执行回调 |
| | | if (data) { |
| | | // 登录成功,自动记录token和用户信息,并返回true |
| | | this.getBookInfo(this.data.bookId); |
| | | } else { |
| | | // 出现错误,返回false |
| | | } |
| | | }); |
| | | this.logInFun(() => { |
| | | this.getBookInfo(this.data.bookId); |
| | | }) |
| | | } else { |
| | | if (this.data.bookDetail.isFavourite) { |
| | | app.MG.store |
| | | .delProductLink({ |
| | | productIds: [this.data.bookDetail.id], |
| | | linkType: "FavoriteBookCity", |
| | | }) |
| | | .then(() => { |
| | | this.setData({ |
| | | "bookDetail.isFavourite": false, |
| | | }); |
| | | }); |
| | | } else { |
| | | const params = { |
| | | productIds: [this.data.bookDetail.id], |
| | | linkType: "FavoriteBookCity", |
| | | }; |
| | | app.MG.store.addProductLink(params).then((res) => { |
| | | this.setData({ |
| | | "bookDetail.isFavourite": true, |
| | | }); |
| | | }); |
| | | } |
| | | this.collectFun() |
| | | } |
| | | }, |
| | | |
| | | collectFun() { |
| | | if (this.data.bookDetail.isFavourite) { |
| | | app.MG.store |
| | | .delProductLink({ |
| | | productIds: [this.data.bookDetail.id], |
| | | linkType: "FavoriteBookCity", |
| | | }) |
| | | .then(() => { |
| | | this.setData({ |
| | | "bookDetail.isFavourite": false, |
| | | }); |
| | | }); |
| | | } else { |
| | | const params = { |
| | | productIds: [this.data.bookDetail.id], |
| | | linkType: "FavoriteBookCity", |
| | | }; |
| | | app.MG.store.addProductLink(params).then((res) => { |
| | | this.setData({ |
| | | "bookDetail.isFavourite": true, |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | // 联系 |
| | | editPhone() { |
| | | this.setData({ |
| | |
| | | suggestBtn() { |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | const child = this.selectComponent("#suggest-component"); |
| | | if (token) |
| | | // child.showDialog(); |
| | | if (token) { |
| | | this.setData({ |
| | | showIndex: '1' |
| | | }) |
| | | } else { |
| | | this.logInFun(() => { |
| | | this.setData({ |
| | | showIndex: '1' |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | // 跳转网店 |
| | | goShop(e) { |
| | |
| | | "buyResourceData.refCode": checkData.refCode, |
| | | }); |
| | | } |
| | | // if ( |
| | | // (e.detail.value == "jsek_teachingResources" && |
| | | // !this.data.teach.length) || |
| | | // (e.detail.value == "jsek_cloudLearning" && !this.data.learn.length) || |
| | | // (e.detail.value == "questionBank" && !this.data.test.length) |
| | | // ) { |
| | | // if (e.detail.value == "jsek_teachingResources") { |
| | | // wx.setStorageSync('teachResourcesPath', checkData.productLinkPath) |
| | | // } |
| | | // this.getResourceData(checkData); |
| | | // } |
| | | if ((e.detail.value == "jsek_teachingResources" && !this.data.teach.length) || (e.detail.value == "jsek_cloudLearning" && !this.data.learn.length)) { |
| | | wx.setStorageSync('teachResourcesPath', checkData.productLinkPath) |
| | | this.getResourceDataList(checkData) |
| | |
| | | loading: false, |
| | | }); |
| | | } |
| | | |
| | | let list = [] |
| | | // 判断云学习有无销售方式和有效期 |
| | | const cloundSaleMethod = |
| | |
| | | learnPath: type.productLinkPath |
| | | }); |
| | | } |
| | | console.log('1', this.data.teach); |
| | | }) |
| | | }, |
| | | // 获取 云测试 |
| | |
| | | }, |
| | | |
| | | // 图书添加购物车 |
| | | async addBookShopcCar() { |
| | | if (!this.data.expire) { |
| | | const shoppingCartGetId = []; |
| | | let query = { |
| | | start: 0, |
| | | size: 9999, |
| | | filterList: [], |
| | | searchList: [], |
| | | }; |
| | | const res = await app.MG.store.getShoppingCartProductList(query); |
| | | res.datas.forEach((item) => { |
| | | shoppingCartGetId.push(item.saleMethod.id); |
| | | }); |
| | | const determine = shoppingCartGetId.some( |
| | | (item) => item == this.data.selectedIds |
| | | ); |
| | | if (!determine) { |
| | | addBookShopcCar() { |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | addFun() |
| | | } else { |
| | | this.logInFun(() => {}) |
| | | } |
| | | const addFun = async () => { |
| | | if (!this.data.expire) { |
| | | const shoppingCartGetId = []; |
| | | let query = { |
| | | requests: [{ |
| | | saleMethodId: this.data.selectedIds, |
| | | storeEventId: null, |
| | | agentCode: "电子书", |
| | | }, ], |
| | | start: 0, |
| | | size: 9999, |
| | | filterList: [], |
| | | searchList: [], |
| | | }; |
| | | const addRes = app.MG.store.addShoppingCart(query); |
| | | this.showSuccessToast(); |
| | | const res = await app.MG.store.getShoppingCartProductList(query); |
| | | res.datas.forEach((item) => { |
| | | shoppingCartGetId.push(item.saleMethod.id); |
| | | }); |
| | | const determine = shoppingCartGetId.some( |
| | | (item) => item == this.data.selectedIds |
| | | ); |
| | | if (!determine) { |
| | | let query = { |
| | | requests: [{ |
| | | saleMethodId: this.data.selectedIds, |
| | | storeEventId: null, |
| | | agentCode: "电子书", |
| | | }, ], |
| | | }; |
| | | const addRes = app.MG.store.addShoppingCart(query); |
| | | this.showSuccessToast(); |
| | | } else { |
| | | Toast({ |
| | | context: this, |
| | | selector: "#t-toast", |
| | | message: "该书已在购物车,请勿重复添加", |
| | | theme: "warning", |
| | | direction: "column", |
| | | }); |
| | | } |
| | | } else { |
| | | Toast({ |
| | | context: this, |
| | | selector: "#t-toast", |
| | | message: "该书已在购物车,请勿重复添加", |
| | | theme: "warning", |
| | | direction: "column", |
| | | wx.showToast({ |
| | | title: "商品不在有效期", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | } |
| | | } else { |
| | | wx.showToast({ |
| | | title: "商品不在有效期", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | } |
| | | }, |
| | | |
| | |
| | | return flattenedArray; |
| | | }, |
| | | // 云学习一键领取 |
| | | async getFreeResource() { |
| | | getFreeResource() { |
| | | const child = this.selectComponent("#learn-resource"); |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | // 如果不是第一次登录,会执行回调 |
| | | if (data) { |
| | | // 登录成功,自动记录token和用户信息,并返回true |
| | | } else { |
| | | // 出现错误,返回false |
| | | } |
| | | }); |
| | | } |
| | | // 领取查看 ,先看云学习上的 再看资源上的 |
| | | const cloundMenu = this.data.resourceCodeList.find((item) => item.refCode == 'jsek_cloudLearning') |
| | | const cloundMenuSaleMethod = |
| | | cloundMenu.saleMethod && cloundMenu.saleMethod.length ? |
| | | cloundMenu.saleMethod.find((ditem) => ditem.SaleType == 'Normal') : |
| | | undefined |
| | | let query = {} |
| | | if (this.data.isCloundHaveSaleMethod && !cloundMenuSaleMethod.Price) { |
| | | // 云学习上有销售方式,且为0元,直接领取云学习 |
| | | query = { |
| | | remarks: '云学习', |
| | | requests: [{ |
| | | saleMethodId: cloundMenuSaleMethod.Id, |
| | | count: 1 |
| | | }] |
| | | } |
| | | this.logInFun(() => {}); |
| | | } else { |
| | | // 领取资源 |
| | | let arr = this.handleTreeData(this.data.learn).filter(item => this.resourceIsBuy(item)) |
| | | let freeIds = arr.filter((item) => { |
| | | return item.saleMethod.find((citem) => citem.SaleType == 'Normal').Price == 0 |
| | | }) |
| | | if (!freeIds.length) |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: "暂无免费资源", |
| | | }); |
| | | let requests = []; |
| | | freeIds.forEach((item, index) => { |
| | | if (this.resourceIsBuy(item)) { |
| | | requests.push({ |
| | | saleMethodId: item.saleMethod[0].Id, |
| | | count: 1, |
| | | }); |
| | | } |
| | | }); |
| | | query = { |
| | | remarks: "云学习", |
| | | requests, |
| | | }; |
| | | getFreeFun() |
| | | } |
| | | child.changeReceive(true); |
| | | try { |
| | | const initOrderRes = await app.MG.store.initOrder(query); |
| | | let parameter = { |
| | | orderNum: initOrderRes.orderNumber, |
| | | }; |
| | | // 确认订单 |
| | | const confirmOrderRes = await app.MG.store.confirmOrder(parameter); |
| | | if (confirmOrderRes.orderNumber) { |
| | | child.changeReceive(false); |
| | | wx.showToast({ |
| | | title: "领取成功", |
| | | const getFreeFun = async () => { |
| | | // 领取查看 ,先看云学习上的 再看资源上的 |
| | | const cloundMenu = this.data.resourceCodeList.find((item) => item.refCode == 'jsek_cloudLearning') |
| | | const cloundMenuSaleMethod = |
| | | cloundMenu.saleMethod && cloundMenu.saleMethod.length ? |
| | | cloundMenu.saleMethod.find((ditem) => ditem.SaleType == 'Normal') : |
| | | undefined |
| | | let query = {} |
| | | if (this.data.isCloundHaveSaleMethod && !cloundMenuSaleMethod.Price) { |
| | | // 云学习上有销售方式,且为0元,直接领取云学习 |
| | | query = { |
| | | remarks: '云学习', |
| | | requests: [{ |
| | | saleMethodId: cloundMenuSaleMethod.Id, |
| | | count: 1 |
| | | }] |
| | | } |
| | | } else { |
| | | // 领取资源 |
| | | let arr = this.handleTreeData(this.data.learn).filter(item => this.resourceIsBuy(item)) |
| | | let freeIds = arr.filter((item) => { |
| | | return item.saleMethod.find((citem) => citem.SaleType == 'Normal').Price == 0 |
| | | }) |
| | | if (!freeIds.length) |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: "暂无免费资源", |
| | | }); |
| | | let requests = []; |
| | | freeIds.forEach((item, index) => { |
| | | if (this.resourceIsBuy(item)) { |
| | | requests.push({ |
| | | saleMethodId: item.saleMethod[0].Id, |
| | | count: 1, |
| | | }); |
| | | } |
| | | }); |
| | | this.getBookInfo(this.data.bookId); |
| | | this.getResourceDataList({ |
| | | refCode: 'jsek_cloudLearning', |
| | | productLinkPath: this.data.learnPath |
| | | }) |
| | | this.setData({ |
| | | successOrderNumber: confirmOrderRes.orderNumber |
| | | }) |
| | | query = { |
| | | remarks: "云学习", |
| | | requests, |
| | | }; |
| | | } |
| | | } catch (error) { |
| | | console.log(error); |
| | | child.changeReceive(true); |
| | | try { |
| | | const initOrderRes = await app.MG.store.initOrder(query); |
| | | let parameter = { |
| | | orderNum: initOrderRes.orderNumber, |
| | | }; |
| | | // 确认订单 |
| | | const confirmOrderRes = await app.MG.store.confirmOrder(parameter); |
| | | if (confirmOrderRes.orderNumber) { |
| | | child.changeReceive(false); |
| | | wx.showToast({ |
| | | title: "领取成功", |
| | | }); |
| | | this.getBookInfo(this.data.bookId); |
| | | this.getResourceDataList({ |
| | | refCode: 'jsek_cloudLearning', |
| | | productLinkPath: this.data.learnPath |
| | | }) |
| | | this.setData({ |
| | | successOrderNumber: confirmOrderRes.orderNumber |
| | | }) |
| | | } |
| | | } catch (error) { |
| | | console.log(error); |
| | | } |
| | | } |
| | | }, |
| | | // 云学习一键购买 |
| | |
| | | } |
| | | }, |
| | | // 云学习全部购买 |
| | | async buyCloudLearnClass() { |
| | | const cloundMenu = this.data.resourceCodeList.find((item) => item.refCode == 'jsek_cloudLearning') |
| | | let query = { |
| | | remarks: '云学习', |
| | | requests: [{ |
| | | saleMethodId: cloundMenu.saleMethod.find((eitem) => eitem.SaleType == 'Normal').Id, |
| | | count: 1 |
| | | }] |
| | | } |
| | | const initOrderRes = await app.MG.store.initOrder(query) |
| | | // 检查订单号是否存在 |
| | | if (initOrderRes.orderNumber) { |
| | | // bookService: orderNumber.value, 少传这个 ,暂时不知道有什么用 |
| | | wx.navigateTo({ |
| | | url: `/pages/cart/paymentPage/index?&bookId=${this.data.bookDetail.id}&bookName=${this.data.bookDetail.name}&orderNumber=${initOrderRes.orderNumber}`, |
| | | }); |
| | | buyCloudLearnClass() { |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | buyClass() |
| | | } else { |
| | | // 订单号不存在,显示警告消息 |
| | | wx.showToast({ |
| | | icon: "error", |
| | | title: "请重试", |
| | | }); |
| | | this.logInFun(() => {}) |
| | | } |
| | | }, |
| | | // 云学习字段购买 |
| | | async buyCloundMenu() { |
| | | const cloundData = this.data.resourceCodeList.find(item => item.refCode == 'jsek_cloudLearning') |
| | | |
| | | const buyClass = async () => { |
| | | const cloundMenu = this.data.resourceCodeList.find((item) => item.refCode == 'jsek_cloudLearning') |
| | | let query = { |
| | | remarks: '云学习', |
| | | requests: [{ |
| | | saleMethodId: cloundMenu.saleMethod.find((eitem) => eitem.SaleType == 'Normal').Id, |
| | | count: 1 |
| | | }] |
| | | } |
| | | const initOrderRes = await app.MG.store.initOrder(query) |
| | | // 检查订单号是否存在 |
| | | if (initOrderRes.orderNumber) { |
| | | // bookService: orderNumber.value, 少传这个 ,暂时不知道有什么用 |
| | | wx.navigateTo({ |
| | | url: `/pages/cart/paymentPage/index?&bookId=${this.data.bookDetail.id}&bookName=${this.data.bookDetail.name}&orderNumber=${initOrderRes.orderNumber}`, |
| | | }); |
| | | } else { |
| | | // 订单号不存在,显示警告消息 |
| | | wx.showToast({ |
| | | icon: "error", |
| | | title: "请重试", |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | // 变为所有check true |
| | | findAndUpdateItemsByIds(tree, ids) { |
| | |
| | | findAndUpdate(node); // 对每个顶层节点执行查找和更新操作 |
| | | } |
| | | return tree; // 返回修改后的完整数组 |
| | | }, |
| | | handleTrue() { |
| | | // findAndUpdateItemsByIds(this.date.) |
| | | }, |
| | | |
| | | // 题库购买 |
| | |
| | | }); |
| | | }, |
| | | // 购买组卷 |
| | | async buyMock() { |
| | | let res; |
| | | if (!this.data.mockData.id) |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: "暂无组卷", |
| | | mask: true, |
| | | }); |
| | | // 构建订单查询对象 |
| | | try { |
| | | let query = { |
| | | remarks: "组卷", |
| | | requests: [{ |
| | | saleMethodId: this.data.mockData.id, |
| | | count: 1, |
| | | }, ], |
| | | }; |
| | | if (this.data.flag) { |
| | | this.setData({ |
| | | flag: false, |
| | | buyMock() { |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | buyMockFun() |
| | | } else { |
| | | this.logInFun(() => {}) |
| | | } |
| | | const buyMockFun = async () => { |
| | | let res; |
| | | if (!this.data.mockData.id) |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: "暂无组卷", |
| | | mask: true, |
| | | }); |
| | | res = await app.MG.store.initOrder(query); |
| | | } |
| | | if (res.orderNumber && this.data.mockData.price) { |
| | | wx.navigateTo({ |
| | | url: `/pages/cart/paymentPage/index?orderNumber=${res.orderNumber}`, |
| | | }); |
| | | } else { |
| | | // 0元直接领取 |
| | | // 确认订单 |
| | | const confirmOrderRes = await app.MG.store.confirmOrder({ |
| | | orderNum: res.orderNumber, |
| | | }); |
| | | if (confirmOrderRes) { |
| | | wx.showToast({ |
| | | icon: "success", |
| | | title: "领取成功", |
| | | }); |
| | | // 构建订单查询对象 |
| | | try { |
| | | let query = { |
| | | remarks: "组卷", |
| | | requests: [{ |
| | | saleMethodId: this.data.mockData.id, |
| | | count: 1, |
| | | }, ], |
| | | }; |
| | | if (this.data.flag) { |
| | | this.setData({ |
| | | flag: true, |
| | | flag: false, |
| | | }); |
| | | await this.recordBuyMock(); // 记录购买时间 |
| | | res = await app.MG.store.initOrder(query); |
| | | } |
| | | if (res.orderNumber && this.data.mockData.price) { |
| | | wx.navigateTo({ |
| | | url: `/pages/cart/paymentPage/index?orderNumber=${res.orderNumber}`, |
| | | }); |
| | | } else { |
| | | // 0元直接领取 |
| | | // 确认订单 |
| | | const confirmOrderRes = await app.MG.store.confirmOrder({ |
| | | orderNum: res.orderNumber, |
| | | }); |
| | | if (confirmOrderRes) { |
| | | wx.showToast({ |
| | | icon: "success", |
| | | title: "领取成功", |
| | | }); |
| | | this.setData({ |
| | | flag: true, |
| | | }); |
| | | await this.recordBuyMock(); // 记录购买时间 |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.log(error); |
| | | } |
| | | } catch (error) { |
| | | console.log(error); |
| | | } |
| | | }, |
| | | // 记录购买组卷时间 |
| | |
| | | }, |
| | | // 底部购买按钮 |
| | | buyBtn() { |
| | | if (this.data.tabValue == "brief" && !this.data.bookBuy) { |
| | | this.buyBook(); |
| | | } else if (this.data.tabValue == "jsek_cloudLearning") { |
| | | const tree = this.selectComponent("#tree"); |
| | | tree.onCloudShoppingCart(); |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | buyFun() |
| | | } else { |
| | | console.log(this.data.tabValue); |
| | | this.logInFun(() => {}) |
| | | } |
| | | const buyFun = () => { |
| | | if (this.data.tabValue == "brief" && !this.data.bookBuy) { |
| | | this.buyBook(); |
| | | } else if (this.data.tabValue == "jsek_cloudLearning") { |
| | | const tree = this.selectComponent("#tree"); |
| | | tree.onCloudShoppingCart(); |
| | | } else { |
| | | console.log(this.data.tabValue); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | goRead() { |
| | | if (!this.data.noFile) { |
| | | wx.showToast({ |
| | | title: "暂无阅读文件", |
| | | icon: "none", |
| | | duration: 2000, |
| | | goRead(e) { |
| | | const readFun = (bookBuy) => { |
| | | if (!this.data.noFile) { |
| | | wx.showToast({ |
| | | title: "暂无阅读文件", |
| | | icon: "none", |
| | | duration: 2000, |
| | | }); |
| | | return false; |
| | | } |
| | | wx.navigateTo({ |
| | | url: "/packageBookService/pages/components/webView/index?md5=" + |
| | | this.data.fileInfo.md5 + |
| | | "&fileName=" + |
| | | this.data.fileInfo.bookName + |
| | | "&fileType=" + |
| | | this.data.fileInfo.fileType + |
| | | "&freePage=" + |
| | | this.data.fileInfo.freePage + |
| | | "&bookBuy=" + |
| | | bookBuy + |
| | | "&bookId=" + |
| | | this.data.bookDetail.id, |
| | | }); |
| | | return false; |
| | | } |
| | | wx.navigateTo({ |
| | | url: "/packageBookService/pages/components/webView/index?md5=" + |
| | | this.data.fileInfo.md5 + |
| | | "&fileName=" + |
| | | this.data.fileInfo.bookName + |
| | | "&fileType=" + |
| | | this.data.fileInfo.fileType + |
| | | "&freePage=" + |
| | | this.data.fileInfo.freePage + |
| | | "&bookBuy=" + |
| | | this.data.bookBuy + |
| | | "&bookId=" + |
| | | this.data.bookDetail.id, |
| | | const { |
| | | type |
| | | } = e.currentTarget.dataset |
| | | if (type == 'freeFile') return readFun(this.data.bookBuy) |
| | | if (this.data.bookDetail.price == '0.00') |
| | | return readFun(true) |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | readFun(this.data.bookBuy) |
| | | } else { |
| | | this.logInFun(() => { |
| | | readFun(this.data.bookBuy) |
| | | }) |
| | | } |
| | | |
| | | }); |
| | | }, |
| | | |
| | | //样书申请 |
| | |
| | | |
| | | //申请电子样书 |
| | | appplyElectronicBook() { |
| | | // 先判断下教师认证,未对原有逻辑修改 |
| | | let role = this.data.userInfo != null ? this.data.userInfo.role : null; |
| | | if (role && role == "Teacher") {} else { |
| | | return wx.showModal({ |
| | | title: "尊敬的用户,您好!", //提示的标题 |
| | | content: "请先进行教师认证?", //提示的内容 |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } else if (res.cancel) {} |
| | | }, |
| | | }); |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | applyFun() |
| | | } else { |
| | | this.logInFun(() => {}) |
| | | } |
| | | if ( |
| | | this.data.bookDetail.isApplyBook == 2 || |
| | | this.data.bookDetail.isApplyBook == 4 |
| | | ) { |
| | | const applyFun = () => { |
| | | // 先判断下教师认证,未对原有逻辑修改 |
| | | let role = this.data.userInfo != null ? this.data.userInfo.role : null; |
| | | if (role && role == "Teacher") { |
| | | if (!this.data.noFile) { |
| | | wx.showToast({ |
| | | title: "暂无电子书文件,请联系管理员!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return; |
| | | } |
| | | if (this.data.ebookCount == 0) { |
| | | wx.showToast({ |
| | | title: "您的电子样书申请次数已用尽,若要继续,请联系管理员!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | |
| | | let isHas = this.data.electronicBookList.find( |
| | | (eitem) => eitem.id == this.data.bookDetail.id |
| | | ); |
| | | if (isHas) { |
| | | wx.showToast({ |
| | | title: "该书已在清单列表中", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | let isApply = this.data.alreadyElectronicBookList.find( |
| | | (eitem) => eitem.content[0].id == this.data.bookDetail.id |
| | | ); |
| | | if (isApply) { |
| | | if (isApply.state == 'WaitAudit') { |
| | | if (role && role == "Teacher") {} else { |
| | | return wx.showModal({ |
| | | title: "尊敬的用户,您好!", //提示的标题 |
| | | content: "请先进行教师认证?", //提示的内容 |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } else if (res.cancel) {} |
| | | }, |
| | | }); |
| | | } |
| | | if ( |
| | | this.data.bookDetail.isApplyBook == 2 || |
| | | this.data.bookDetail.isApplyBook == 4 |
| | | ) { |
| | | let role = this.data.userInfo != null ? this.data.userInfo.role : null; |
| | | if (role && role == "Teacher") { |
| | | if (!this.data.noFile) { |
| | | wx.showToast({ |
| | | title: "该书已申请!", |
| | | title: "暂无电子书文件,请联系管理员!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return; |
| | | } |
| | | if (this.data.ebookCount == 0) { |
| | | wx.showToast({ |
| | | title: "您的电子样书申请次数已用尽,若要继续,请联系管理员!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } else if (isApply.state == 'Normal') { |
| | | const flag = new Date(isApply.feedBack.endDate + ' 23:59:59').getTime() > new Date().getTime() |
| | | if (flag) { |
| | | } |
| | | |
| | | let isHas = this.data.electronicBookList.find( |
| | | (eitem) => eitem.id == this.data.bookDetail.id |
| | | ); |
| | | if (isHas) { |
| | | wx.showToast({ |
| | | title: "该书已在清单列表中", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | let isApply = this.data.alreadyElectronicBookList.find( |
| | | (eitem) => eitem.content[0].id == this.data.bookDetail.id |
| | | ); |
| | | if (isApply) { |
| | | if (isApply.state == 'WaitAudit') { |
| | | wx.showToast({ |
| | | title: "该书已申请!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } else if (isApply.state == 'Normal') { |
| | | const flag = new Date(isApply.feedBack.endDate + ' 23:59:59').getTime() > new Date().getTime() |
| | | if (flag) { |
| | | wx.showToast({ |
| | | title: "该书已申请!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (this.data.electronicBookList.length >= 2) { |
| | | wx.showToast({ |
| | | title: "每次最多只可申请2本样书", |
| | | icon: "none", |
| | | duration: 1000, |
| | | if (this.data.electronicBookList.length >= 2) { |
| | | wx.showToast({ |
| | | title: "每次最多只可申请2本样书", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | this.addBookFun(this.data.bookDetail, "eBook"); |
| | | } else { |
| | | wx.showModal({ |
| | | title: "尊敬的用户,您好!", //提示的标题 |
| | | content: "请先进行教师认证?", //提示的内容 |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } else if (res.cancel) {} |
| | | }, |
| | | }); |
| | | return false; |
| | | } |
| | | this.addBookFun(this.data.bookDetail, "eBook"); |
| | | } else { |
| | | wx.showModal({ |
| | | title: "尊敬的用户,您好!", //提示的标题 |
| | | content: "请先进行教师认证?", //提示的内容 |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } else if (res.cancel) {} |
| | | }, |
| | | wx.showToast({ |
| | | title: "该书不能申请电子样书", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | } |
| | | } else { |
| | | wx.showToast({ |
| | | title: "该书不能申请电子样书", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | } |
| | | }, |
| | | //申请纸质样书 |
| | | appplyPaperBook() { |
| | | let role = this.data.userInfo != null ? this.data.userInfo.role : null; |
| | | if (role && role == "Teacher") {} else { |
| | | return wx.showModal({ |
| | | title: "尊敬的用户,您好!", //提示的标题 |
| | | content: "请先进行教师认证?", //提示的内容 |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } else if (res.cancel) {} |
| | | }, |
| | | }); |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | applyFun() |
| | | } else { |
| | | this.logInFun(() => {}) |
| | | } |
| | | if ( |
| | | this.data.bookDetail.isApplyBook == 3 || |
| | | this.data.bookDetail.isApplyBook == 4 |
| | | ) { |
| | | const applyFun = () => { |
| | | let role = this.data.userInfo != null ? this.data.userInfo.role : null; |
| | | if (role && role == "Teacher") { |
| | | // 点击选中 |
| | | if (this.data.paperBookCount == 0) { |
| | | wx.showToast({ |
| | | title: "您的纸质样书申请次数已用尽,若要继续,请联系管理员!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | let isApply = this.data.alreadyPaperBookList.find( |
| | | (pitem) => pitem.content[0].id == this.data.bookDetail.id |
| | | ); |
| | | if (isApply) { |
| | | wx.showToast({ |
| | | title: "该书已申请!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | |
| | | let isHas = this.data.paperBookList.find( |
| | | (pitem) => pitem.id == this.data.bookDetail.id |
| | | ); |
| | | if (isHas) { |
| | | wx.showToast({ |
| | | title: "该书已在清单列表中", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | if (this.data.paperBookList.length >= 2) { |
| | | wx.showToast({ |
| | | title: "每次最多只可申请2本样书", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | this.addBookFun(this.data.bookDetail, "pBook"); |
| | | } else { |
| | | wx.showModal({ |
| | | if (role && role == "Teacher") {} else { |
| | | return wx.showModal({ |
| | | title: "尊敬的用户,您好!", //提示的标题 |
| | | content: "请先进行教师认证?", //提示的内容 |
| | | confirmColor: "#ff6c00", |
| | |
| | | }, |
| | | }); |
| | | } |
| | | } else { |
| | | wx.showToast({ |
| | | title: "该书不能申请纸质样书", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | if ( |
| | | this.data.bookDetail.isApplyBook == 3 || |
| | | this.data.bookDetail.isApplyBook == 4 |
| | | ) { |
| | | let role = this.data.userInfo != null ? this.data.userInfo.role : null; |
| | | if (role && role == "Teacher") { |
| | | // 点击选中 |
| | | if (this.data.paperBookCount == 0) { |
| | | wx.showToast({ |
| | | title: "您的纸质样书申请次数已用尽,若要继续,请联系管理员!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | let isApply = this.data.alreadyPaperBookList.find( |
| | | (pitem) => pitem.content[0].id == this.data.bookDetail.id |
| | | ); |
| | | if (isApply) { |
| | | wx.showToast({ |
| | | title: "该书已申请!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | |
| | | let isHas = this.data.paperBookList.find( |
| | | (pitem) => pitem.id == this.data.bookDetail.id |
| | | ); |
| | | if (isHas) { |
| | | wx.showToast({ |
| | | title: "该书已在清单列表中", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | if (this.data.paperBookList.length >= 2) { |
| | | wx.showToast({ |
| | | title: "每次最多只可申请2本样书", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | this.addBookFun(this.data.bookDetail, "pBook"); |
| | | } else { |
| | | wx.showModal({ |
| | | title: "尊敬的用户,您好!", //提示的标题 |
| | | content: "请先进行教师认证?", //提示的内容 |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } else if (res.cancel) {} |
| | | }, |
| | | }); |
| | | } |
| | | } else { |
| | | wx.showToast({ |
| | | title: "该书不能申请纸质样书", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | // 添加样书 |
| | |
| | | return childrenList |
| | | }, |
| | | uploadFile(e) { |
| | | const userInfo = JSON.parse(wx.getStorageSync(app.config.userInfoKey)) |
| | | if (userInfo.role != 'Teacher') return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请先进行教师认证', |
| | | }) |
| | | this.setData({ |
| | | dialogBox: true, |
| | | isShowUp: true |
| | | }); |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | uploadFun() |
| | | } else { |
| | | this.logInFun(() => { |
| | | uploadFun() |
| | | }) |
| | | } |
| | | const uploadFun = () => { |
| | | const userInfo = JSON.parse(wx.getStorageSync(app.config.userInfoKey)) |
| | | if (userInfo.role != 'Teacher') return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请先进行教师认证', |
| | | }) |
| | | this.setData({ |
| | | dialogBox: true, |
| | | isShowUp: true |
| | | }); |
| | | } |
| | | }, |
| | | closeDialog() { |
| | | this.setData({ |
| | |
| | | <import src="index.skeleton.wxml" /> |
| | | <template is="skeleton" wx:if="{{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}}"> |
| | | <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="suggest" bindtap="editPhone"> |
| | | <t-icon class="editIcon" style="color: rgb(194, 194, 194);" name="calendar-edit" size="40rpx" /> |
| | | <t-icon |
| | | class="editIcon" |
| | | style="color: rgb(194, 194, 194)" |
| | | name="calendar-edit" |
| | | size="40rpx" |
| | | /> |
| | | <view class="use-title">联系</view> |
| | | </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}}" catalogue="{{bookDetail.catalogue}}" 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}}" |
| | | catalogue="{{bookDetail.catalogue}}" |
| | | 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="暂无数据" /> --> |
| | | <empty /> |
| | | </view> |
| | |
| | | style="{{tabPanelstyle}}" |
| | | > |
| | | </t-tab-panel> --> |
| | | <t-tab-panel label="教学资源" icon="{{tabValue == 'jsek_teachingResources' ? teachResourcesClickIcon : teachResourcesIcon}}" value="jsek_teachingResources" class="{{loading ? 'loading': ''}}"> |
| | | <t-tab-panel |
| | | label="教学资源" |
| | | icon="{{tabValue == 'jsek_teachingResources' ? teachResourcesClickIcon : teachResourcesIcon}}" |
| | | value="jsek_teachingResources" |
| | | class="{{loading ? 'loading': ''}}" |
| | | > |
| | | <view wx:if="{{!loading && applyState}}"> |
| | | <teach-resource applyState="{{applyState}}" rejectCause="{{rejectCause}}" deadline="{{deadline}}" bind:applyResource="applyResource" md5List="{{md5List}}" applyResourceLoading="{{applyResourceLoading}}" bind:uploadFile="uploadFile"></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> |
| | | <teach-resource |
| | | applyState="{{applyState}}" |
| | | rejectCause="{{rejectCause}}" |
| | | deadline="{{deadline}}" |
| | | bind:applyResource="applyResource" |
| | | md5List="{{md5List}}" |
| | | applyResourceLoading="{{applyResourceLoading}}" |
| | | bind:uploadFile="uploadFile" |
| | | ></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> |
| | | <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"> |
| | | <empty /> |
| | | </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}}" isShowBuyCloundMenu="{{isShowBuyCloundMenu}}" isShowBuyCloundBtn="{{isShowBuyCloundBtn}}" bind:buyCloudLearnClass="buyCloudLearnClass" learnTaskData="{{learnTaskData}}"></learn-resource> |
| | | <learn-resource |
| | | bind:getFreeResource="getFreeResource" |
| | | bind:allAddShoppiingCar="allAddShoppiingCar" |
| | | id="learn-resource" |
| | | buyResourceData="{{buyResourceData}}" |
| | | bookId="{{bookDetail.id}}" |
| | | isshowDrawBtn="{{isshowDrawBtn}}" |
| | | successOrderNumber="{{successOrderNumber}}" |
| | | isGoBuyResource="{{isGoBuyResource}}" |
| | | isShowBuyCloundMenu="{{isShowBuyCloundMenu}}" |
| | | isShowBuyCloundBtn="{{isShowBuyCloundBtn}}" |
| | | bind:buyCloudLearnClass="buyCloudLearnClass" |
| | | learnTaskData="{{learnTaskData}}" |
| | | ></learn-resource> |
| | | |
| | | <tree id="tree" openIds="{{openLearnids}}" bookInfo="{{bookDetail}}" tab="{{tabValue}}" treeList="{{learn}}" learnList="{{learn}}" buyIds="{{buyIdList}}" openLearnids="{{openLearnids}}" cloundMenuIsBuy="{{cloundMenuIsBuy}}" learnMenu="{{learnMenu}}" isCloundHaveSaleMethod="{{isCloundHaveSaleMethod}}" bind:updateShoppingCartHidden="updateShoppingCartHidden" bind:updateCloudLearning="updateCloudLearning" bind:getCloundIsBuy="getCloundIsBuy"></tree> |
| | | <tree |
| | | id="tree" |
| | | openIds="{{openLearnids}}" |
| | | bookInfo="{{bookDetail}}" |
| | | tab="{{tabValue}}" |
| | | treeList="{{learn}}" |
| | | learnList="{{learn}}" |
| | | buyIds="{{buyIdList}}" |
| | | openLearnids="{{openLearnids}}" |
| | | cloundMenuIsBuy="{{cloundMenuIsBuy}}" |
| | | learnMenu="{{learnMenu}}" |
| | | isCloundHaveSaleMethod="{{isCloundHaveSaleMethod}}" |
| | | bind:updateShoppingCartHidden="updateShoppingCartHidden" |
| | | bind:updateCloudLearning="updateCloudLearning" |
| | | bind:getCloundIsBuy="getCloundIsBuy" |
| | | ></tree> |
| | | </view> |
| | | <view wx:if="{{noResources && !loading}}" class="noData"> |
| | | <empty /> |
| | | </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}}" bankSaleData="{{bankSaleData}}" isBuyBank="{{isBuyBank}}" isShoppingBank="{{isShoppingBank}}" bookInfo="{{bookDetail}}" openIds="{{openLearnids}}" mockData="{{mockData}}" tab="{{tabValue}}" storeInfo="{{options.storeInfo}}" jslx="{{jslx}}" bind:buyMock="buyMock" bind:buyBank="buyBank" bind:handleShoppingBank="handleShoppingBank"></test-resource> |
| | | <test-resource |
| | | id="test-resource" |
| | | list="{{test}}" |
| | | bankSaleData="{{bankSaleData}}" |
| | | isBuyBank="{{isBuyBank}}" |
| | | isShoppingBank="{{isShoppingBank}}" |
| | | bookInfo="{{bookDetail}}" |
| | | openIds="{{openLearnids}}" |
| | | mockData="{{mockData}}" |
| | | tab="{{tabValue}}" |
| | | storeInfo="{{options.storeInfo}}" |
| | | jslx="{{jslx}}" |
| | | bind:buyMock="buyMock" |
| | | bind:buyBank="buyBank" |
| | | bind:handleShoppingBank="handleShoppingBank" |
| | | ></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> |
| | |
| | | </view> |
| | | </t-dialog> |
| | | <!-- 我要建议弹窗 --> |
| | | <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 || applicationState == 'overdue'}}"> |
| | | <view |
| | | class="{{!bookBuy && bookDetail.isSell ? 'bottom-btn tryRead' : 'bottom-btn try'}}" |
| | | bind:tap="goRead" |
| | | data-type="freeFile" |
| | | wx:if="{{!bookBuy || applicationState == 'overdue'}}" |
| | | > |
| | | <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="buy read" bind:tap="goRead" wx:if="{{bookBuy || applicationState == 'Normal'}}">立即查看</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" |
| | | data-type="file" |
| | | wx:if="{{bookBuy || applicationState == 'Normal'}}" |
| | | >立即查看</view |
| | | > |
| | | </view> |
| | | </view> |
| | | <view wx:if="{{dialogBox}}"> |
| | |
| | | <view class="row-info"> |
| | | <view class="body"> |
| | | <view class="dialog-title">文件上传</view> |
| | | <view style="width: 100%; height: 2rpx; background-color: #f4f4f4"></view> |
| | | <view |
| | | style="width: 100%; height: 2rpx; background-color: #f4f4f4" |
| | | ></view> |
| | | <view class="from-item"> |
| | | <view class="label"> <text class="icon">*</text>资源名称: </view> |
| | | <view class="item-content"> |
| | | <view class="inputBox1"> |
| | | <t-input placeholder="输入资源名称" borderless value="{{resourceInfo.resourceName}}" bindchange="onNameInput" /> |
| | | <t-input |
| | | placeholder="输入资源名称" |
| | | borderless |
| | | value="{{resourceInfo.resourceName}}" |
| | | bindchange="onNameInput" |
| | | /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | <!-- <view class="inputBox1"> |
| | | <t-input placeholder="输入资源类型" borderless value="{{resourceInfo.fileType}}" bindchange="onFileTypeInput" /> |
| | | </view> --> |
| | | <t-cell class="mb-16" title="" arrow hover note="{{resourceInfo.fileType}}" bind:click="onResourcePicker" /> |
| | | <t-picker visible="{{resourceVisible}}" value="{{resourceValue}}" data-key="resource" title="选择资源类型" cancelBtn="取消" confirmBtn="确认" usingCustomNavbar bindchange="onPickerChange" bindcancel="onPickerCancel"> |
| | | <t-cell |
| | | class="mb-16" |
| | | title="" |
| | | arrow |
| | | hover |
| | | note="{{resourceInfo.fileType}}" |
| | | bind:click="onResourcePicker" |
| | | /> |
| | | <t-picker |
| | | visible="{{resourceVisible}}" |
| | | value="{{resourceValue}}" |
| | | data-key="resource" |
| | | title="选择资源类型" |
| | | cancelBtn="取消" |
| | | confirmBtn="确认" |
| | | usingCustomNavbar |
| | | bindchange="onPickerChange" |
| | | bindcancel="onPickerCancel" |
| | | > |
| | | <t-picker-item options="{{fileTypeList}}" /> |
| | | </t-picker> |
| | | </view> |
| | |
| | | <view class="label">文件描述:</view> |
| | | <view class="item-content"> |
| | | <view class="inputBox1"> |
| | | <t-textarea placeholder="请输入文件描述" value="{{resourceInfo.description}}" disableDefaultPadding="{{true}}" autosize="{{true}}" maxlength="300" indicator bind:change="textareaChange" /> |
| | | <t-textarea |
| | | placeholder="请输入文件描述" |
| | | value="{{resourceInfo.description}}" |
| | | disableDefaultPadding="{{true}}" |
| | | autosize="{{true}}" |
| | | maxlength="300" |
| | | indicator |
| | | bind:change="textareaChange" |
| | | /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> <text class="icon">*</text>上传文件: </view> |
| | | <view class="item-content"> |
| | | <t-button size="small" class="right-btn" bind:tap="uploadPicture" wx:if="{{isShowUp}}">点击上传</t-button> |
| | | <view wx:if="{{!isShowUp && fileList.length > 0}}" class="fileList"> |
| | | <t-button |
| | | size="small" |
| | | class="right-btn" |
| | | bind:tap="uploadPicture" |
| | | wx:if="{{isShowUp}}" |
| | | >点击上传</t-button |
| | | > |
| | | <view |
| | | wx:if="{{!isShowUp && fileList.length > 0}}" |
| | | class="fileList" |
| | | > |
| | | <text class="fileName">{{fileList[0].name}}</text> |
| | | <image src="/static/images/bookService/detail/deleteHover.png" class="deleteBtn" data-md5="{{fileList[0].md5}}" bind:tap="handleRemove" /> |
| | | <image |
| | | src="/static/images/bookService/detail/deleteHover.png" |
| | | class="deleteBtn" |
| | | data-md5="{{fileList[0].md5}}" |
| | | bind:tap="handleRemove" |
| | | /> |
| | | </view> |
| | | </view> |
| | | <view class="tip">注:文件大小不得超过50MB</view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="protocolBox"> |
| | | <t-checkbox label="同意" icon="rectangle" checked="{{resourceInfo.agree}}" bind:change="onChange" /> |
| | | <t-checkbox |
| | | label="同意" |
| | | icon="rectangle" |
| | | checked="{{resourceInfo.agree}}" |
| | | bind:change="onChange" |
| | | /> |
| | | <text class="wait" bind:tap="getAgreement">《授权同意书》</text> |
| | | </view> |
| | | </view> |
| | |
| | | </view> |
| | | |
| | | <view class="popupBox"> |
| | | <t-popup visible="{{protocolShow}}" bind:visible-change="onVisibleChange" placement="center"> |
| | | <t-popup |
| | | visible="{{protocolShow}}" |
| | | bind:visible-change="onVisibleChange" |
| | | placement="center" |
| | | > |
| | | <view class="block"> |
| | | <view class="protocol"> |
| | | <rich-text space="emsp" nodes="{{protocolTxt}}" class="content" /> |
| | | </view> |
| | | <t-icon t-class="close-btn" name="close-circle" size="32" color="#fff" bind:tap="onCloseProtocol" /> |
| | | <t-icon |
| | | t-class="close-btn" |
| | | name="close-circle" |
| | | size="32" |
| | | color="#fff" |
| | | bind:tap="onCloseProtocol" |
| | | /> |
| | | </view> |
| | | </t-popup> |
| | | </view> |
| | | <!-- <view class="loading" wx:if="{{pageLoading}}"> |
| | | <t-loading loading="{{pageLoading}}" size="40"></t-loading> |
| | | </view> --> |
| | | </view> --> |
| | |
| | | this.setData({ |
| | | passId: options.id |
| | | }) |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.bookExhibitionGet(this.data.passId) |
| | | this.getBookExhibitionDetails() |
| | | } else { |
| | | this.bookExhibitionGet(this.data.passId) |
| | | this.getBookExhibitionDetails() |
| | | } |
| | | }) |
| | | |
| | | } else { |
| | | this.bookExhibitionGet(this.data.passId) |
| | | this.getBookExhibitionDetails() |
| | | } |
| | | |
| | | this.bookExhibitionGet(this.data.passId) |
| | | this.getBookExhibitionDetails() |
| | | }, |
| | | |
| | | /** |
| | |
| | | loginInfo |
| | | } from '../../../assets/js/login'; |
| | | import wxbarcode from 'wxbarcode' |
| | | |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | bookId: options.id, |
| | | bookPath: parentPath.join('\\') |
| | | }) |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.digitalCoursesDetailsGet(options.id) |
| | | this.getPlayerList() |
| | | this.getType() |
| | | } else {} |
| | | }) |
| | | } |
| | | this.digitalCoursesDetailsGet(options.id) |
| | | this.getPlayerList() |
| | | this.getType() |
| | | // this.setData({ |
| | | // userName: JSON.parse(wx.getStorageSync(app.config.userInfoKey)).name, |
| | | // }) |
| | | }, |
| | | |
| | | logInFun(callback) { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.digitalCoursesDetailsGet(options.id) |
| | | this.getPlayerList() |
| | | this.getType() |
| | | callback() |
| | | } |
| | | }) |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | |
| | | //学习笔记 |
| | | //在线提问 |
| | | // 图书添加购物车 |
| | | async addBookShopcCar() { |
| | | if (!this.data.expire) { |
| | | const shoppingCartGetId = []; |
| | | let query = { |
| | | start: 0, |
| | | size: 9999, |
| | | filterList: [], |
| | | searchList: [], |
| | | }; |
| | | const res = await app.MG.store.getShoppingCartProductList(query); |
| | | res.datas.forEach((item) => { |
| | | shoppingCartGetId.push(item.saleMethod.id); |
| | | }); |
| | | const determine = shoppingCartGetId.some( |
| | | (item) => item == this.data.digitalsData.defaultSaleMethodId |
| | | ); |
| | | if (!determine) { |
| | | addBookShopcCar() { |
| | | const addFun = async () => { |
| | | if (!this.data.expire) { |
| | | const shoppingCartGetId = []; |
| | | let query = { |
| | | requests: [{ |
| | | saleMethodId: this.data.digitalsData.defaultSaleMethodId, |
| | | storeEventId: null, |
| | | agentCode: "电子书", |
| | | }, ], |
| | | start: 0, |
| | | size: 9999, |
| | | filterList: [], |
| | | searchList: [], |
| | | }; |
| | | const addRes = app.MG.store.addShoppingCart(query); |
| | | this.showSuccessToast(); |
| | | const res = await app.MG.store.getShoppingCartProductList(query); |
| | | res.datas.forEach((item) => { |
| | | shoppingCartGetId.push(item.saleMethod.id); |
| | | }); |
| | | const determine = shoppingCartGetId.some( |
| | | (item) => item == this.data.digitalsData.defaultSaleMethodId |
| | | ); |
| | | if (!determine) { |
| | | let query = { |
| | | requests: [{ |
| | | saleMethodId: this.data.digitalsData.defaultSaleMethodId, |
| | | storeEventId: null, |
| | | agentCode: "电子书", |
| | | }, ], |
| | | }; |
| | | const addRes = app.MG.store.addShoppingCart(query); |
| | | this.showSuccessToast(); |
| | | } else { |
| | | Toast({ |
| | | context: this, |
| | | selector: "#t-toast", |
| | | message: "该课程已在购物车,请勿重复添加", |
| | | theme: "warning", |
| | | direction: "column", |
| | | }); |
| | | } |
| | | } else { |
| | | Toast({ |
| | | context: this, |
| | | selector: "#t-toast", |
| | | message: "该课程已在购物车,请勿重复添加", |
| | | theme: "warning", |
| | | direction: "column", |
| | | wx.showToast({ |
| | | title: "商品不在有效期", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | } |
| | | } else { |
| | | wx.showToast({ |
| | | title: "商品不在有效期", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | } |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | this.logInFun(() => {}) |
| | | } else { |
| | | addFun() |
| | | } |
| | | |
| | | }, |
| | | showSuccessToast() { |
| | | Toast({ |
| | |
| | | |
| | | //购买按钮 |
| | | async buyBtn() { |
| | | if (!this.data.expire) { |
| | | let bookOrdersId = ""; |
| | | let query = { |
| | | remarks: "电子书", |
| | | requests: [{ |
| | | saleMethodId: this.data.digitalsData.defaultSaleMethodId, |
| | | count: 1, |
| | | }, ], |
| | | }; |
| | | // 发起订单初始化请求并等待结果 |
| | | const res = await app.MG.store.initOrder(query); |
| | | // 获取订单号并赋值给 orderNumber.value |
| | | bookOrdersId = res.orderNumber; |
| | | // 检查订单号是否存在 |
| | | if (bookOrdersId) { |
| | | if (this.data.digitalsData.price == "0.00") { |
| | | app.MG.store |
| | | .confirmOrder({ |
| | | orderNum: bookOrdersId, |
| | | }) |
| | | .then((res) => { |
| | | if (res) { |
| | | this.digitalCoursesDetailsGet(this.data.digitalsData.id); |
| | | wx.showToast({ |
| | | title: "领取成功", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | this.digitalCoursesDetailsGet(this.data.bookId); |
| | | } |
| | | const buyFun = async () => { |
| | | if (!this.data.expire) { |
| | | let bookOrdersId = ""; |
| | | let query = { |
| | | remarks: "电子书", |
| | | requests: [{ |
| | | saleMethodId: this.data.digitalsData.defaultSaleMethodId, |
| | | count: 1, |
| | | }, ], |
| | | }; |
| | | // 发起订单初始化请求并等待结果 |
| | | const res = await app.MG.store.initOrder(query); |
| | | // 获取订单号并赋值给 orderNumber.value |
| | | bookOrdersId = res.orderNumber; |
| | | // 检查订单号是否存在 |
| | | if (bookOrdersId) { |
| | | if (this.data.digitalsData.price == "0.00") { |
| | | app.MG.store |
| | | .confirmOrder({ |
| | | orderNum: bookOrdersId, |
| | | }) |
| | | .then((res) => { |
| | | if (res) { |
| | | this.digitalCoursesDetailsGet(this.data.digitalsData.id); |
| | | wx.showToast({ |
| | | title: "领取成功", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | this.digitalCoursesDetailsGet(this.data.bookId); |
| | | } |
| | | }); |
| | | } else { |
| | | const url = "/pages/cart/paymentPage/index?orderNumber=" + bookOrdersId + '&onNorderSaleMethod=' + res.saleMethodLinks[0].orderSaleMethod.id; |
| | | wx.navigateTo({ |
| | | url, |
| | | }); |
| | | } else { |
| | | const url = "/pages/cart/paymentPage/index?orderNumber=" + bookOrdersId + '&onNorderSaleMethod=' + res.saleMethodLinks[0].orderSaleMethod.id; |
| | | wx.navigateTo({ |
| | | url, |
| | | }); |
| | | } |
| | | } else {} |
| | | } else { |
| | | wx.showToast({ |
| | | title: "商品不在有效期", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | } |
| | | } else {} |
| | | } else { |
| | | wx.showToast({ |
| | | title: "商品不在有效期", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | } |
| | | } |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | this.logInFun(() => {}) |
| | | } else { |
| | | buyFun() |
| | | } |
| | | |
| | | }, |
| | | |
| | | |
| | |
| | | }, |
| | | |
| | | onCertificate() { |
| | | if (!this.data.isBuy) { |
| | | wx.showToast({ |
| | | title: "请先购买,体验完整服务", |
| | | icon: "none", |
| | | duration: 1000, |
| | | const cateFun = () => { |
| | | if (!this.data.isBuy) { |
| | | wx.showToast({ |
| | | title: "请先购买,体验完整服务", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false |
| | | } |
| | | if (!this.data.isLearn) { |
| | | wx.showToast({ |
| | | title: "您的学习任务还未完成,暂不能申请证书,加油哦!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false |
| | | } |
| | | if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') { |
| | | wx.showToast({ |
| | | title: "您申请的证书正在审核中", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false |
| | | } |
| | | var page = getCurrentPages().pop(); // 获取当前页面实例 |
| | | page.setData({ |
| | | // 动态设置禁止滚动的样式 |
| | | disableScrollStyle: 'overflow: hidden;' |
| | | }); |
| | | return false |
| | | this.setData({ |
| | | dialogBox: true, |
| | | scrollJudge: '' |
| | | }) |
| | | } |
| | | if (!this.data.isLearn) { |
| | | wx.showToast({ |
| | | title: "您的学习任务还未完成,暂不能申请证书,加油哦!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false |
| | | } |
| | | if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') { |
| | | wx.showToast({ |
| | | title: "您申请的证书正在审核中", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | this.logInFun(() => {}) |
| | | } else { |
| | | cateFun() |
| | | } |
| | | |
| | | var page = getCurrentPages().pop(); // 获取当前页面实例 |
| | | page.setData({ |
| | | // 动态设置禁止滚动的样式 |
| | | disableScrollStyle: 'overflow: hidden;' |
| | | }); |
| | | this.setData({ |
| | | dialogBox: true, |
| | | scrollJudge: '' |
| | | }) |
| | | }, |
| | | closeDialog() { |
| | | this.setData({ |
| | |
| | | } |
| | | }, |
| | | setCoolect() { |
| | | // 首页测试登录功能,后续注释 |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | // 如果不是第一次登录,会执行回调 |
| | | if (data) { |
| | | if (this.data.digitalsData.isFavourite) { |
| | | app.MG.store |
| | | .delProductLink({ |
| | | productIds: [this.data.digitalsData.id], |
| | | linkType: 'Favoriteclass' |
| | | }) |
| | | .then(() => { |
| | | this.setData({ |
| | | "digitalsData.isFavourite": false |
| | | }) |
| | | }) |
| | | } else { |
| | | let params = { |
| | | productIds: [this.data.digitalsData.id], |
| | | linkType: 'Favoriteclass' |
| | | } |
| | | app.MG.store.addProductLink(params).then((res) => { |
| | | this.setData({ |
| | | "digitalsData.isFavourite": true |
| | | }) |
| | | }) |
| | | } |
| | | } else { |
| | | // 出现错误,返回false |
| | | } |
| | | }) |
| | | } else { |
| | | const collectFun = () => { |
| | | if (this.data.digitalsData.isFavourite) { |
| | | app.MG.store |
| | | .delProductLink({ |
| | |
| | | }) |
| | | } |
| | | } |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | this.logInFun(() => {}) |
| | | } else { |
| | | collectFun() |
| | | } |
| | | }, |
| | | |
| | | //证书查看 |
| | |
| | | // pages/digitalCourses/index.js |
| | | import { |
| | | loginInfo |
| | | } from '../../assets/js/login'; |
| | | const app = getApp() |
| | | import { |
| | | setSessionGuid, |
| | |
| | | }); |
| | | } |
| | | this.getCourseTypeListList() |
| | | this.getShoppingCartList() |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (token) this.getShoppingCartList() |
| | | }, |
| | | |
| | | /** |
| | |
| | | }) |
| | | }, |
| | | 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) { |
| | | const addFun = () => { |
| | | 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: 'success', |
| | | 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() |
| | | } |
| | | this.getShoppingCartList() |
| | | } catch (error) { |
| | | console.error('出错了:', error) |
| | | } |
| | | } catch (error) { |
| | | console.error('出错了:', error) |
| | | } |
| | | } |
| | | |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (token) { |
| | | addFun() |
| | | } else { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.getShoppingCartList() |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | }) |
| | |
| | | if (data) { |
| | | this.addCartFun(info) |
| | | this.registe() |
| | | } else { |
| | | this.addCartFun(info) |
| | | } |
| | | }) |
| | | } |
| | |
| | | }, |
| | | |
| | | onRetrievalPage() { |
| | | |
| | | // 首页测试登录功能,后续注释 |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | // 如果不是第一次登录,会执行回调 |
| | | if (data) { |
| | | wx.navigateTo({ |
| | | url: '/pages/retrievalPage/index?searchVal=' + this.data.searchVal |
| | | }) |
| | | } else { |
| | | // 出现错误,返回false |
| | | } |
| | | }) |
| | | } else { |
| | | wx.navigateTo({ |
| | | url: '/pages/retrievalPage/index?searchVal=' + this.data.searchVal |
| | | }) |
| | | } |
| | | |
| | | |
| | | wx.navigateTo({ |
| | | url: '/pages/retrievalPage/index?searchVal=' + this.data.searchVal |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | |
| | | <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">京师智教</text> |
| | | </view> |
| | | <view class="home-page-header"> |
| | | <view class="bg"> |
| | | <image src="https://jsek.bnuic.com/home/image/home-bg.png" mode="heightFix" class="image" /> |
| | | <image |
| | | src="https://jsek.bnuic.com/home/image/home-bg.png" |
| | | mode="heightFix" |
| | | class="image" |
| | | /> |
| | | </view> |
| | | <view class="search"> |
| | | <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="onRetrievalPage" /> |
| | | <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="onRetrievalPage" |
| | | /> |
| | | </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" class="swiper-item"> |
| | | <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" |
| | | class="swiper-item" |
| | | > |
| | | <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:if="{{specialSubjectList.length > 0}}"> |
| | | <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/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/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="aspectFit" 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 wx:if="{{item.price}}" 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 |
| | | wx:if="{{item.price}}" |
| | | src="/static/images/home/home-cart.png" |
| | | mode="aspectFit" |
| | | class="addCartImg" |
| | | bind:tap="addCart" |
| | | data-info="{{item}}" |
| | | /> |
| | | </view> |
| | | </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> |
| | |
| | | </t-popup> --> |
| | | </view> |
| | | <import src="home.skeleton.wxml" /> |
| | | <template is="skeleton" wx:if="{{loading}}" /> |
| | | <template is="skeleton" wx:if="{{loading}}" /> |
| | |
| | | // pages/retrievalPage/index.js |
| | | import request from '../../assets/request/index' |
| | | |
| | | import { |
| | | loginInfo |
| | | } from '../../assets/js/login'; |
| | | import { |
| | | handleQueryResourceListData |
| | | } from '../../assets/js/middleGround/tool' |
| | |
| | | } |
| | | this.onTabsChange(e) |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.getUserInfo() |
| | | } |
| | | }) |
| | | } else { |
| | | this.getUserInfo() |
| | | } |
| | | // const token = wx.getStorageSync(app.config.tokenKey) |
| | | // if (!token) { |
| | | // loginInfo(app, (data) => { |
| | | // if (data) { |
| | | // this.getUserInfo() |
| | | // } |
| | | // }) |
| | | // } else { |
| | | // this.getUserInfo() |
| | | // } |
| | | var that = this; |
| | | // 动态获取屏幕高度 |
| | | wx.getSystemInfo({ |
| | |
| | | } |
| | | |
| | | } |
| | | let url = '/store/api/ApiQueryProductByAppUser' |
| | | let url = '/store/api/ApiQueryProduct' |
| | | //图书 |
| | | let queryBook = { |
| | | AccessControl: { |
| | |
| | | mailbox(e) { |
| | | const key = e.currentTarget.dataset.key; |
| | | const item = e.currentTarget.dataset.item; |
| | | this.setData({ |
| | | [key]: true, |
| | | dialogKey: key, |
| | | Md5: item.datas.freeFile.FileList[0].Md5 |
| | | }); |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.getUserInfo() |
| | | this.setData({ |
| | | [key]: true, |
| | | dialogKey: key, |
| | | Md5: item.datas.freeFile.FileList[0].Md5 |
| | | }); |
| | | } |
| | | }) |
| | | } else { |
| | | this.getUserInfo() |
| | | this.setData({ |
| | | [key]: true, |
| | | dialogKey: key, |
| | | Md5: item.datas.freeFile.FileList[0].Md5 |
| | | }); |
| | | } |
| | | }, |
| | | //邮箱的校验 |
| | | onEmailInput(e) { |