il y a 7 mois
Parent
commit
846aaba3fa
3 fichiers modifiés avec 126 ajouts et 25 suppressions
  1. 9 1
      pages/my/index.vue
  2. 115 24
      pages/my/jobPosting.vue
  3. 2 0
      pages/my/jobPostingSecond.vue

+ 9 - 1
pages/my/index.vue

@@ -454,7 +454,7 @@
 										<view class=""> 招聘数据 </view>
 									</view>
 									<view class="jobServer-box-btn-item flex justify-center flex-wrap"
-										@click="goNavStatus('/package/addJob/addJob')">
+										@click="goNavStatus('/pages/my/jobPosting')">
 										<image src="../../static/images/index/qwzn.svg" mode=""></image>
 										<view class=""> 发布招聘 </view>
 									</view>
@@ -1302,23 +1302,30 @@
 							uni.setStorageSync("companyId", res.data.companyId);
 						}
 						if (res.data.userType == 1 || res.data.userType == null) {
+							
 							this.userType = 1;
 							uni.setStorageSync("userType", 1);
+							
 							if (res.data.isUserVip == 1) {
 								//判断用户是否是vip
 								this.isVip = true;
+								uni.setStorageSync("isUserVip", 1);
 							} else {
 								this.isVip = false;
 							}
 						} else {
 							this.userType = 2;
 							uni.setStorageSync("userType", 2);
+							uni.setStorageSync("vipDueTimes", res.data.vipDueTimes?res.data.vipDueTimes:0);
+							uni.setStorageSync("vipPostTimes", res.data.vipPostTimes?res.data.vipPostTimes:0);
 							if (res.data.isCompanyVip == 1) {
 								//判断企业用户是否是vip
 								this.isCompanyVip = true;
+								uni.setStorageSync("isCompanyVip", 0);
 							} else {
 								this.isCompanyVip = false;
 							}
+							
 						}
 					}
 				});
@@ -1378,6 +1385,7 @@
 					if (res.code == 0 && res.data) {
 						this.companyStatus = res.data.status;
 						uni.setStorageSync("companyStatus", this.companyStatus);
+						uni.setStorageSync("companyName",  res.data.companyAllName);
 					} else {
 						this.companyStatus = "";
 					}

+ 115 - 24
pages/my/jobPosting.vue

@@ -10,15 +10,20 @@
 				</view>
 
 				<view class="check-title-big">招聘模式</view>
-				<view class="check-select">
-					<radio-group @change="radioChange">
-						<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in items" :key="item.value">
-							<view>
-								<radio :value="item.value" :checked="index === current" />
-							</view>
-							<view>{{item.name}}</view>
-						</label>
+				<view class="check-select radioseletvi">
+					<radio-group @change="onRadioChange">
+						<view class="select-txt radioseletview">
+							<label class="radio radioselet">
+								<radio value="0" :checked="true" class="radio-size" />普通岗位招聘
+							</label>
+							<label class="radio radioselet">
+								<radio value="1" class="radio-size" />急聘
+							</label>
+							<text
+								style="position: absolute;right: 0;bottom: 18px;font-size: 12px;color: rgba(120, 130, 138, 1);">急聘职位剩余{{vipDueTimes}}个</text>
+						</view>
 					</radio-group>
+
 				</view>
 
 
@@ -48,18 +53,12 @@
 	export default {
 		data() {
 			return {
-				items: [{
-						value: '0',
-						name: '普通岗位招聘',
-						checked: 'true'
-					},
-					{
-						value: '1',
-						name: '急聘'
-					}
-				],
+				selectedValue: 0, // 默认选中值
 				peopleList: ["社招全职", "应届生校园招聘", "实习生招聘", "兼职招聘"],
 				check: 0,
+				isCompanyVip: 0,
+				vipDueTimes: 0,
+				vipPostTimes: 0,
 				text: "",
 				status: "",
 				companyName: "",
@@ -86,26 +85,36 @@
 			// 接收上个页面传递的公司名称参数
 			if (options.companyName) {
 				this.companyName = decodeURIComponent(options.companyName);
-				console.log('接收的公司名称:', this.companyName);
+			}else{
+				this.companyName = uni.getStorageSync('companyName')
 			}
 			this.descListener = uni.$on("jobDescUpdated", (data) => {
-				console.log("收到岗位描述数据:", data);
 				this.text = data.desc; // 赋值给当前页变量
 			});
 			this.jobListener = uni.$on('jobs', (data) => {
 				console.log('接收从B页传来的数据:', data);
 				// 手动更新 A 页的 data
 				this.jobInfo = data;
-
 			});
 			if (options.companyId) {
 				this.companyId = options.companyId;
-				console.log('接收的公司ID:', this.companyId);
+			}else{
+				this.companyId = uni.getStorageSync('companyId')
 			}
 			if (options.status) {
-				this.status = decodeURIComponent(options.status);
-				console.log('接收的公司状态:', this.status);
+				this.status = options.status;
+			}else{
+				this.status = uni.getStorageSync('companyStatus')
 			}
+			this.isCompanyVip = uni.getStorageSync('isCompanyVip') || 0
+			this.vipDueTimes = uni.getStorageSync('vipDueTimes') || 0
+			this.vipPostTimes = uni.getStorageSync('vipPostTimes') || 0
+			
+			
+			console.log('接收的公司名称:', this.companyName);
+			console.log("收到岗位描述数据:", this.text);
+			console.log('接收的公司ID:', this.companyId);
+			console.log('接收的公司状态:', this.status);
 
 		},
 		onUnload() {
@@ -131,6 +140,40 @@
 					url: `/package/jobIntention/editJob`,
 				});
 			},
+			//radio 选中变化时触发
+			onRadioChange(e) {
+				// 获取选中的值
+
+
+				// 根据值做不同处理
+				if (this.selectedValue === 0) {
+					console.log('选中了:普通岗位招聘');
+					// 执行普通岗位招聘的逻辑
+				} else if (this.selectedValue === 1) {
+					console.log('选中了:急聘');
+					if (!this.isCompanyVip) {
+						uni.showToast({
+							title: '对不起,您还不是会员,不能发布急聘。',
+							icon: 'none',
+							duration: 2000
+						});
+						return
+					}
+					if (this.vipDueTimes < 1) {
+						uni.showToast({
+							title: '对不起,您的次数已经用完,不能发布。',
+							icon: 'none',
+							duration: 2000
+						});
+						return
+					}
+
+					// 执行急聘的逻辑
+				}
+				this.selectedValue = e.detail.value;
+
+
+			},
 
 			//提交
 			goJobPostingSecond() {
@@ -215,8 +258,31 @@
 				if (!validate()) {
 					return; // 校验失败,终止提交
 				}
+
+
+				if (this.selectedValue == 1) {//急聘刚
+					if (!this.isCompanyVip) {
+						uni.showToast({
+							title: '对不起,您还不是会员,不能发布急聘。',
+							icon: 'none',
+							duration: 2000
+						});
+						return
+					}
+					if (this.vipDueTimes < 1) {
+						uni.showToast({
+							title: '对不起,您的次数已经用完,不能发布。',
+							icon: 'none',
+							duration: 2000
+						});
+						return
+					}
+				}
+
+
 				const data = {
 					type: this.check,
+					isDue: this.selectedValue,
 					positionDetails: this.text,
 					ruleClassifyId: this.jobInfo.ruleClassifyId,
 					ruleClassifyName: this.jobInfo.ruleClassifyName,
@@ -353,6 +419,31 @@
 					.select-txt {}
 				}
 
+				.radioseletvi {
+					position: relative;
+				}
+
+				.radioseletview {
+					display: flex;
+					flex-direction: column;
+					justify-content: space-between;
+					font-size: 14px;
+				}
+
+				.radioselet {
+					display: block;
+					margin-top: 10px;
+				}
+
+				.radio-size {
+					transform: scale(0.5);
+					/* 放大到1.5倍,可根据需要调整数值 */
+					/* 可选:调整位置避免偏移 */
+				}
+
+
+
+
 				.check-box {
 					width: 100%;
 					display: grid;

+ 2 - 0
pages/my/jobPostingSecond.vue

@@ -322,6 +322,8 @@
 			if (options.status) {
 				this.status = decodeURIComponent(options.status);
 				console.log('接收的公司状态:', this.status);
+			}else{
+				this.status = uni.getStorageSync('companyStatus')
 			}
 			this.fundListener = uni.$on("fundData", (data) => {
 				console.log("接收到的福利数据:", data);