Răsfoiți Sursa

Merge branch 'master' of https://git.nanodreamtech.com/Boss/yizhizan-h5

7 luni în urmă
părinte
comite
e4e3f1c65f

+ 12 - 9
components/hg-level4-address/hgLevel4Address.vue

@@ -47,6 +47,10 @@
 			county: {
 				type: [String, Number],
 				default: ''
+			},
+			street: {
+				type: [String, Number],
+				default: ''
 			}
 		},
 		data() {
@@ -104,19 +108,18 @@
 
 				for (const province of this.addressData) {
 					for (const city of province.children || []) {
-						if (city.code == this.city || city.name.indexOf(this.city) !== -1) {
+						if (this.city!=''&&(city.code == this.city || city.name.indexOf(this.city) !== -1)) {
 							this.selectedProvince = province
 							this.selectedCity = city
-							
 							for (const area of city.children || []) {
-								if (area.code == this.county || area.name.indexOf(this.county) !== -1) {
+								if (this.county!=''&&(area.code == this.county || area.name.indexOf(this.county) !== -1)) {
 									this.selectedArea=area
 								}
-							}
-	
-							this.selectedStreet = {
-								code: 'all',
-								name: '全部'
+								for (const street of area.children || []) {
+									if (this.street!=''&&(street.code == this.street || street.name.indexOf(this.street) !== -1)) {
+										this.selectedStreet=street
+									}
+								}
 							}
 							return
 						}
@@ -160,7 +163,7 @@
 
 			/** 街道选择 */
 			selectStreet(street) {
-				return this.$queue.showToast('街道选择暂未开放')
+				return this.$queue.showToast('街道选择暂未开放')
 				this.selectedStreet = street
 			},
 

+ 11 - 2
package/jobIntention/city.vue

@@ -73,15 +73,17 @@
 				city: "",
 				latitude: "",
 				longitude: "",
+				type:''
 			};
 		},
 		components: {
 			navBar,
 		},
-		onLoad() {
+		onLoad(options) {
 			this.getLatOrLng(); //获取经纬度
 			this.getRmCityList(); //热门城市
 			this.getCitysList();
+			this.type=options&&options.type
 		},
 		methods: {
 			/**
@@ -174,7 +176,14 @@
 				uni.$emit("city", {
 					city: city,
 				});
-				uni.navigateBack();
+				let data = {
+					city: city=='全国'||city=='全部'?'':city,
+					county: ''
+				}
+				uni.$emit('filterCity', data)
+				uni.navigateBack({
+					delta: this.type=='search'?2:1,
+				});
 			},
 
 			bindToView(event) {

+ 6 - 4
package/screen/city.vue

@@ -12,7 +12,7 @@
 			</view>
 		</view>
 		 <view class="content">
-			<hg-level4-address :city="city" :county="county"
+			<hg-level4-address :city="city" :county="county" :street="street"
 			  placeholder="请选择地址"
 			  @confirm="onAddressConfirm"
 			  >         
@@ -32,14 +32,16 @@
 				statusBarHeight: 0, // 状态栏高度
 				city: '', //市
 				county: '', //区
+				street:''//街道
 			};
 		},
 		onLoad(options) {
 			// 获取状态栏高度
 			let systemInfo = uni.getSystemInfoSync();
 			this.statusBarHeight = systemInfo.statusBarHeight || 0;
-			this.city = options&&options.city
-			this.county = options&&options.county
+			this.city = options&&options.city||''
+			this.county = options&&options.county||''
+			this.street = options&&options.street||''
 		},
 		onShow() {
 
@@ -61,7 +63,7 @@
 			},
 			goTo(){
 				uni.navigateTo({
-					url:'/package/jobIntention/city'
+					url:'/package/jobIntention/city?type=search'
 				})
 			}
 		}

+ 30 - 13
pages/index/game/gameList.vue

@@ -66,30 +66,25 @@
 
             <view class="topbg-sx-box-r flex align-center">
               <!-- 城市 -->
-              <view class="topbg-sx-box-r-i flex align-center" style="">
-                <text
-                  style="margin-right: 10rpx"
-                  @click="goNavs('/package/jobIntention/city')"
-                  >{{ city ? city : "选择城市" }}</text
-                >
+              <view class="topbg-sx-box-r-i flex align-center" style="" @click="goNav('/package/screen/city?city='+city+'&county='+county)">
+                <text style="margin-right: 10rpx">{{county?county:city?city:'选择城市'}}</text>
                 <u-icon
                   name="arrow-down"
-                  color="#00B78F"
+                  color="#016bf6"
                   size="16"
-                  @click="goNavs('/package/jobIntention/city')"
                 ></u-icon>
               </view>
 
               <!-- 筛选 -->
-              <view class="topbg-sx-box-filter flex align-center">
+              <view class="topbg-sx-box-filter flex align-center" :class="{ activeColor: filledFieldsCount }">
                 <text
                   style="margin-right: 10rpx"
                   @click="goNavs('/package/screen/screen')"
-                  >筛选</text
+                  >筛选{{filledFieldsCount}}</text
                 >
                 <u-icon
                   name="arrow-down"
-                  color="#999999"
+                  :color="filledFieldsCount?'#016bf6':'#999999'"
                   size="16"
                   @click="goNavs('/package/screen/screen')"
                 ></u-icon>
@@ -293,6 +288,7 @@ export default {
 			name: '附近',
 		}
       ],
+	  county: '', //区
       city: "",
       searchKeyword: "", // 搜索关键词
       dataList: [], // 职位列表
@@ -312,14 +308,28 @@ export default {
 	  companyPeople : '' //公司规模
     };
   },
+  computed: {
+  	filledFieldsCount() {
+         const fields = [this.education, this.experience, this.industry, this.salaryRange, this.companyPeople];
+         const count = fields.filter(item => item).length;
+         return count > 0 ? '·' + count : '';
+  	}
+    },
   onLoad() {
     // 获取状态栏高度
     let systemInfo = uni.getSystemInfoSync();
     this.statusBarHeight = systemInfo.statusBarHeight || 0;
 	let that = this;
 	// 更换城市调用getJobSearchList
-	uni.$on('city', data => {
+	// uni.$on('city', data => {
+	// 	that.city = data.city
+	// 	uni.setStorageSync('city', that.city);
+	// 	this.searchPage = 1
+	// 	this.getJobSearchList();
+	// })
+	uni.$on('filterCity', data => {
 		that.city = data.city
+		that.county = data.county;
 		uni.setStorageSync('city', that.city);
 		this.searchPage = 1
 		this.getJobSearchList();
@@ -355,7 +365,8 @@ export default {
     this.getLocation();
   },
   onUnload(){
-	uni.$off('city');
+	  uni.$off('filterCity');
+	// uni.$off('city');
 	uni.$off('updateScreenFilterRecord');
 	uni.$off('updatePosition')
   },
@@ -1182,6 +1193,7 @@ page {
   height: 19vh;
 }
 
+
 .topbg-type.fixed {
   position: fixed;
   top: 9vh;
@@ -1191,4 +1203,9 @@ page {
   background: rgba(255, 255, 255, 0.95);
   backdrop-filter: blur(10rpx);
 }
+.activeColor{
+	color: #016bf6 !important;
+	border:1rpx solid #016bf6;
+	background: #fce9dc !important;
+}
 </style>

+ 38 - 17
pages/index/index.vue

@@ -139,29 +139,27 @@
 
 								<view class="topbg-sx-box-r flex align-center">
 									<!-- 城市 -->
-									<view class="topbg-sx-box-r-i flex align-center" style="">
-										<text style="margin-right: 10rpx;"
-											@click="goNavs('/package/jobIntention/city')">{{city?city:'选择城市'}}</text>
-										<u-icon name="arrow-down" color="#00B78F" size="16"
-											@click="goNavs('/package/jobIntention/city')"></u-icon>
+									<view class="topbg-sx-box-r-i flex align-center" style="" @click="goNav('/package/screen/city?city='+city+'&county='+county)">
+										<text style="margin-right: 10rpx;">{{county?county:city?city:'选择城市'}}</text>
+										<u-icon name="arrow-down" color="#016bf6" size="16"></u-icon>
 									</view>
 
 									<!-- <text style="color: #CCCCCC;margin-left: 30rpx;margin-right: 30rpx;">|</text> -->
 									<block v-if="current != typeList.length - 1">
 										<!-- 筛选 -->
-										<view class="topbg-sx-box-filter flex align-center">
+										<view class="topbg-sx-box-filter flex align-center" :class="{ activeColor: filledFieldsCount }">
 											<text style="margin-right: 10rpx;"
-												@click="goNavs('/package/screen/screen')">筛选</text>
-											<u-icon name="arrow-down" color="#999999" size="16"
+												@click="goNavs('/package/screen/screen')">筛选{{filledFieldsCount}}</text>
+											<u-icon name="arrow-down" :color="filledFieldsCount?'#016bf6':'#999999'" size="16"
 												@click="goNavs('/package/screen/screen')"></u-icon>
 										</view>
 									</block>
 									<block v-else>
 										<!-- 筛选 -->
-										<view class="topbg-sx-box-filter flex align-center">
+										<view class="topbg-sx-box-filter flex align-center" :class="{ activeColor: filledFieldsCount }">
 											<text style="margin-right: 10rpx;"
-												@click="goNavs('/package/screen/screenComp')">筛选</text>
-											<u-icon name="arrow-down" color="#999999" size="16"
+												@click="goNavs('/package/screen/screenComp')">筛选{{filledFieldsCount}}</text>
+											<u-icon name="arrow-down" color="filledFieldsCount?'#016bf6':'#999999'" size="16"
 												@click="goNavs('/package/screen/screenComp')"></u-icon>
 										</view>
 									</block>
@@ -255,7 +253,7 @@
 										<view class="gwList-box-item-box-label flex align-center flex-wrap">
 											<text class="job-tag">{{item.education}}</text>
 											<text class="job-tag">{{item.experience}}</text>
-											<text class="job-tag" v-for="(ite,ind) in item.welfareTag"
+											<text class="job-tag" v-for="(ite,ind) in item.welfareTag||[]"
 												:key="ind">{{ite}}</text>
 										</view>
 										<!-- <view class="gwList-box-item-box-line"></view> -->
@@ -267,7 +265,7 @@
 													style="width: 58rpx;height: 58rpx;border-radius: 50%;" mode="">
 												</image>
 												<view class="company-info-text">
-													{{item.user.userName?item.user.userName:'未知'}}·{{item.hr.hrPosition?item.hr.hrPosition:'未知'}}
+													{{item.user&&item.user.userName||'未知'}}·{{item.hr&&item.hr.hrPosition||'未知'}}
 												</view>
 												<view v-if="item.respondTime" class="reply-time">{{item.respondTime}}
 												</view>
@@ -532,6 +530,7 @@
 				statusBarHeight: 0, // 状态栏高度
 				enable: true, //开启吸顶
 				goback: false,
+				county: '', //区
 				city: '',
 				companyName: "",
 				companyId: "",
@@ -627,6 +626,13 @@
 				imageUrl: this.bgImg
 			}
 		},
+		computed: {
+			filledFieldsCount() {
+		       const fields = [this.education, this.experience, this.industry, this.salaryRange, this.companyPeople];
+		       const count = fields.filter(item => item).length;
+		       return count > 0 ? '·' + count : '';
+			}
+		},
 		watch: {
 			current(newData, oldData) {
 				console.log(this.current)
@@ -798,15 +804,24 @@
 			uni.$on('updateScreenFilterRecord', () => {
 				//待处理
 			})
-			uni.$on('city', data => {
+			// uni.$on('city', data => {
+			// 	that.city = data.city
+			// 	uni.setStorageSync('city', that.city)
+			// })
+			uni.$on('filterCity', data => {
+				console.log(data, '选择的市')
 				that.city = data.city
+				that.county = data.county
 				uni.setStorageSync('city', that.city)
+				this.page = 1
+				that.getUserList();
 			})
 		},
 		onUnload() {
+			uni.$off('filterCity');
 			uni.$off('preferenceUpdated')
 			uni.$off('updateScreenFilterRecord')
-			uni.$off('city')
+			// uni.$off('city')
 		},
 		//下拉刷新
 		onPullDownRefresh() {
@@ -1415,6 +1430,7 @@
 					//postType: this.typeList.length > 0 ? this.typeList[this.current].id : '',
 					ruleClassifyName: this.typeList[this.current].name, //岗位名称
 					screen: +this.currentSx + 1, //1推荐 2最新
+					county: this.county, //区
 					city: this.city == '全国' ? '' : this.city, //城市
 					salaryRange: this.salaryRange, //薪资范围
 					education: this.education, //学历
@@ -2169,7 +2185,7 @@
 			border-radius: 6px;
 			background: #D6E7FD;
 			padding: 8rpx 12rpx;
-			display: inline-block;
+			// display: inline-block;
 			min-width: 60rpx;
 			white-space: nowrap;
 			cursor: pointer;
@@ -2188,7 +2204,7 @@
 			border-radius: 6px;
 			background: rgba(198, 198, 198, 0.1);
 			padding: 8rpx 12rpx;
-			display: inline-block;
+			// display: inline-block;
 			min-width: 60rpx;
 			white-space: nowrap;
 			cursor: pointer;
@@ -2719,4 +2735,9 @@
 		color: #333333;
 		font-size: 24upx;
 	}
+	.activeColor{
+		color: #016bf6 !important;
+		border:1rpx solid #016bf6;
+		background: #D6E7FD !important;
+	}
 </style>