Browse Source

* 小程序变更

chen.cheng 10 months ago
parent
commit
1e3aeb1144
4 changed files with 34 additions and 18 deletions
  1. 1 0
      common/EnumConst.js
  2. 9 6
      pasb/pages/file/index.scss
  3. 22 8
      pasb/pages/file/index.vue
  4. 2 4
      pasb/pages/meeting-info/index.vue

+ 1 - 0
common/EnumConst.js

@@ -12,6 +12,7 @@ export const CONTENT_TYPE = {
   news: 1,
   conference: 6,
   theme: 4,
+  conferenceMaterials: 5
 };
 export const FILE_ICON = {
   doc: '/profile/upload/2024/08/20/word_20240820110735A012.svg',

+ 9 - 6
pasb/pages/file/index.scss

@@ -1,6 +1,9 @@
+@import "common/common.scss";
 .file-info-container {
-  width: 90%;
-  margin: 20rpx auto;
+  width: 100%;
+  display: flex;
+  align-items: center;
+  flex-direction: column;
   padding: 0;
   .u-page{
     padding: 0;
@@ -20,8 +23,8 @@
     padding: 20rpx 0;
 
     .file-info-item-img {
-      width: 100rpx;
-      height: 100rpx;
+      width: 110rpx;
+      height: 145rpx;
       display: flex;
       align-items: center;
       justify-content: center;
@@ -38,8 +41,8 @@
       margin-left: 20rpx;
       flex-grow: 1;
       .file-info-item-title {
-        height: 70rpx;
-        line-height: 70rpx;
+        height: 100rpx;
+        line-height: 50rpx;
         width: 500rpx;
         word-break: break-word;
         box-sizing: border-box;

+ 22 - 8
pasb/pages/file/index.vue

@@ -1,5 +1,8 @@
 <template>
   <view class="file-info-container">
+    <view class="search-content">
+      <u-search placeholder="请输入关键字" v-model="keyword" @custom="onSearch" @search="onSearch"></u-search>
+    </view>
     <view class="u-page">
       <u-list
           v-if="indexList.length>0"
@@ -11,7 +14,7 @@
         >
           <view class="file-info-item" @click="onItemClick(item)">
             <view class="file-info-item-img">
-              <image :src="fileIcon(item.fileExt)" mode="aspectFill" />
+              <image :src="item.imgUrl" mode="aspectFill" />
             </view>
             <view class="file-info-item-content">
               <view class="file-info-item-title">{{ item.title }}</view>
@@ -27,8 +30,8 @@
 
 <script>
 
-import { fetchFileList } from '@/common/api';
-import { ICON_CFG } from '@/common/EnumConst';
+import { fetchContentInfo } from '@/common/api';
+import { CONTENT_TYPE, ICON_CFG } from '@/common/EnumConst';
 import { fileIcon, getImageUrl, viewFileFn } from '@/util';
 
 let page = 1;
@@ -38,6 +41,7 @@ export default {
   data() {
     return {
       ICON_CFG,
+      keyword: '',
       indexList: [],
       loadStatus: 'loadmore', // loadmore,loading,nomore
     };
@@ -53,7 +57,10 @@ export default {
     fileIcon,
     getImageUrl,
     onItemClick(item) {
-      viewFileFn(getImageUrl(item.uri), item.title, `.${item.fileExt}`);
+      // viewFileFn(getImageUrl(item.uri), item.title, `.${item.fileExt}`);
+      uni.navigateTo({
+        url: `/pasb/pages/detail/index?id=${item.id}`,
+      });
     },
     scrolltolower() {
       if (page > 1 && this.loadStatus === 'nomore') {
@@ -63,10 +70,12 @@ export default {
     },
     loadmore() {
       this.loadStatus = 'loading';
-      fetchFileList({
-        pageNum: page,
-        pageSize: 10,
-        fileType: 2,
+
+      fetchContentInfo({
+        pageNum: 1,
+        pageSize: 99,
+        contentType: CONTENT_TYPE.conferenceMaterials,
+        title: this.keyword,
       }).then(res => {
         page += 1;
         if (res.rows.length > 0) {
@@ -75,6 +84,7 @@ export default {
               id: item.id,
               title: item.fileName,
               date: item.createTime,
+              imgUrl: getImageUrl(item.thumbnail),
               ...item,
             };
           }));
@@ -84,6 +94,10 @@ export default {
         }
       });
     },
+    onSearch() {
+      page = 1;
+      this.loadmore();
+    },
   },
 };
 </script>

+ 2 - 4
pasb/pages/meeting-info/index.vue

@@ -1,8 +1,5 @@
 <template>
   <view class="meeting-info-container">
-    <view class="search-content">
-      <u-search placeholder="请输入关键字" v-model="keyword" @custom="onSearch" @search="onSearch"></u-search>
-    </view>
     <view class="u-page">
       <item-list :ds="indexList" :onItemClick="onContentClick" />
     </view>
@@ -11,6 +8,7 @@
 
 <script>
 import { fetchContentInfo } from '@/common/api';
+import { CONTENT_TYPE } from '@/common/EnumConst';
 import ItemList from '@/components/ItemList/index.vue';
 import { getImageUrl } from '@/util';
 
@@ -37,7 +35,7 @@ export default {
       const res = await fetchContentInfo({
         pageNum: 1,
         pageSize: 99,
-        contentType: 3,
+        contentType: CONTENT_TYPE.conference,
         title: keyword,
       });
       this.indexList = res.rows.map(item => {