Browse Source

补充附件简历选择发送模板

lyuis 7 months ago
parent
commit
c05f1e5959
4 changed files with 220 additions and 9 deletions
  1. 149 0
      components/attachment.vue
  2. 18 1
      components/empty.vue
  3. 27 4
      pages/index/game/order.vue
  4. 26 4
      pages/msg/im.vue

+ 149 - 0
components/attachment.vue

@@ -0,0 +1,149 @@
+<template>
+	<view>
+
+		<!-- <nav-bar title="基本信息"></nav-bar> -->
+		<view class="contain flex flex-direction">
+			<view class="title">请选择要发送的文件</view>
+			<view class="usermain">
+				<scroll-view scroll-with-animation scroll-y>
+				<!-- 我的公司 -->
+					<view @click="select(item)" 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="fileContent c-flex-center">
+							<view class="fileName">{{item.attachmentName}}</view>
+							<view class="filedesc">{{item.attachmentSize}}kb 更新于{{item.createTime}}</view>
+						</view>
+						<view @click.stop="seekDoc(item)" class="c-flex-center">
+							<view class="seekview">预览</view>
+						</view>
+					</view>
+					<empty size="mini" :isShow="false" v-if="content.length==0" />
+				</scroll-view>
+			</view>
+			
+			<view @click="goTo('/pages/my/attachment')" class="footer-btn">
+				管理附件 <u-icon name="arrow-right"></u-icon>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	// 引入组件
+	import empty from './empty.vue'
+	export default {
+		components: {
+			empty
+		},
+		props: {
+			content: {
+				type: Array,
+				default: []
+			}
+		},
+		methods: {
+			seekDoc(it){
+				//#ifdef APP-PLUS
+				uni.downloadFile({
+				  url: it.attachmentAddress,
+				  success: function (res) {
+				    var filePath = res.tempFilePath;
+				    uni.openDocument({
+				      filePath: filePath,
+				      showMenu: true,
+				      success: function (res) {
+				        console.log('打开文档成功');
+				      }
+				    });
+				  }
+				});
+				return;
+				//#endif
+				uni.navigateTo({
+					url: '/pages/index/webView?url=' + it.attachmentAddress+'&title='+it.attachmentName
+				});
+			},
+			goTo(url){
+				uni.navigateTo({
+					url
+				})
+			},
+			select(item){
+				this.$emit('select',item)
+			}
+		},
+	};
+</script>
+
+<style lang="scss" scoped>
+	page {
+		/* background: #f6f6f6; */
+	}
+	.contain{
+		height: 33vh;
+		.title{
+			padding: 25rpx 40rpx;
+			color: #666;
+		}
+	}
+	.usermain {
+		background: #ffffff;
+		/* color: #fff; */
+		height: 100vh;
+		scroll-view{
+			height: 100%;
+		}
+	}
+
+	.usermain-item {
+		display: flex;
+		justify-content: space-between;
+		margin: 0 40rpx;
+		padding: 30rpx 0;
+		// border-bottom: 1rpx solid rgba(229, 229, 229, 0.3);
+		background: #fff;
+		gap: 16rpx;
+		.fileContent{
+			width: 80%;
+			margin:0 20rpx;
+		}
+		.fileName{
+			color: #222;
+			font-size: 32rpx;
+		}
+		.filedesc{
+			margin-top: 10rpx;
+			font-size: 24rpx;
+		}
+		.c-flex-center{
+			align-self: center;
+			color: #aaa;
+			.seekview{
+				white-space: nowrap;
+				color: #888;
+			}
+		}
+		
+	}
+
+	.usermain-item-title {
+		color: rgba(31, 44, 55, 1);
+		font-family: DM Sans;
+		font-size: 28rpx;
+		font-weight: 500;
+		line-height: 44rpx;
+		text-align: left;
+		.header-icon{
+			width: 50rpx;
+			height: 50rpx;
+			display: block;
+		}
+	}
+
+	.footer-btn {
+		text-align:center;
+		padding: 40rpx 0;
+		color: rgba(1, 107, 246, 1);
+	}
+
+</style>

+ 18 - 1
components/empty.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="page-box" :style="isShow?'height:50vh':''">
 		<view class="centre">
-			<image src="../static/images/index/empty.png" mode=""></image>
+			<image :class="size" src="../static/images/index/empty.png" mode=""></image>
 			<view class="tips">
 				{{content}}
 			</view>
@@ -16,6 +16,10 @@
 				type: String,
 				default: '暂无内容'
 			},
+			size:{
+				type: String,
+				default: 'large'
+			},
 			isShow:{
 				type:Boolean,
 				default:true
@@ -53,6 +57,19 @@
 			margin: 0 auto 20rpx;
 			// border: 1px dotted #000000;
 		}
+		.large{
+			width: 340rpx;
+			height: 340rpx;
+		}
+		.medium{
+			width: 240rpx;
+			height: 240rpx;
+		}
+		.mini{
+			width: 140rpx;
+			height: 140rpx;
+			margin-top: 40rpx;
+		}
 
 		.tips {
 			color: rgba(200, 201, 204, 1);

+ 27 - 4
pages/index/game/order.vue

@@ -184,7 +184,7 @@
 		</view>
 		<!-- 底部操作 -->
 		<view class="caozuo flex justify-center align-center">
-			<view v-if="info&&info.isDue==1" class="caozuo-box-l flex justify-center align-center" @click="oneClickApply">
+			<view v-if="info&&info.isDue==1" class="caozuo-box-l flex justify-center align-center" @click="attachmentShow=true">
 				一键投递
 			</view>
 			<view class="caozuo-box-r flex justify-center align-center" @click="bindphone(2)">
@@ -266,13 +266,16 @@
 				</view>	
 			-->
 		<!-- #endif -->
-
+		<u-popup v-model="attachmentShow" z-index="99999" mode="bottom" border-radius="14" height="auto" :closeable="true">
+			<attachment @select="selectAttachment" :content="content"></attachment>
+		</u-popup>
 	</view>
 
 </template>
 
 <script>
 	import config from '../../../common/config.js'
+	import attachment from '../../../components/attachment.vue'
 	export default {
 		//分享
 		onShareAppMessage(res) {
@@ -292,11 +295,15 @@
 				title: this.info.stationName,
 			}
 		},
+		components: {
+			attachment
+		},
 		data() {
 			return {
 				statusBarHeight: 0, // 状态栏高度
 				loading: true,
 				shows: false,
+				attachmentShow:false,
 				postPushId: '',
 				info: {}, //岗位详情
 				token: uni.getStorageSync('token'),
@@ -319,6 +326,7 @@
 				}],
 				sharType: 0,
 				sharMsg: '',
+				content:[]
 			};
 		},
 		onLoad(option) {
@@ -352,6 +360,13 @@
 					}
 				}
 			});
+			this.$Request.get("/app/resumes/getAttachment").then(res => {
+				if (res.code == 0) {
+					this.content=res.data
+				}
+				uni.hideLoading();
+			});
+			
 			uni.showLoading({
 				title: '加载中'
 			})
@@ -472,6 +487,8 @@
 			},
 			//在线联系
 			bindphone(phone, index) {
+				if(!this.info.user||!this.info.user.userId)
+					return this.$queue.showToast('岗位发布者已不知所踪,请联系管理员')
 				if (uni.getStorageSync('token')) {
 					this.$Request.get('/app/resumes/selectResumesByUserId').then(res => {
 						if (res.code == 0) {
@@ -605,8 +622,13 @@
 					url: '/my/enterpriseInfo/enterpriseInfo?companyId=' + this.info.company.companyId
 				})
 			},
+			selectAttachment(item){
+				//console.log(item)
+				this.attachmentShow=false
+				this.oneClickApply(item)
+			},
 			//一键投递
-			oneClickApply() {
+			oneClickApply(item) {
 				if (uni.getStorageSync('token')) {
 					this.$Request.get('/app/resumes/selectResumesByUserId').then(res => {
 						if (res.code == 0) {
@@ -629,7 +651,8 @@
 								// 执行一键投递逻辑
 								this.$Request.postT("/app/sendRecord/addSendRecord", {
 									postPushId: this.postPushId,
-									resumesId: res.data.resumesId
+									resumesId: res.data.resumesId,
+									resumesAttachmentId:item.resumesAttachmentId
 								}).then(res => {
 									if (res.code == 0) {
 										uni.showToast({

+ 26 - 4
pages/msg/im.vue

@@ -863,7 +863,9 @@
 				</view>
 			</view>
 		</u-popup>
-
+		<u-popup v-model="attachmentShow" z-index="99999" mode="bottom" border-radius="14" height="auto" :closeable="true">
+			<attachment @select="selectAttachment" :content="attachmentContent"></attachment>
+		</u-popup>
 	</view>
 </template>
 
@@ -872,7 +874,11 @@
 	const HEARTBEAT_INTERVAL = 20000; // 每20秒发送一次心跳消息
 	import configdata from '../../common/config.js';
 	import emoji from '../../common/emoji.json';
+	import attachment from '../../components/attachment.vue'
 	export default {
+		components: {
+			attachment
+		},
 		data() {
 			return {
 				msshow: false,
@@ -1024,7 +1030,9 @@
 				isVideo: false, //是否打视频
 				ossUrl:configdata.ossUrl,
 				jobStatusList:[],
-				conversationInfo:{}
+				conversationInfo:{},
+				attachmentShow:false,
+				attachmentContent:[]
 			};
 		},
 		onUnload() {
@@ -1095,6 +1103,12 @@
 			})
 			// #endif
 			this.jobStatusList = this.$queue.resumesStatus()
+			this.$Request.get("/app/resumes/getAttachment").then(res => {
+				if (res.code == 0) {
+					this.attachmentContent=res.data
+				}
+				uni.hideLoading();
+			});
 		},
 		onShow() {
 			if (this.chatConversationId) {
@@ -1650,12 +1664,14 @@
 					}
 				})
 			},
-			// 同意简历请求并发送简历
-			sendResumesSave() {
+			selectAttachment(item){
+				//console.log(item)
+				this.attachmentShow=false
 				let that = this
 				let data = {
 					to: this.byUserId, //接收人的userId
 					postPushId: this.postPushId, //岗位id
+					resumesAttachmentId:item.resumesAttachmentId
 				}
 				this.$Request.postT("/app/resumes/sendResumes", data).then(res => {
 					if (res.code == 0) {
@@ -1673,8 +1689,13 @@
 					}
 				})
 			},
+			// 同意简历请求并发送简历
+			sendResumesSave() {
+				this.attachmentShow=true
+			},
 			resumesTy() {
 				let that = this
+				return that.sendResumesSave()
 				uni.showModal({
 					title: '提示',
 					content: '确定发送简历给对方?',
@@ -1703,6 +1724,7 @@
 			//发简历
 			sendResumes() {
 				let that = this
+				return that.sendResumesSave()
 				uni.showModal({
 					title: '提示',
 					content: '是否将简历发送给对方?',