From 40b16e5fc85c445e0f21cfb75c10f6839fbacdfe Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期五, 22 十一月 2024 10:48:21 +0800
Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/TextbookReader

---
 src/assets/images/resource/jy2.fbx   |    0 
 src/views/readerPages/webHome.vue    |  149 ++++++++++++++++++++++++++++++++++++++-----------
 src/child.ts                         |   10 ++
 src/views/readerPages/mobileHome.vue |    1 
 4 files changed, 124 insertions(+), 36 deletions(-)

diff --git a/src/assets/images/resource/jy2.fbx b/src/assets/images/resource/jy2.fbx
new file mode 100644
index 0000000..628718d
--- /dev/null
+++ b/src/assets/images/resource/jy2.fbx
Binary files differ
diff --git a/src/child.ts b/src/child.ts
index 67dd7f9..e5e4b52 100644
--- a/src/child.ts
+++ b/src/child.ts
@@ -65,9 +65,15 @@
     container: '#container',
     activeRule: '/home' //鍖归厤鎵�鏈変互/subPath寮�澶寸殑涓哄瓙搴旂敤
   },
-  civilAviationServices:{
+  civilServices:{
     name: 'app-content',
-    entry: '//jsek.bnuic.com/books/book/civilAviationServices',
+    entry: '//jsek.bnuic.com/books/book/civilServices',
+    container: '#container',
+    activeRule: '/home' //鍖归厤鎵�鏈変互/subPath寮�澶寸殑涓哄瓙搴旂敤
+  },
+  meetingPlanners:{
+    name: 'app-content',
+    entry: '//jsek.bnuic.com/books/book/meetingPlanners',
     container: '#container',
     activeRule: '/home' //鍖归厤鎵�鏈変互/subPath寮�澶寸殑涓哄瓙搴旂敤
   },
diff --git a/src/views/readerPages/mobileHome.vue b/src/views/readerPages/mobileHome.vue
index 2f0f453..b872b00 100644
--- a/src/views/readerPages/mobileHome.vue
+++ b/src/views/readerPages/mobileHome.vue
@@ -697,7 +697,6 @@
         userInfo.value = {
           ...wechatInfo,
           phoneNumber: phoneInfo?.credential,
-          Email: emailInfo?.credential,
           role: 'Student'
         }
       } else if (phoneInfo) {
diff --git a/src/views/readerPages/webHome.vue b/src/views/readerPages/webHome.vue
index 7aa19f7..30bfc2a 100644
--- a/src/views/readerPages/webHome.vue
+++ b/src/views/readerPages/webHome.vue
@@ -399,7 +399,7 @@
                             class="icon hover"
                             size="20"
                             @click="JumpPosition(item)"
-                            v-if="resourceType == 'default'"
+                            v-if="item.pagination"
                           >
                             <LocationInformation />
                           </el-icon>
@@ -435,18 +435,20 @@
                           >
                             <View />
                           </el-icon>
+                          <!-- 鍏朵粬绫诲瀷棰勮鎴栫洿鎺ヤ笅杞� -->
+                          <el-icon
+                            @click="goPlay(item)"
+                            size="20"
+                            class="icon hover"
+                            v-if="item.resourceType != '瑙嗛' && item.resourceType != '闊抽' && item.resourceType != '鍥剧墖'"
+                          >
+                            <View />
+                          </el-icon>
                           <el-icon
                             size="20"
                             class="icon hover"
-                            @click="goPlay(item)"
-                            v-if="
-                              !(
-                                item.resourceType == '瑙嗛' ||
-                                item.resourceType == '闊抽' ||
-                                item.resourceType == '涔犻' ||
-                                item.resourceType == '鍥剧墖'
-                              ) && item.isDownload == '鏄�'
-                            "
+                            @click="goDownload(item)"
+                            v-if="item.isDownload == '鏄�'"
                           >
                             <Download />
                           </el-icon>
@@ -1150,9 +1152,17 @@
       <video controls controlslist="nodownload" :src="testVideo"></video>
     </div>
 
-    <!-- <div class="wordBox" v-if="resourType == 'word'">
-      <vue-office-docx :src="testWord" />
-    </div> -->
+    <div class="wordBox" v-if="resourType == 'PDF' || resourType == 'PPT' || resourType == 'WORD'">
+          <div
+            v-for="(item, index) in showData"
+            :key="index"
+            class="pdfItem"
+            :page="index + 1"
+          >
+            <img :src="item.showSrc" alt="" style="min-height: 550px" loading="lazy" />
+            <el-divider content-position="center"> 绗� {{ index + 1 }} 椤� </el-divider>
+          </div>
+        </div>
   </el-dialog>
   <div class="audioBox" v-show="false">
     <!-- <video controls controlslist="nodownload" :src="testVideo"></video> -->
@@ -1261,7 +1271,12 @@
   </el-dialog>
   <el-dialog title="妯″瀷宸ュ叿" align-center v-model="modelToolVisble" width="80%" class="myDialogs">
     <div class="wendabox">
-      <iframe src="https://adjam93.github.io/threejs-model-viewer/#" frameborder="0"></iframe>
+      <iframe :src="sceneUrl" frameborder="0"></iframe>
+    </div>
+  </el-dialog>
+  <el-dialog title="妯″瀷宸ュ叿" align-center v-model="modelTool" width="80%" class="myDialogs">
+    <div class="wendabox">
+      <iframe src='https://adjam93.github.io/threejs-model-viewer/#' frameborder="0"></iframe>
     </div>
   </el-dialog>
   <el-dialog title="鐢熻瘝鍗$墖" align-center v-model="shengciVisble" width="800" class="myDialogs">
@@ -1798,8 +1813,8 @@
     {
       icon: huabi,
       name: '鐢荤瑪',
-      // isShow: bookConfig.value.textbookComponents.indexOf('800109C0') > -1
-      isShow: true
+      isShow: bookConfig.value.textbookComponents.indexOf('800109C0') > -1
+      // isShow: true
     },
     {
       icon: baiban,
@@ -2048,6 +2063,11 @@
                 if (resItem1.resourceType == classifySelectList.value[0].title) {
                   resourceDataList.value.push(resItem1)
                 }
+                if(activeClassify.value == 'other'){
+                  if (resItem1.resourceType != '鍥剧墖' && resItem1.resourceType != '瑙嗛' && resItem1.resourceType != '闊抽') {
+                    resourceDataList.value.push(resItem1)
+                  }
+                }
               })
             }
           } else {
@@ -2122,6 +2142,11 @@
                 if (resItem1.resourceType == classifySelectList.value[0].title) {
                   resourceDataList.value.push(resItem1)
                 }
+                if(activeClassify.value == 'other'){
+                  if (resItem1.resourceType != '鍥剧墖' && resItem1.resourceType != '瑙嗛' && resItem1.resourceType != '闊抽') {
+                    resourceDataList.value.push(resItem1)
+                  }
+                }
               })
             }
           }
@@ -2154,7 +2179,10 @@
   }
 }
 //璧勬簮鎾斁瑙嗛
+const sceneUrl = ref()
+const showData = ref()
 const goPlay = (data, index) => {
+  console.log(data.resourceType,123)
   resourType.value = data.resourceType
   if (data.resourceType == '瑙嗛') {
     if (data.md5) {
@@ -2171,7 +2199,54 @@
       testAudio.value = bookConfig.value.resourceUrl + '/' + data.resourcePath
     }
     autoPlay()
-  } else {
+  } else if (data.resourceType == '妯″瀷') {
+    console.log(data,222)
+    let file = bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5
+    console.log(file.exd,777)
+    const ctx = 'https://jsek.bnuic.com'
+    if (data.md5) {
+      sceneUrl.value = 'https://jsek.bnuic.com/books/book/civilAviation/static/modelView/index.html?md5=' + data.md5 + '&name=je' + '&domain=' + ctx + '&exd=obj' + '&target=iframe'
+    } else {
+      sceneUrl.value = bookConfig.value.resourceUrl + '/' + data.resourcePath
+    }
+    modelToolVisble.value = true
+    // if (data.md5) {
+    //   window.open(bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5)
+    // } else if (data.resourcePath) {
+    //   window.open(bookConfig.value.resourceUrl + '/' + data.resourcePath)
+    // }
+  }else if(data.resourceType == 'PPT' || data.resourceType == 'PDF'){
+    let md5 = data.md5
+    let dataList = []
+      MG.file
+        .getPdfInfo({
+          md5
+        })
+        .then((res: any) => {
+          console.log()
+          if (res && res.totalPages) {
+            for (let i = 0; i < res.totalPages; i++) {
+              const src =
+              bookConfig.value.requestCtx +
+                '/file/GetPdfPageImage?md5=' +
+                md5 +
+                '&index=' +
+                (i + 1) +
+                '&dpi=300'
+              dataList.push({
+                showSrc: src
+              })
+            }
+            console.log(dataList)
+            showData.value = dataList
+            // 鍚姩椤电爜瑙傚療
+            setTimeout(() => {
+              resourVisble.value = true
+            }, 500)
+          }
+        })
+
+  }else {
     if (data.md5) {
       window.open(bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5)
     } else if (data.resourcePath) {
@@ -2182,6 +2257,13 @@
   //  else if (data.resourceType == 'word') {
   //   testWord.value = bookConfig.value.resourceUrl + '/' + data.resourcePath
   // }
+}
+const goDownload =(data) =>{
+  if (data.md5) {
+    window.open(bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5)
+  } else if (data.resourcePath) {
+    window.open(bookConfig.value.resourceUrl + '/' + data.resourcePath)
+  }
 }
 // 鍏抽棴瑙嗛
 const resourVisbleClose = () => {
@@ -2209,6 +2291,9 @@
 //璧勬簮绫诲瀷閫夋嫨榛樿/鏁欏笀
 const selectResourceType = (type) => {
   resourceType.value = type
+  resourceDataList.value = []
+  classifySelectList.value = []
+  activeClassify.value = ''
   searchText.value = ''
   if (type == 'collect') {
     getCollectResource()
@@ -2812,6 +2897,7 @@
 const functionVisible = ref(false)
 const siweiVisble = ref(false)
 const modelToolVisble = ref(false)
+const modelTool = ref(false)
 const shengciVisble = ref(false)
 const calculatorVisble = ref(false)
 const activeTool = ref(0)
@@ -2834,7 +2920,7 @@
         siweiVisble.value = true
         break
       case '妯″瀷宸ュ叿':
-        modelToolVisble.value = true
+      modelTool.value = true
         break
       case '璇嶅吀':
         cidianVisible.value = true
@@ -2923,7 +3009,6 @@
 
 //娴獥宸ュ叿鏍忕偣鍑讳簨浠�
 const floatItemHandle = (item) => {
-  console.log(floatingToolData.activeToolData, 'floatingToolData.activeToolData')
   if (floatingToolData.activeToolData == '鐢荤瑪') {
     floatingToolData.activeToolData = ''
   } else {
@@ -3160,7 +3245,6 @@
 
 //璺宠浆
 const goReMark = (item) => {
-  console.log(item)
   if (window.qiankunState && window.qiankunState.gotoPage) {
     window.qiankunState.gotoPage(Number(item.chapterNum), Number(item.page))
   }
@@ -3245,7 +3329,6 @@
 }
 //鍙栨秷鍥炶皟
 const closeFn = (base64: any) => {
-  console.log(base64)
   floatingToolData.activeToolData = ''
 }
 //淇濆瓨鎴浘
@@ -3492,7 +3575,6 @@
         window.speechSynthesis.cancel()
         const synth = window.speechSynthesis
         const utterance = new SpeechSynthesisUtterance(dialogToolData.txt)
-        console.log(utterance, 1)
         utterance.lang = 'zh-CN' // 璁剧疆璇█涓轰腑鏂�
         synth.speak(utterance)
         showToolBox.value = false
@@ -3529,10 +3611,8 @@
 
         showToolBox.value = false
         // cidianVisible.value = true
-        console.log(dialogToolData.txt)
         break
       case '鐧剧':
-        console.log('https://baike.baidu.com/item/' + dialogToolData.txt)
         baiduVisible.value = true
         break
     }
@@ -3773,7 +3853,6 @@
             const item = res[i]
             // 鍌ㄥ��
             let data = catalogueData.value.find((item1) => item1.chapter == Number(item.key))
-            // console.log(data,'666')
             let dataList = []
             if (catalogueData.value.length > 0) {
               catalogueData.value.forEach((item1) => {
@@ -3815,7 +3894,6 @@
               })
             }
           }
-          console.log(scribeData.noteList, 'scribeData.noteList')
         }
         listLoading.value = false
       })
@@ -3889,13 +3967,11 @@
   document.addEventListener('mousemove', function (event) {
     var x = event.offsetX
     var y = event.offsetY
-    // console.log('榧犳爣鍧愭爣浣嶇疆锛�', x, y)
     noteContent.top = event.clientY + 20
     noteContent.left = event.clientX
   })
 }
 window.noteOut = (type) => {
-  console.log(type, 123)
   noteContent.show = false
 }
 
@@ -3945,7 +4021,6 @@
 
 //绗旇璺宠浆
 const jumpContent = (item) => {
-  console.log(item)
   if (window.qiankunState && window.qiankunState.gotoPage) {
     window.qiankunState.gotoPage(Number(item.chapterNum), Number(item.page))
   }
@@ -3953,7 +4028,6 @@
 
 //鑿滃崟绗旇缂栬緫
 const update = (item) => {
-  console.log(item)
   dialogToolData.chapter = item.chapterNum
   noteColorActive.value = item.color
   formData.id = item.id
@@ -4036,13 +4110,11 @@
         }
       ])
       .then((res) => {
-        console.log(res[0][0], 'cid')
         if (res.length > 0 && res[0].length > 0) {
           res[0].map((item) => {
             item.trans = JSON.parse(item.trans)
           })
           dictionaryData.data = res[0][0]
-          console.log(dictionaryData.data, '14')
           dictionaryData.showContent = true
         }
       })
@@ -5294,7 +5366,7 @@
 
 .wendabox {
   width: 100%;
-  height: 95vh;
+  height: 82vh;
 
   iframe {
     width: 100%;
@@ -5395,6 +5467,17 @@
 
 .wordBox {
   height: 600px;
+  width: 100%;
+  overflow-y: scroll;
+
+    img {
+      display: block;
+      margin: 0 auto;
+      width: 90%;
+      height: auto;
+      box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.1);
+      object-fit: contain;
+    }
 }
 
 .imgUrlBox {

--
Gitblit v1.9.1