<view @click="downloadFile(item,i)" class="customCard marginRight" v-if="item.contentsType =='FileUrl'||
item.type=='file' ||
item.contentsType=='FILE'">
<view class="all">
<view class="filePic">
<video v-if="isVideo(item.ext.filename)" :src="item.ext.url"></video>
<image v-else :src="getFileType(item.ext.filename)" mode="widthFix"></image>
</view>
<view class="Bottom" >
<view class="fileName" v-if="!isVideo(item.ext.filename)">
{{item.ext.filename}}
</view>
<view class="fileSize" v-if="!isVideo(item.ext.filename)">
大小:{{formatFileSize(item.ext.fileSize) || '未知'}}
</view>
</view>
</view>
<view class="" style="padding: 0 20rpx;">
<u-line-progress v-if="fileIndexes.includes(i)" height="6"
:percentage="percentageValue[i]"
activeColor="#19be6b"></u-line-progress>
</view>
</view>
getFileType(e) {
const ext = e.split('.').pop()
if (["apk","exe", "mp3", "pdf", "ppt", "rar", "txt", "word", 'xls', "zip"].includes(
ext)) {
return require(`@/static/fileicon/${ext}.png`)
} else if (['doc', 'dot', 'docx', 'rtf'].includes(ext)) {
return require('@/static/fileicon/word.png')
} else if (['xlsx', 'xls'].includes(ext)) {
return require('@/static/fileicon/xls.png')
} else if (['ppt', 'pptx'].includes(ext)) {
return require('@/static/fileicon/ppt.png')
} else {
return require('@/static/fileicon/null.png')
}
},