闫增涛
2024-09-19 1674ff52a2874cfdf59bc876290c0d102265ad32
packageDomain/pages/resourceDetails/document/index.js
@@ -70,10 +70,16 @@
    const token = wx.getStorageSync(app.config.tokenKey)
    if (!token) {
      loginInfo(app, (data) => {
        if (data) {} else {}
        if (data) {
          this.resourceDetailsData()
        } else {
          this.resourceDetailsData()
        }
      })
    } else {
      this.resourceDetailsData()
    }
    this.resourceDetailsData()
  },
  /**
@@ -153,9 +159,8 @@
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  },
  onShareAppMessage() {},
  onShareTimeline() {},
  goBack() {
    wx.navigateBack()
  },
@@ -278,7 +283,6 @@
  //刚进来的时候调用
  handleTeachData(item) {
    //图片
    console.log(item, 'item11111');
    if (item.selectType == 'picture') {
      this.setData({
        showData: item.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.freeFile,
@@ -302,13 +306,17 @@
      app.MG.file.getPdfInfo({
        md5: item.file
      }).then((res) => {
        if (res && res.totalPages) {
          for (let i = 0; i < res.totalPages; i++) {
        let naturalResources = []
        if (res && JSON.parse(res).totalPages) {
          for (let i = 0; i < JSON.parse(res).totalPages; i++) {
            const src = app.config.requestCtx + '/file/GetPdfPageImage?md5=' + item.file + '&index=' + (i + 1) + '&dpi=300'
            this.data.naturalResources.push(src)
            // console.log(this.data.naturalResources, ' this.data.naturalResources');
            naturalResources.push(src)
          }
        }
        this.setData({
          naturalResources
        })
        console.log('ppt', this.data.naturalResources);
      })
    }
  },