zhengkaixin 1 anno fa
parent
commit
ec75a5b7fd

+ 44 - 4
pages/packages/jobInformation/jobDetails.vue

@@ -91,14 +91,23 @@
 						(实名认证后可查看)
 					</view>
 				</view>
+				
+				<view  v-if="info.images" class="codeImage">
+					
+					<view  class="codeImageView" >展示图片</view>
+					
+					<image  mode="aspectFit"  v-for="(item,i) in imagesList " 
+					v-if="item" :key="i"
+					:src="item.url" :show-menu-by-longpress="true" ></image>
+					<view  class="codeImageView" ><u-icon name="arrow-upward"></u-icon><u-icon name="arrow-upward"></u-icon><u-icon name="arrow-upward"></u-icon> 长按图片可保存<u-icon name="arrow-upward"></u-icon><u-icon name="arrow-upward"></u-icon><u-icon name="arrow-upward"></u-icon></view>
+				</view>
 
 			</view>
+			
+			
 		</view>
 		
-		<!-- 幻灯片 -->
-		<view class="swiper2" v-if="false"  >
-			<img src="https://equipment.xiaoxinda.com/jk-temporary-workers-portal/favicon.ico"><view class="view">想随时随地看急招好岗位?</view><span  class="span">点击加入群聊</span>
-		</view>
+		
 		
 		<!-- 幻灯片 -->
 		<view class="swiper"  v-if="bannerlist.length">
@@ -234,6 +243,13 @@
 			}
 		},
 		computed: {
+			imagesList(){
+				if(this.info&&this.info.images){
+					var images=this.info.images;
+					return  JSON.parse(images)
+				}
+					return []
+			},
 			showTitle() {
 				if (this.info.id) {
 					return (this.info.isOnline?'':'已下架-')+this.info.positionName + '-' + this.info.salary + this.getUnit(this.info)
@@ -490,6 +506,30 @@
 </style>
 
 <style lang="scss" scoped>
+	
+	.codeImage{
+		background-color: #fff;
+		 text-align: center;
+		  border: 1px dashed;
+		  width: 700rpx;
+		.codeImageView{
+			padding: 20rpx 0px 40rpx;
+			font-size: 32rpx;
+		}
+		image {
+			
+			max-height: 500rpx;
+		}
+		image img{
+			
+			max-height: 500rpx;
+		}
+		img{
+		
+			max-height: 500rpx;
+		}
+	}
+	
 	.swiper{
 		  margin: 20rpx;
 	}

+ 80 - 11
pages/packages/mine/employmentService/laborManagement/postMessage.vue

@@ -149,6 +149,15 @@
 			</view>
 
 
+		</view>
+		<view class="information-group">
+			<view class="headline">
+				展示图片<span>(最多上传5张)</span>
+			</view>
+			<u-upload  ref="uUpload" :action="action" name="photoFile" :file-list="listPic"
+				:form-data="formDataUpload" :header="header" width="180"  max-count="5" @on-success="onSuccess">
+			</u-upload>
+			
 		</view>
 		<u-select v-model="show" value-name="value" label-name="name" :list="list" @confirm="confirm"></u-select>
 
@@ -250,7 +259,8 @@
 					workArea: "",
 					address: "",
 					salaryForm: "2",
-					ageRequirement:"",
+					ageRequirement:"",
+					images:"",
 				},
 				settlementMethod: "",
 				salaryForm: "计时",
@@ -281,7 +291,11 @@
 				],
 				valueList: [-1, -1, -1, -1, -1, -1],
 				userInfo: {},
-				id: "",
+				id: "",
+				formDataUpload:{},
+				action: '',
+				header: '',
+				listPic: [],
 			}
 		},
 		onLoad(op) {
@@ -290,15 +304,35 @@
 				this.id = op.id
 				this.getInfo()
 			} else {
-				var enterpriseInfo = this.carhelp.getPersonInfoPlus().enterpriseInfo
-				this.formData.contacts = enterpriseInfo.contactsPersonId
-				this.formData.address = enterpriseInfo.address
+				var enterpriseInfo = this.carhelp.getPersonInfoPlus().enterpriseInfo
+				if(enterpriseInfo){
+					this.formData.contacts = enterpriseInfo.contactsPersonId
+					this.formData.address = enterpriseInfo.address
+				}
+				
+			}
+			
+			this.action = process.car.BASE_URL+"uploadPicture";
+			
+			this.formDataUpload = {
+				subFolder: "laborManagement"
+			}
+			var token = this.carhelp.getToken();
+			this.header={
+				'Authorization': token,
+				'X-Requested-With': 'XMLHttpRequest'
 			}
 
-
 			//this.tel=this.userInfo.phone
 		},
-		methods: {
+		methods: {
+			onSuccess(data, index, lists, name) {
+				
+				 console.log(this.$refs.uUpload.lists)
+				if(data.result) {
+					
+				}
+			},
 			reset() {
 				this.isChecked = -1;
 
@@ -354,7 +388,22 @@
 							//.log(name[i]+'N')
 							this[name[i]] = this.formData[(name[i] + 'N')]
 						}
-						this.workArea = this.formData.workArea
+						this.workArea = this.formData.workArea
+						
+						this.listPic=JSON.parse(this.formData.images) 
+						for(var i in this.listPic){
+							var obj=this.listPic[i]
+							obj.progress=100
+							obj.error=false
+							obj.response={
+								code: 200,
+								data: obj.url,
+								message: null,
+								result: true
+							}
+						}
+						 this.$refs.uUpload.lists=this.listPic
+						
 					}
 
 				}).catch(error => {
@@ -407,7 +456,22 @@
 					this.show = true
 				}
 			},
-			submit() {
+			submit() {
+				this.formData.images="";
+				var  imgs= this.$refs.uUpload.lists.filter(val => {
+					return val.progress == 100;
+				})
+				if(imgs&&imgs.length){
+					var str =imgs.map(item=>{
+						return {
+							name:"1.jpg",
+							url:item.url
+						}
+					})
+					console.log(str)
+					this.formData.images=JSON.stringify(str);
+				}
+				
 				if (!this.formData.positionName) {
 					uni.showToast({
 						icon: 'none',
@@ -482,7 +546,8 @@
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
-				})
+				})
+				
 				API.createRecruit(this.formData).then((res) => {
 					uni.hideLoading();
 
@@ -535,7 +600,11 @@
 			font-size: 36rpx;
 			margin-bottom: 24rpx;
 
-			font-family: 'PingFangSC-medium';
+			font-family: 'PingFangSC-medium';
+			span{
+				    font-size: 24rpx;
+				    color: #9E9E9E;
+			}
 		}
 
 		.item {