| | |
| | | export const requestCtx = "http://182.92.203.7:3001"; // 请求地址 |
| | | export const appId = 27; |
| | | // 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 requestCtx = "http://182.92.203.7:3001"; // 请求地址 |
| | | // export const appId = 27; |
| | | 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 pdfUrl = "http://182.92.203.7:3007/pdfRead/" |
| | | export const requestTimeOut = 300000; // 请求超时时间 |
| | | export const tokenKey = "jsek-token"; |
| | |
| | | remarks: "电子书", |
| | | requests: [{ |
| | | saleMethodId: this.data.bookItemDetail.defaultSaleMethodId ? |
| | | this.data.bookItemDetail.defaultSaleMethodId : |
| | | this.data.bookDetail.defaultSaleMethodId, |
| | | this.data.bookItemDetail.defaultSaleMethodId : this.data.bookDetail.defaultSaleMethodId, |
| | | count: 1, |
| | | }, ], |
| | | }; |
| | |
| | | }); |
| | | return false; |
| | | } |
| | | if (this.data.electronicBookList.length >= 2) { |
| | | wx.showToast({ |
| | | title: "每次最多只可申请2本样书", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | |
| | | let isHas = this.data.electronicBookList.find( |
| | | (eitem) => eitem.id == this.data.bookDetail.id |
| | | ); |
| | |
| | | if (isApply) { |
| | | wx.showToast({ |
| | | title: "该书已申请!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | if (this.data.electronicBookList.length >= 2) { |
| | | wx.showToast({ |
| | | title: "每次最多只可申请2本样书", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | |
| | | }); |
| | | return false; |
| | | } |
| | | let isApply = this.data.alreadyPaperBookList.find( |
| | | (pitem) => pitem.id == this.data.bookDetail.id |
| | | ); |
| | | if (isApply) { |
| | | wx.showToast({ |
| | | title: "该书已申请!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | if (this.data.paperBookList.length >= 2) { |
| | | wx.showToast({ |
| | | title: "每次最多只可申请2本样书", |
| | |
| | | if (isHas) { |
| | | wx.showToast({ |
| | | title: "该书已在清单列表中", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false; |
| | | } |
| | | let isApply = this.data.alreadyPaperBookList.find( |
| | | (pitem) => pitem.id == this.data.bookDetail.id |
| | | ); |
| | | if (isApply) { |
| | | wx.showToast({ |
| | | title: "该书已申请!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | |
| | | if (emailError === isPhoneNumber) { |
| | | this.setData({ |
| | | emailError: !isPhoneNumber, |
| | | "userInfoForm.email": e.detail.value, |
| | | }); |
| | | } |
| | | this.setData({ |
| | | "userInfoForm.email": e.detail.value, |
| | | }); |
| | | } else { |
| | | this.setData({ |
| | | emailError: false, |
| | |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | // 开启短信验证倒计时 |
| | | this.getSecond(60) |
| | | } else { |
| | | wx.showToast({ |
| | | title: '邮箱验证码发送失败', |
| | |
| | | |
| | | confirmInfo() { |
| | | if (this.data.editType == 'nickName') { |
| | | if (!this.data.userInfoForm.nickName) { |
| | | wx.showToast({ |
| | | title: '请输入昵称', |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | return false; |
| | | } |
| | | let userTypeInfo = { |
| | | "requests": [{ |
| | | data: JSON.stringify({ |
| | |
| | | }) |
| | | |
| | | } else if (this.data.editType == 'phone') { |
| | | if (!this.data.userInfoForm.phone) { |
| | | wx.showToast({ |
| | | title: '请输入手机号', |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | return false; |
| | | } |
| | | if (!this.data.userInfoForm.code) { |
| | | wx.showToast({ |
| | | title: '请输入验证码', |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | return false; |
| | | } |
| | | let query = { |
| | | phoneNumber: this.data.userInfoForm.phone, |
| | | phoneCaptcha: this.data.userInfoForm.code |
| | |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | this.setData({ |
| | | countDown: 0, |
| | | }); |
| | | } else if (res == '此手机号码已被其它账号绑定') { |
| | | wx.showToast({ |
| | | title: res + ',请更换其他手机号。', |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | this.setData({ |
| | | countDown: 0, |
| | | }); |
| | | } else { |
| | | wx.showToast({ |
| | | title: res, |
| | |
| | | } |
| | | }) |
| | | } else if (this.data.editType == 'email') { |
| | | if (!this.data.userInfoForm.email) { |
| | | wx.showToast({ |
| | | title: '请输入邮箱', |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | return false; |
| | | } |
| | | if (!this.data.userInfoForm.code) { |
| | | wx.showToast({ |
| | | title: '请输入验证码', |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | return false; |
| | | } |
| | | let query = { |
| | | eMail: this.data.userInfoForm.email, |
| | | captcha: this.data.userInfoForm.code |
| | |
| | | <t-input placeholder="输入短信验证码" borderless value="{{userInfoForm.code}}" type="number" bindchange="onCodeInput" /> |
| | | </view> |
| | | <view class="code"> |
| | | <button class="btn" bindtap="getPhoneCode">{{countDown > 0 ? countDown : '获取短信验证码'}}</button> |
| | | <button class="btn" bindtap="getPhoneCode">{{countDown > 0 ? '验证码(' + countDown + 's)' : '获取短信验证码'}}</button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | onPullDownRefresh() { |
| | | this.setData({ |
| | | 'baseRefresh.value': true, |
| | | isWhite: false |
| | | }) |
| | | this.getBannerList(); |
| | | this.init(); |
| | | }, |
| | | init() { |
| | |
| | | }, |
| | | |
| | | onScrollToTop(e) { |
| | | |
| | | this.setData({ |
| | | isWhite: e.detail.scrollTop > 50 ? true : false |
| | | }) |
| | | }, |
| | | |
| | | onRetrievalPage() { |
| | | |
| | | // 首页测试登录功能,后续注释 |
| | |
| | | <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}}" mode="aspectFit" class="img" /> |
| | | <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> |