packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js
@@ -1,4 +1,7 @@ // pages/bookServices/detail/components/learnResource/learnResource.js import { loginInfo } from "../../../../../../assets/js/login"; Component({ /** * 组件的属性列表 @@ -54,6 +57,14 @@ }, // 跳转资源购买页 goBuyResource() { const token = wx.getStorageSync(app.config.tokenKey); if (token) { gotoPageFun() } else { loginInfo(app, (data) => { }) } const gotoPageFun = () => { if (!this.properties.isGoBuyResource) { return wx.showToast({ icon: 'error', @@ -63,6 +74,7 @@ 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) { @@ -76,9 +88,19 @@ }) }, goLearnTask() { 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对象,提供给事件监听函数 packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxml
@@ -1,5 +1,9 @@ <!--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}}" @@ -14,19 +18,38 @@ <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> packageBookService/pages/bookServices/detail/components/note/note.js
@@ -1,5 +1,8 @@ // pages/bookServices/detail/components/note/note.js const app = getApp(); import { loginInfo } from "../../../../../../assets/js/login"; Component({ /** * 组件的属性列表 @@ -64,6 +67,7 @@ }); }, openDialog() { loginInfo(app, (data) => {}) this.setData({ submitTitle: this.properties.bookInfo.name, showNoteDialog: true, packageBookService/pages/bookServices/detail/components/testResource/testResource.js
@@ -1,4 +1,7 @@ // pages/bookServices/detail/components/testResource/testResource.js import { loginInfo } from "../../../../../../assets/js/login"; const app = getApp(); Component({ /** @@ -147,14 +150,14 @@ 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 @@ -162,6 +165,7 @@ answertype == "collectQuestion" ? "我的收藏" : "我的错题" }&answerType=${answertype}`, }); } }, // 练习 组件切换 onRadioChange(e) { packageBookService/pages/bookServices/detail/components/testResource/testResource.wxml
@@ -27,38 +27,6 @@ <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" packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -165,9 +165,7 @@ // 跳转音视频播放器 goPlayer(e) { // 检查登录状态 console.log(e.currentTarget.dataset.item) const token = wx.getStorageSync(app.config.tokenKey); if (!token) return false const goPlayerFun = () => { const item = e.currentTarget.dataset.item; const parent = e.currentTarget.dataset.parent; const parentProductLinkPath = parent ? @@ -195,17 +193,10 @@ }) } 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] @@ -217,7 +208,6 @@ } } if (this.properties.tab == "jsek_cloudLearning") { // 1.找出所有父级目录和本身(有销售方式) 和 云学习本身(有销售方式) 放到一个数组 为空则暂未开放销售 let learn = [] if (this.properties.isCloundHaveSaleMethod) { @@ -250,7 +240,6 @@ }); } } } let url; if (item.selectType == "video" || item.learnSelectType == "video") { @@ -268,6 +257,16 @@ 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() } }, // 拿到所有项 packageBookService/pages/bookServices/detail/index.js
@@ -13,9 +13,6 @@ * 页面的初始数据 */ data: { // 进页面默认切换 展开的id // defaultactiveTeachid 教学资源 // defaultactiveLearnid 云学习 bookId: "", barHeight: "", navBarHeight: "", @@ -49,7 +46,7 @@ learnPath: '', applyResourceState: false, // 申请教学资源按钮防抖 resourceClassList: [], // 资源所属分类 applyState: "", // 教学资源申请状态 applyState: "1", // 教学资源申请状态 deadline: "", // 教学资源申请有效日期, isShowBuyCloundBtn: false, isshowDrawBtn: true, // 云学习领取查看按钮是否显示 @@ -224,6 +221,26 @@ 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() } }) }, /** * 生命周期函数--监听页面加载 */ @@ -245,21 +262,18 @@ 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 (options.tabValue) { this.setData({ tabValue: options.tabValue, }); } const token = wx.getStorageSync(app.config.tokenKey); if (token) { this.getShoppingCartProductGet(); this.getApplyInfo(options.id); 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)), @@ -268,10 +282,6 @@ this.getSelectPaperBookCount(); this.getSelectBookCount(); } if (options.tabValue) { this.setData({ tabValue: options.tabValue, }); } }, @@ -724,17 +734,14 @@ setCollect() { const token = wx.getStorageSync(app.config.tokenKey); if (!token) { // 检查登录状态 loginInfo(app, (data) => { // 如果不是第一次登录,会执行回调 if (data) { // 登录成功,自动记录token和用户信息,并返回true this.logInFun(() => { this.getBookInfo(this.data.bookId); }) } else { // 出现错误,返回false this.collectFun() } }); } else { }, collectFun() { if (this.data.bookDetail.isFavourite) { app.MG.store .delProductLink({ @@ -757,9 +764,7 @@ }); }); } } }, // 联系 editPhone() { this.setData({ @@ -771,12 +776,18 @@ 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) { @@ -810,17 +821,6 @@ "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) @@ -1028,7 +1028,6 @@ loading: false, }); } let list = [] // 判断云学习有无销售方式和有效期 const cloundSaleMethod = @@ -1120,6 +1119,7 @@ learnPath: type.productLinkPath }); } console.log('1', this.data.teach); }) }, // 获取 云测试 @@ -1271,7 +1271,14 @@ }, // 图书添加购物车 async addBookShopcCar() { 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 = { @@ -1312,6 +1319,7 @@ icon: "none", duration: 1000, }); } } }, @@ -1787,19 +1795,15 @@ 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 this.logInFun(() => {}); } else { // 出现错误,返回false getFreeFun() } }); } const getFreeFun = async () => { // 领取查看 ,先看云学习上的 再看资源上的 const cloundMenu = this.data.resourceCodeList.find((item) => item.refCode == 'jsek_cloudLearning') const cloundMenuSaleMethod = @@ -1866,6 +1870,7 @@ } catch (error) { console.log(error); } } }, // 云学习一键购买 async allAddShoppiingCar() { @@ -1918,7 +1923,14 @@ } }, // 云学习全部购买 async buyCloudLearnClass() { buyCloudLearnClass() { const token = wx.getStorageSync(app.config.tokenKey); if (token) { buyClass() } else { this.logInFun(() => {}) } const buyClass = async () => { const cloundMenu = this.data.resourceCodeList.find((item) => item.refCode == 'jsek_cloudLearning') let query = { remarks: '云学习', @@ -1941,11 +1953,7 @@ title: "请重试", }); } }, // 云学习字段购买 async buyCloundMenu() { const cloundData = this.data.resourceCodeList.find(item => item.refCode == 'jsek_cloudLearning') } }, // 变为所有check true findAndUpdateItemsByIds(tree, ids) { @@ -1964,9 +1972,6 @@ findAndUpdate(node); // 对每个顶层节点执行查找和更新操作 } return tree; // 返回修改后的完整数组 }, handleTrue() { // findAndUpdateItemsByIds(this.date.) }, // 题库购买 @@ -2090,7 +2095,14 @@ }); }, // 购买组卷 async buyMock() { 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({ @@ -2136,6 +2148,7 @@ } } catch (error) { console.log(error); } } }, // 记录购买组卷时间 @@ -2238,6 +2251,13 @@ }, // 底部购买按钮 buyBtn() { const token = wx.getStorageSync(app.config.tokenKey); if (token) { buyFun() } else { this.logInFun(() => {}) } const buyFun = () => { if (this.data.tabValue == "brief" && !this.data.bookBuy) { this.buyBook(); } else if (this.data.tabValue == "jsek_cloudLearning") { @@ -2246,9 +2266,11 @@ } else { console.log(this.data.tabValue); } } }, goRead() { goRead(e) { const readFun = (bookBuy) => { if (!this.data.noFile) { wx.showToast({ title: "暂无阅读文件", @@ -2267,11 +2289,26 @@ "&freePage=" + this.data.fileInfo.freePage + "&bookBuy=" + this.data.bookBuy + 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) }) } }, //样书申请 @@ -2384,6 +2421,13 @@ //申请电子样书 appplyElectronicBook() { const token = wx.getStorageSync(app.config.tokenKey); if (token) { applyFun() } else { this.logInFun(() => {}) } const applyFun = () => { // 先判断下教师认证,未对原有逻辑修改 let role = this.data.userInfo != null ? this.data.userInfo.role : null; if (role && role == "Teacher") {} else { @@ -2489,9 +2533,17 @@ duration: 1000, }); } } }, //申请纸质样书 appplyPaperBook() { const token = wx.getStorageSync(app.config.tokenKey); if (token) { applyFun() } else { this.logInFun(() => {}) } const applyFun = () => { let role = this.data.userInfo != null ? this.data.userInfo.role : null; if (role && role == "Teacher") {} else { return wx.showModal({ @@ -2576,6 +2628,7 @@ icon: "none", duration: 1000, }); } } }, // 添加样书 @@ -2703,6 +2756,15 @@ return childrenList }, uploadFile(e) { 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', @@ -2712,6 +2774,7 @@ dialogBox: true, isShowUp: true }); } }, closeDialog() { this.setData({ packageBookService/pages/bookServices/detail/index.wxml
@@ -2,35 +2,65 @@ <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> @@ -54,12 +84,19 @@ <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> <!-- 销售信息 --> @@ -68,12 +105,19 @@ <!-- 电子书售价 --> <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> @@ -81,27 +125,72 @@ <!-- 纸质书售价 --> <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> @@ -113,38 +202,138 @@ 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> @@ -152,7 +341,11 @@ <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> @@ -166,34 +359,77 @@ </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}}"> @@ -203,12 +439,19 @@ <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> @@ -218,8 +461,25 @@ <!-- <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> @@ -228,24 +488,51 @@ <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> @@ -260,12 +547,22 @@ </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> pages/bookExhibitionDetails/index.js
@@ -39,23 +39,8 @@ 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() } }, /** pages/digitalCourses/digitalCoursesDetails/index.js
@@ -13,6 +13,7 @@ loginInfo } from '../../../assets/js/login'; import wxbarcode from 'wxbarcode' Page({ /** @@ -166,24 +167,20 @@ bookId: options.id, bookPath: parentPath.join('\\') }) const token = wx.getStorageSync(app.config.tokenKey) if (!token) { this.digitalCoursesDetailsGet(options.id) this.getPlayerList() this.getType() }, logInFun(callback) { loginInfo(app, (data) => { if (data) { this.digitalCoursesDetailsGet(options.id) this.getPlayerList() this.getType() } else {} }) callback() } this.digitalCoursesDetailsGet(options.id) this.getPlayerList() this.getType() // this.setData({ // userName: JSON.parse(wx.getStorageSync(app.config.userInfoKey)).name, // }) }) }, /** * 生命周期函数--监听页面初次渲染完成 */ @@ -831,7 +828,8 @@ //学习笔记 //在线提问 // 图书添加购物车 async addBookShopcCar() { addBookShopcCar() { const addFun = async () => { if (!this.data.expire) { const shoppingCartGetId = []; let query = { @@ -873,6 +871,14 @@ duration: 1000, }); } } const token = wx.getStorageSync(app.config.tokenKey) if (!token) { this.logInFun(() => {}) } else { addFun() } }, showSuccessToast() { Toast({ @@ -886,6 +892,7 @@ //购买按钮 async buyBtn() { const buyFun = async () => { if (!this.data.expire) { let bookOrdersId = ""; let query = { @@ -931,6 +938,14 @@ duration: 1000, }); } } const token = wx.getStorageSync(app.config.tokenKey) if (!token) { this.logInFun(() => {}) } else { buyFun() } }, @@ -1097,6 +1112,7 @@ }, onCertificate() { const cateFun = () => { if (!this.data.isBuy) { wx.showToast({ title: "请先购买,体验完整服务", @@ -1121,7 +1137,6 @@ }); return false } var page = getCurrentPages().pop(); // 获取当前页面实例 page.setData({ // 动态设置禁止滚动的样式 @@ -1131,6 +1146,14 @@ dialogBox: true, scrollJudge: '' }) } const token = wx.getStorageSync(app.config.tokenKey) if (!token) { this.logInFun(() => {}) } else { cateFun() } }, closeDialog() { this.setData({ @@ -1317,62 +1340,35 @@ } }, setCoolect() { // 首页测试登录功能,后续注释 // 检查登录状态 const collectFun = () => { 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 }) }) } } 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 }) }) this.logInFun(() => {}) } 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 { 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 }) }) } collectFun() } }, pages/digitalCourses/index.js
@@ -1,4 +1,7 @@ // pages/digitalCourses/index.js import { loginInfo } from '../../assets/js/login'; const app = getApp() import { setSessionGuid, @@ -68,7 +71,8 @@ }); } this.getCourseTypeListList() this.getShoppingCartList() const token = wx.getStorageSync(app.config.tokenKey) if (token) this.getShoppingCartList() }, /** @@ -288,6 +292,7 @@ }) }, addCart(e) { const addFun = () => { const { item } = e.currentTarget.dataset; @@ -336,7 +341,17 @@ console.error('出错了:', error) } } } const token = wx.getStorageSync(app.config.tokenKey) if (token) { addFun() } else { loginInfo(app, (data) => { if (data) { this.getShoppingCartList() } }) } }, }) pages/home/home.js
@@ -546,8 +546,6 @@ if (data) { this.addCartFun(info) this.registe() } else { this.addCartFun(info) } }) } @@ -711,28 +709,9 @@ }, 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 }) } }, /** pages/home/home.wxml
@@ -1,22 +1,66 @@ <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> @@ -25,37 +69,81 @@ </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> @@ -67,7 +155,11 @@ </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> @@ -75,16 +167,39 @@ </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> @@ -100,35 +215,78 @@ </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> @@ -142,7 +300,11 @@ <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> @@ -150,8 +312,18 @@ </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> @@ -164,28 +336,64 @@ </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> @@ -198,17 +406,37 @@ </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> pages/retrievalPage/index.js
@@ -1,6 +1,8 @@ // pages/retrievalPage/index.js import request from '../../assets/request/index' import { loginInfo } from '../../assets/js/login'; import { handleQueryResourceListData } from '../../assets/js/middleGround/tool' @@ -97,16 +99,16 @@ } 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({ @@ -233,7 +235,7 @@ } } let url = '/store/api/ApiQueryProductByAppUser' let url = '/store/api/ApiQueryProduct' //图书 let queryBook = { AccessControl: { @@ -703,11 +705,26 @@ mailbox(e) { const key = e.currentTarget.dataset.key; const item = e.currentTarget.dataset.item; 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) {