|
@@ -234,7 +234,7 @@
|
|
|
|
|
|
//预览文件
|
|
|
handlePreviewFiles(e){
|
|
|
- if (e.type === "pdf") {
|
|
|
+ if (e.type === "pdf"||e.type==='word') {
|
|
|
preViewFile(e.url)
|
|
|
} else {
|
|
|
uni.previewImage({
|
|
@@ -275,12 +275,19 @@
|
|
|
//处理文件
|
|
|
handleFile(filesUrl){
|
|
|
const reg = /\.(pdf)$/;
|
|
|
+ const reg2= /\.doc|\.docx$/
|
|
|
if(reg.test(filesUrl)){
|
|
|
this.file={
|
|
|
type: "pdf",
|
|
|
url: filesUrl,
|
|
|
img: require("../static/pdf.png"),
|
|
|
}
|
|
|
+ }else if(reg2.test(filesUrl)){
|
|
|
+ this.file={
|
|
|
+ type: "word",
|
|
|
+ url: filesUrl,
|
|
|
+ img: require("../static/word.png"),
|
|
|
+ }
|
|
|
}else{
|
|
|
this.file={
|
|
|
type: "img",
|
|
@@ -294,12 +301,19 @@
|
|
|
async handleUpload(){
|
|
|
const res=await uploadFiles({type:'all'})
|
|
|
const reg = /\.(pdf)$/;
|
|
|
+ const reg2= /\.doc|\.docx$/
|
|
|
if(reg.test(res[0])){
|
|
|
this.file={
|
|
|
type:'pdf',
|
|
|
url:res[0],
|
|
|
img:require('../static/pdf.png')
|
|
|
}
|
|
|
+ }else if(reg2.test(res[0])){
|
|
|
+ this.file={
|
|
|
+ type:'word',
|
|
|
+ url:res[0],
|
|
|
+ img:require('../static/word.png')
|
|
|
+ }
|
|
|
}else{
|
|
|
this.file={
|
|
|
type:'img',
|