From 1674ff52a2874cfdf59bc876290c0d102265ad32 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期四, 19 九月 2024 15:40:00 +0800
Subject: [PATCH] document文档资源查看修改

---
 packageDomain/pages/resourceDetails/document/index.wxss               |    8 ++++++++
 packageDomain/pages/resourceDetails/document/index.js                 |    9 ++++++---
 packageDomain/pages/resourceDetails/document/index.wxml               |    8 +++++++-
 packageBookService/pages/bookServices/detail/components/tree/index.js |    2 +-
 packageBookService/pages/bookServices/detail/index.js                 |    1 -
 5 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.js b/packageBookService/pages/bookServices/detail/components/tree/index.js
index 74bb4ae..185b9d2 100644
--- a/packageBookService/pages/bookServices/detail/components/tree/index.js
+++ b/packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -253,7 +253,7 @@
       ) {
         url = "/packageDomain/pages/resourceDetails/myAudio/index";
       }
-      if (item.selectType == "picture") {
+      if (item.selectType == "picture" || item.selectType == 'document') {
         url = "/packageDomain/pages/resourceDetails/document/index";
       }
       wx.navigateTo({
diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js
index f9a7f11..a8a444c 100644
--- a/packageBookService/pages/bookServices/detail/index.js
+++ b/packageBookService/pages/bookServices/detail/index.js
@@ -971,7 +971,6 @@
       },
     }
     app.MG.store.getProductDetailNoChildren(query).then((res) => {
-      console.log('鏈鐞嗚祫婧�', res.datas.cmsDatas[0].datas);
       if (!res.datas.cmsDatas[0].datas.length) {
         return this.setData({
           noResources: true,
diff --git a/packageDomain/pages/resourceDetails/document/index.js b/packageDomain/pages/resourceDetails/document/index.js
index ef0ca54..13930df 100644
--- a/packageDomain/pages/resourceDetails/document/index.js
+++ b/packageDomain/pages/resourceDetails/document/index.js
@@ -283,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,
@@ -307,13 +306,17 @@
       app.MG.file.getPdfInfo({
         md5: item.file
       }).then((res) => {
+        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);
       })
     }
   },
diff --git a/packageDomain/pages/resourceDetails/document/index.wxml b/packageDomain/pages/resourceDetails/document/index.wxml
index a16d7be..e6c3160 100644
--- a/packageDomain/pages/resourceDetails/document/index.wxml
+++ b/packageDomain/pages/resourceDetails/document/index.wxml
@@ -40,8 +40,14 @@
     wx:key="index"
     wx:for-item="item"
     wx:for-index="index"
+    class="img-box"
   >
-    <image src="{{item}}" alt="" style="min-height: 550px"></image>
+    <image
+      src="{{item}}"
+      alt=""
+      style="min-height: 550px"
+      mode="aspectFit"
+    ></image>
     <view class="divider">绗� {{index + 1}} 椤�</view>
   </view>
 </view>
diff --git a/packageDomain/pages/resourceDetails/document/index.wxss b/packageDomain/pages/resourceDetails/document/index.wxss
index 4e92ab4..18efc73 100644
--- a/packageDomain/pages/resourceDetails/document/index.wxss
+++ b/packageDomain/pages/resourceDetails/document/index.wxss
@@ -103,4 +103,12 @@
   75% {
     transform: scale(2.0);
   }
+}
+
+.img-box {
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  box-shadow: 0 3px 6px 1px #00000029;
 }
\ No newline at end of file

--
Gitblit v1.9.1