|
@@ -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>
|