| | |
| | | const saleData = res.datas.saleMethod.find(item => item.Name.includes('题库')) |
| | | if (saleData && !res.datas.purchasedSaleMethodIdList.includes(saleData.Id)) return wx.showModal({ |
| | | title: '提示', |
| | | content: '请先购买题库再答题', |
| | | content: '请先激活或购买题库再答题', |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | editable: false, //是否显示输入框 |
| | |
| | | wx.showModal({ |
| | | icon: 'error', |
| | | title: '温馨提示', |
| | | content: '请购买题库,即将返回购买页', |
| | | content: '请激活或购买题库,即将返回图书详情页面', |
| | | confirmText: '确定', |
| | | showCancel: false, // 关闭取消按钮 |
| | | success: function (res) { |
| | |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) {} else { |
| | | wx.switchTab({ |
| | | url: '/pages/home/home', |
| | | }) |
| | | } |
| | | }) |
| | | } else {} |
| | | // const token = wx.getStorageSync(app.config.tokenKey) |
| | | // if (!token) { |
| | | // loginInfo(app, (data) => { |
| | | // if (data) {} else { |
| | | // wx.switchTab({ |
| | | // url: '/pages/home/home', |
| | | // }) |
| | | // } |
| | | // }) |
| | | // } else {} |
| | | }, |
| | | |
| | | /** |
| | |
| | | |
| | | submit() { |
| | | let that = this; |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => {}) |
| | | return false |
| | | } |
| | | if (!that.data.teacherInfo.topicName) { |
| | | wx.showToast({ |
| | | title: "请填写选题名称!", |
| | |
| | | if (this.data.storeInfo) query['storeInfo'] = this.data.storeInfo |
| | | app.MG.store.getProductDetail(query).then(async (res) => { |
| | | this.setData({ |
| | | bookDetail: res.datas |
| | | bookDetail: res.datas, |
| | | bookName: res.datas.name, |
| | | }) |
| | | this.resourceDetailsData(); |
| | | }); |
| | |
| | | wx.hideLoading(); |
| | | wx.showModal({ |
| | | title: '温馨提示', |
| | | content: '该资源未购买,将返回购买', |
| | | content: '该资源未激活或购买,即将返回图书详情页面', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | if (this.data.source == 'qrcode') { |
| | |
| | | <view |
| | | class="titleNameBox" |
| | | wx:if="{{selectType != 'webpage' && learnSelectType != 'webpage'}}" |
| | | > |
| | | <view class="titleNameBox" wx:if="{{selectType != 'webpage' && learnSelectType != 'webpage'}}"> |
| | | {{titleName}} |
| | | </view> |
| | | <view |
| | | class="pictureBox" |
| | | wx:if="{{selectType == 'picture' || learnSelectType == 'picture'}}" |
| | | > |
| | | <image |
| | | src="{{showData}}" |
| | | mode="widthFix" |
| | | data-src="{{showData}}" |
| | | bindtap="preview" |
| | | /> |
| | | <view class="pictureBox" wx:if="{{selectType == 'picture' || learnSelectType == 'picture'}}"> |
| | | <image src="{{showData}}" mode="widthFix" data-src="{{showData}}" bindtap="preview" /> |
| | | </view> |
| | | |
| | | <view wx:if="{{selectType == 'zip' || learnSelectType == 'zip'}}"> |
| | |
| | | </view> |
| | | </view> |
| | | |
| | | <view |
| | | wx:if="{{(selectType == 'document' || learnSelectType == 'document') && selectTypeData == 'excel'}}" |
| | | class="excelBox" |
| | | > |
| | | <view |
| | | wx:for="{{naturalResources}}" |
| | | wx:key="key" |
| | | wx:for-item="item" |
| | | wx:for-index="index" |
| | | class="textBox" |
| | | > |
| | | <view |
| | | class="textWidth" |
| | | wx:for="{{item}}" |
| | | wx:key="key1" |
| | | wx:for-index="index1" |
| | | wx:for-item="item1" |
| | | >{{item1}}</view |
| | | > |
| | | <view wx:if="{{(selectType == 'document' || learnSelectType == 'document') && selectTypeData == 'excel'}}" class="excelBox"> |
| | | <view wx:for="{{naturalResources}}" wx:key="key" wx:for-item="item" wx:for-index="index" class="textBox"> |
| | | <view class="textWidth" wx:for="{{item}}" wx:key="key1" wx:for-index="index1" wx:for-item="item1">{{item1}}</view> |
| | | </view> |
| | | </view> |
| | | |
| | | <scroll-view |
| | | wx:if="{{(selectType == 'pdf' || selectType == 'document' || learnSelectType == 'pdf' || learnSelectType == 'document') && selectTypeData != 'excel'}}" |
| | | scroll-y="{{true}}" |
| | | bindscrolltolower="scrolltolower" |
| | | class="scrollBox" |
| | | > |
| | | <view |
| | | wx:for="{{naturalResources}}" |
| | | wx:key="index" |
| | | wx:for-item="item" |
| | | wx:for-index="index" |
| | | class="img-box" |
| | | > |
| | | <image |
| | | src="{{item}}" |
| | | data-src="{{item}}" |
| | | bind:tap="preview" |
| | | alt="" |
| | | style="min-height: 550px; width: 100%" |
| | | mode="aspectFit" |
| | | ></image> |
| | | <scroll-view wx:if="{{(selectType == 'pdf' || selectType == 'document' || learnSelectType == 'pdf' || learnSelectType == 'document') && selectTypeData != 'excel'}}" scroll-y="{{true}}" bindscrolltolower="scrolltolower" class="scrollBox"> |
| | | <view wx:for="{{naturalResources}}" wx:key="index" wx:for-item="item" wx:for-index="index" class="img-box"> |
| | | <image src="{{item}}" data-src="{{item}}" bind:tap="preview" alt="" style="min-height: 550px; width: 100%" mode="aspectFit"></image> |
| | | <view class="divider">第 {{index + 1}} 页</view> |
| | | </view> |
| | | <!-- <web-view src="{{pdfSrc}}" id="web-view-pdf" /> --> |
| | | </scroll-view> |
| | | |
| | | <web-view |
| | | wx:if="{{selectType == 'webpage' || learnSelectType == 'webpage'}}" |
| | | src="{{webpageSrc}}" |
| | | ></web-view> |
| | | <web-view wx:if="{{selectType == 'webpage' || learnSelectType == 'webpage'}}" src="{{webpageSrc}}"></web-view> |
| | | <!-- <button bind:tap="handleTap">点位</button> --> |
| | | |
| | | <!-- <t-button theme="primary" size="large" variant="outline" block>基础图片预览</t-button> --> |
| | | <t-toast id="t-toast" /> |
| | | <t-image-viewer |
| | | usingCustomNavbar |
| | | deleteBtn="{{deleteBtn}}" |
| | | closeBtn="{{closeBtn}}" |
| | | showIndex="{{showIndex}}" |
| | | visible="{{visible}}" |
| | | images="{{images}}" |
| | | bind:change="onChange" |
| | | bind:delete="onDelete" |
| | | bind:close="onClose" |
| | | ></t-image-viewer> |
| | | <t-image-viewer usingCustomNavbar deleteBtn="{{deleteBtn}}" closeBtn="{{closeBtn}}" showIndex="{{showIndex}}" visible="{{visible}}" images="{{images}}" bind:change="onChange" bind:delete="onDelete" bind:close="onClose"></t-image-viewer> |
| | | |
| | | <t-dialog |
| | | class="prompDialog" |
| | | visible="{{promptVisable}}" |
| | | title="提示" |
| | | content="试看结束,请购买正式资源" |
| | | confirm-btn="{{ confirmBtn }}" |
| | | bind:confirm="closePromapDialog" |
| | | /> |
| | | <t-dialog class="prompDialog" visible="{{promptVisable}}" title="提示" content="试看结束,请购买正式资源" confirm-btn="{{ confirmBtn }}" bind:confirm="closePromapDialog" /> |
| | |
| | | app.MG.store.getProductDetail(query).then(async (res) => { |
| | | this.setData({ |
| | | bookDetail: res.datas, |
| | | bookName: res.datas.name, |
| | | buyIdList: res.datas.purchasedSaleMethodIdList, |
| | | learnClassData: res.datas.cmsDatas[0].datas.find(item => item.refCode == "jsek_cloudLearning") |
| | | }) |
| | |
| | | wx.hideLoading(); |
| | | wx.showModal({ |
| | | title: '温馨提示', |
| | | content: '该资源未购买,将返回购买', |
| | | content: '该资源未激活或购买,即将返回图书详情页面', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | if (this.data.source == 'qrcode') { |
| | |
| | | try { |
| | | this.setData({ |
| | | bookDetail: res.datas, |
| | | bookName: res.datas.name, |
| | | buyIdList: res.datas.purchasedSaleMethodIdList, |
| | | learnClassData: res.datas.cmsDatas[0].datas.length > 0 ? res.datas.cmsDatas[0].datas.find(item => item.refCode == "jsek_cloudLearning") : null |
| | | }) |
| | |
| | | } catch (error) { |
| | | console.log(error) |
| | | } |
| | | |
| | | }); |
| | | }, |
| | | // 教学资源 云学习 获取 |
| | |
| | | goBack() { |
| | | wx.navigateBack(); |
| | | }, |
| | | |
| | | |
| | | async getBuyCmsItem() { |
| | | let cmsItemData = null |
| | | let query = { |
| | |
| | | wx.hideLoading(); |
| | | wx.showModal({ |
| | | title: '温馨提示', |
| | | content: '该资源未购买,将返回购买', |
| | | content: '该资源未激活或购买,即将返回图书详情页面', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | if (this.data.source == 'qrcode') { |
| | |
| | | } else { |
| | | cmsItemData = dataList[0] |
| | | } |
| | | |
| | | return cmsItemData |
| | | }, |
| | | |
| | | resourceDetailsData() { |
| | | this.setData({ |
| | | videoLoading: true, |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | onVideo(e) { |
| | | this.setPlayerList() |
| | | const item = e.currentTarget.dataset.item |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | addCart(e) { |
| | | const { |
| | | info |
| | |
| | | <image src="https://jsek.bnuic.com/home/image/home-bg.png" mode="heightFix" class="image" /> |
| | | </view> |
| | | <view class="search"> |
| | | <image class="icon" src="/static/images/home/nav_icon_scan.png" bindtap="onIconScanTap" /> |
| | | <image class="icon" src="/static/images/home/nav_icon_scan.png" bindtap="onIconScanTap" mode="aspectFit" /> |
| | | <t-search t-class-input="t-search__input" t-class-input-container="t-search__input-container" placeholder="请输入关键词/书名/ISBN/作者/项目负责人" leftIcon="" bind:submit="onRetrievalPage" model:value="{{searchVal}}"> |
| | | <t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" bind:tap="onRetrievalPage" /> |
| | | </t-search> |
| | |
| | | background: #fff !important; |
| | | font-size: 28rpx !important; |
| | | flex: 1; |
| | | width: 85vw; |
| | | width: 82vw; |
| | | margin-left: 20rpx; |
| | | } |
| | | |
| | | .home-page-header .search .icon { |
| | | width: 40rpx; |
| | | height: 40rpx; |
| | | width: 60rpx; |
| | | height: 60rpx; |
| | | |
| | | } |
| | | |