bzkf30 2 anni fa
parent
commit
961fd64ec3

+ 29 - 29
public/config.js

@@ -1,46 +1,46 @@
 // 本地开发环境
 const local = {
-    web_pc: 'https://tyyx.bozedu.top/',
-    web_mobile: 'https://tyyxm.bozedu.top/',
-    api: 'https://tyyxopenapi.bozedu.top/',
-    oss: 'https://tyyxopenapi.bozedu.top/',
-    origin: window.location.origin,
+  web_pc: 'https://tyyx.bozedu.top/',
+  web_mobile: 'https://tyyxm.bozedu.top/',
+  api: 'https://tyyxopenapi.bozedu.top/',
+  oss: 'https://tyyxopenapi.bozedu.top/',
+  origin: window.location.origin,
 }
 
 // 测试服环境
 const development = {
-    web_pc: 'https://tyyx.bozedu.top/',
-    web_mobile: 'https://tyyxm.bozedu.top/',
-    origin: window.location.origin,
-    api: 'https://tyyxopenapi.bozedu.top/',
-    oss: 'https://tyyxopenapi.bozedu.top/'
+  web_pc: 'https://tyyx.bozedu.top/',
+  web_mobile: 'https://tyyxm.bozedu.top/',
+  origin: window.location.origin,
+  api: 'https://tyyxopenapi.bozedu.top/',
+  oss: 'https://tyyxopenapi.bozedu.top/'
 }
 // 演示服环境
 const demo = {
-    web_pc: 'https://tyyx.bozedu.net/',
-    web_mobile: 'https://tyyxm.bozedu.net/',
-    origin: window.location.origin,
-    api: 'https://tyyxopenapi.bozedu.net/',
-    oss: 'https://tyyxopenapi.bozedu.net/'
+  web_pc: 'https://tyyx.bozedu.net/',
+  web_mobile: 'https://tyyxm.bozedu.net/',
+  origin: window.location.origin,
+  api: 'https://tyyxopenapi.bozedu.net/',
+  oss: 'https://tyyxopenapi.bozedu.net/'
 }
 // 正式服环境
 const production = {
-    web_pc: 'https://tyyx.txhlwxx.com/',
-    web_mobile: 'https://tyyxm.txhlwxx.com/',
-    origin: window.location.origin,
-    api: 'https://tyyxopenapi.txhlwxx.com/',
-    oss: 'https://tyyxopenapi.txhlwxx.com/'
+  web_pc: 'https://tyyx.txhlwxx.com/',
+  web_mobile: 'https://tyyxm.txhlwxx.com/',
+  origin: window.location.origin,
+  api: 'https://tyyxopenapi.txhlwxx.com/',
+  oss: 'https://tyyxopenapi.txhlwxx.com/'
 }
 
 function isWhich() {
-    if (window.location.host.includes('tyyx.bozedu.top')) {
-        return development
-    } else if(window.location.host.includes('tyyx.bozedu.net')) {
-        return demo
-    } else if(window.location.host.includes('tyyx.txhlwxx.com')) {
-        return production
-    } else {
-        return local
-    }
+  if (window.location.host.includes('tyyx.bozedu.top')) {
+    return development
+  } else if (window.location.host.includes('tyyx.bozedu.net')) {
+    return demo
+  } else if (window.location.host.includes('tyyxm.txhlwxx.com')) {
+    return production
+  } else {
+    return local
+  }
 }
 window.GLOBAL_CONFIG = isWhich()

+ 1 - 1
src/pages/jckc/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="jckcContent">
     <van-nav-bar left-arrow title="基础课程" right-text="筛选" @click-right="handleRightClick" @click-left="onClickLeft" />
-    <van-search v-model="keyword" shape="round" placeholder="搜索你要看的内容" @search="handleSearch" />
+    <van-search v-model="keyword" shape="round" placeholder="搜索你要看的内容" @search="handleSearch" @clear="handleSearch" />
 
     <van-empty v-if="listData.length==0 && !loading" description="无数据" />
     <van-pull-refresh v-model="refreshing" @refresh="onRefresh">

+ 15 - 6
src/pages/jckc/zy_detail.vue

@@ -3,7 +3,10 @@
     <div class="top flex justify-between items-center w-full p-1">
       <van-icon name="arrow-left" color="#fff" size="16" @click="onClickLeft" />
     </div>
-    <div class="look px-2">当前观看人数:{{detailInfo.kf_view_num}}</div>
+    <div class="look px-2" v-if="suffix!='doc' && suffix!='docx'">当前观看人数:{{detailInfo.kf_view_num}}</div>
+    <div class="look px-2" v-else @click="download">
+      <van-icon name="down" /> 点击下载
+    </div>
 
     <div v-if="suffix=='mp4'" class="videoDiv">
       <div class="aliPlayerShow" id="J_prismPlayer"></div>
@@ -11,13 +14,15 @@
     <audio v-else-if="suffix=='mp3'" ref="urlResouce" controls :src="commonUrl">
       <source :src="commonUrl" type="audio/mp3">
     </audio>
-    <div v-else style="height: calc(100% - 60px);">
+    <div v-else-if="suffix=='pdf'" style="height: calc(100% - 60px);">
       <iframe :src="commonUrl" frameborder="0" width="100%" height="100%"></iframe>
     </div>
-    <!-- <video ref="videoPlay" controls>
-      <source :src="commonUrl" type="video/mp4" />
-      <source :src="commonUrl" type="video/ogg" />
-    </video> -->
+    <div v-else-if="suffix=='doc' || suffix=='docx'" style="height: 100px;line-height: 140px;text-align: center;font-size: 12px;color: #ccc;">
+      当前文件暂不支持预览
+    </div>
+    <div v-else style="height: calc(100% - 60px);">
+      <iframe :src="(detailInfo.file_preview || commonUrl)" frameborder="0" width="100%" height="100%"></iframe>
+    </div>
 
     <div class="flex justify-between items-center px-3 mt-2">
       <div style="font-size: 15px;">{{detailInfo.kf_name}}</div>
@@ -105,6 +110,10 @@ function initDetailData() {
   });
 }
 
+const download = () => {
+  window.open(commonUrl.value);
+}
+
 const handleFinger = () => {
   if (detailInfo.value.is_like == 1) {//0:关 1:开
     //去掉赞

+ 1 - 1
src/pages/jckc/zy_index.vue

@@ -14,7 +14,7 @@
     </div>
 
     <div class="flex justify-between items-center space-x-1">
-      <van-search class="flex-1" v-model="keyword" shape="round" placeholder="搜索你要看的内容" @search="handleSearch" />
+      <van-search class="flex-1" v-model="keyword" shape="round" placeholder="搜索你要看的内容" @search="handleSearch" @clear="handleSearch" />
       <!-- <div @click="onClickRight" class="flex items-center" style="color: #00A3FF;font-size: 12px;">
         课程安排
         <van-icon name="arrow" size="14" />

+ 12 - 1
src/pages/ysgc/detail.vue

@@ -22,7 +22,7 @@
 
     <div class="swiperContent m-2">
       <van-swipe class="mb-5">
-        <van-swipe-item class="flex items-center justify-center" v-for="(item, index) in imageData" :key="index">
+        <van-swipe-item class="flex items-center justify-center" v-for="(item, index) in imageData" :key="index" @click="lookDetail(index)">
           <van-image :src="getFullUrl(item)" />
         </van-swipe-item>
       </van-swipe>
@@ -48,6 +48,7 @@
 </template>
 
 <script setup>
+import { showImagePreview } from 'vant';
 import { getFullUrl } from '~/utils/helper';
 import { ysgc_detail, ysgc_evaluate_list, ysgc_addEvaluate, jszp_like_add, jszp_like_del, jszp_fav_add, jszp_fav_del, user_detail } from "./api.js";
 import userInfo from '~/store/index';
@@ -80,6 +81,16 @@ function initDetailData() {
   })
 }
 
+const showIndex = ref(0);
+const lookDetail = (index) => {
+  showIndex.value = index;
+
+  showImagePreview({
+    images: imageData.value.filter(item => getFullUrl(item)),
+    startPosition: showIndex.value,
+  });
+}
+
 initEvaluateData();
 function initEvaluateData() {
   let obj = {

+ 1 - 1
src/pages/ysgc/index.vue

@@ -13,7 +13,7 @@
       <van-tab title="教师优秀作品" name="2"></van-tab>
     </van-tabs>
 
-    <van-search v-model="keyword" shape="round" placeholder="搜索你要看的内容" @search="handleSearch" />
+    <van-search v-model="keyword" shape="round" placeholder="搜索你要看的内容" @search="handleSearch" @clear="handleSearch" />
 
     <!-- <jszp :Plist="listData"></jszp> -->
 

File diff suppressed because it is too large
+ 52 - 52
src/store/index.ts