Ver código fonte

Merge branch 'master' of https://git.nanodreamtech.com/Boss/yizhizan-h5

jianghaili 7 meses atrás
pai
commit
32bfc71951
2 arquivos alterados com 16 adições e 4 exclusões
  1. 15 4
      pages/my/attachment.vue
  2. 1 0
      static/images/docx.svg

+ 15 - 4
pages/my/attachment.vue

@@ -17,9 +17,9 @@
 				<scroll-view scroll-with-animation scroll-y>
 				<!-- 我的公司 -->
 					<view class="usermain-item item-padding" v-for="item in content">
-						<view class="usermain-item-title c-flex-center"><image src="../../static/images/pdf.svg" class="header-icon" /></view>
+						<view class="usermain-item-title c-flex-center"><image :src="item.fileType=='pdf'?'../../static/images/pdf.svg':'../../static/images/docx.svg'" class="header-icon" mode="aspectFill"/></view>
 						<view @click="seekDoc(item)" class="fileContent c-flex-center">
-							<view class="fileName">{{item.attachmentName}}</view>
+							<view class="fileName m-ellipsis">{{item.attachmentName}}</view>
 							<view class="filedesc">{{item.attachmentSize}}kb 更新于{{item.createTime}}</view>
 						</view>
 						<view @click.stop="more(item.resumesAttachmentId)" class="c-flex-center">
@@ -223,6 +223,10 @@
 			getUserInfo() {
 				this.$Request.get("/app/resumes/getAttachment").then(res => {
 					if (res.code == 0) {
+						res.data.forEach(function(item){
+							const ext = item.attachmentName.split('.').pop().toLowerCase();
+							item.fileType=ext
+						})
 						this.content=res.data
 					}
 					uni.hideLoading();
@@ -234,9 +238,16 @@
 			uploadResumes(e) {
 				var that=this
 				console.log(e.path)
+				const validExtensions = ['pdf', 'doc', 'docx'];
+				  const ext = e.name.split('.').pop().toLowerCase();
+				  if (!validExtensions.includes(ext)) {
+					  this.$queue.showToast('仅支持PDF/DOC/DOCX格式')
+					return;
+				  }
 				uni.getFileInfo({
 				  filePath: e.path,
 				  success: (info) => {
+					  
 				    console.log('文件大小:', info.size); // 单位:字节
 					let attachment_size=(info.size/1024).toFixed(1)
 					that.$queue.uploadFile(e.path,function(path){
@@ -432,9 +443,8 @@
 		padding: 30rpx 0;
 		// border-bottom: 1rpx solid rgba(229, 229, 229, 0.3);
 		background: #fff;
-		gap: 16rpx;
 		.fileContent{
-			width: 80%;
+			width: 85%;
 			margin:0 20rpx;
 		}
 		.fileName{
@@ -448,6 +458,7 @@
 		.c-flex-center{
 			align-self: center;
 			color: #aaa;
+			flex-shrink: 0;
 		}
 		
 	}

+ 1 - 0
static/images/docx.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1764753476644" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7354" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48"><path d="M112.152 2.438c-19.504 0-39.01 19.505-39.01 39.01v941.104c0 19.505 19.506 39.01 39.01 39.01h802.134c19.504 0 39.01-19.505 39.01-39.01V224.305L728.99 2.438H112.152z" fill="#2C97FF" p-id="7355"></path><path d="M728.99 2.438v182.857c0 19.505 19.505 39.01 39.01 39.01h182.857L728.99 2.438z" fill="#99D3FF" p-id="7356"></path><path d="M741.181 760.686c-9.752 0-19.505-4.876-24.381-12.19L512 536.38 307.2 748.495c-9.752 9.753-24.381 14.629-39.01 9.753s-21.942-19.505-21.942-34.134V370.59c0-19.504 17.066-36.571 36.571-36.571s36.571 17.067 36.571 36.571v265.753L487.62 460.8c7.314-7.314 17.067-12.19 24.381-12.19 9.752 0 19.505 4.876 24.381 12.19l165.79 173.105V370.59c0-19.504 17.067-36.571 36.572-36.571s36.571 17.067 36.571 36.571v355.962c0 14.629-9.752 26.82-21.943 34.134h-12.19z" fill="#FFFFFF" p-id="7357"></path></svg>