litian
2024-09-07 89d33476c7ab9bf7a4fbad399685652eabd478de
packageBookService/pages/components/webView/index.js
@@ -1,5 +1,8 @@
// packageBookService/pages/components/webView/index.js
const app = getApp()
import {
  loginInfo
} from '../../../../assets/js/login';
Page({
  /**
@@ -21,6 +24,7 @@
   */
  onLoad(options) {
    console.log(options)
    if (options && options.link) {
      this.setData({
        src: decodeURIComponent(options.link),
@@ -32,13 +36,21 @@
        src: ''
      })
      if (options) {
        console.log(options)
        wx.setNavigationBarTitle({
          title: options.fileName,
          skeletonLoding: true
        })
        this.getProgress(options)
      }
    }
    const token = wx.getStorageSync(app.config.tokenKey)
    if (!token) {
      loginInfo(app, (data) => {
        if (data) {
          this.getProgress(options)
        } else {
          this.getProgress(options)
        }
      })
    }
  },
@@ -96,12 +108,10 @@
            const src = app.config.requestCtx + '/file/GetPdfPageImage?md5=' + data.md5 + '&index=' + (i + 1) + '&dpi=300'
            list.push(src)
          }
          console.log(list)
          that.setData({
            pdfList: list,
            skeletonLoding: false,
          })
        }
      })
    }