| | |
| | | this.setData({ |
| | | num: Number(this.data.paperBookList.length) + Number(this.data.electronicBookList.length), |
| | | }); |
| | | if (this.data.bookDetail) { |
| | | if (this.data.bookDetail.id) { |
| | | this.getBookInfo(this.data.bookDetail.id) |
| | | } |
| | | }, |
| | |
| | | }, |
| | | // 获取图书详情 |
| | | getBookInfo(id) { |
| | | console.log(id, "id") |
| | | this.setData({ |
| | | "mockData'.id": 0, |
| | | "mockData.price": 0, |
| | |
| | | let parentData = await app.MG.store.getProductBySaleMethod({ |
| | | saleMethodId: i.id |
| | | }) |
| | | console.log(parentData, 111) |
| | | if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalCourses') { |
| | | item.type = '数字课程' |
| | | } |
| | |
| | | |
| | | }) |
| | | }, |
| | | goBookDetails(e) { |
| | | async goBookDetails(e) { |
| | | const { |
| | | book |
| | | } = e.currentTarget.dataset; |
| | | console.log(book) |
| | | let type = e.currentTarget.dataset.type |
| | | if (type == '数字课程') { |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/index?id=${book.id}&name=${book.name}`, |
| | | url: `/pages/digitalCourses/digitalCoursesDetails/index?id=${book.id}`, |
| | | }); |
| | | } else if (type == '数字教材') { |
| | | wx.navigateTo({ |
| | | url: `/pages/digitalTextbooks/digitalTextbooksDetails/index?id=${book.id}`, |
| | | }); |
| | | } else { |
| | | let tabValue = type == '题库' ? 'questionBank' : type == '云学习' ? 'jsek_cloudLearning' : '' |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/index?id=${book.id}&name=${book.name}&tabValue=${tabValue}`, |
| | | }); |
| | | } |
| | | }, |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | |
| | | <view class="listBox"> |
| | | <scroll-view class="srcolbox" scroll-x scroll-with-animation='true'> |
| | | <view class="order-centent" wx:if="{{items.productList.length > 0}}"> |
| | | <view class="bookBox" wx:for="{{items.productList}}" wx:for-item="itemes" wx:for-index="idx" wx:key="idx" bindtap="goBookDetails" data-book="{{itemes}}"> |
| | | <view class="bookBox" wx:for="{{items.productList}}" wx:for-item="itemes" wx:for-index="idx" wx:key="idx" bindtap="goBookDetails" data-book="{{itemes}}" data-type="{{items.type}}"> |
| | | <view class="leftCon"> |
| | | <!-- 获取图片 --> |
| | | <image class="purchasedIcon" wx:if="{{itemes.icon}}" src="{{itemes.icon}}" mode="aspectFit" /> |