wkw 6 месяцев назад
Родитель
Сommit
1bc9ddeb51
3 измененных файлов с 303 добавлено и 140 удалено
  1. 77 133
      src/components/header/header.vue
  2. 15 3
      src/components/postPush/postPush.vue
  3. 211 4
      src/views/search/index.vue

+ 77 - 133
src/components/header/header.vue

@@ -153,110 +153,66 @@
 						<div class="myVipCon-li" v-if="userType == 2">
 							<div class="myVipCon-li-sj"></div>
 							<div class="myVipCon-li-con">
+								<!-- 顶部标题行 -->
 								<div class="myVipCon-li-con-item flex align-center justify-between">
-									<div class="myVipCon-li-con-items" style="font-weight: 500;">
-										权益类型
-									</div>
+									<div class="myVipCon-li-con-items" style="font-weight: 500;">权益类型</div>
 									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1"
+										style="font-weight: 500;">基础权益</div>
+
+									<div v-for="(vip, index) in viplist" :key="index"
+										class="myVipCon-li-con-items myVipCon-li-con-itemscolor2"
 										style="font-weight: 500;">
-										基础权益
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2"
-										style="font-weight: 500;">
-										{{ trialVersion.vipName }}
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2"
-										style="font-weight: 500;">
-										{{ monthlyPayment.vipName }}
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2"
-										style="font-weight: 500;">
-										{{ annual.vipName }}
+										{{ vip.vipName }}
 									</div>
 								</div>
+
+								<!-- 在线普通职位 -->
 								<div class="myVipCon-li-con-item flex align-center justify-between">
-									<div class="myVipCon-li-con-items" style="font-weight: 500;">
-										在线普通职位
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">
-										1个
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
-										{{ trialVersion.vipPostTimes }}个
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
-										{{ monthlyPayment.vipPostTimes }}个
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
-										{{ annual.vipPostTimes }}个
+									<div class="myVipCon-li-con-items" style="font-weight: 500;">在线普通职位</div>
+									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">1个</div>
+									<div v-for="(vip, index) in viplist" :key="index"
+										class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
+										{{ vip.vipPostTimes }}个
 									</div>
 								</div>
+
+								<!-- 在线急聘职位 -->
 								<div class="myVipCon-li-con-item flex align-center justify-between">
-									<div class="myVipCon-li-con-items" style="font-weight: 500;">
-										在线急聘职位
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">
-										0个
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
-										{{ trialVersion.vipDueTimes }}个
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
-										{{ monthlyPayment.vipDueTimes }}个
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
-										{{ annual.vipDueTimes }}个
+									<div class="myVipCon-li-con-items" style="font-weight: 500;">在线急聘职位</div>
+									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">0个</div>
+									<div v-for="(vip, index) in viplist" :key="index"
+										class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
+										{{ vip.vipDueTimes }}个
 									</div>
 								</div>
+
+								<!-- 每日查看总数 -->
 								<div class="myVipCon-li-con-item flex align-center justify-between">
-									<div class="myVipCon-li-con-items" style="font-weight: 500;">
-										每日查看总数
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">
-										5个
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
-										{{ trialVersion.vipViewTimes }}个
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
-										{{ monthlyPayment.vipViewTimes }}个
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
-										{{ annual.vipViewTimes }}个
+									<div class="myVipCon-li-con-items" style="font-weight: 500;">每日查看总数</div>
+									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">5个</div>
+									<div v-for="(vip, index) in viplist" :key="index"
+										class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
+										{{ vip.vipViewTimes }}个
 									</div>
 								</div>
+
+								<!-- 每日沟通总数 -->
 								<div class="myVipCon-li-con-item flex align-center justify-between">
-									<div class="myVipCon-li-con-items" style="font-weight: 500;">
-										每日沟通总数
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">
-										5个
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
-										{{ trialVersion.vipConTimes }}个
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
-										{{ monthlyPayment.vipConTimes }}个
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
-										{{ annual.vipConTimes }}个
+									<div class="myVipCon-li-con-items" style="font-weight: 500;">每日沟通总数</div>
+									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">5个</div>
+									<div v-for="(vip, index) in viplist" :key="index"
+										class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
+										{{ vip.vipConTimes }}个
 									</div>
 								</div>
+
+								<!-- 价格 -->
 								<div class="myVipCon-li-con-item flex align-center justify-between">
-									<div class="myVipCon-li-con-items" style="font-weight: 500;">
-										价格
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">
-										免费
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
-										{{ trialVersion.money }}/{{ vipNameTypeText(trialVersion.vipNameType) }}
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
-										{{ monthlyPayment.money }}/{{ vipNameTypeText(monthlyPayment.vipNameType) }}
-									</div>
-									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
-										{{ annual.money }}/{{ vipNameTypeText(annual.vipNameType) }}
+									<div class="myVipCon-li-con-items" style="font-weight: 500;">价格</div>
+									<div class="myVipCon-li-con-items myVipCon-li-con-itemscolor1">免费</div>
+									<div v-for="(vip, index) in viplist" :key="index"
+										class="myVipCon-li-con-items myVipCon-li-con-itemscolor2">
+										{{ vip.money }}/{{ vipNameTypeText(vip.vipNameType) }}
 									</div>
 								</div>
 							</div>
@@ -638,11 +594,11 @@
 				<div class="wallet-pay">
 					<div class="wallet-pay-se">
 						<el-radio-group @change="changeRadio" v-model="radio" class="ml-4">
-							<!-- <el-radio :label="1" size="large" class="flex align-center">
+							<el-radio :label="1" size="large" class="flex align-center">
 								<img style="width: 30px;height: 30px;border-radius: 50%;margin-right: 10px;"
 									src="/images/money/weixin.png" alt="" />
 								微信支付
-							</el-radio> -->
+							</el-radio>
 							<el-radio :label="2" size="large">
 								<img style="width: 30px;height: 30px;border-radius: 50%;margin-right: 10px;"
 									src="/images/money/zhifubao.png" alt="" />
@@ -710,7 +666,7 @@
 				alPay: '',
 				orderId: '', //支付订单号
 				timer: null, //查询状态定时器
-				radio: 2, //1:微信支付 2:支付宝支付
+				radio: 1, //1:微信支付 2:支付宝支付
 				size: 160, //二维码大小
 				qrColor: {
 					'background': '#ffffff'
@@ -748,7 +704,7 @@
 				vipNumCom: 0,
 				vipTimeC: '', //企业会员到期时间
 				vipTime: '', //用户会员到期时间
-				vipPrice: '0', //会员价格
+				vipPrice: '', //会员价格
 				vipId:'',
 				checkVipXy: false,
 				vipNum: 0,
@@ -798,9 +754,6 @@
 				myDueTimes: 0,
 				viplist: [],
 				selectedPlan: '',
-				trialVersion: [],
-				monthlyPayment: [],
-				annual: [],
 				remainingDays: 0, // 剩余天数
 				vipName: "",
 				hrEmail:'',
@@ -918,16 +871,7 @@
 			selectVipDetails() {
 				this.$Request.get("/app/VipDetails/selectVipDetails").then((res) => {
 					if (res.code == 0) {
-						this.viplist = res.data
-						if (res.data && res.data.length > 0) {
-							this.selectPlan(res.data[0]);
-						}
-						if (res.data) {
-							this.trialVersion = res.data[0];
-							this.monthlyPayment = res.data[1];
-							this.annual = res.data[2];
-						}
-						
+						this.viplist = res.data || [];
 					}
 				});
 			},
@@ -1147,35 +1091,35 @@
 			},
 			//会员支付
 			payMoney() {
-				// if (this.radio == 1) { //微信支付
-				// 	// 微信支付
-				// 	let data = {
-				// 		classify: 6,
-				// 		money: this.vipPrice,
-				// 		type: 2,
-				// 	}
-				// 	this.$Request.post('/app/wxPay/wxPayOrder', data).then(res => {
-				// 		if (res.code == 0) {
-				// 			if (res.data) {
-				// 				this.cleanTimer()
-				// 				this.codeUrl = res.data.param.code_url
-				// 				this.orderId = res.data.orderId
-				// 				this.timer = setInterval(() => {
-				// 					this.getPayStatus()
-				// 				}, 1000)
-
-				// 			}
-				// 		} else {
-				// 			this.cleanTimer()
-				// 			ElMessage({
-				// 				message: res.msg,
-				// 				type: 'error',
-				// 				duration: 1500,
-				// 				offset: this.screenHeight / 2
-				// 			})
-				// 		}
-				// 	})
-				// } else {
+				if (this.radio == 1) { //微信支付
+					// 微信支付
+					let data = {
+						classify: 6,
+						// money: this.vipPrice,
+						type: this.vipId,
+					}
+					this.$Request.post('/app/wxPay/wxPayOrder', data).then(res => {
+						if (res.code == 0) {
+							if (res.data) {
+								this.cleanTimer()
+								this.codeUrl = res.data.param.code_url
+								this.orderId = res.data.orderId
+								this.timer = setInterval(() => {
+									this.getPayStatus()
+								}, 1000)
+
+							}
+						} else {
+							this.cleanTimer()
+							ElMessage({
+								message: res.msg,
+								type: 'error',
+								duration: 1500,
+								offset: this.screenHeight / 2
+							})
+						}
+					})
+				} else {
 					let data = {
 						classify: 7,
 						// money: 0.1,
@@ -1202,7 +1146,7 @@
 								})
 							}
 						});
-				// }
+				}
 
 			},
 			//去企业中心

+ 15 - 3
src/components/postPush/postPush.vue

@@ -16,8 +16,8 @@
 					<el-form-item prop="isDue" :rules="[{ required: true, message: '请选择招聘模式', trigger: 'change', },]"
 						class="row45" label="招聘模式">
 						<el-radio-group v-model="postPushForm.isDue" :disabled="type == 'updata'">
-							<el-radio :value="0">普通岗位招聘</el-radio>
-							<el-radio :value="1">急聘</el-radio>
+							<el-radio :value="0">普通岗位招聘(剩余{{ lastPostTimes }}个)</el-radio>
+							<el-radio :value="1">急聘(剩余{{ lastDueTimes }}个)</el-radio>
 						</el-radio-group>
 					</el-form-item>
 					<el-form-item prop="postType" :rules="[{ required: true, message: '请选择招聘类型', trigger: 'blur', },]"
@@ -392,7 +392,9 @@ export default {
 			editorRef: '',
 			editorConfig: {
 				placeholder: '请输入岗位介绍'
-			}
+			},
+			lastDueTimes: 0,
+			lastPostTimes: 0
 		}
 	},
 	watch: {
@@ -443,10 +445,20 @@ export default {
 		// this.getPostType()
 		this.IntentionChen()
 		this.getSchoolList()
+		this.getUserInfoVipList();
 		// this.getMoneyList()
 		// this.getFuliList()
 	},
 	methods: {
+		//获取vip个人信息
+		getUserInfoVipList() {
+			this.$Request.get("/app/user/vipData").then((res) => {
+				if (res.code == 0) {
+					this.lastDueTimes = res.data.lastDueTimes || 0;
+					this.lastPostTimes = res.data.lastPostTimes || 0;
+				}
+			});
+		},
 		updateSalaryRange() {
 			if (this.minSalary && this.maxSalary) {
 				const min = this.parseK(this.minSalary)

+ 211 - 4
src/views/search/index.vue

@@ -95,7 +95,7 @@
 								<div>您的跨境标签将用于为您推荐更匹配的职位</div>
 							</div>
 							<!-- 岗位对应的跨境标签 -->
-							<div style="margin-top: 20px;">
+							<div style="margin-top: 20px;" class="flex align-center">
 								<div class="tag-list flex" v-if="tabs.length">
 									<span v-for="(tag, i) in ['不限', ...parseSkills(tabs[tabsCurr]?.industry)]"
 										:key="i" class="tag-item"
@@ -104,6 +104,11 @@
 										{{ tag }}
 									</span>
 								</div>
+								<div style="margin-left: 16px;" @click="openIndustryDialog">
+									<el-icon>
+										<Plus />
+									</el-icon>
+								</div>
 							</div>
 						</div>
 						<!-- 地区选择 -->
@@ -363,6 +368,49 @@
 				</div>
 			</div>
 		</el-dialog>
+		<!-- 跨境标签选择 -->
+		<el-dialog class="workDialog" v-model="industryDialog" title="选择跨境标签" :draggable="true" destroy-on-close
+			align-center center>
+			<template #header>
+				<div class="my-header flex align-center">
+					<div class="my-header-title" style="font-weight: bold">
+						选择跨境标签
+					</div>
+					<div class="my-header-title flex align-center" style="margin-left: 40px; width: 600px">
+						<el-select :collapse-tags="true" :max-collapse-tags="5"
+							class="my-header-title-se" multiple-limit="20" v-model="selectedIndustryTags" multiple
+							placeholder="请选择跨境标签">
+							<el-option v-for="item in industryArrList" :key="item.postSkillName"
+								:label="item.postSkillName" :value="item.postSkillName" />
+						</el-select>
+						<span style="margin-left: 10px;font-size: 13px;color: #999999;">
+							{{ selectedIndustryTags.length }}/20
+						</span>
+						<el-button @click="addHangye" style="margin-left: 10px" type="primary">确定</el-button>
+					</div>
+				</div>
+			</template>
+
+			<div class="preference-grid">
+				<div v-for="(parent, pIndex) in industryList" :key="pIndex" class="preference-group">
+					<div class="preference-title">
+						<span>{{ parent.postSkillName }}</span>
+					</div>
+
+					<div class="preference-children">
+						<div v-for="(child, cIndex) in parent.childrenList" :key="cIndex" class="preference-tag"
+							:class="{ active: selectedIndustryTags.includes(child.postSkillName) }"
+							@click="togglePreference(child.postSkillName)">
+							<span>{{ child.postSkillName }}</span>
+						</div>
+					</div>
+				</div>
+
+
+
+				<el-empty v-if="industryList.length == 0" description="暂无从事方向" />
+			</div>
+		</el-dialog>
 	</div>
 </template>
 
@@ -383,6 +431,10 @@ export default {
 	},
 	data() {
 		return {
+			industryDialog: false, // 控制弹窗
+			industryList: [], // 后端返回的完整行业树
+			industryArrList: [],
+			selectedIndustryTags: [], // ✅ 用这个数组代替 postPushForm.positionTag
 			tabs: [],
 			tabsCurr:0,
 			size: 160, //二维码大小
@@ -494,6 +546,113 @@ export default {
 
 	},
 	methods: {
+		// 点击“+”打开行业标签弹窗
+		openIndustryDialog() {
+			// 打开弹窗
+			this.industryDialog = true;
+			// 获取当前岗位的 industry 字符串
+			const tagString = this.tabs[this.tabsCurr]?.industry || '';
+			// 调用回显方法,渲染出选中的系统标签
+			this.handleTagDisplay(tagString);
+		},
+		handleTagDisplay(tagString) {
+			if (!tagString) return;
+
+			tagString = tagString.replace(/,/g, ',');
+
+			let tagArray = [];
+			if (tagString.includes('/')) {
+				tagArray = tagString.split('/').map(tag => tag.trim()).filter(tag => tag && tag !== '不限');
+			} else if (tagString.includes(',')) {
+				tagArray = tagString.split(',').map(tag => tag.trim()).filter(tag => tag && tag !== '不限');
+			} else {
+				tagArray = [tagString];
+			}
+
+			const allSystemTags = [];
+			this.industryList.forEach(category => {
+				if (category.childrenList) {
+					category.childrenList.forEach(item => {
+						allSystemTags.push(item.postSkillName);
+					});
+				}
+			});
+			this.selectedIndustryTags = [];
+
+			tagArray.forEach(tag => {
+				if (allSystemTags.includes(tag) && !this.selectedIndustryTags.includes(tag)) {
+					this.selectedIndustryTags.push(tag);
+				}
+			});
+		},
+		togglePreference(name) {
+			const index = this.selectedIndustryTags.indexOf(name);
+			if (index === -1) {
+				if (this.selectedIndustryTags.length >= 20) {
+					this.$message.warning('最多选择20个跨境标签');
+					return;
+				}
+				this.selectedIndustryTags.push(name);
+			} else {
+				this.selectedIndustryTags.splice(index, 1);
+			}
+		},
+
+		addHangye() {
+			// 更新岗位标签数据
+			this.tabs[this.tabsCurr].industry = this.selectedIndustryTags.join(',');
+			// 关闭弹窗
+			this.industryDialog = false;
+		},
+		getIndustryList() {
+			let data = {
+				ruleClassifyId: this.tabs[this.tabsCurr].ruleClassifyId
+			};
+			this.$Request.get('/app/userFirst/getPostSkill', { params: data }).then(res => {
+				if (res.code === 0) {
+					this.industryList = res.data || [];
+					this.industryArrList = [];
+					this.flattenIndustryList(this.industryList);
+				}
+			});
+		},
+		flattenIndustryList(list) {
+			for (const item of list) {
+				// 添加当前节点
+				this.industryArrList.push(item);
+				// 递归处理子节点
+				if (item.childrenList && item.childrenList.length > 0) {
+					this.flattenIndustryList(item.childrenList);
+				}
+			}
+		},
+		selectTag(tag) {
+			// 1. 如果点击的是“不限”
+			if (tag === '不限') {
+				this.selectedTags = ['不限'];
+			} else {
+				// 2. 否则处理多选逻辑
+				const index = this.selectedTags.indexOf(tag);
+				if (index === -1) {
+					// 新增选中
+					this.selectedTags.push(tag);
+					// 移除“不限”
+					this.selectedTags = this.selectedTags.filter(t => t !== '不限');
+				} else {
+					// 取消选中
+					this.selectedTags.splice(index, 1);
+				}
+
+				// 3. 如果全都取消了 → 默认选中“不限”
+				if (this.selectedTags.length === 0) {
+					this.selectedTags = ['不限'];
+				}
+			}
+
+			// 更新选择
+			this.intentPostSkill = this.selectedTags.join(',');
+			this.getRecommendJob();
+		},
 		changeType(type){
 			this.searchType = type;
 			this.page = 1
@@ -524,7 +683,7 @@ export default {
 					}
 				}
 			});
-			
+			this.getIndustryList();
 			//重新获取岗位
 			this.page = 1
 			this.getUserList()
@@ -535,6 +694,7 @@ export default {
 				console.log(res)
 				if (res.code == 0 && res.data.length > 0) {
 					this.tabs = res.data;
+					this.getIndustryList();
 					//获取岗位列表
 					this.getUserList()
 				}else{
@@ -1372,6 +1532,7 @@ $marginTop-60: 120px;
 			align-items: center;
 			color: #ffffff;
 			cursor: pointer;
+			padding:0 10px;
 		}
 
 		.condizione-box-c-downApp {
@@ -1689,14 +1850,15 @@ $marginTop-60: 120px;
 
 .tag-list {
 	flex-wrap: wrap;
+	gap: 10px;
 }
 
 .tag-item {
 	padding: 4px 12px;
 	background-color: #f8f8f8;
 	border-radius: 4px;
-	margin-right: 10px;
-	margin-bottom: 10px;
+	// margin-right: 10px;
+	// margin-bottom: 10px;
 	cursor: pointer;
 	font-size: 14px;
 	color: #333333;
@@ -1714,4 +1876,49 @@ $marginTop-60: 120px;
 	font-weight: 400;
 	margin-top: 18px;
 }
+/* 从事方向选择样式 */
+.preference-grid {
+	padding: 20px;
+	max-height: 400px;
+	overflow-y: auto;
+}
+
+.preference-group {
+	margin-bottom: 20px;
+}
+
+.preference-title {
+	font-size: 16px;
+	font-weight: bold;
+	margin-bottom: 10px;
+	color: #333;
+}
+
+.preference-children {
+	display: flex;
+	flex-wrap: wrap;
+	gap: 10px;
+}
+
+.preference-tag {
+	padding: 8px 16px;
+	border: 1px solid #dcdfe6;
+	border-radius: 20px;
+	cursor: pointer;
+	transition: all 0.3s ease;
+	background-color: #fff;
+	font-size: 14px;
+	color: #606266;
+}
+
+.preference-tag:hover {
+	border-color: #00DD9A;
+	color: #00DD9A;
+}
+
+.preference-tag.active {
+	background-color: #00DD9A;
+	border-color: #00DD9A;
+	color: #fff;
+}
 </style>