| | |
| | | if (isSHow) { |
| | | return false; |
| | | } else { |
| | | return data.saleMethod[0].price > 0 ? true : false; |
| | | return data.saleMethod[0].Price > 0 ? true : false; |
| | | } |
| | | return !isSHow; |
| | | } else { |
| | |
| | | wx.getStorageSync("teachResourcesPath"); |
| | | const parentName = parent ? parent.name : "教学资源"; |
| | | let url; |
| | | if (item.selectType == 'zip') { |
| | | if (this.properties.applyState == 'Normal') { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请前往PC端下载', |
| | | }) |
| | | } else { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请先申请下载', |
| | | }) |
| | | } |
| | | } |
| | | if (this.properties.isShowCheck && this.resourceIsBuy(item)) { |
| | | return false; |
| | | } |
| | |
| | | title: "暂未开始销售,请联系管理员", |
| | | }); |
| | | } |
| | | if (this.properties.tab == "jsek_teachingResources" && item.fileMap) { |
| | | if (this.properties.tab == "jsek_teachingResources" && (item.file || item.freeFile)) { |
| | | let file = item.fileMap[item.file] ? item.fileMap[item.file] : item.fileMap[item.freeFile] |
| | | debugger |
| | | if (file && file.protectType !== "Public") { |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: "资源不可用,请联系管理员", |
| | | }); |
| | | } |
| | | } else { |
| | | } else if ((this.properties.tab == "jsek_teachingResources" || this.properties.tab == "jsek_cloudLearning") && (!item.file || !item.freeFile || !item.protectedFile)) { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '暂无资源', |
| | |
| | | item.freeFile; |
| | | console.log(fileLink, "fileLink"); |
| | | //提示加载中 |
| | | util.showLoading(); |
| | | // 单次下载允许的最大文件为 200MB |
| | | wx.downloadFile({ |
| | | url: fileLink, |
| | |
| | | data-parent="{{''}}" |
| | | > |
| | | <!-- 教学资源 云学习 图标 --> |
| | | <view class="box-image" style="width: 80%"> |
| | | <view class="box-image fl-cn" style="width: 80%"> |
| | | <view |
| | | class="checkBox" |
| | | wx:if="{{isShowCheck}}" |
| | |
| | | /> |
| | | </view> |
| | | <!-- 教学资源图标 --> |
| | | <view class="teach-icon"> |
| | | <view class="teach-icon fl-cn"> |
| | | <image |
| | | wx:if="{{item.selectType == 'audio' || item.learnSelectType == 'audio'}}" |
| | | src="/static/images/bookService/detail/audioIcon.png" |
| | |
| | | <text class="name" style="width: 100%">{{item.name || '-'}}</text> |
| | | </view> |
| | | <!-- 教学资源类型 --> |
| | | <view class="teachClass"> {{item.resourceClass}} </view> |
| | | <view class="teachClass fl-cn"> {{item.resourceClass}} </view> |
| | | <view class="teach-btn" wx:if="{{tab == 'jsek_teachingResources'}}"> |
| | | <!-- 下载按钮 --> |
| | | <!-- <image |
| | |
| | | data-parent="{{item}}" |
| | | > |
| | | <!-- 教学资源 云学习 图标 --> |
| | | <view class="box-image"> |
| | | <view class="box-image fl-cn"> |
| | | <view |
| | | class="checkBox" |
| | | wx:if="{{isShowCheck}}" |
| | |
| | | /> |
| | | </view> |
| | | <!-- 教学资源图标 --> |
| | | <view class="teach-icon"> |
| | | <view class="teach-icon fl-cn"> |
| | | <image |
| | | wx:if="{{citem.selectType == 'audio' || citem.learnSelectType == 'audio'}}" |
| | | src="/static/images/bookService/detail/audioIcon.png" |
| | |
| | | <!-- 名称 --> |
| | | <text |
| | | class="name" |
| | | style="{{ tab == 'jsek_teachingResources' ? citem.resourceClass ? 'width: 420rpx' : 'width: 560rpx;' : 'width: 400rpx;'}}" |
| | | style="{{ tab == 'jsek_teachingResources' ? citem.resourceClass ? 'width: 420rpx' : 'width: 560rpx;' : (citem.isShopCar &&citem.isbuy ) ? 'width: 400rpx;' : (citem.isShopCar ||citem.isbuy) ? 'width:520rpx' : 'width:560rpx'}}" |
| | | >{{citem.name || '-'}}</text |
| | | > |
| | | </view> |
| | | <!-- 教学资源类型 --> |
| | | <view class="teachClass" wx:if="{{citem.resourceClass}}"> |
| | | <view class="teachClass fl-cn" wx:if="{{citem.resourceClass}}"> |
| | | {{citem.resourceClass}} |
| | | </view> |
| | | <view wx:if="{{tab == 'jsek_cloudLearning'}}"> |
| | |
| | | |
| | | .teachClass { |
| | | color: #949494; |
| | | height: 44rpx; |
| | | } |
| | | |
| | | .teach-btn { |
| | |
| | | /* .t-collapse-panel__content { |
| | | padding: var(--td-collapse-content-padding, 0rpx) !important; |
| | | } */ |
| | | |
| | | .fl-cn { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | |
| | | }) |
| | | const dataList = res.datas.cmsDatas[0].datas |
| | | if (dataList.length) { |
| | | const tag = dataList.findIndex(item => this.isShowNeedBuy(item)) |
| | | const tag = dataList.findIndex(item => item.saleMethod.length && item.saleMethod[0].Price > 0) |
| | | this.setData({ |
| | | isGoBuyResource: tag > -1 ? true : false |
| | | }) |
| | |
| | | if (isSHow) { |
| | | return false; |
| | | } else { |
| | | return data.saleMethod[0].price > 0 ? true : false; |
| | | return data.saleMethod[0].Price > 0 ? true : false; |
| | | } |
| | | return !isSHow; |
| | | } else { |
| | |
| | | wx:if="{{bookDetail.content || bookDetail.authorIntroduction}}" |
| | | ></book-brief> |
| | | <view |
| | | wx:if="{{!bookDetail.content && !bookDetail.authorIntroduction}}" |
| | | wx:if="{{!bookDetail.content && !bookDetail.authorIntroduction && !loading}}" |
| | | class="noData" |
| | | > |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | |
| | | loading="{{loading}}" |
| | | ></t-skeleton> |
| | | </view> |
| | | <view wx:if="{{noResources}}" class="noData"> |
| | | <view wx:if="{{noResources && !loading}}" class="noData"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | </t-tab-panel> |
| | |
| | | bind:updateCloudLearning="updateCloudLearning" |
| | | ></tree> |
| | | </view> |
| | | <view wx:if="{{noResources}}" class="noData"> |
| | | <view wx:if="{{noResources && !loading}}" class="noData"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | </t-tab-panel> |
| | |
| | | wx:for-index="index" |
| | | class="pdfItem" |
| | | > |
| | | <image src="{{item}}" alt="" mode="widthFix"></image> |
| | | <image src="{{item}}" alt="" mode="aspectFit"></image> |
| | | </view> |
| | | </view> |
| | | <web-view |
| | |
| | | </view> |
| | | |
| | | <view class="button-example"> |
| | | <t-button size="large" bind:tap="onDownloadButton"> |
| | | <t-button size="large" bind:tap="onDownloadButton" class="download-btn"> |
| | | <view class="text"> 下载 </view> |
| | | </t-button> |
| | | </view> |
| | |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | .download-btn { |
| | | width: 100%; |
| | | } |
| | |
| | | loading: true, |
| | | hidden: true |
| | | }, |
| | | // // 时间格式化 |
| | | // format(t) { |
| | | // let time = Math.floor(t / 60) >= 10 ? Math.floor(t / 60) : '0' + Math.floor(t / 60); |
| | | // t = time + ':' + ((t % 60) / 100).toFixed(2).slice(-2); |
| | | // return t; |
| | | // }, |
| | | |
| | | |
| | | format(time) { |
| | | let minute = Math.floor(time / 60); |
| | | let second = Math.floor(time % 60); |
| | | let second = Math.round(time % 60); |
| | | let minuteStr = minute < 10 ? "0" + minute : "" + minute; |
| | | let secondStr = second < 10 ? "0" + second : "" + second; |
| | | return minuteStr + ":" + secondStr; |
| | |
| | | return formattedDate |
| | | }, |
| | | |
| | | |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | console.log(options); |
| | | wx.setNavigationBarTitle({ |
| | | |
| | | title: '资源详情-音频' |
| | | |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | * |
| | | */ |
| | | onReady() { |
| | | |
| | | |
| | | }, |
| | | onReady() {}, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | |
| | | onShareAppMessage() { |
| | | |
| | | }, |
| | | onTabsChange(event) { |
| | | onTabsChange(event) {}, |
| | | |
| | | }, |
| | | |
| | | onTabsClick(event) { |
| | | |
| | | }, |
| | | onTabsClick(event) {}, |
| | | handleChange(e) { |
| | | this.setData({ |
| | | activeValues: e.detail.value, |
| | | }); |
| | | }, |
| | | onTakeNotes() { |
| | | |
| | | }, |
| | | onTakeNotes() {}, |
| | | showDialog(e) { |
| | | this.setData({ |
| | | submitTitle: this.data.titleName, |
| | |
| | | }, |
| | | |
| | | onVideo(e) { |
| | | // myAudio.destroy(); |
| | | |
| | | this.setData({ |
| | | myAudioCurrent: '00:00', |
| | | myAudioPos: '', |
| | | isplay: false |
| | | }) |
| | | |
| | | const item = e.currentTarget.dataset.item |
| | | if (this.data.showData != '') { |
| | | this.setData({ |
| | |
| | | selectedId: e.currentTarget.dataset.index, |
| | | showData: '' |
| | | }) |
| | | |
| | | if (item.selectType == "audio" || item.learnSelectType === "audio") { |
| | | if (this.data.formPath == 'jsek_cloudLearning') { |
| | | // 这里处理云学习的 |
| | |
| | | showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + item.protectedFile + '&token=' + wx.getStorageSync(app.config.tokenKey) |
| | | }) |
| | | this.pubulicPlayFun() |
| | | |
| | | } else { |
| | | |
| | | |
| | | this.setData({ |
| | | showData: item.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.freeFile |
| | | }) |
| | | this.pubulicPlayFun() |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | |
| | | |
| | | newTopicMessageGet() { |
| | | let query = { |
| | |
| | | |
| | | // 标题改变 |
| | | changeTitle(e) { |
| | | |
| | | this.setData({ |
| | | flag: e.currentTarget.dataset.value |
| | | }) |
| | |
| | | this.getNoteList() |
| | | |
| | | }, |
| | | onTextarea() { |
| | | |
| | | }, |
| | | onTextarea() {}, |
| | | textareaChange(e) { |
| | | this.setData({ |
| | | textvalue: e.detail.value |
| | | }) |
| | | }, |
| | | |
| | | |
| | | // 获取笔记列表 |
| | | async getNoteList() { |
| | |
| | | }, |
| | | // 新建笔记接口 |
| | | async makeNote() { |
| | | |
| | | let topicId |
| | | await app.MG.ugc |
| | | .getProductUserSubmitTopic({ |
| | |
| | | //播放事件 |
| | | myAudio.play(); |
| | | |
| | | |
| | | |
| | | |
| | | // 播放完成处理,按钮变一下 |
| | | myAudio.onEnded((res) => { |
| | | this.setData({ |
| | | speed: 1.0, |
| | | }) |
| | | myAudio.playbackRate = this.data.speed; |
| | | |
| | | this.setData({ |
| | | isplay: true, |
| | | myAudioCurrent: '00:00', |
| | | myAudioPos: '', |
| | | }) |
| | | |
| | | }); |
| | | |
| | | //进度条变化 |
| | | myAudio.onTimeUpdate(() => { |
| | | |
| | | |
| | | |
| | | this.setData({ |
| | | myAudioPos: myAudio.currentTime / myAudio.duration * 100, |
| | | myAudioCurrent: this.format(myAudio.currentTime), |
| | | myAudioDuration: this.format(myAudio.duration), |
| | | }); |
| | | // debugger |
| | | |
| | | console.log(this.data.myAudioPos); |
| | | console.log(myAudio.currentTime, myAudio.duration); |
| | | }) |
| | | |
| | | // if (this.data.myAudioDuration !== this.data.myAudioCurrent) { |
| | | // this.setData({ |
| | | // myAudioPos: myAudio.currentTime / myAudio.duration * 100, |
| | | // myAudioCurrent: this.format(myAudio.currentTime), |
| | | // myAudioDuration: this.format(myAudio.duration), |
| | | // }); |
| | | |
| | | // }else{ |
| | | // myAudio.pause(); |
| | | // this.setData({ |
| | | // isplay: true |
| | | // }); |
| | | // } |
| | | }, |
| | | |
| | | |
| | | //播放 |
| | | play() { |
| | |
| | | isplay: true |
| | | }); |
| | | }, |
| | | |
| | | |
| | | //右切换 |
| | | onLeftSwitch() { |
| | |
| | | speed: 1.0, |
| | | myAudioCurrent: '00:00' |
| | | }) |
| | | console.log('右切换'); |
| | | const index = this.data.threeLeveData.findIndex((item) => item.id == this.data.selectId) |
| | | if (this.data.threeLeveData[index + 1]) { |
| | | this.changeItem(this.data.threeLeveData[index + 1]) |
| | |
| | | |
| | | // 左右切换 |
| | | changeItem(item) { |
| | | |
| | | |
| | | if (this.data.showData != '') { |
| | | this.setData({ |
| | | showData: '' |
| | |
| | | |
| | | // 拖动进度条,到指定位置 |
| | | hanle_slider_change(e) { |
| | | |
| | | const position = e.detail.value; |
| | | var currentTime = position / 100 * myAudio.duration; |
| | | myAudio.seek(currentTime); |
| | |
| | | myAudioPos: position, |
| | | myAudioCurrent: this.format(currentTime) |
| | | }) |
| | | |
| | | |
| | | |
| | | }, |
| | | |
| | | |
| | | toggleDropdown() { |
| | | this.setData({ |
| | | showDropdown: !this.data.showDropdown |
| | | }); |
| | | |
| | | }, |
| | | smallSpeed() { |
| | | this.setData({ |
| | |
| | | formPath: '', |
| | | loading: true, |
| | | hidden: true, |
| | | videoError: false |
| | | videoError: false, |
| | | videoLoaidng: false |
| | | }, |
| | | // 格式化笔记时间 |
| | | convertTimestamp(timestamp) { |
| | |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | | console.log(options, 'options'); |
| | | this.setData({ |
| | | navBarHeight: navBarHeight, |
| | | barHeight: systInfo.statusBarHeight, |
| | |
| | | parentName: options.parentName, |
| | | }) |
| | | } |
| | | console.log(options, 'options'); |
| | | this.resourceDetailsData() |
| | | this.getNoteList() |
| | | }, |
| | |
| | | wx.navigateBack(); |
| | | }, |
| | | resourceDetailsData() { |
| | | this.setData({ |
| | | videoLoaidng: true |
| | | }) |
| | | let query = { |
| | | path: '*', |
| | | queryType: '*', |
| | |
| | | } |
| | | app.MG.store.getProductDetail(query).then(res => { |
| | | res.datas.cmsDatas[0].datas.forEach((item) => { |
| | | console.log(item); |
| | | if (item.selectType === "video" || item.learnSelectType === "video") { |
| | | this.data.threeLeveData.push(item) |
| | | this.setData({ |
| | |
| | | onVideo(e) { |
| | | const item = e.currentTarget.dataset.item |
| | | this.setData({ |
| | | videoLoaidng: true, |
| | | selectedId: e.currentTarget.dataset.index, |
| | | showData: '', |
| | | titleName: item.name |
| | |
| | | textvalue: e.detail.value |
| | | }) |
| | | }, |
| | | |
| | | |
| | | // 获取笔记列表 |
| | | async getNoteList() { |
| | | // this.setData({ |
| | |
| | | this.setData({ |
| | | videoError: true |
| | | }); |
| | | }, |
| | | loadedmetadata(e) { |
| | | this.setData({ |
| | | videoLoaidng: false |
| | | }) |
| | | } |
| | | }) |
| | |
| | | "t-textarea": "tdesign-miniprogram/textarea/textarea", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-popup": "tdesign-miniprogram/popup/popup", |
| | | "t-empty": "tdesign-miniprogram/empty/empty" |
| | | "t-empty": "tdesign-miniprogram/empty/empty", |
| | | "t-skeleton": "tdesign-miniprogram/skeleton/skeleton" |
| | | } |
| | | } |
| | |
| | | <import src="index.skeleton.wxml" /> |
| | | <template is="skeleton" wx:if="{{loading}}" /> |
| | | |
| | | <view wx:if="{{!hidden}}"> |
| | | <view wx:if="{{!loading}}"> |
| | | <!-- <view style="width: 100%; height: {{barHeight}}px; "></view> |
| | | <view class="nacigationBar" style="width: 100%; height: {{navBarHeight}}px;"> |
| | | <view> |
| | |
| | | <view class="videoBox" wx:if="{{videoChange}}"> |
| | | <!-- autoplay='false' 是否自动播放 --> |
| | | <!-- <video binderror="videoErrorCallback" src="{{showData}}" play-btn-position='center' object-fit='fill' controls enable-play-gesture enable-auto-rotation></video> --> |
| | | <video src="{{showData}}"></video> |
| | | <view wx:if="{{videoLoaidng}}" class="video-loading"> |
| | | <t-loading |
| | | theme="circular" |
| | | size="60rpx" |
| | | class="wrapper" |
| | | loading="{{videoLoaidng}}" |
| | | /> |
| | | </view> |
| | | <video |
| | | show-center-play-btn="{{false}}" |
| | | src="{{showData}}" |
| | | bindloadedmetadata="loadedmetadata" |
| | | ></video> |
| | | </view> |
| | | |
| | | <view wx:if="{{!videoChange}}" class="videoSubsidiaryBox"> |
| | |
| | | |
| | | .videoBox { |
| | | width: 100%; |
| | | position: relative; |
| | | } |
| | | |
| | | .video-loading { |
| | | position: absolute; |
| | | top: 42%; |
| | | left: 50%; |
| | | z-index: 9999999999; |
| | | } |
| | | |
| | | .videoBox video { |
| | |
| | | }, |
| | | onResetSecond() { |
| | | this.setData({ |
| | | skeletonLoding: true, |
| | | pathList: [], |
| | | 'secondList.value': [], |
| | | }); |
| | |
| | | }, |
| | | |
| | | getPhoneCode() { |
| | | if (this.data.countDown > 0) return false |
| | | if (this.data.userInfoForm.phone && this.data.userInfoForm.captcha) { |
| | | app.MG.identity |
| | | .getPhoneCode({ |
| | |
| | | </view> |
| | | <view class="itemList"> |
| | | <view class="label">用户名</view> |
| | | <view class="content" data-info="{{'nickName'}}" bindtap="editUserInfo">{{userInfo.nickName || '微信用户'}}</view> |
| | | <view class="content" data-info="{{'nickName'}}" bindtap="editUserInfo" |
| | | >{{userInfo.nickName || '微信用户'}}</view |
| | | > |
| | | <t-icon name="chevron-right" size="40rpx" color="#C2C2C2" /> |
| | | </view> |
| | | <view class="itemList"> |
| | | <view class="label">手机号码</view> |
| | | <view class="content" data-info="{{'phone'}}" bindtap="editUserInfo">{{userInfo.phoneNumber || '未绑定手机号'}}</view> |
| | | <t-icon name="chevron-right" size="40rpx" color="#C2C2C2" data-info="{{'phone'}}" bindtap="editUserInfo" /> |
| | | <view class="content" data-info="{{'phone'}}" bindtap="editUserInfo" |
| | | >{{userInfo.phoneNumber || '未绑定手机号'}}</view |
| | | > |
| | | <t-icon |
| | | name="chevron-right" |
| | | size="40rpx" |
| | | color="#C2C2C2" |
| | | data-info="{{'phone'}}" |
| | | bindtap="editUserInfo" |
| | | /> |
| | | </view> |
| | | <view class="itemList"> |
| | | <view class="label">邮箱</view> |
| | | <view class="content" data-info="{{'email'}}" bindtap="editUserInfo">{{userInfo.Email}}</view> |
| | | <t-icon name="chevron-right" size="40rpx" color="#C2C2C2" data-info="{{'email'}}" bindtap="editUserInfo" /> |
| | | <view class="content" data-info="{{'email'}}" bindtap="editUserInfo" |
| | | >{{userInfo.Email}}</view |
| | | > |
| | | <t-icon |
| | | name="chevron-right" |
| | | size="40rpx" |
| | | color="#C2C2C2" |
| | | data-info="{{'email'}}" |
| | | bindtap="editUserInfo" |
| | | /> |
| | | </view> |
| | | <!-- <t-popup visible="{{userInfoBox}}" bind:visible-change="onVisibleChange" placement="center"> |
| | | <view class="block"> |
| | |
| | | <t-icon t-class="close-btn" name="close-circle" size="32" color="#fff" bind:tap="onCloseProtocol" /> |
| | | </view> |
| | | </t-popup> --> |
| | | |
| | | </view> |
| | | <view class="popup-box" wx:if="{{userInfoBox}}" bindtap="onCloseProtocol"></view> |
| | | <view |
| | | class="popup-box" |
| | | wx:if="{{userInfoBox}}" |
| | | bindtap="onCloseProtocol" |
| | | ></view> |
| | | <view class="info-center" style="top:{{height*0.3}}px;" wx:if="{{userInfoBox}}"> |
| | | <view> |
| | | <view class="row-info"> |
| | |
| | | <view class="label"> 昵称: </view> |
| | | <view class="item-content"> |
| | | <view class="inputBox1"> |
| | | <t-input placeholder="输入昵称" borderless value="{{userInfoForm.nickName}}" bindchange="onNameInput" /> |
| | | <t-input |
| | | placeholder="输入昵称" |
| | | borderless |
| | | value="{{userInfoForm.nickName}}" |
| | | bindchange="onNameInput" |
| | | /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | <view class="label"> 手机号: </view> |
| | | <view class="item-content"> |
| | | <view class="outsideInputBox1"> |
| | | |
| | | <view class="inputBox1"> |
| | | <t-input placeholder="输入手机号码" borderless value="{{userInfoForm.phone}}" type="number" bindchange="onPhoneInput" /> |
| | | <t-input |
| | | placeholder="输入手机号码" |
| | | borderless |
| | | value="{{userInfoForm.phone}}" |
| | | type="number" |
| | | bindchange="onPhoneInput" |
| | | /> |
| | | </view> |
| | | <view wx:if="{{phoneError}}" style="font-size: 24rpx; color: red;">手机号输入不正确</view> |
| | | |
| | | |
| | | <view wx:if="{{phoneError}}" style="font-size: 24rpx; color: red" |
| | | >手机号输入不正确</view |
| | | > |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | <view class="from-item" wx:if="{{editType == 'email'}}"> |
| | |
| | | <view class="item-content"> |
| | | <view class="outsideInputBox1"> |
| | | <view class="inputBox1"> |
| | | <t-input placeholder="输入邮箱" borderless value="{{userInfoForm.email}}" bindchange="onEmailInput" /> |
| | | |
| | | <t-input |
| | | placeholder="输入邮箱" |
| | | borderless |
| | | value="{{userInfoForm.email}}" |
| | | bindchange="onEmailInput" |
| | | /> |
| | | </view> |
| | | <view wx:if="{{emailError}}" style="font-size: 24rpx; color: red;">邮箱输入不正确</view> |
| | | <view wx:if="{{emailError}}" style="font-size: 24rpx; color: red" |
| | | >邮箱输入不正确</view |
| | | > |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | <view class="from-item" wx:if="{{editType !== 'nickName'}}"> |
| | | <view class="label"> 图形验证码: </view> |
| | | <view class="item-content"> |
| | | <view class="inputBox"> |
| | | <t-input placeholder="输入图形验证码" borderless value="{{userInfoForm.captcha}}" type="number" bindchange="onCaptchaInput" /> |
| | | <t-input |
| | | placeholder="输入图形验证码" |
| | | borderless |
| | | value="{{userInfoForm.captcha}}" |
| | | type="number" |
| | | bindchange="onCaptchaInput" |
| | | /> |
| | | </view> |
| | | <view class="code"> |
| | | <image src="{{imgCode}}" class="imgCode hover" bindtap="getImgCapcha" /> |
| | | <image |
| | | src="{{imgCode}}" |
| | | class="imgCode hover" |
| | | bindtap="getImgCapcha" |
| | | /> |
| | | </view> |
| | | </view> |
| | | |
| | | </view> |
| | | <view class="from-item" wx:if="{{editType == 'phone'}}"> |
| | | <view class="label"> 短信验证码: </view> |
| | | <view class="item-content"> |
| | | <view class="inputBox"> |
| | | <t-input placeholder="输入短信验证码" borderless value="{{userInfoForm.code}}" type="number" bindchange="onCodeInput" /> |
| | | <t-input |
| | | placeholder="输入短信验证码" |
| | | borderless |
| | | value="{{userInfoForm.code}}" |
| | | type="number" |
| | | bindchange="onCodeInput" |
| | | /> |
| | | </view> |
| | | <view class="code"> |
| | | <button class="{{countDown > 0 ? ' disabled' : 'btn'}}" bindtap="getPhoneCode">{{countDown > 0 ? '验证码(' + countDown + 's)' : '获取短信验证码'}}</button> |
| | | <button |
| | | disabled="{{countDown > 0}}" |
| | | class="{{countDown > 0 ? ' disabled' : 'btn'}}" |
| | | bindtap="getPhoneCode" |
| | | > |
| | | {{countDown > 0 ? '验证码(' + countDown + 's)' : |
| | | '获取短信验证码'}} |
| | | </button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | <view class="label"> 邮箱验证码: </view> |
| | | <view class="item-content"> |
| | | <view class="inputBox"> |
| | | <t-input placeholder="输入邮箱验证码" borderless value="{{userInfoForm.code}}" type="number" bindchange="onCodeInput" /> |
| | | <t-input |
| | | placeholder="输入邮箱验证码" |
| | | borderless |
| | | value="{{userInfoForm.code}}" |
| | | type="number" |
| | | bindchange="onCodeInput" |
| | | /> |
| | | </view> |
| | | <view class="code"> |
| | | <button class="{{mailCountDown > 0 ? ' disabled' : 'btn'}}" bindtap="getEmailCode"> {{mailCountDown > 0 ? '验证码(' + mailCountDown + 's)' : '获取邮箱验证码'}}</button> |
| | | <button |
| | | disabled="{{mailCountDown > 0}}" |
| | | class="{{mailCountDown > 0 ? ' disabled' : 'btn'}}" |
| | | bindtap="getEmailCode" |
| | | > |
| | | {{mailCountDown > 0 ? '验证码(' + mailCountDown + 's)' : |
| | | '获取邮箱验证码'}} |
| | | </button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | |
| | | .btn { |
| | | width: 190rpx; |
| | | height: 72rpx; |
| | | height: 76rpx; |
| | | padding: 0 10rpx !important; |
| | | background: #ff6c00; |
| | | border: 2rpx solid #ff6c00; |
| | | /* border: 2rpx solid #ff6c00; */ |
| | | /* padding: 0 2rpx; */ |
| | | color: #fff; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .disabled { |
| | | width: 190rpx; |
| | | height: 72rpx; |
| | | height: 76rpx; |
| | | background: #ccc; |
| | | |
| | | color: #000; |
| | | cursor: not-allowed; |
| | | font-size: 28rpx; |
| | |
| | | emailError: false, |
| | | loading: true, //开启骨架屏加载 |
| | | hidden: true, //是否展示内容 |
| | | height: '', |
| | | dialogBox: false, |
| | | inputStyle: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding: 0 0 0 16rpx;height:70rpx', |
| | | }, |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | this.onTabsChange(event) |
| | | var that = this; |
| | | // 动态获取屏幕高度 |
| | | wx.getSystemInfo({ |
| | | success: (result) => { |
| | | that.setData({ |
| | | height: result.windowHeight |
| | | }); |
| | | }, |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | |
| | | onTabsChange(event) { |
| | | const value = event.detail.value |
| | | this.setData({ |
| | | isMore: null, |
| | | tabValue: value, |
| | | }) |
| | | if (value == '0') { |
| | | this.higherGet() |
| | | } else if (value == '1') { |
| | | this.vocationalGet() |
| | | } else if (value == '2') { |
| | | this.teacherGet() |
| | | } |
| | | }, |
| | | //高等教育 |
| | | higherGet(keyword) { |
| | |
| | | }, |
| | | SysType: 'CmsItem' |
| | | }).then(res => { |
| | | |
| | | res.datas.forEach(item => { |
| | | item.determine = true |
| | | }) |
| | |
| | | loading: false, //开启骨架屏加载 |
| | | hidden: false, //是否展示内容 |
| | | }) |
| | | if (res.datas.length < 7 && res.datas.length > 0) { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | } |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | |
| | | vocationalList: res.datas, |
| | | vocationalTotal: res.total |
| | | }) |
| | | if (res.datas.length < 7 && this.datas.length > 0) { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | } |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | |
| | | teacherList: res.datas, |
| | | teacherTotal: res.total |
| | | }) |
| | | if (res.datas.length < 7 && this.datas.length > 0) { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | } |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | |
| | | // }, 2000); |
| | | // }, |
| | | downloadData(event) { |
| | | console.log(this.data.isMore); |
| | | debugger |
| | | const item = event.currentTarget.dataset.item |
| | | if (item.fileType == "pdf") { |
| | | wx.navigateTo({ |
| | |
| | | const key = e.currentTarget.dataset.key; |
| | | const item = e.currentTarget.dataset.item; |
| | | this.setData({ |
| | | Md5: item.datas.freeFile.FileList[0].Md5 |
| | | Md5: item.datas.freeFile.FileList[0].Md5, |
| | | dialogBox: true |
| | | }) |
| | | wx.showModal({ |
| | | title: '请输入邮箱', |
| | | content: '', |
| | | confirmColor: '#ff6c00', |
| | | cancelColor: '#949494', |
| | | placeholderText: '请输入邮箱号', |
| | | editable: true, |
| | | complete: (res) => { |
| | | if (res.cancel) { |
| | | console.log('取消'); |
| | | } |
| | | if (res.confirm) { |
| | | // wx.showModal({ |
| | | // title: '请输入邮箱', |
| | | // content: '', |
| | | // confirmColor: '#ff6c00', |
| | | // cancelColor: '#949494', |
| | | // placeholderText: '请输入邮箱号', |
| | | // editable: true, |
| | | // complete: (res) => { |
| | | // if (res.cancel) { |
| | | // console.log('取消'); |
| | | // } |
| | | // if (res.confirm) { |
| | | // this.setData({ |
| | | // input: res.content |
| | | // }) |
| | | // this.confirmM() |
| | | // } |
| | | // } |
| | | // }) |
| | | }, |
| | | // 弹窗取消 |
| | | closeDialog() { |
| | | this.setData({ |
| | | input: res.content |
| | | }) |
| | | this.confirmM() |
| | | } |
| | | } |
| | | dialogBox: false |
| | | }) |
| | | }, |
| | | //提交 |
| | | confirmM(e) { |
| | | const isEmailValid = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(this.data.input); |
| | | if (isEmailValid && this.data.input) { |
| | | this.setData({ |
| | | dialogBox: false |
| | | }) |
| | | let query = { |
| | | eMail: this.data.input, |
| | | md5s: [this.data.Md5] |
| | |
| | | }); |
| | | } |
| | | }, |
| | | inputChange(e) { |
| | | this.setData({ |
| | | input: e.detail.value |
| | | }) |
| | | } |
| | | }) |
| | |
| | | scroll-y="{{true}}" |
| | | wx:else |
| | | class="scroll-box" |
| | | refresher-enabled="{{true}}" |
| | | lower-threshold="{{200}}" |
| | | refresher-threshold="{{80}}" |
| | | refresher-default-style="none" |
| | | refresher-triggered="{{triggered}}" |
| | | bindscrolltolower="onReachBottom" |
| | |
| | | scroll-y="{{true}}" |
| | | wx:else |
| | | class="scroll-box" |
| | | refresher-enabled="{{true}}" |
| | | lower-threshold="{{200}}" |
| | | refresher-threshold="{{80}}" |
| | | refresher-default-style="none" |
| | | refresher-triggered="{{triggered}}" |
| | | bindscrolltolower="onReachBottom" |
| | |
| | | scroll-y="{{true}}" |
| | | wx:else |
| | | class="scroll-box" |
| | | refresher-enabled="{{true}}" |
| | | lower-threshold="{{200}}" |
| | | refresher-threshold="{{80}}" |
| | | refresher-default-style="none" |
| | | refresher-triggered="{{triggered}}" |
| | | bindscrolltolower="onReachBottom" |
| | |
| | | </view> |
| | | </view> |
| | | <t-toast id="t-toast" /> |
| | | |
| | | <!-- 弹窗 --> |
| | | <view class="info-center" style="top:{{height*0.3}}px;" wx:if="{{dialogBox}}"> |
| | | <view> |
| | | <view class="row-info"> |
| | | <view class="body"> |
| | | <view class="dialog-title">请输入邮箱</view> |
| | | <view class="input-box"> |
| | | <t-input |
| | | style="{{inputStyle}}" |
| | | class="input" |
| | | placeholder="请输入联系方式" |
| | | value="{{input}}" |
| | | bind:change="inputChange" |
| | | ></t-input> |
| | | </view> |
| | | </view> |
| | | <view class="row-btn"> |
| | | <view class="left-btn" bindtap="closeDialog">取消</view> |
| | | <view class="right-btn" bindtap="confirmM">确认</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | } |
| | | |
| | | .higherTextBox { |
| | | height: 55rpx; |
| | | height: 48rpx; |
| | | font-weight: bold; |
| | | font-size: 25rpx; |
| | | color: #333333; |
| | |
| | | height: calc(100vh - 264rpx - env(safe-area-inset-bottom)); |
| | | padding-bottom: env(safe-area-inset-bottom); |
| | | } |
| | | |
| | | .info-center { |
| | | position: fixed; |
| | | z-index: 999; |
| | | background-color: white; |
| | | align-items: center; |
| | | justify-content: center; |
| | | border-radius: 10rpx; |
| | | width: 80%; |
| | | margin-left: 10%; |
| | | margin-right: 10%; |
| | | } |
| | | |
| | | .row-btn { |
| | | width: 100%; |
| | | display: flex; |
| | | flex-direction: row; |
| | | align-items: center; |
| | | border-top: 1rpx solid #f1f1f1; |
| | | } |
| | | |
| | | .row-btn view { |
| | | flex: 1; |
| | | text-align: center; |
| | | margin: 20rpx 10%; |
| | | padding: 12rpx 0; |
| | | font-size: 32rpx; |
| | | border-radius: 10rpx; |
| | | } |
| | | |
| | | .left-btn { |
| | | background-color: #f1f1f1; |
| | | color: #5C5C5C; |
| | | } |
| | | |
| | | .right-btn { |
| | | background-color: #ff6c00; |
| | | color: white; |
| | | } |
| | | |
| | | .row-info .body { |
| | | min-height: 100rpx; |
| | | } |
| | | |
| | | .dialog-title { |
| | | padding: 20rpx 0; |
| | | text-align: center; |
| | | font-size: 36rpx; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .input-box { |
| | | width: 100%; |
| | | margin-bottom: 16rpx; |
| | | } |
| | | |
| | | .input { |
| | | --td-input-border-radius: 20rpx; |
| | | border-radius: 20rpx; |
| | | } |
| | |
| | | .t-radio { |
| | | font-size: var(--td-radio-font-size, 28rpx) !important; |
| | | } |
| | | |
| | | .t-icon-base { |
| | | font-size: 44rpx; |
| | | } |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | wx.setNavigationBarTitle({ |
| | | title: '提交订单' |
| | | }); |
| | | |
| | | |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | |
| | | wx.navigateBack(); |
| | | }, |
| | | |
| | | |
| | | // 金额显示.00格式 |
| | | numFormat(value) { |
| | | if (!value) return "0.00"; |
| | | value = Number(value).toFixed(2); |
| | | var intPart = Math.trunc(value); // 获取整数部分 |
| | | var intPartFormat = intPart |
| | | .toString() |
| | | .replace(/(\d)(?=(?:\d{3})+$)/g, "$1,"); // 将整数部分逢三一断 |
| | | var floatPart = ".00"; // 预定义小数部分 |
| | | var value2Array = value.split("."); |
| | | // =2表示数据有小数位 |
| | | if (value2Array.length === 2) { |
| | | floatPart = value2Array[1].toString(); // 拿到小数部分 |
| | | if (floatPart.length === 1) { |
| | | return `${intPartFormat}.${floatPart}0`; |
| | | } |
| | | return `${intPartFormat}.${floatPart}`; |
| | | } |
| | | return intPartFormat + floatPart; |
| | | }, |
| | | getOrderByOrderNumData() { |
| | | console.log(this.data.orderNumber, 'this.data.orderNumber'); |
| | | let query = { |
| | |
| | | } |
| | | } |
| | | app.MG.store.getOrderByOrderNum(query).then(res => { |
| | | console.log(res, 'res'); |
| | | this.setData({ |
| | | orderGoods: res.orderNumber |
| | | }) |
| | | console.log(this.data.orderGoods, 'res.orderNumber'); |
| | | |
| | | console.log(res.payPrice); |
| | | this.setData({ |
| | | payPrice: res.payPrice.toFixed(2), |
| | | ImmediatelyReceive: res.payPrice |
| | | }) |
| | | console.log(this.data.ImmediatelyReceive); |
| | | res.saleMethodLinks.forEach(item => { |
| | | // console.log(item.type, 'item.type'); |
| | | |
| | | const type = item.orderSaleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product'; |
| | | item.type = type; // 将type设置为item对象的属性,而不是使用setData |
| | | item.paymentIcon = getPublicImage(item.orderSaleMethod.product.icon) |
| | | console.log(item.type, 'item'); |
| | | item.payPrice = this.numFormat(item.payPrice) |
| | | console.log(item, 'item'); |
| | | }) |
| | | this.setData({ |
| | | productList: res.saleMethodLinks, |
| | | // type: item.orderSaleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product' |
| | | loading: false, |
| | | hidden: false, |
| | | }) |
| | |
| | | <template is="skeleton" wx:if="{{loading}}" /> |
| | | |
| | | <view hidden="{{hidden}}"> |
| | | |
| | | <!-- <view class="titleBox"> |
| | | <view style="width: 100%; height: {{barHeight}}px; "></view> |
| | | <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> |
| | |
| | | |
| | | <view class="paymentPageBox"> |
| | | <view class="content"> |
| | | |
| | | <view class="shoppingCartList"> |
| | | <view class="cartList" wx:for="{{productList}}" wx:key="index" wx:for-item="item" wx:for-index="index"> |
| | | <view |
| | | class="cartList" |
| | | wx:for="{{productList}}" |
| | | wx:key="index" |
| | | wx:for-item="item" |
| | | wx:for-index="index" |
| | | > |
| | | <view class="imageBox"> |
| | | <image wx:if="{{item.paymentIcon}}" src="{{item.paymentIcon }}" mode="aspectFit" /> |
| | | <image wx:else src="/static/images/default-book-img.png" class="imageStyle" mode="aspectFit" /> |
| | | <image |
| | | wx:if="{{item.paymentIcon}}" |
| | | src="{{item.paymentIcon }}" |
| | | mode="aspectFit" |
| | | /> |
| | | <image |
| | | wx:else |
| | | src="/static/images/default-book-img.png" |
| | | class="imageStyle" |
| | | mode="aspectFit" |
| | | /> |
| | | </view> |
| | | <view class="cartListContent"> |
| | | <view class="cartListDetails"> |
| | | <view wx:if="{{item.type == 'product'}}" style="width: 386rpx;"> |
| | | <view wx:if="{{item.type == 'product'}}" style="width: 386rpx"> |
| | | <view class="boosName"> |
| | | <text class="eBook">电子书</text> |
| | | <text> {{item.orderSaleMethod.product.name}}</text> |
| | | </view> |
| | | </view> |
| | | <view wx:if="{{item.type == 'item'}}" style="width: 386rpx;"> |
| | | <view wx:if="{{item.type == 'item'}}" style="width: 386rpx"> |
| | | <view class="boosName"> |
| | | <text class="cloudLearning">云学习</text> |
| | | <text> {{item.orderSaleMethod.product.name}}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="textBox" wx:if="{{item.type == 'product'}}">图书服务-电子书</view> |
| | | <view class="textBox" wx:if="{{item.type == 'item'}}">图书服务-云学习</view> |
| | | <view class="priceBox">¥{{payPrice}}</view> |
| | | <view class="textBox" wx:if="{{item.type == 'product'}}" |
| | | >图书服务-电子书</view |
| | | > |
| | | <view class="textBox" wx:if="{{item.type == 'item'}}" |
| | | >图书服务-云学习</view |
| | | > |
| | | <view class="priceBox">¥{{item.payPrice}}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | <view> <text>合计: </text> ¥{{payPrice}}</view> |
| | | </view> |
| | | </view> |
| | | |
| | | </view> |
| | | <!-- <view class="interval"></view> --> |
| | | <view class="paymentBox"> |
| | | <view class="residue">待支付:<text class="residueTextBox">¥{{payPrice}}</text></view> |
| | | <view class="residue" |
| | | >待支付:<text class="residueTextBox">¥{{payPrice}}</text></view |
| | | > |
| | | <view> |
| | | <t-button wx:if="{{ImmediatelyReceive === 0}}" class="buttonBox" shape="round" catch:tap="onReceive">立即领取</t-button> |
| | | <t-button wx:else class="buttonBox" shape="round" catch:tap="confirmOrderGet">微信支付</t-button> |
| | | |
| | | <t-button |
| | | wx:if="{{ImmediatelyReceive === 0}}" |
| | | class="buttonBox" |
| | | shape="round" |
| | | catch:tap="onReceive" |
| | | >立即领取</t-button |
| | | > |
| | | <t-button |
| | | wx:else |
| | | class="buttonBox" |
| | | shape="round" |
| | | catch:tap="confirmOrderGet" |
| | | >微信支付</t-button |
| | | > |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | <view class="bookDataAuthor">{{item.author}}</view> |
| | | </view> |
| | | </view> |
| | | <view wx:if="{{bookData.length != 0}}" class="bottom-box"> |
| | | <view wx:if="{{bookData.length}}" class="bottom-box"> |
| | | <t-loading |
| | | theme="circular" |
| | | size="40rpx" |
| | |
| | | } |
| | | |
| | | .scrollViewBox { |
| | | height: calc(100vh - 326rpx); |
| | | /* width: calc(100vw - 60rpx); */ |
| | | height: calc(100vh - 208rpx - env(safe-area-inset-bottom)); |
| | | } |
| | | |
| | | .t-search__input-box--square { |