zhengnaiwen_citu 5 mesi fa
parent
commit
fa15d64624
2 ha cambiato i file con 27 aggiunte e 18 eliminazioni
  1. 10 10
      components/FilterList/index.vue
  2. 17 8
      pages/index/position.vue

+ 10 - 10
components/FilterList/index.vue

@@ -53,17 +53,17 @@ const props = defineProps({
   lazy: { type: Boolean, default: false },
   lazy: { type: Boolean, default: false },
 })
 })
 
 
-const popup = ref()
+// const popup = ref()
 
 
-const handleOpen = (index) => {
-  popup.value[index].open('bottom')
-}
-const handleChangeItem = (i, item) => {
-  if (i === item.active) {
-    return
-  }
-  item.active = i
-}
+// const handleOpen = (index) => {
+//   popup.value[index].open('bottom')
+// }
+// const handleChangeItem = (i, item) => {
+//   if (i === item.active) {
+//     return
+//   }
+//   item.active = i
+// }
 
 
 
 
 const handleClick = (e, name, item) => {
 const handleClick = (e, name, item) => {

+ 17 - 8
pages/index/position.vue

@@ -103,7 +103,7 @@ const showAdvertisePop = ref(false)
 const swiperAdList = ref([])
 const swiperAdList = ref([])
 const getSystemWebContent = async () => {
 const getSystemWebContent = async () => {
   const { data } = await getWebContent()
   const { data } = await getWebContent()
-  swiperAdList.value = data.appHomeCarousel || []
+  swiperAdList.value = data?.appHomeCarousel || []
   // 是否展示弹窗广告
   // 是否展示弹窗广告
   showAdvertisePop.value = data && data.appAdvertisement && data.appAdvertisement.length ? true : false
   showAdvertisePop.value = data && data.appAdvertisement && data.appAdvertisement.length ? true : false
 }
 }
@@ -111,7 +111,7 @@ getSystemWebContent()
 
 
 
 
 const filterList = ref([
 const filterList = ref([
-  { label: '城市', dictType: 'areaTreeDataExtend', key: 'areaIds', map: { text: 'name', value: 'id' } },
+  { label: '城市', multiple: true, dictType: 'areaTreeDataExtend', key: 'areaIds', map: { text: 'name', value: 'id' } },
   // { label: '行业', dictType: 'industryTreeData',key: 'industryIds', map: { text: 'nameCn', value: 'id' } },
   // { label: '行业', dictType: 'industryTreeData',key: 'industryIds', map: { text: 'nameCn', value: 'id' } },
   { label: '职位', dictType: 'positionTreeData',key: 'positionId', map: { text: 'nameCn', value: 'id' } },
   { label: '职位', dictType: 'positionTreeData',key: 'positionId', map: { text: 'nameCn', value: 'id' } },
   { label: '求职类型', dictType: 'menduner_job_type', key: 'jobType' },
   { label: '求职类型', dictType: 'menduner_job_type', key: 'jobType' },
@@ -212,7 +212,15 @@ const getData = async () => {
 
 
   // 带搜索条件(除分页外)用职位搜索接口,无条件则用推荐接口
   // 带搜索条件(除分页外)用职位搜索接口,无条件则用推荐接口
   const api = hasValue ? getJobAdvertisedSearch : getPromotedPosition
   const api = hasValue ? getJobAdvertisedSearch : getPromotedPosition
-  const params = hasValue ? query : { pageSize: query.pageSize, pageNo: query.pageNo, hire: 0 }
+  const _query = Object.keys(query).reduce((acc, cur) => {
+    if (!query[cur]) {
+      return acc
+    }
+    acc[cur] = query[cur]
+    return acc
+    
+  }, {})
+  const params = hasValue ? _query : { pageSize: query.pageSize, pageNo: query.pageNo, hire: 0 }
   type.value = hasValue ? 'position' : 'recommend'
   type.value = hasValue ? 'position' : 'recommend'
   try {
   try {
     const res = await api(params)
     const res = await api(params)
@@ -250,11 +258,12 @@ const onScroll = (e) =>{
 }
 }
 
 
 const handleSearch = (key, value) => {
 const handleSearch = (key, value) => {
-  if (key === 'positionId' || key === 'payScope') {
-    query[key] = value || null
-  } else {
-    query[key] = value ? [value] : []
-  }
+  query[key] = value
+  // if (key === 'positionId' || key === 'payScope') {
+  //   query[key] = value || null
+  // } else {
+  //   query[key] = value ? [value] : []
+  // }
   onSearch()
   onSearch()
 }
 }