Browse Source

feat:职务要求回显

jianghaili 7 tháng trước cách đây
mục cha
commit
19d8db697b

+ 0 - 2
package/jobIntention/addAddress.vue

@@ -103,7 +103,6 @@ export default {
     this.provinces = addr;
     if (options.address) {
       let address = JSON.parse(options.address);
-      console.log(address,'子地址')
       // 回显上一页传递的地址信息
       // this.address = decodeURIComponent(address.address);
       // this.addressDetail = decodeURIComponent(address.addressDetail);
@@ -193,7 +192,6 @@ export default {
           });
         },
         fail: (err) => {
-          console.error('地图选择失败:', err);
           if (err.errMsg.includes('auth')) {
             uni.showToast({ title: '请开启位置权限', icon: 'none' });
           }

+ 1 - 1
package/jobIntention/fund.vue

@@ -55,7 +55,7 @@ export default {
   },
   components: { navBar },
   onLoad(options) {
-    if (options.tag) {
+    if (options.tag&&options.tag.length>0&&options.tag!='undefined') {
       this.selectedTags = options.tag.split(';')
     }
   },

+ 54 - 3
package/jobIntention/jobSkills.vue

@@ -84,10 +84,16 @@
 				newTagName: '',
 				selectedOperation: [],
 				customTags: [],
-				operationOptions: []
+				operationOptions: [],
+				tagParam: '' // 新增:保存传入的tag参数
 			}
 		},
 		onLoad(options) {
+			// 保存tag参数
+			if(options.tag){
+				this.tagParam = options.tag
+			}
+			
 			// 获取状态栏高度
 			let systemInfo = uni.getSystemInfoSync();
 			this.statusBarHeight = systemInfo.statusBarHeight || 0;
@@ -126,15 +132,60 @@
 							}]
 						} else
 							this.operationOptions = res.data
+						
+						// 数据加载完成后处理标签回显
+						if (this.tagParam) {
+							this.handleTagDisplay(this.tagParam)
+						}
+					}
+				})
+			},
+			
+			// 处理标签回显(区分系统标签和自定义标签)
+			handleTagDisplay(tagString) {
+				const tagArray = tagString.split(',')
+				
+				// 收集所有系统标签名称
+				const allSystemTags = []
+				this.operationOptions.forEach(category => {
+					if (category.childrenList) {
+						category.childrenList.forEach(item => {
+							allSystemTags.push(item.postSkillName)
+						})
+					}
+				})
+				
+				// 清空当前选中的标签
+				this.selectedOperation = []
+				this.customTags = []
+				
+				// 遍历传入的标签,区分系统标签和自定义标签
+				tagArray.forEach(tag => {
+					const trimmedTag = tag.trim()
+					if (!trimmedTag) return // 跳过空标签
+					
+					// 检查是否是系统标签
+					if (allSystemTags.includes(trimmedTag)) {
+						// 是系统标签
+						if (!this.selectedOperation.includes(trimmedTag) && this.selectedOperation.length < 8) {
+							this.selectedOperation.push(trimmedTag)
+						}
+					} else {
+						// 是自定义标签
+						if (this.customTags.length < 5 && 
+							this.customTags.length + this.selectedOperation.length < 8) {
+							this.customTags.push(trimmedTag)
+						}
 					}
 				})
 			},
+			
 			toggleOperation(item) {
 				const index = this.selectedOperation.indexOf(item)
 				if (index > -1) {
 					this.selectedOperation.splice(index, 1)
 				} else {
-					if (this.selectedOperation.length < 8) {
+					if (this.selectedOperation.length + this.customTags.length < 8) {
 						this.selectedOperation.push(item)
 					} else {
 						uni.showToast({
@@ -464,7 +515,7 @@
 				height: 88rpx;
 				border-radius: 16rpx;
 				display: flex;
-				align-items: center;
+						align-items: center;
 				justify-content: center;
 				font-size: 30rpx;
 				font-weight: 500;

+ 1 - 1
pages/my/jobPosting.vue

@@ -326,7 +326,7 @@ export default {
 				postPushId: this.postPushId,
 				type: this.check,
 				isDue: this.selectedValue,
-				companyId: (this.companyId === undefined || this.companyId === 'undefined') ? '' : this.companyId,
+				// companyId: (this.companyId === undefined || this.companyId === 'undefined') ? '' : this.companyId,
 				positionDetails: this.text,
 				ruleClassifyId: this.jobInfo.ruleClassifyId,
 				ruleClassifyName: this.jobInfo.ruleClassifyName,

+ 5 - 6
pages/my/jobPostingSecond.vue

@@ -334,9 +334,9 @@ export default {
 			let workData = JSON.parse(options.workData)
 			this.selectedExper = workData.experience;
 			this.selectedLevel = workData.education;
-			this.selectedSalary = workData.salaryRange;
-			this.salaryTimes = workData.salaryTimes;
-			this.welfareTag = workData.welfareTag;
+			this.selectedSalary = workData.salaryRange||'';
+			this.salaryTimes = workData.salaryTimes||'';
+			this.welfareTag = workData.welfareTag||'';
 			this.positionTag = workData.positionTag ? workData.positionTag.split(',') : [];
 			this.address = workData.address;
 			this.stationName.fullText = workData.address, //地址
@@ -358,7 +358,6 @@ export default {
 			this.address = data.fullText;
 			this.stationName = data;
 			this.stationName.fullText = data.fullText;
-			console.log("接收到的地址数据jhl:", data);
 
 			this.stationName = data; // 赋值给当前页面变量
 		});
@@ -515,7 +514,7 @@ export default {
 		// 跳转页面并接收参数(职位关键词)
 		goJobSkill() {
 			uni.navigateTo({
-				url: "/package/jobIntention/jobSkills",
+				url: "/package/jobIntention/jobSkills?tag="+this.positionTag,
 				events: {
 					skillsUpdated: (data) => {
 						this.positionTag = data.selectedTags;
@@ -602,7 +601,7 @@ export default {
 				province: this.stationName.province,
 				city: this.stationName.city,
 				county: this.stationName.district,
-				companyId: (this.companyId === undefined || this.companyId === 'undefined') ? '' : this.companyId,
+				// companyId: (this.companyId === undefined || this.companyId === 'undefined') ? '' : this.companyId,
 				salaryTimes: this.salaryTimes
 
 			};