lyuis 7 luni în urmă
părinte
comite
6fe6587a22

+ 14 - 3
components/hg-level4-address/hgLevel4Address.vue

@@ -43,6 +43,10 @@
 			city: {
 				type: [String, Number],
 				default: ''
+			},
+			county: {
+				type: [String, Number],
+				default: ''
 			}
 		},
 		data() {
@@ -103,10 +107,13 @@
 						if (city.code == this.city || city.name.indexOf(this.city) !== -1) {
 							this.selectedProvince = province
 							this.selectedCity = city
-							this.selectedArea = {
-								code: 'all',
-								name: '全部'
+							
+							for (const area of city.children || []) {
+								if (area.code == this.county || area.name.indexOf(this.county) !== -1) {
+									this.selectedArea=area
+								}
 							}
+	
 							this.selectedStreet = {
 								code: 'all',
 								name: '全部'
@@ -153,6 +160,7 @@
 
 			/** 街道选择 */
 			selectStreet(street) {
+				return this.$queue.showToast('街道选择暂未开放,')
 				this.selectedStreet = street
 			},
 
@@ -231,6 +239,9 @@
 	.street{
 		flex: 1;
 		background: linear-gradient(to right, rgba(251, 251, 251, 1), rgba(255, 255, 255, 1));
+		.item{
+			color: #ccc;
+		}
 	}
 	.item {
 		padding: 15rpx 50rpx;

+ 41 - 10
package/screen/city.vue

@@ -5,12 +5,14 @@
 				<view class="nav-left" @click="goBack">
 					<u-icon name="close" color="#333" size="32"></u-icon>
 				</view>
-				<view class="nav-title">城市选择</view>
-				<view class="nav-right"></view>
+				<view class="nav-title">{{city||'北京'}}</view>
+				<view @click="goTo" class="nav-right">
+					<image src="../../static/images/filter.svg" mode="widthFix"></image> 筛选城市
+				</view>
 			</view>
 		</view>
 		 <view class="content">
-			<hg-level4-address :city="city"
+			<hg-level4-address :city="city" :county="county"
 			  placeholder="请选择地址"
 			  @confirm="onAddressConfirm"
 			  >         
@@ -28,14 +30,16 @@
 		data() {
 			return {
 				statusBarHeight: 0, // 状态栏高度
-				
+				city: '', //市
+				county: '', //区
 			};
 		},
-		onLoad(option) {
+		onLoad(options) {
 			// 获取状态栏高度
 			let systemInfo = uni.getSystemInfoSync();
 			this.statusBarHeight = systemInfo.statusBarHeight || 0;
-			this.city = option.city
+			this.city = options&&options.city
+			this.county = options&&options.county
 		},
 		onShow() {
 
@@ -43,10 +47,21 @@
 		methods: {
 			onAddressConfirm(selected) {
 			  console.log("选中的地址:", selected);
-			},
+							this.city = selected[1].name
+							this.county = selected[2].name
+							let data = {
+								city: this.city=='全国'||this.city=='全部'?'':this.city,
+								county: this.county == '全部' ? '' : this.county
+							}
+							uni.$emit('filterCity', data)
+							uni.navigateBack()
+						},
 			goBack(){
+				uni.navigateBack()
+			},
+			goTo(){
 				uni.navigateTo({
-					url:'/package/search/search'
+					url:'/package/jobIntention/city'
 				})
 			}
 		}
@@ -66,11 +81,27 @@
 			box-sizing: border-box;
 			padding: 0 32rpx;
 			.nav-left, .nav-right {
-				width: 60rpx;
+				width: 146rpx;
 				height: 60rpx;
 				display: flex;
 				align-items: center;
-				justify-content: center;
+				justify-content: flex-start;
+				padding-left: 20rpx;
+			}
+			.nav-right{
+				width: fit-content;
+				white-space: nowrap;
+				color: #016Bf6;
+				align-items: center;
+				justify-content: flex-start;
+				padding-left: 0rpx;
+				image{
+					width: 28rpx;
+					display: block;
+					margin-right:6rpx;
+					position: relative;
+					top:2rpx
+				}
 			}
 			.nav-title {
 				color: rgba(51, 51, 51, 1);

+ 1 - 0
static/images/filter.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1764319656146" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6920" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48"><path d="M548.8 959c-19.9 0-36-16.1-36-36V413.6c0-8.6 3.1-17 8.7-23.5l218-253h-565l200.8 254.2c5 6.4 7.8 14.2 7.8 22.3v312.6c0 19.9-16.1 36-36 36s-36-16.1-36-36V426.1L72 123.5c-8.6-10.8-10.2-25.6-4.2-38s18.6-20.3 32.4-20.3h717.9c14.1 0 26.9 8.2 32.7 21 5.9 12.8 3.7 27.8-5.5 38.5L584.8 427v496c0 19.9-16.1 36-36 36z" fill="#016bf6" p-id="6921"></path><path d="M923.4 521.6H710.1c-19.9 0-36-16.1-36-36s16.1-36 36-36h213.3c19.9 0 36 16.1 36 36s-16.1 36-36 36zM923.4 704.4H710.1c-19.9 0-36-16.1-36-36s16.1-36 36-36h213.3c19.9 0 36 16.1 36 36s-16.1 36-36 36z" fill="#016bf6" p-id="6922"></path></svg>