css
litian
2024-03-29 326467df08eb1af36cce83ac161addaa947e2e82
packageBookService/pages/components/webView/index.js
@@ -44,16 +44,43 @@
  },
  setWebViewSrc: function (data) {
    var url = app.config.epubUrl +
      "?md5=" +
      data.md5 +
      "&bookName=" +
      data.fileName +
      "&url=" + app.config.requestCtx +
      "&token=" +
      wx.getStorageSync(app.config.tokenKey) +
      "&recordLocation=" +
      this.data.currentPage
    var url = "";
    if (data.fileType == 'epub') {
      if (data.bookBuy) {
        url = app.config.epubUrl +
          "?md5=" +
          data.md5 +
          "&bookName=" +
          data.fileName +
          "&url=" + app.config.requestCtx +
          "&token=" +
          wx.getStorageSync(app.config.tokenKey) +
          "&recordLocation=" +
          this.data.currentPage
      } else {
        url = app.config.epubUrl +
          "?md5=" +
          data.md5 +
          "&bookName=" +
          data.fileName +
          "&url=" + app.config.requestCtx +
          "&token=" +
          wx.getStorageSync(app.config.tokenKey) +
          "&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
    })
@@ -96,9 +123,9 @@
            domain: "bookReadProgress",
            key: this.data.epubObj.md5,
            value: JSON.stringify(data),
          },],
          }, ],
        })
        .then((res) => { });
        .then((res) => {});
    }
  },
@@ -108,7 +135,7 @@
      percentage,
      type
    } =
      e.detail.data[0];
    e.detail.data[0];
    if (type == "progress" && type != "backDetail") {
      this.setProgress({
        page: currentLocation,