ys1
litian
2024-04-03 e3fe8b0782e38f760df9b09a52b09d4282e3fa66
ys1
3个文件已修改
26 ■■■■ 已修改文件
packageBookService/pages/components/webView/index.js 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packagePersonal/pages/downloads/index.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packagePersonal/pages/downloads/index.wxss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/components/webView/index.js
@@ -20,6 +20,7 @@
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    console.log(options)
    if (options && options.link) {
      this.setData({
        src: decodeURIComponent(options.link),
@@ -53,7 +54,7 @@
    let that = this;
    var url = "";
    if (data.fileType == 'epub') {
      if (data.bookBuy) {
      if (data.bookBuy == "true") {
        url = app.config.epubUrl +
          "?md5=" +
          data.md5 +
@@ -74,29 +75,29 @@
          "&token=" +
          wx.getStorageSync(app.config.tokenKey) +
          "&recordLocation=" +
          this.data.currentPage + "&freeEpubPage=" + data.freePage
          that.data.currentPage + "&freeEpubPage=" + data.freePage
      }
      this.setData({
      that.setData({
        src: url,
        skeletonLoding: false,
      })
    } else {
      this.setData({
      that.setData({
        navigationBarTitleText: data.fileName
      })
      app.MG.file.getPdfInfo({
        md5: data.md5
      }).then((res) => {
        let pageCount = data.bookBuy ? res.totalPages : Number(data.freePage)
        let pageCount = data.bookBuy == "true" ? res.totalPages : Number(data.freePage)
        console.log(pageCount, "connt")
        if (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)
          }
          console.log(list)
          this.setData({
          that.setData({
            pdfList: list,
            skeletonLoding: false,
          })
@@ -192,7 +193,7 @@
    this.setData({
      pauseTime: Date.now()
    })
    if (wx.getStorageSync(app.config.tokenKey) && epubObj.bookBuy) {
    if (wx.getStorageSync(app.config.tokenKey) && this.data.epubObj.bookBuy) {
      let duration = this.data.pauseTime - this.data.startTime
      this.count(duration)
    }
@@ -205,7 +206,7 @@
    this.setData({
      pauseTime: Date.now()
    })
    if (wx.getStorageSync(app.config.tokenKey) && epubObj.bookBuy) {
    if (wx.getStorageSync(app.config.tokenKey) && this.data.epubObj.bookBuy == 'true') {
      let duration = this.data.pauseTime - this.data.startTime
      this.count(duration)
    }
@@ -220,8 +221,8 @@
      sysType: 'App'
    }
    //阅读商品的id
    if (epubObj.bookId) {
      data.productId = epubObj.bookId
    if (this.data.epubObj.bookId) {
      data.productId = this.data.epubObj.bookId
    }
    //阅读资源的id
    // if (product.cmsItemId) {
packagePersonal/pages/downloads/index.wxml
@@ -10,7 +10,7 @@
        <view class="item-con" data-book="{{item}}" bindtap="goBookDetails">
          <view class="icon">
            <t-image src="{{item.product.icon}}" mode="aspectFill" class="img" wx:if="{{item.product.icon}}" />
            <image class="purchasedIcon" src="/static/images/default-book-img.png" mode="aspectFit" wx:else />
            <image class="img" src="/static/images/default-book-img.png" mode="aspectFit" wx:else />
          </view>
          <view class="titleBox">
            <view class="item-title">{{item.name}}</view>
packagePersonal/pages/downloads/index.wxss
@@ -38,6 +38,7 @@
.titleBox {
  margin-left: 20rpx;
  flex: 1;
}
.titleBox .item-title {