lyuis 7 月之前
父節點
當前提交
333ab2e16d
共有 1 個文件被更改,包括 51 次插入25 次删除
  1. 51 25
      pages/index/index.vue

+ 51 - 25
pages/index/index.vue

@@ -605,17 +605,19 @@ export default {
 			directionList: [ //方向列表
 				{
 					id: '不限',
-					name: '不限'
+					name: '不限',
+					ruleClassifyId:0
 				}
 			],
 			// 招聘端标签
 			positionTag:[
 				{
 					id: '不限',
-					name: '不限'
+					name: '不限',
 				}
 			],
-			positionTagArr:[]
+			positionTagArr:[],
+			preferenceChange:false
 		};
 	},
 	onShareAppMessage(res) {
@@ -651,7 +653,18 @@ export default {
 			if (this.current == this.typeList.length - 1) { //公司
 				this.getComanyList()
 			} else {
-				this.getUserList()
+				//this.getUserList()
+				this.directionList=[ //方向列表
+					{
+						id: '不限',
+						name: '不限',
+						ruleClassifyId:0
+					}
+				]
+				this.preferenceChange=false
+				this.preference=[]
+				this.industry=''
+				this.getPostType()
 			}
 		},
 		currentSx(newData, oldData) {
@@ -741,11 +754,16 @@ export default {
 			data.preferences.forEach(function (item) {
 				var tem = {
 					id: item,
-					name: item
+					name: item,
+					ruleClassifyId:that.typeList[that.current].id
 				}
 				prefer.push(tem)
 			})
+			/* this.preference.split(',').forEach((item)=>{
+				if(data.preferences.indexOf(item)<0)明天处理这里的逻辑----------------------------------------------------------------------------------------------
+			}) */
 			that.directionList = prefer
+			that.preferenceChange=true
 		})
 		uni.$on("skillsUpdated", (data) => {
 			console.log("接收到的职位技能数据:", data);
@@ -1652,6 +1670,9 @@ export default {
 		 */
 		getPostType() {
 			var that = this
+			if(that.preferenceChange){
+				return this.getUserList()
+			}
 			//行业期望
 			this.$Request.get('/app/intention/getIntentionList', {
 
@@ -1665,32 +1686,26 @@ export default {
 													label: '全部'
 												} */
 					]
-
 					let industry = this.directionList
-					var industryArr = this.industry == '' ? [] : this.industry.split(',')
-					industryArr.forEach(function (item) {
-						if (that.$queue.array_column(that.directionList, 'name').indexOf(item) < 0)
-							industry.push({
-								id: item,
-								name: item
-							})
-					})
-
-					arr.forEach(function (item) {
+					arr.forEach(function (item,index) {
 						var tmp = {}
 						tmp.id = item.ruleClassifyId
 						tmp.name = item.ruleClassifyName
 						tmp.label = item.ruleClassifyName
 						classRule.push(tmp)
-						var indus = item.industry ? item.industry.split('/') : []
-						indus.forEach(function (ind) {
-							var tm = {}
-							tm.name = ind
-							tm.id = ind
-							if (that.$queue.array_column(industry, 'name').indexOf(tm.name) <
-								0)
-								industry.push(tm)
-						})
+						let indexRulrId=that.typeList.length>0&&that.typeList[that.current].id?that.typeList[that.current].id:arr[0].ruleClassifyId
+						if(indexRulrId==item.ruleClassifyId){
+							var indus = item.industry ? item.industry.split('/') : []
+							indus.forEach(function (ind) {
+								var tm = {}
+								tm.name = ind
+								tm.id = ind
+								tm.ruleClassifyId=item.ruleClassifyId
+								if (that.$queue.array_column(industry, 'name').indexOf(tm.name) <
+									0)
+									industry.push(tm)
+							})
+						}
 					})
 					classRule.push({
 						id: '',
@@ -1698,6 +1713,17 @@ export default {
 						label: ''
 					}) //模拟个空企业选项,为了兼容源码和设计图
 					this.typeList = classRule
+					
+					var industryArr = this.industry == '' ? [] : this.industry.split(',')
+					industryArr.forEach(function (item) {
+						if (that.$queue.array_column(that.directionList, 'name').indexOf(item) < 0)
+							industry.push({
+								id: item,
+								name: item,
+								ruleClassifyId:that.typeList[that.current].id
+							})
+					})
+					
 					this.directionList = industry
 					// console.log(this.typeList, '1111')
 					this.getUserList()