| | |
| | | export const requestCtx = "https://jsek.bnuic.com" // 请求地址 |
| | | export const appId = 3; |
| | | // export const epubUrl = "http://182.92.203.7:3007/epubReadMobile/"; |
| | | export const epubUrl = "http://jsysf.bnuic.com/epubReadMobile/#/"; |
| | | export const epubUrl = "https://jsek.bnuic.com/epubReadMobile/#/"; |
| | | export const pdfUrl = "http://182.92.203.7:3007/pdfRead/" |
| | | export const requestTimeOut = 300000; // 请求超时时间 |
| | | export const tokenKey = "jsek-token"; |
| | |
| | | }); |
| | | return false; |
| | | } |
| | | if (this.data.paperBookList.length >= 2) { |
| | | wx.showToast({ |
| | | title: "每次最多只可申请2本样书", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | |
| | | let isHas = this.data.paperBookList.find( |
| | | (pitem) => pitem.id == this.data.bookDetail.id |
| | | ); |
| | |
| | | }); |
| | | 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({ |
| | |
| | | 'contactInfo.phone': JSON.parse(this.data.userInfo.data).phone, |
| | | 'contactInfo.detailedAddress': JSON.parse(this.data.userInfo.data).detailedAddress, |
| | | }) |
| | | } else { |
| | | wx.showModal({ |
| | | title: '尊敬的用户,您好!', //提示的标题 |
| | | content: '请先进行教师认证?', //提示的内容 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | if (wx.getStorageSync("paperBookList")) { |
| | | this.setData({ |
| | |
| | | author: [], |
| | | isbn: [], |
| | | publicationDate: [], |
| | | pdf: [], |
| | | protectedEpub: [], |
| | | isApplyBook: [], |
| | | 'isApplyBook>': ['1'], |
| | | ...searchObj, |
| | |
| | | }) |
| | | } else { |
| | | that.setData({ |
| | | bookList: [], |
| | | pageTotalCount: 0, |
| | | bottomLoading: false, |
| | | skeletonLoding: false, |
| | | loading: false |
| | | }) |
| | |
| | | }, |
| | | |
| | | //选择电子样书 |
| | | onChangeElectron(e) { |
| | | async onChangeElectron(e) { |
| | | const item = e.currentTarget.dataset.book; |
| | | console.log(item) |
| | | const index = this.data.bookList.findIndex(citem => citem.id == item.id) |
| | | let role = this.data.userInfo != null ? this.data.userInfo.role : null |
| | | if (role && role == 'Teacher') { |
| | | // 是教师 |
| | | if (e.detail.checked) { |
| | | // 点击选中 |
| | | //商品有无电子书 |
| | | const obj = { |
| | | path: '*', |
| | | queryType: 'SubProduct', |
| | | sort: { |
| | | type: 'Desc', |
| | | field: 'CreateDate' |
| | | }, |
| | | paging: { |
| | | start: 0, |
| | | size: 1 |
| | | }, |
| | | mainProductId: item.id, |
| | | fields: { |
| | | bookshelf_pdf: [], |
| | | bookshelf_protectedEpub: [], |
| | | } |
| | | } |
| | | const res = await app.MG.store.getProductList(obj) |
| | | if (res.datas.length > 0) { |
| | | if (!res.datas[0].bookshelf_pdf && !res.datas[0].bookshelf_protectedEpub) { |
| | | wx.showToast({ |
| | | title: "暂无电子书文件,请联系管理员!", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | return false; |
| | | } |
| | | } else { |
| | | if (!item.pdf && !item.protectedEpub) { |
| | | wx.showToast({ |
| | | title: "暂无电子书文件,请联系管理员!", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //申请次数 |
| | | if (this.data.ebookCount == 0) { |
| | | wx.showToast({ |
| | | title: "您的电子样书申请次数已用尽,若要继续,请联系管理员!", |
| | |
| | | "t-search": "tdesign-miniprogram/search/search", |
| | | "t-checkbox": "tdesign-miniprogram/checkbox/checkbox", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh" |
| | | "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh", |
| | | "t-empty": "tdesign-miniprogram/empty/empty" |
| | | } |
| | | } |
| | |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | list: [], |
| | | pageTotalCount: 0, |
| | | skeletonLoding: false, |
| | | }) |
| | | } |
| | |
| | | data: { |
| | | active: 0, |
| | | activeName: "bookOpinion", |
| | | tabList: [ |
| | | { |
| | | tabList: [{ |
| | | label: '图书建议', |
| | | key: 0, |
| | | value: 'bookOpinion' |
| | |
| | | |
| | | getDataList(isReachBottom) { |
| | | app.MG.ugc.getTopicMessageList({ |
| | | appRefCode: app.config.appRefCode, |
| | | topicIdOrRefCode: this.data.topicIdOrRefCode, |
| | | start: this.data.page * this.data.limit - this.data.limit, |
| | | size: this.data.limit, |
| | | sort: { |
| | | type: "Desc", |
| | | field: "CreateDate" |
| | | } |
| | | }) |
| | | appRefCode: app.config.appRefCode, |
| | | topicIdOrRefCode: this.data.topicIdOrRefCode, |
| | | start: this.data.page * this.data.limit - this.data.limit, |
| | | size: this.data.limit, |
| | | sort: { |
| | | type: "Desc", |
| | | field: "CreateDate" |
| | | } |
| | | }) |
| | | .then(res => { |
| | | try { |
| | | if (res.datas.length > 0) { |
| | |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | list: [], |
| | | pageTotalCount: 0, |
| | | skeletonLoding: false, |
| | | }) |
| | | } |
| | |
| | | <view wx:if="{{activeName == 'bookOpinion'}}" class="listBox"> |
| | | <view class="content-item" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"> |
| | | <view class="icon"> |
| | | <t-image src="{{item.content.icon}}" mode="aspectFill" class="img" /> |
| | | <t-image src="{{item.content.icon ? item.content.icon : '/static/images/default-book-img.png'}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view class="item-con"> |
| | | <view class="titleBox"> |
| | |
| | | |
| | | getDataList(isReachBottom) { |
| | | app.MG.app.getAppMessageList({ |
| | | appRefCode: app.config.appRefCode, |
| | | start: this.data.page * this.data.limit - this.data.limit, |
| | | size: this.data.limit, |
| | | sort: { |
| | | type: "Desc", |
| | | field: "CreateDate" |
| | | } |
| | | }) |
| | | appRefCode: app.config.appRefCode, |
| | | start: this.data.page * this.data.limit - this.data.limit, |
| | | size: this.data.limit, |
| | | sort: { |
| | | type: "Desc", |
| | | field: "CreateDate" |
| | | } |
| | | }) |
| | | .then(res => { |
| | | try { |
| | | if (res.datas.length > 0) { |
| | |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | list: [], |
| | | pageTotalCount: 0, |
| | | skeletonLoding: false, |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | list: [], |
| | | pageTotalCount: 0, |
| | | skeletonLoding: false, |
| | | loading: false |
| | | }) |
| | |
| | | const { |
| | | phoneError |
| | | } = this.data; |
| | | const isPhoneNumber = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(e.detail.value); |
| | | if (phoneError === isPhoneNumber) { |
| | | if (e.detail.value) { |
| | | const isPhoneNumber = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(e.detail.value); |
| | | if (phoneError === isPhoneNumber) { |
| | | this.setData({ |
| | | phoneError: !isPhoneNumber, |
| | | mannder: e.detail.value, |
| | | }); |
| | | } |
| | | } else { |
| | | this.setData({ |
| | | phoneError: !isPhoneNumber, |
| | | mannder: e.detail.value, |
| | | phoneError: false, |
| | | mannder: '' |
| | | }); |
| | | } |
| | | }, |
| | |
| | | if (this.data.mannder.replace(/^\s*|\s*$/g, "") == '') { |
| | | this.data.lock = true; |
| | | wx.showToast({ |
| | | title: "反馈内容不能为空", |
| | | title: "联系方式不能为空", |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |