|
@@ -7,8 +7,9 @@
|
|
<u-list-item
|
|
<u-list-item
|
|
v-for="(item, index) in indexList"
|
|
v-for="(item, index) in indexList"
|
|
:key="index"
|
|
:key="index"
|
|
|
|
+
|
|
>
|
|
>
|
|
- <view class="file-info-item">
|
|
|
|
|
|
+ <view class="file-info-item" @click="onItemClick(item)">
|
|
<view class="file-info-item-img">
|
|
<view class="file-info-item-img">
|
|
<image :src="getImageUrl(ICON_CFG.file_icon)" mode="aspectFill" />
|
|
<image :src="getImageUrl(ICON_CFG.file_icon)" mode="aspectFill" />
|
|
</view>
|
|
</view>
|
|
@@ -28,7 +29,7 @@
|
|
|
|
|
|
import { fetchFileList } from '@/common/api';
|
|
import { fetchFileList } from '@/common/api';
|
|
import { ICON_CFG } from '@/common/EnumConst';
|
|
import { ICON_CFG } from '@/common/EnumConst';
|
|
-import { getImageUrl } from '@/util';
|
|
|
|
|
|
+import { getImageUrl, viewFileFn } from '@/util';
|
|
|
|
|
|
let page = 1;
|
|
let page = 1;
|
|
export default {
|
|
export default {
|
|
@@ -48,7 +49,13 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
getImageUrl,
|
|
getImageUrl,
|
|
|
|
+ onItemClick(item) {
|
|
|
|
+ viewFileFn(getImageUrl(item.uri), item.title, `.${item.fileExt}`);
|
|
|
|
+ },
|
|
scrolltolower() {
|
|
scrolltolower() {
|
|
|
|
+ if (page > 1 && this.loadStatus === 'nomore') {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
this.loadmore();
|
|
this.loadmore();
|
|
},
|
|
},
|
|
loadmore() {
|
|
loadmore() {
|
|
@@ -56,7 +63,7 @@ export default {
|
|
fetchFileList({
|
|
fetchFileList({
|
|
pageNum: page,
|
|
pageNum: page,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
- fileType: 1,
|
|
|
|
|
|
+ fileType: 2,
|
|
}).then(res => {
|
|
}).then(res => {
|
|
page += 1;
|
|
page += 1;
|
|
if (res.rows.length > 0) {
|
|
if (res.rows.length > 0) {
|
|
@@ -65,6 +72,7 @@ export default {
|
|
id: item.id,
|
|
id: item.id,
|
|
title: item.fileName,
|
|
title: item.fileName,
|
|
date: item.createTime,
|
|
date: item.createTime,
|
|
|
|
+ ...item,
|
|
};
|
|
};
|
|
}));
|
|
}));
|
|
}
|
|
}
|