xxdezh hace 8 meses
padre
commit
987c9b5237
Se han modificado 1 ficheros con 93 adiciones y 22 borrados
  1. 93 22
      package/jobIntention/completeMsg.vue

+ 93 - 22
package/jobIntention/completeMsg.vue

@@ -23,22 +23,24 @@
 			</view>
 			<view class="form-item">
 				<view class="form-label">求职者视角中的效果</view>
-				<view class="form-border">
+				<view class="form-border" v-for="(item, inx)  in userpost" :key="inx">
 					<view class="form-border-top">
-						<view class="form-border-title">亚马逊店铺运营</view>
-						<view class="form-border-money">24-36K·16薪</view>
+						<view class="form-border-title">{{item.ruleClassifyName}}</view>
+						<view class="form-border-money">{{item.salaryRange}}</view>
 					</view>
-					<view class="form-border-desc">演示公司100-499人</view>
+					<view class="form-border-desc">{{item.companyName}}{{item.companyPeople}}人</view>
 					<view class="form-border-img-name">
 						<view class="people-img">
-							<image src="@/static/images/jobApplicant/touxiang.svg" mode="scaleToFill"
+							<image v-if="item.hr!=null && item.hr.hrImg" :src="item.hr.hrImg" class="avatar-image"
+								mode="aspectFill"></image>
+							<image v-else src="@/static/images/jobApplicant/touxiang.svg" mode="scaleToFill"
 								class="user-img" />
 						</view>
-						<view class="people-name">孙先生 招聘者</view>
+						<view class="people-name">{{item.hr.hrPosition}} 招聘者</view>
 					</view>
 				</view>
 			</view>
-			<view class="bottom-btn" @click="goCompanyReview">开始招聘</view>
+			<view class="bottom-btn" @click="submithr">开始招聘</view>
 		</view>
 	</view>
 </template>
@@ -49,6 +51,8 @@
 			return {
 				avatar: "",
 				name: "",
+				isok: false,
+				userpost: {}
 			};
 		},
 		components: {
@@ -64,52 +68,119 @@
 				});
 			},
 			goCompanyReview() {
-				uni.navigateTo({
-					url: "/package/jobIntention/companyReview",
+				if (this.isok) {
+					uni.navigateTo({
+						url: "/package/jobIntention/companyReview",
+					});
+				}
+				return uni.showToast({
+					title: "请补全资料",
+					icon: "none"
 				});
+
 			},
 			// 选择头像
 			chooseAvatar() {
-				var that=this
+				var that = this
 				uni.chooseImage({
 					count: 1,
 					sizeType: ["compressed"],
 					sourceType: ["album", "camera"],
 					success: (res) => {
 						that.$queue.uploadFile(res.tempFilePaths[0], function(path) {
-							console.log("上传返回?:",path)
-							if (path)
+							console.log("上传返回?:", path)
+							if (path){
 								that.avatar = path;
+							}
+								
 						})
 
 					},
 				});
 			},
+			//提交hr 信息
 
+			submithr() {
+				// 验证必填项
+				if (!this.avatar) {
+					return uni.showToast({
+						title: "请上传头像",
+						icon: "none"
+					});
+				}
+				if (!this.name) {
+					return uni.showToast({
+						title: "请输入职务",
+						icon: "none"
+					});
+				}
+				// 构造提交数据
+				const data = {
+					hrImg: this.avatar, //头像
+					hrPosition: this.name, //职位
+				};
 
-			//获取我发布的岗位列表
-			getmypost() {
-				this.$Request.get("/app/postPush/getMyPostPush", "")
+				// 调用接口提交
+				uni.showLoading({
+					title: "提交中..."
+				});
+				this.$Request.postJson("/app/HrFirst/addHr", data)
 					.then((res) => {
-						if (res.code != 0) {
+						uni.hideLoading();
+						if (res.code === 0) {
+							this.isok = true
 							uni.showToast({
-								title: res.msg || "查询失败",
+								title: "提交成功,请开始招聘吧。",
+								icon: "success"
+							});
+							uni.navigateTo({
+								url: "/package/jobIntention/companyReview",
+							});
+							
+						} else {
+							uni.showToast({
+								title: res.msg || "提交失败",
 								icon: "none"
 							});
-							return;
 						}
-						this.companyinfo = res.data || {};
-						console.log("查询我的岗位列表状态", res)
 					})
 					.catch((err) => {
-						console.error("查询失败:", err);
+						uni.hideLoading();
+						console.error("提交失败:", err);
 						uni.showToast({
 							title: "网络异常",
 							icon: "none"
 						});
 					});
-			}
+			
 		},
+
+
+		//获取我发布的岗位列表
+		getmypost() {
+			this.$Request.get("/app/postPush/getMyPostPush", "")
+				.then((res) => {
+					if (res.code != 0) {
+						uni.showToast({
+							title: res.msg || "查询失败",
+							icon: "none"
+						});
+						return;
+					}
+					this.userpost = res.data.records || {};
+					this.name=this.userpost[0].hr.hrPosition || ""
+					this.avatar=this.userpost[0].hr.hrImg || ""
+					console.log("查询我的岗位列表状态", res)
+				})
+				.catch((err) => {
+					console.error("查询失败:", err);
+					uni.showToast({
+						title: "网络异常",
+						icon: "none"
+					});
+				});
+		}
+	},
 	};
 </script>
 <style scoped lang="scss">