Jelajahi Sumber

城市选择优化

wkw 7 bulan lalu
induk
melakukan
323ae1bf64
2 mengubah file dengan 29 tambahan dan 16 penghapusan
  1. 13 9
      pages/index/game/gameList.vue
  2. 16 7
      pages/index/index.vue

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

@@ -66,17 +66,12 @@
 
             <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="#016bf6"
                   size="16"
-                  @click="goNavs('/package/jobIntention/city')"
                 ></u-icon>
               </view>
 
@@ -293,6 +288,7 @@ export default {
 			name: '附近',
 		}
       ],
+	  county: '', //区
       city: "",
       searchKeyword: "", // 搜索关键词
       dataList: [], // 职位列表
@@ -325,8 +321,15 @@ export default {
     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();
@@ -362,7 +365,8 @@ export default {
     this.getLocation();
   },
   onUnload(){
-	uni.$off('city');
+	  uni.$off('filterCity');
+	// uni.$off('city');
 	uni.$off('updateScreenFilterRecord');
 	uni.$off('updatePosition')
   },

+ 16 - 7
pages/index/index.vue

@@ -139,11 +139,9 @@
 
 								<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="#016bf6" 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> -->
@@ -532,6 +530,7 @@
 				statusBarHeight: 0, // 状态栏高度
 				enable: true, //开启吸顶
 				goback: false,
+				county: '', //区
 				city: '',
 				companyName: "",
 				companyId: "",
@@ -805,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() {
@@ -1390,6 +1398,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, //学历