| | |
| | | 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 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"; |
| | |
| | | |
| | | |
| | | export const loginInfo = (app, callback) => { |
| | | if (app.config.appId == 27) { |
| | | wx.navigateTo({ |
| | | url: "/pages/testLogin/index", |
| | | }); |
| | | } else { |
| | | wx.login({ |
| | | success: (res) => { |
| | | wx.getUserInfo({ |
| | |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | fail: (err) => { |
| | | console.log(err); |
| | |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // 获取登录用户身份 |
| | | const getUserInfo = (app, callback, token) => { |
| | |
| | | <view class="tabBarBox"> |
| | | <view class="tabItem" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="changeTab" data-num="{{index}}"> |
| | | <view class="custom-tab-bar-wrapper"> |
| | | <t-image wx:if="{{active !== index}}" class="tabImg" src="{{item.icon}}" mode="aspectFit" width="22" height="22" /> |
| | | <t-image wx:else class="tabImg" src="{{item.activeIcon}}" mode="aspectFit" width="22" height="22" /> |
| | | <view class="tab-images"> |
| | | <image wx:if="{{active !== index}}" class="tabImg" src="{{item.icon}}" mode="aspectFit" /> |
| | | <image wx:else class="tabImg" src="{{item.activeIcon}}" mode="aspectFit" /> |
| | | </view> |
| | | <view class="text {{active == index ? 'activeText' : ''}}">{{ item.text }}</view> |
| | | </view> |
| | | </view> |
| | |
| | | align-items: center; |
| | | } |
| | | |
| | | |
| | | |
| | | .custom-tab-bar-wrapper .text { |
| | | font-size: 20rpx; |
| | | margin-top: 10rpx; |
| | |
| | | padding-top: 20rpx; |
| | | } |
| | | |
| | | .tabItem:nth-child(1) .tab-images { |
| | | width: 52rpx; |
| | | height: 44rpx; |
| | | } |
| | | |
| | | .tabItem:nth-child(2) .tab-images { |
| | | width: 38rpx; |
| | | height: 44rpx; |
| | | } |
| | | |
| | | .tabItem:nth-child(3) .tab-images { |
| | | width: 57rpx; |
| | | height: 44rpx; |
| | | } |
| | | |
| | | .tabItem:nth-child(4) .tab-images { |
| | | width: 45rpx; |
| | | height: 44rpx; |
| | | } |
| | | |
| | | .tabItem:nth-child(5) .tab-images { |
| | | width: 43rpx; |
| | | height: 44rpx; |
| | | } |
| | | |
| | | .tab-images .tabImg { |
| | | width: 100%; |
| | | height: 100%; |
| | | margin: 0 auto; |
| | | } |
| | | |
| | | .text { |
| | | font-size: 20rpx; |
| | | text-align: center; |
| | |
| | | link: false, |
| | | epubObj: null, |
| | | currentPage: '', |
| | | pdfList: [] |
| | | }, |
| | | |
| | | /** |
| | |
| | | }, |
| | | |
| | | setWebViewSrc: function (data) { |
| | | let that = this; |
| | | var url = ""; |
| | | if (data.fileType == 'epub') { |
| | | if (data.bookBuy) { |
| | |
| | | "&recordLocation=" + |
| | | this.data.currentPage + "&freeEpubPage=" + data.freePage |
| | | } |
| | | } else { |
| | | url = app.config.pdfUrl + |
| | | "?md5=" + |
| | | data.md5 + |
| | | "&bookName=" + |
| | | data.fileName + |
| | | "&url=" + app.config.requestCtx + |
| | | "&token=" + |
| | | wx.getStorageSync(app.config.tokenKey) + |
| | | "&recordLocation=" + |
| | | this.data.currentPage; |
| | | } |
| | | this.setData({ |
| | | src: url |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | navigationBarTitleText: data.fileName |
| | | }) |
| | | app.MG.file.getPdfInfo({ |
| | | md5: data.md5 |
| | | }).then((res) => { |
| | | let pageCount = data.bookBuy ? res.totalPages : data.freePage |
| | | if (res && pageCount) { |
| | | let list = []; |
| | | for (let i = 0; i < pageCount; i++) { |
| | | const src = app.config.requestCtx + '/file/GetPdfPageImage?md5=' + data.md5 + '&index=' + (i + 1) + '&dpi=300' |
| | | list.push(src) |
| | | } |
| | | this.setData({ |
| | | pdfList: list |
| | | }) |
| | | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | |
| | | |
| | |
| | | <!--packageBookService/pages/components/webView/index.wxml--> |
| | | <view class="page-body"> |
| | | <web-view bind:message="drawBack" binderror="onError" bindload="onLoadWeb" src="{{src}}" id="webView"></web-view> |
| | | <view wx:if="{{epubObj.fileType == 'pdf'}}" class="pdfBox"> |
| | | <view wx:for="{{pdfList}}" wx:key="index" wx:for-item="item" wx:for-index="index" class="pdfItem"> |
| | | <image src="{{item}}" alt="" mode="widthFix"></image> |
| | | </view> |
| | | </view> |
| | | <web-view bind:message="drawBack" binderror="onError" bindload="onLoadWeb" src="{{src}}" id="webView" wx:else></web-view> |
| | | </view> |
| | |
| | | height: calc(100vh - env(safe-area-inset-bottom)); |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .pdfBox { |
| | | box-sizing: border-box; |
| | | height: calc(100vh - env(safe-area-inset-bottom)); |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | .pdfItem { |
| | | text-align: center; |
| | | } |
| | |
| | | |
| | | <view wx:if="{{selectType == 'pdf' || selectType == 'document'}}"> |
| | | <view wx:for="{{naturalResources}}" wx:key="index" wx:for-item="item" wx:for-index="index"> |
| | | |
| | | <image src="{{item}}" alt="" style="min-height: 550px;"></image> |
| | | <view class="divider">第 {{index + 1}} 页</view> |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | |
| | |
| | | </view> --> |
| | | |
| | | <!-- 暂停播放 --> |
| | | <<<<<<< Updated upstream |
| | | <view |
| | | class="audioIconBox color" |
| | | style="margin-left: 30rpx; margin-right: 10rpx" |
| | | > |
| | | <view wx:if="{{!isplay}}" bind:tap="play" class="pauseCircleBox"> |
| | | <!-- <t-icon name="play-circle-stroke" size="24" /> --> |
| | | <image |
| | | src="/static/images/resourceDetailsMyAudio/play@2x.png" |
| | | mode="" |
| | | /> |
| | | ======= |
| | | <view class="audioIconBox color" style="margin-left: 30rpx; margin-right: 10rpx"> |
| | | <view wx:if="{{!isplay}}" bind:tap="play"> |
| | | <t-icon name="play-circle-stroke" size="24" /> |
| | | >>>>>>> Stashed changes |
| | | </view> |
| | | <view wx:else bind:tap="stop" class="pauseCircleBox"> |
| | | <!-- <t-icon name="pause-circle-stroke" size="24" /> --> |
| | | <image |
| | | src="/static/images/resourceDetailsMyAudio/zanting@2x.png" |
| | | mode="" |
| | | /> |
| | | <image src="/static/images/resourceDetailsMyAudio/zanting@2x.png" mode="" /> |
| | | </view> |
| | | </view> |
| | | <slider style="width: 300rpx" activeColor="#FF6C00" class="mp-slider-bar" block-size="16" value="{{myAudioPos}}" bindchange="hanle_slider_change"></slider> |
| | |
| | | <view class="item"> |
| | | <text class="label">姓名:</text> |
| | | <view class="item-content"> |
| | | <t-input placeholder="请输入真实姓名" borderless value="{{contactInfo.fullName}}" bindchange="onFullNameInput" /> |
| | | <t-input placeholder="请输入真实姓名" borderless adjust-position="false" value="{{contactInfo.fullName}}" bindchange="onFullNameInput" /> |
| | | </view> |
| | | </view> |
| | | <view class="item"> |
| | | <text class="label">联系电话:</text> |
| | | <view class="item-content"> |
| | | <t-input placeholder="输入联系电话" borderless value="{{contactInfo.phone}}" type="number" tips="{{phoneError ? '手机号输入不正确' : ''}}" bindchange="onPhoneInput" /> |
| | | <t-input placeholder="输入联系电话" borderless adjust-position="false" value="{{contactInfo.phone}}" type="number" tips="{{phoneError ? '手机号输入不正确' : ''}}" bindchange="onPhoneInput" /> |
| | | </view> |
| | | </view> |
| | | <view class="item"> |
| | | <text class="label">详细地址:</text> |
| | | <view class="item-content"> |
| | | <t-input placeholder="请输入详细地址" borderless value="{{contactInfo.detailedAddress}}" bindchange="onAddressInput" /> |
| | | <t-input placeholder="请输入详细地址" borderless adjust-position="false" value="{{contactInfo.detailedAddress}}" bindchange="onAddressInput" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | <view class="from-item"> |
| | | <view class="label"> 学校: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="请输入学校" borderless value="{{teacherInfo.schoolName}}" disabled="{{!editState}}" bindchange="onSchoolNameInput" /> |
| | | <t-input placeholder="请输入学校" borderless adjust-position="false" value="{{teacherInfo.schoolName}}" disabled="{{!editState}}" bindchange="onSchoolNameInput" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 真实姓名: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="请输入真实姓名" borderless value="{{teacherInfo.fullName}}" disabled="{{!editState}}" bindchange="onFullNameInput" /> |
| | | <t-input placeholder="请输入真实姓名" borderless adjust-position="false" value="{{teacherInfo.fullName}}" disabled="{{!editState}}" bindchange="onFullNameInput" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | |
| | | <view class="from-item"> |
| | | <view class="label"> 任教课程: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="请输入任教课程" borderless value="{{teacherInfo.courseName}}" bindchange="onCourseNameInput" disabled="{{!editState}}" /> |
| | | <t-input placeholder="请输入任教课程" borderless adjust-position="false" value="{{teacherInfo.courseName}}" bindchange="onCourseNameInput" disabled="{{!editState}}" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 手机号: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="输入手机号码" borderless value="{{teacherInfo.phone}}" type="number" tips="{{phoneError ? '手机号输入不正确' : ''}}" bindchange="onPhoneInput" disabled="{{!editState}}" /> |
| | | <t-input placeholder="输入手机号码" borderless adjust-position="false" value="{{teacherInfo.phone}}" type="number" tips="{{phoneError ? '手机号输入不正确' : ''}}" bindchange="onPhoneInput" disabled="{{!editState}}" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 座机: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="输入座机号" borderless value="{{teacherInfo.telphone}}" tips="{{telphoneError ? '座机号输入不正确' : ''}}" bindchange="onTelphoneInput" disabled="{{!editState}}" /> |
| | | <t-input placeholder="输入座机号" borderless value="{{teacherInfo.telphone}}" adjust-position="false" tips="{{telphoneError ? '座机号输入不正确' : ''}}" bindchange="onTelphoneInput" disabled="{{!editState}}" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 邮箱: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="输入邮箱" borderless value="{{teacherInfo.email}}" tips="{{emailError ? '邮箱输入不正确' : ''}}" bindchange="onEmailInput" disabled="{{!editState}}" /> |
| | | <t-input placeholder="输入邮箱" borderless adjust-position="false" value="{{teacherInfo.email}}" tips="{{emailError ? '邮箱输入不正确' : ''}}" bindchange="onEmailInput" disabled="{{!editState}}" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 详细地址: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="请输入详细地址" borderless value="{{teacherInfo.detailedAddress}}" bindchange="onAddressInput" disabled="{{!editState}}" /> |
| | | <t-input placeholder="请输入详细地址" borderless adjust-position="false" value="{{teacherInfo.detailedAddress}}" bindchange="onAddressInput" disabled="{{!editState}}" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | isBackTop: false, |
| | | setScrollValue: 0, |
| | | skeletonLoding: true, |
| | | queryFilter: [] |
| | | queryFilter: [], |
| | | isPaySuccess: false, |
| | | isPayComplete: false, |
| | | }, |
| | | |
| | | /** |
| | |
| | | }, |
| | | "complete": function (res) { |
| | | if (res.errMsg == 'requestPayment:ok') { |
| | | that.setData({ |
| | | isPayComplete: true |
| | | }) |
| | | that.getDataList(false) |
| | | } |
| | | if (that.data.isPaySuccess && that.data.isPayComplete) { |
| | | that.navToBack() |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | navToActivityDetail(e) { |
| | | console.log(item) |
| | | let { |
| | | info |
| | | } = e.currentTarget.dataset |
| | | wx.navigateTo({ |
| | | url: info.link, |
| | | }); |
| | | }, |
| | | |
| | | loadHomePage() { |
| | | fetchHome().then(({ |
| | |
| | | |
| | | // 监听滚动条 |
| | | onScroll(e) { |
| | | console.log(e) |
| | | this.setData({ |
| | | isWhite: true |
| | | }) |
| | | if (e.detail.scrollTop == 0) { |
| | | this.setData({ |
| | | isWhite: false |
| | | isWhite: e.detail.scrollTop > 20 ? true : false |
| | | }) |
| | | } |
| | | // this.setData({ |
| | | // isWhite: e.detail.scrollTop > 20 ? true : false |
| | | // }) |
| | | }, |
| | | |
| | | onScrollToTop(e) { |
| | |
| | | <swiper interval="5000" indicator-dots="true" autoplay="true" circular="true" class="swiper" wx:if="{{bannerList.length > 0}}"> |
| | | <swiper-item wx:for="{{bannerList}}" wx:for-index="index" wx:key="index" data-info="{{item}}" bindtap="navToActivityDetail"> |
| | | <view class="swiperItem"> |
| | | <image src="{{item.value}}" mode="aspectFill" class="img" /> |
| | | <image src="{{item.value}}" mode="widthFix" class="img" /> |
| | | </view> |
| | | </swiper-item> |
| | | </swiper> |
| | |
| | | } |
| | | |
| | | .swiper .img { |
| | | width: auto !important; |
| | | height: auto !important; |
| | | max-width: 100% !important; |
| | | max-height: 100% !important; |
| | | /* max-height: 100% !important; */ |
| | | width: auto !important; |
| | | /* height: auto !important; */ |
| | | position: absolute !important; |
| | | top: 0 !important; |
| | | left: 0 !important; |
| | |
| | | <view class="domainList1"> |
| | | <view wx:for="{{moreMenu}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toPages" data-info="{{item}}" class="listItem"> |
| | | <view class="icon"> |
| | | <image src="{{item.icon}}" mode="aspectFit" class="img" /> |
| | | <image src="{{item.icon}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view class="label"> |
| | | <text>{{item.title}}</text> |
| | |
| | | <view class="domainList2"> |
| | | <view wx:for="{{moreMenu1}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toPages" data-info="{{item}}" class="listItem"> |
| | | <view class="icon"> |
| | | <image src="{{item.icon}}" mode="aspectFit" class="img" /> |
| | | <image src="{{item.icon}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view class="label"> |
| | | <text>{{item.title}}</text> |
| | |
| | | defaultUser = { |
| | | ...teacherInfos, |
| | | nickName: teacherInfos.fullName, |
| | | avatarUrl: teacherInfos.icon, |
| | | icon: teacherInfos.icon, |
| | | userId: res.userId, |
| | | role: 'Teacher', |
| | | roleId: teacherRole.role.id |
| | |
| | | } else if (WeChatInfo) { |
| | | defaultUser = { |
| | | nickName: WeChatInfo.name, |
| | | avatarUrl: WeChatInfo.icon, |
| | | icon: WeChatInfo.icon, |
| | | userId: res.userId, |
| | | } |
| | | } else if (secretData) { |
| | | defaultUser = { |
| | | nickName: secretData.credential, |
| | | avatarUrl: "", |
| | | icon: "", |
| | | userId: res.userId |
| | | } |
| | | } |