| | |
| | | import { |
| | | loginInfo |
| | | } from "../../../../../../assets/js/login"; |
| | | const app = getApp() |
| | | Component({ |
| | | /** |
| | | * 组件的属性列表 |
| | |
| | | }, |
| | | // 跳转资源购买页 |
| | | goBuyResource() { |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | gotoPageFun() |
| | | } else { |
| | | loginInfo(app, (data) => { |
| | | }) |
| | | } |
| | | const gotoPageFun = () => { |
| | | if (!this.properties.isGoBuyResource) { |
| | | return wx.showToast({ |
| | |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/buyResource/index?productLinkPath=${this.properties.buyResourceData.productLinkPath}&refCode=${this.properties.buyResourceData.refCode}&bookId=${this.properties.bookId}`, |
| | | }) |
| | | } |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | gotoPageFun() |
| | | } else { |
| | | loginInfo(app, (data) => {}) |
| | | } |
| | | }, |
| | | |
| | |
| | | }) |
| | | }, |
| | | goLearnTask() { |
| | | const gotoPageFun = () => { |
| | | 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() |
| | |
| | | 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对象,提供给事件监听函数 |
| | |
| | | * 组件的初始数据 |
| | | */ |
| | | data: { |
| | | inputStyle: |
| | | "border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding:16rpx", |
| | | inputStyle: "border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding:16rpx", |
| | | placeholderstyle: "font-size:28rpx", |
| | | flag: false, // 输入框是否显示 |
| | | submitType: "new", // 新建 or 编辑 |
| | |
| | | }, |
| | | openDialog() { |
| | | loginInfo(app, (data) => {}) |
| | | if (data) |
| | | this.setData({ |
| | | submitTitle: this.properties.bookInfo.name, |
| | | showNoteDialog: true, |
| | |
| | | } |
| | | }, |
| | | goMycollect(e) { |
| | | const answertype = e.currentTarget.dataset.answertype; |
| | | const token = wx.getStorageSync("jsek-token"); |
| | | if (token) { |
| | | gotoPage() |
| | | } else { |
| | | loginInfo(app, (data) => { |
| | | if (data) gotoPage() |
| | | }) |
| | | } |
| | | const gotoPage = () => { |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/examination/examination?bookId=${ |
| | |
| | | }&answerType=${answertype}`, |
| | | }); |
| | | } |
| | | const answertype = e.currentTarget.dataset.answertype; |
| | | const token = wx.getStorageSync("jsek-token"); |
| | | if (token) { |
| | | gotoPage() |
| | | } else { |
| | | loginInfo(app, (data) => { |
| | | if (data) {} |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | // 练习 组件切换 |
| | | onRadioChange(e) { |
| | |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (!token && this.data.tab != 'jsek_teachingResources') { |
| | | loginInfo(app, (data) => { |
| | | if (data) goPlayerFun() |
| | | if (data) {} |
| | | }) |
| | | } else { |
| | | goPlayerFun() |
| | |
| | | } |
| | | this.setData({ |
| | | num: Number(this.data.paperBookList.length) + Number(this.data.electronicBookList.length), |
| | | editDialog: false |
| | | }); |
| | | if (this.data.bookDetail.id) { |
| | | this.getBookInfo(this.data.bookDetail.id) |
| | |
| | | editDialog: true |
| | | }) |
| | | }, |
| | | |
| | | closeEditDialog() { |
| | | this.setData({ |
| | | editDialog: false |
| | | }) |
| | | }, |
| | | // 我要建议 |
| | | suggestBtn() { |
| | | // 检查登录状态 |
| | |
| | | }, |
| | | // 购买组卷 |
| | | buyMock() { |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | buyMockFun() |
| | | } else { |
| | | this.logInFun(() => {}) |
| | | } |
| | | const buyMockFun = async () => { |
| | | let res; |
| | | if (!this.data.mockData.id) |
| | |
| | | console.log(error); |
| | | } |
| | | } |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | buyMockFun() |
| | | } else { |
| | | this.logInFun(() => {}) |
| | | } |
| | | |
| | | }, |
| | | // 记录购买组卷时间 |
| | | recordBuyMock() { |
| | |
| | | |
| | | //去样书申请单 |
| | | goApply() { |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/sampleBookList/applicationForm/index", |
| | | }); |
| | | } else { |
| | | this.logInFun(() => {}) |
| | | } |
| | | }, |
| | | handleTree() { |
| | | // const child = this.selectComponent('#teach-tree') |
| | |
| | | </movable-view> |
| | | </movable-area> |
| | | <!-- 联系编辑弹窗 --> |
| | | <t-dialog visible="{{editDialog}}" close-btn> |
| | | <t-dialog visible="{{editDialog}}" close-btn bind:close="closeEditDialog"> |
| | | <view slot="content" class="editContent"> |
| | | <view class="editText">图书编辑:{{bookDetail.bookEditor}}</view> |
| | | <view class="editText">联系方式:{{bookDetail.contactInformation}}</view> |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad() { |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) {} |
| | | }) |
| | | } else {} |
| | | this.getType() |
| | | }, |
| | | |
| | |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) {} else { |
| | | wx.switchTab({ |
| | | url: '/pages/home/home', |
| | | }) |
| | | } |
| | | }) |
| | | } else {} |
| | | }, |
| | | |
| | | /** |
| | |
| | | isBuy: res.datas.purchasedSaleMethodIdList.includes(res.datas.defaultSaleMethodId) |
| | | }) |
| | | res.datas.cmsDatas[0].datas.forEach((item) => { |
| | | // if (this.data.productLinkPath == item.productLinkPath) { |
| | | // this.handleTeachData(item) |
| | | // this.setData({ |
| | | // titleName: item.name, |
| | | // selectType: item.selectType, |
| | | // learnSelectType: item.learnSelectType |
| | | // }) |
| | | // } else { |
| | | // return wx.showToast({ |
| | | // icon: 'none', |
| | | // title: '暂无资源', |
| | | // }) |
| | | // } |
| | | if (this.data.productLinkPath == item.productLinkPath) { |
| | | this.handleTeachData(item) |
| | | this.setData({ |
| | | titleName: item.name, |
| | | selectType: item.selectType, |
| | | learnSelectType: item.learnSelectType |
| | | }) |
| | | } |
| | | if (this.data.storeInfo == 'jsek_digitalCourses') { |
| | | if (this.data.isBuy) { |
| | | if (this.data.productLinkPath == item.productLinkPath) { |
| | |
| | | learnSelectType: item.learnSelectType, |
| | | }) |
| | | } else { |
| | | wx.showToast({ |
| | | icon: 'none', |
| | | title: '请先返回资源所在图书详情购买视频资源', |
| | | }) |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/index?id=${this.data.bookDetail.id}&name=${this.data.bookDetail.name}&tabValue=jsek_cloudLearning`, |
| | | }); |
| | | // wx.showToast({ |
| | | // icon: 'none', |
| | | // title: '请先返回资源所在图书详情购买视频资源', |
| | | // }) |
| | | // wx.navigateTo({ |
| | | // url: `/packageBookService/pages/bookServices/detail/index?id=${this.data.bookDetail.id}&name=${this.data.bookDetail.name}&tabValue=jsek_cloudLearning`, |
| | | // }); |
| | | } |
| | | }) |
| | | }, |
| | |
| | | showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey), |
| | | titleName: items.name |
| | | }) |
| | | debugger |
| | | this.aliVod(file, this.data.showData) |
| | | } else { |
| | | this.setData({ |
| | |
| | | }, |
| | | // 判断当前点击的数据是否购买 |
| | | cmsItemIsBuy(item) { |
| | | // 1.this.data.buyIdList 上是否有 cmsItem的linkpath里的id |
| | | const linkData = item.productLinkInfo.find(citem => citem.LinkType == 'Link' && citem.CmsItemId == item.id) |
| | | let linkids = [] |
| | | try { |
| | | linkids = linkData.LinkPath.split('\\') |
| | | } catch (error) {} |
| | | if (!this.data.buyIdList.length) return false |
| | | const flag = linkids.some(citem => { |
| | | return this.data.buyIdList.includes(Number(citem)) |
| | | }) |
| | | console.log(linkids, flag); |
| | | let flag = false |
| | | // 买了 |
| | | if (this.data.buyList.length) { |
| | | if (this.data.buyList.some(citem => item.productLinkPath.includes(citem.productLinkPath))) |
| | | flag = true |
| | | } else { |
| | | // 没买且无销售方式 |
| | | if (!item.saleMethod.length) { |
| | | flag = true |
| | | } else { |
| | | // 没买且销售方式过期//没买,销售方式价格为0 |
| | | const itemSaleMethod = item.saleMethod.find(citem => citem.SaleType == 'Normal') |
| | | if (new Date().getTime() > new Date(itemSaleMethod.EndDate).getTime() || itemSaleMethod.Price == 0) flag = true |
| | | } |
| | | } |
| | | return flag |
| | | } |
| | | }) |
| | |
| | | |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | that.setData({ |
| | | userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)) |
| | | }) |
| | | that.getAlreadyPBookList() |
| | | that.getAlreadyEBookList() |
| | | // 获取申请次数 |
| | | that.getSelectPaperBookCount() |
| | | that.getSelectBookCount() |
| | | |
| | | } |
| | | }) |
| | | } else { |
| | | if (token) { |
| | | that.setData({ |
| | | userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)) |
| | | }) |
| | |
| | | */ |
| | | onShow() { |
| | | let that = this; |
| | | // that.setData({ |
| | | // page: 1, |
| | | // paperBookList: [], |
| | | // electronicBookList: [] |
| | | // }) |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | that.setData({ |
| | | userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)) |
| | | }) |
| | | that.getAlreadyPBookList() |
| | | that.getAlreadyEBookList() |
| | | // 获取申请次数 |
| | | that.getSelectPaperBookCount() |
| | | that.getSelectBookCount() |
| | | } else { |
| | | wx.switchTab({ |
| | | url: '/pages/home/home', |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | if (wx.getStorageSync("paperBookList") || wx.getStorageSync("electronicBookList")) { |
| | | if (wx.getStorageSync("paperBookList")) { |
| | | that.setData({ |
| | |
| | | //获取职称 |
| | | this.getpositionalTitle(); |
| | | this.getAgreement(); |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.getUserRole() |
| | | } |
| | | }) |
| | | } else { |
| | | this.getUserRole() |
| | | } |
| | | |
| | | }, |
| | | |
| | | /** |
| | |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.getUserRole() |
| | | } else { |
| | | wx.switchTab({ |
| | | url: '/pages/home/home', |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | this.getUserRole() |
| | | } |
| | | |
| | | }, |
| | | |
| | |
| | | }); |
| | | }, |
| | | }) |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (token) { |
| | | this.getUserInfo() |
| | | } |
| | | }, |
| | | |
| | | /** |
| | |
| | | */ |
| | | onShow() { |
| | | // console.log(this.data.value); |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.getUserInfo() |
| | | } |
| | | }) |
| | | } else { |
| | | this.getUserInfo() |
| | | } |
| | | |
| | | }, |
| | | |
| | | /** |
| | |
| | | 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({ |
| | | Md5: item.datas.freeFile.FileList[0].Md5, |
| | | dialogBox: true |
| | | }) |
| | | } else {} |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | Md5: item.datas.freeFile.FileList[0].Md5, |
| | | dialogBox: true |
| | | }) |
| | | } |
| | | |
| | | // wx.scanCode({ |
| | | // success: res => { |
| | | // console.log(res); |
| | |
| | | wx.setNavigationBarTitle({ |
| | | title: '购物车' |
| | | }); |
| | | this.shoppingCartGet(); |
| | | // this.shoppingCartGet(); |
| | | this.setData({ |
| | | swipeOpened: true |
| | | }) |
| | | }, |
| | | onShow() { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.shoppingCartGet(); |
| | | } else { |
| | | wx.switchTab({ |
| | | url: '/pages/home/home', |
| | | }) |
| | | } |
| | | }) |
| | | this.setData({ |
| | | swipeOpened: false |
| | | }) |
| | |
| | | active: 3 |
| | | }) |
| | | } |
| | | this.shoppingCartGet(); |
| | | this.setData({ |
| | | totalPrice: 0.00, |
| | | selectedCount: 0, |
| | |
| | | }); |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | goPaymentPage() { |
| | | |
| | | // 首页测试登录功能,后续注释 |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | |
| | | }); |
| | | this.getUserInfo() |
| | | this.getIntegral() |
| | | } else { |
| | | wx.switchTab({ |
| | | url: '/pages/home/home', |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | this.getStaticsSum(); |
| | | this.getDataList(false); |
| | | this.getListCount() |
| | | } else { |
| | | wx.switchTab({ |
| | | url: '/pages/home/home', |
| | | }) |
| | | } |
| | | }) |
| | | } else { |