lyuis 7 maanden geleden
bovenliggende
commit
a4eabbe8df
6 gewijzigde bestanden met toevoegingen van 115 en 171 verwijderingen
  1. 1 0
      App.vue
  2. 43 1
      common/queue.js
  3. 1 1
      package/screen/screen.vue
  4. 36 56
      package/search/search.vue
  5. 16 50
      pages/index/game/gameList.vue
  6. 18 63
      pages/index/index.vue

+ 1 - 0
App.vue

@@ -3,6 +3,7 @@ export default {
   onLaunch: function () {
     let that = this;
 	that.$queue.changeTabbar(that.$queue.getData('userType')||1)
+	uni.removeStorageSync('filter')
     // #ifdef APP
     // 检查是否首次启动 - 引导页逻辑
     let firstUpload = uni.getStorageSync("firstUpload") || false;

+ 43 - 1
common/queue.js

@@ -420,5 +420,47 @@ module.exports = {
 	            }
 	            
 	            return years;
-	        }
+	        },
+			// 筛选求职列表
+			getFilterData:function(){
+				const condition={
+					education : '', //学历
+					experience : '', //经验
+					industry : '', //行业
+					salaryRange : '',//薪资
+					companyPeople : '' //公司规模
+				}
+				//获取选中的筛选条件
+				if (uni.getStorageSync('filter') && (uni.getStorageSync('filter')).length > 0) {
+					let filter = uni.getStorageSync('filter')
+					filter.map(item => {
+						let arr = []
+						item.list.map(ite => {
+							if (ite.value != '不限') {
+								arr.push(ite.value)
+							}
+						})
+						switch (item.name) {
+							case '学历要求':
+								condition.education = arr.join(',')
+								break;
+							case '薪资范围(单选)':
+								condition.salaryRange = arr.join(',')
+								break;
+							case '经验要求':
+								condition.experience = arr.join(',')
+								break;
+							case '公司规模':
+								condition.companyPeople = arr.join(',')
+								break;
+							case '行业':
+								condition.industry = arr.join(',')
+								break;
+						}
+				
+					})
+					// console.log(filter)
+				}
+				return condition
+			},
 };

+ 1 - 1
package/screen/screen.vue

@@ -153,7 +153,7 @@
 				} else {
 					uni.setStorageSync("filter", arr);
 				}
-				uni.$emit('updateRecord')
+				uni.$emit('updateScreenFilterRecord')
 				uni.navigateBack();
 			},
 			/**

+ 36 - 56
package/search/search.vue

@@ -300,6 +300,27 @@
 			let systemInfo = uni.getSystemInfoSync();
 			this.statusBarHeight = systemInfo.statusBarHeight || 0;
 			let that = this
+			const condition=this.$queue.getFilterData()
+			this.education = condition.education //学历
+			this.experience = condition.experience //经验
+			this.industry = condition.industry //行业
+			this.salaryRange = condition.salaryRange //薪资
+			this.companyPeople = condition.companyPeople //公司规模
+			if (!this.city) {
+				if (uni.getStorageSync('city')) {
+					this.city = uni.getStorageSync('city')
+				} else {
+					this.city = ''
+				}
+			}
+			uni.$on('filterCity', data => {
+				console.log(data, '选择的市')
+				that.city = data.city
+				that.county = data.county
+				this.page = 1
+				that.getUserList();
+			})
+			this.token = uni.getStorageSync('token');
 			//获取经纬度后请求岗位接口,经纬度用于筛选距离
 			uni.getLocation({
 				type: 'wgs84', //wgs84  gcj02
@@ -315,6 +336,21 @@
 			})
 			this.getMyRecordList()
 			this.getHotList()
+			
+			uni.$on('updateScreenFilterRecord', () => {
+				const condition=this.$queue.getFilterData()
+				this.education = condition.education //学历
+				this.experience = condition.experience //经验
+				this.industry = condition.industry //行业
+				this.salaryRange = condition.salaryRange //薪资
+				this.companyPeople = condition.companyPeople //公司规模
+				this.page = 1
+				that.getUserList();
+			})
+		},
+		onUnload(){
+			uni.$off('filterCity');
+			uni.$off('updateScreenFilterRecord');
 		},
 		computed: {
 			filledFieldsCount() {
@@ -323,62 +359,6 @@
 		       return count > 0 ? '·' + count : '';
 			}
 		  },
-		onShow() {
-			let that = this;
-			if (!this.city) {
-				if (uni.getStorageSync('city')) {
-					this.city = uni.getStorageSync('city')
-				} else {
-					this.city = ''
-				}
-			}
-			uni.$once('filterCity', data => {
-				console.log(data, '选择的市')
-				that.city = data.city
-				that.county = data.county
-				that.getUserList();
-			})
-			this.token = uni.getStorageSync('token');
-
-			console.log(uni.getStorageSync('filter'), '1111111111');
-			if (uni.getStorageSync('filter') && (uni.getStorageSync('filter')).length > 0) {
-				let filter = uni.getStorageSync('filter')
-				console.log(filter)
-				filter.map(item => {
-					let arr = []
-					item.list.map(ite => {
-						if (ite.value != '不限') {
-							arr.push(ite.value)
-						}
-					})
-					switch (item.name) {
-						case '学历要求':
-							this.education = arr.join(',')
-							break;
-						case '薪资范围(单选)':
-							this.salaryRange = arr.join(',')
-							break;
-						case '经验要求':
-							this.experience = arr.join(',')
-							break;
-						case '公司规模':
-							this.companyPeople = arr.join(',')
-							break;
-						case '行业':
-							this.industry = arr.join(',')
-							break;
-					}
-
-				})
-			} else {
-				this.education = '' //学历
-				this.experience = '' //经验
-				this.industry = '' //行业
-				this.salaryRange = '' //薪资
-				this.companyPeople = '' //公司规模
-			}
-			that.getUserList();
-		},
 		onPullDownRefresh() {
 			this.page = 1
 			this.getUserList();

+ 16 - 50
pages/index/game/gameList.vue

@@ -325,8 +325,15 @@ export default {
 		this.getJobSearchList();
 	})
 	// 监听筛选条件触发getJobSearchList
-	uni.$on('updateRecord', () => {
-	    this.getFilterData();
+	uni.$on('updateScreenFilterRecord', () => {
+		const condition=this.$queue.getFilterData()
+		this.education = condition.education //学历
+		this.experience = condition.experience //经验
+		this.industry = condition.industry //行业
+		this.salaryRange = condition.salaryRange //薪资
+		this.companyPeople = condition.companyPeople //公司规模
+		this.searchPage = 1
+		this.getJobSearchList();
 	})
 	// 监听工作性质变化
 	uni.$on('updatePosition', () => {
@@ -339,11 +346,17 @@ export default {
 	} else {
 		this.city = ''
 	}
+	const condition=this.$queue.getFilterData()
+	this.education = condition.education //学历
+	this.experience = condition.experience //经验
+	this.industry = condition.industry //行业
+	this.salaryRange = condition.salaryRange //薪资
+	this.companyPeople = condition.companyPeople //公司规模
     this.getLocation();
   },
   onUnload(){
 	uni.$off('city');
-	uni.$off('updateRecord');
+	uni.$off('updateScreenFilterRecord');
 	uni.$off('updatePosition')
   },
   watch: {
@@ -556,53 +569,6 @@ export default {
       this.page = 1;
       this.getJobList();
     },
-	// 筛选求职列表
-	getFilterData(){
-		//获取选中的筛选条件
-		if (uni.getStorageSync('filter') && (uni.getStorageSync('filter')).length > 0) {
-			let filter = uni.getStorageSync('filter')
-			this.education = '' //学历
-			this.experience = '' //经验
-			this.industry = '' //行业
-			this.salaryRange = '' //薪资
-			this.companyPeople = '' //公司规模
-			filter.map(item => {
-				let arr = []
-				item.list.map(ite => {
-					if (ite.value != '不限') {
-						arr.push(ite.value)
-					}
-				})
-				switch (item.name) {
-					case '学历要求':
-						this.education = arr.join(',')
-						break;
-					case '薪资范围(单选)':
-						this.salaryRange = arr.join(',')
-						break;
-					case '经验要求':
-						this.experience = arr.join(',')
-						break;
-					case '公司规模':
-						this.companyPeople = arr.join(',')
-						break;
-					case '行业':
-						this.industry = arr.join(',')
-						break;
-				}
-		
-			})
-			// console.log(filter)
-		} else {
-			this.education = '' //学历
-			this.experience = '' //经验
-			this.industry = '' //行业
-			this.salaryRange = '' //薪资
-			this.companyPeople = '' //公司规模
-		}
-		this.searchPage = 1
-		this.getJobSearchList();
-	},
     // 获取求职列表
     getJobSearchList() {
       let data = {

+ 18 - 63
pages/index/index.vue

@@ -794,9 +794,19 @@
 					}
 				});
 			}
+			// 监听筛选条件触发getJobSearchList
+			uni.$on('updateScreenFilterRecord', () => {
+				//待处理
+			})
+			uni.$on('city', data => {
+				that.city = data.city
+				uni.setStorageSync('city', that.city)
+			})
 		},
 		onUnload() {
 			uni.$off('preferenceUpdated')
+			uni.$off('updateScreenFilterRecord')
+			uni.$off('city')
 		},
 		//下拉刷新
 		onPullDownRefresh() {
@@ -833,17 +843,7 @@
 		},
 		onShow() {
 			let that = this;
-			uni.$once('city', data => {
-				that.city = data.city
-				uni.setStorageSync('city', that.city)
-			})
-
-			// 监听标签选择
-			uni.$once('tagSelected', data => {
-				console.log('选择的标签:', data)
-				// 这里可以处理选择的标签数据
-			})
-
+			
 			this.getBannerList()
 			this.getgridList()
 			this.getgonggaoList()
@@ -877,58 +877,13 @@
 			}
 
 			this.token = uni.getStorageSync('token');
-			//获取选中的筛选条件
-			if (uni.getStorageSync('filter') && (uni.getStorageSync('filter')).length > 0) {
-				let filter = uni.getStorageSync('filter')
-				this.education = '' //学历
-				this.experience = '' //经验
-				this.industry = '' //行业
-				this.salaryRange = '' //薪资
-				this.companyPeople = '' //公司规模
-				filter.map(item => {
-					let arr = []
-					item.list.map(ite => {
-						if (ite.value != '不限') {
-							arr.push(ite.value)
-						}
-					})
-					switch (item.name) {
-						case '学历要求':
-
-							//this.education = arr.join(',')
-							this.education = item.list[0].value == '不限' ? '' : item.list[0].value
-							break;
-						case '薪资范围(单选)':
-							//this.salaryRange = arr.join(',')
-
-							this.salaryRange = item.list[0].value == '不限' ? '' : item.list[0].value
-							break;
-						case '经验要求':
-							//this.experience = arr.join(',')
-
-							this.experience = item.list[0].value == '不限' ? '' : item.list[0].value
-							break;
-						case '公司规模':
-							//this.companyPeople = arr.join(',')
-
-							this.companyPeople = item.list[0].value == '不限' ? '' : item.list[0].value
-							break;
-						case '行业':
-							//this.industry = arr.join(',')
-
-							this.industry = item.list[0].value == '不限' ? '' : item.list[0].value
-							break;
-					}
-
-				})
-				// console.log(filter)
-			} else {
-				this.education = '' //学历
-				this.experience = '' //经验
-				this.industry = '' //行业
-				this.salaryRange = '' //薪资
-				this.companyPeople = '' //公司规模
-			}
+			const condition=this.$queue.getFilterData()
+			this.education = condition.education //学历
+			this.experience = condition.experience //经验
+			this.industry = condition.industry //行业
+			this.salaryRange = condition.salaryRange //薪资
+			this.companyPeople = condition.companyPeople //公司规模
+			
 			// this.getPostType();
 			if (this.userType == 1) {
 				uni.setNavigationBarColor({