Selaa lähdekoodia

改为可选择一级行业(无子行业情况下)

htc 21 tuntia sitten
vanhempi
commit
6585de4bb5
1 muutettua tiedostoa jossa 8 lisäystä ja 5 poistoa
  1. 8 5
      pagesPublish/industry.vue

+ 8 - 5
pagesPublish/industry.vue

@@ -29,8 +29,8 @@
 					</scroll-view>
 				</view>
 			</view> -->
-			<view class="bottom-top">
-				已选:<span>{{firstName}} - {{secondName}}</span>
+			<view class="bottom-top adfac">
+				已选:<span>{{firstName}}</span><span v-if="secondName" style="margin: 0 10rpx;">-</span><span v-if="secondName">{{secondName}}</span>
 			</view>
 			<view class="bottom-btns adfacjb">
 				<!-- <view class="bottom-btns-btn" @click="clear">清空条件</view> -->
@@ -153,10 +153,13 @@
 				})
 			},
 			confirm(){
-				if(!this.secondName) return this.$showToast('请先选择行业')
+				if(this.secondList.length===0&&!this.firstName) return this.$showToast('请选择主行业')
+				if(this.secondList.length&&!this.secondName) return this.$showToast(`请选择子行业`)
+				const industryId = this.secondList.length?this.sid:this.fid;
+				const industryName = this.secondList.length?this.secondName:this.firstName;
 				this.getOpenerEventChannel().emit('selectConfirm',{
-					industryId:this.sid,
-					industryName:this.secondName
+					industryId,
+					industryName
 				})
 				uni.navigateBack()
 			}