|  |  | 
 |  |  | <template> | 
 |  |  |   <PageLayoutWithBg class="index-page-wrapper" :title="'首页'" :need-auth="false"> | 
 |  |  |   <PageLayoutWithBg class="index-page-wrapper" :title="''" :need-auth="false"> | 
 |  |  |     <template #left> | 
 |  |  |       <div class="menu-btn-wrapper city-btn" @click="goCitySelect"> | 
 |  |  |         <div class="city-btn-text">{{ locationCity }}</div> | 
 |  |  |         <RectDown :size="12" /> | 
 |  |  |       <div class="menu-btn-wrapper menu-logo"> | 
 |  |  |         <img :src="IconLogo" class="logo" /> | 
 |  |  |       </div> | 
 |  |  |     </template> | 
 |  |  |     <div class="home-header"> | 
 |  |  |       <div class="home-searchbar-wrapper"> | 
 |  |  |         <div class="city-btn-wrapper"> | 
 |  |  |           <div class="city-btn"> | 
 |  |  |             <img :src="IconLocaltion" class="city-btn-icon" /> | 
 |  |  |             <div class="city-btn-text">{{ locationCity }}</div> | 
 |  |  |           </div> | 
 |  |  |         </div> | 
 |  |  |         <div class="reset-localtion" @click="resetLocation">重新定位</div> | 
 |  |  |       </div> | 
 |  |  |       <!-- <div class="home-banner-wrapper"> | 
 |  |  |         <nut-swiper :auto-play="3000"> | 
 |  |  |           <nut-swiper-item v-for="(item, index) in list" :key="index"> | 
 |  |  |             <img :src="item" class="banner-img" draggable="false" /> | 
 |  |  |           </nut-swiper-item> | 
 |  |  |         </nut-swiper> | 
 |  |  |       </div> --> | 
 |  |  |     </div> | 
 |  |  |     <ProTabs | 
 |  |  |       v-model="queryState.orderType" | 
 |  |  |       name="home-tab" | 
 |  |  |       :showPaneContent="false" | 
 |  |  |       :showSmile="false" | 
 |  |  |       class="home-tabs" | 
 |  |  |       isTransparent | 
 |  |  |       title-gutter="8" | 
 |  |  |       title-scroll | 
 |  |  |     > | 
 |  |  |       <ProTabPane :title="`最新`" :pane-key="HomeOrderType.LastShelfTime"></ProTabPane> | 
 |  |  |       <template #right> | 
 |  |  |         <Menu> | 
 |  |  |           <MenuItem title="岗位" ref="selectPositionItem"> | 
 |  |  |             <HomeQueryPositionMenuView | 
 |  |  |               v-model:query="queryPositionState" | 
 |  |  |               @close="handleMenuSelectPositionClose" | 
 |  |  |             ></HomeQueryPositionMenuView> | 
 |  |  |           </MenuItem> | 
 |  |  |           <MenuItem title="筛选" ref="selectItem"> | 
 |  |  |             <HomeQueryMenuView | 
 |  |  |               v-model:query="queryMenuState" | 
 |  |  |               @close="handleMenuSelectClose" | 
 |  |  |             ></HomeQueryMenuView> | 
 |  |  |           </MenuItem> | 
 |  |  |         </Menu> | 
 |  |  |       </template> | 
 |  |  |     </ProTabs> | 
 |  |  |     <InfiniteLoading | 
 |  |  |       scrollViewClassName="common-infinite-scroll-list home-list" | 
 |  |  |       v-bind="infiniteLoadingProps" | 
 |  |  |       :key="queryState.orderType" | 
 |  |  |     > | 
 |  |  |       <template #renderItem="{ item }"> | 
 |  |  |         <FlexJobCard | 
 |  |  |           :name="item.name" | 
 |  |  |           :gender="item.gender" | 
 |  |  |           :age="item.age" | 
 |  |  |           :isReal="item.isReal" | 
 |  |  |           :personalIdentityContent="item.personalIdentityContent" | 
 |  |  |           :educationalBackgroundContent="item.educationalBackgroundContent" | 
 |  |  |           :taskCount="item.taskCount" | 
 |  |  |           :avatar="item.avatar" | 
 |  |  |           :workExperience="item.workExperience" | 
 |  |  |           :workSeniority="item.workSeniority" | 
 |  |  |           @click="goFlexJobDetail(item)" | 
 |  |  |           :showFooterLeft="false" | 
 |  |  |         /> | 
 |  |  |       </template> | 
 |  |  |     </InfiniteLoading> | 
 |  |  |   </PageLayoutWithBg> | 
 |  |  | </template> | 
 |  |  |  | 
 |  |  | 
 |  |  | import { useUserStore } from '@/stores/modules/user'; | 
 |  |  | import { RectDown } from '@nutui/icons-vue-taro'; | 
 |  |  | import Taro from '@tarojs/taro'; | 
 |  |  | import { LocationUtils } from '@12333/utils'; | 
 |  |  | import { LocationUtils, trim } from '@12333/utils'; | 
 |  |  | import IconLogo from '@/assets/home/icon-logo.png'; | 
 |  |  | import { ProTabs, ProTabPane, FlexJobCard } from '@12333/components'; | 
 |  |  | import { HomeOrderType } from './constants'; | 
 |  |  | import { useInfiniteLoading } from '@12333/hooks'; | 
 |  |  | import { | 
 |  |  |   EnumPagedListOrder, | 
 |  |  |   EnumTaskRecommendStatus, | 
 |  |  |   EnumTaskReleaseStatus, | 
 |  |  |   EnumUserGender, | 
 |  |  | } from '@12333/constants'; | 
 |  |  | import _ from 'lodash'; | 
 |  |  | import HomeQueryMenuView from './HomeQueryMenuView.vue'; | 
 |  |  | import HomeQueryPositionMenuView from './HomeQueryPositionMenuView.vue'; | 
 |  |  | import IconLocaltion from '@/assets/home/icon-localtion.png'; | 
 |  |  | import { setLocationCity } from '@/utils'; | 
 |  |  | import * as userResumeServices from '@12333/services/apiV2/userResume'; | 
 |  |  |  | 
 |  |  | const { locationCity } = useUser(); | 
 |  |  |  | 
 |  |  | onMounted(async () => { | 
 |  |  |   try { | 
 |  |  |     await resetLocation(); | 
 |  |  |   } catch (error) {} | 
 |  |  | }); | 
 |  |  |  | 
 |  |  | const userStore = useUserStore(); | 
 |  |  |  | 
 |  |  | const queryMenuState = reactive({ | 
 |  |  |   genderLimit: '' as any as EnumUserGender, | 
 |  |  |   age: [15, 65], | 
 |  |  |   personalIdentityCode: '', | 
 |  |  |   certificateType: '', | 
 |  |  | }); | 
 |  |  |  | 
 |  |  | const queryPositionState = reactive({ | 
 |  |  |   userExpectJobs: [] as string[], | 
 |  |  | }); | 
 |  |  |  | 
 |  |  | const queryState = reactive({ | 
 |  |  |   orderType: HomeOrderType.LastShelfTime, | 
 |  |  | }); | 
 |  |  |  | 
 |  |  | const { infiniteLoadingProps } = useInfiniteLoading( | 
 |  |  |   ({ pageParam }) => { | 
 |  |  |     let params: API.GetUserResumesQuery = { | 
 |  |  |       pageModel: { | 
 |  |  |         rows: 20, | 
 |  |  |         page: pageParam, | 
 |  |  |         orderInput: [{ property: 'createdTime', order: EnumPagedListOrder.Desc }], | 
 |  |  |       }, | 
 |  |  |       userExpectJobs: queryPositionState.userExpectJobs, | 
 |  |  |       gender: queryMenuState.genderLimit, | 
 |  |  |       personalIdentityCode: queryMenuState.personalIdentityCode, | 
 |  |  |       // ageMin: queryMenuState.age[0], | 
 |  |  |       // ageMax: queryMenuState.age[1], | 
 |  |  |       userCredentials: queryMenuState.certificateType ? [queryMenuState.certificateType] : null, | 
 |  |  |     }; | 
 |  |  |  | 
 |  |  |     return userResumeServices.getOpenUserResumes(params, { | 
 |  |  |       showLoading: false, | 
 |  |  |     }); | 
 |  |  |   }, | 
 |  |  |   { | 
 |  |  |     queryKey: [ | 
 |  |  |       'userResumeServices/getOpenUserResumes', | 
 |  |  |       queryState, | 
 |  |  |       queryMenuState, | 
 |  |  |       queryPositionState, | 
 |  |  |     ], | 
 |  |  |   } | 
 |  |  | ); | 
 |  |  |  | 
 |  |  | function goCitySelect() { | 
 |  |  |   Taro.navigateTo({ | 
 |  |  |     url: RouterPath.citySelect, | 
 |  |  |   }); | 
 |  |  | } | 
 |  |  | // onMounted(async () => { | 
 |  |  | //   if (!isSetMatchMakingIdentity.value) { | 
 |  |  | //     Taro.navigateTo({ | 
 |  |  | //       url: RouterPath.toggleMatchMakingIdentity, | 
 |  |  | //     }); | 
 |  |  | //   } | 
 |  |  | // }); | 
 |  |  |  | 
 |  |  | const list = ref([ | 
 |  |  |   'https://storage.360buyimg.com/jdc-article/NutUItaro34.jpg', | 
 |  |  |   'https://storage.360buyimg.com/jdc-article/NutUItaro2.jpg', | 
 |  |  |   'https://storage.360buyimg.com/jdc-article/welcomenutui.jpg', | 
 |  |  |   'https://storage.360buyimg.com/jdc-article/fristfabu.jpg', | 
 |  |  | ]); | 
 |  |  |  | 
 |  |  | const selectItem = ref(); | 
 |  |  | const selectPositionItem = ref(); | 
 |  |  |  | 
 |  |  | function handleMenuSelectClose() { | 
 |  |  |   selectItem.value?.toggle?.(); | 
 |  |  | } | 
 |  |  |  | 
 |  |  | function handleMenuSelectPositionClose() { | 
 |  |  |   selectPositionItem.value?.toggle?.(); | 
 |  |  | } | 
 |  |  |  | 
 |  |  | function goFlexJobDetail(item: API.GetUserResumesQueryResultItem) { | 
 |  |  |   Taro.navigateTo({ | 
 |  |  |     url: `${RouterPath.flexJobDetail}?userId=${item.id}`, | 
 |  |  |   }); | 
 |  |  | } | 
 |  |  |  | 
 |  |  | async function resetLocation() { | 
 |  |  |   try { | 
 |  |  |     await setLocationCity(); | 
 |  |  |   } catch (error) {} | 
 |  |  | } | 
 |  |  | </script> | 
 |  |  |  | 
 |  |  | <style lang="scss"> | 
 |  |  | @import '@/styles/common.scss'; | 
 |  |  |  | 
 |  |  | .index-page-wrapper { | 
 |  |  |   .city-btn { | 
 |  |  |   .menu-logo { | 
 |  |  |     padding: 0; | 
 |  |  |  | 
 |  |  |     .logo { | 
 |  |  |       width: 96px; | 
 |  |  |       height: 64px; | 
 |  |  |     } | 
 |  |  |   } | 
 |  |  |  | 
 |  |  |   .nut-menu__item + .nut-menu__item { | 
 |  |  |     margin-left: 24px; | 
 |  |  |   } | 
 |  |  |  | 
 |  |  |   .home-searchbar-wrapper { | 
 |  |  |     padding: 32px 0 28px; | 
 |  |  |     display: flex; | 
 |  |  |     align-items: center; | 
 |  |  |  | 
 |  |  |     .city-btn-text { | 
 |  |  |       max-width: 200px; | 
 |  |  |       @include ellipsis; | 
 |  |  |       margin-right: 12px; | 
 |  |  |     .city-btn-wrapper { | 
 |  |  |       flex: 1; | 
 |  |  |       min-width: 0; | 
 |  |  |  | 
 |  |  |       .city-btn { | 
 |  |  |         display: flex; | 
 |  |  |         align-items: center; | 
 |  |  |         padding-right: 36px; | 
 |  |  |         color: boleGetCssVar('text-color', 'primary'); | 
 |  |  |  | 
 |  |  |         .city-btn-icon { | 
 |  |  |           width: 40px; | 
 |  |  |           height: 40px; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         .city-btn-text { | 
 |  |  |           max-width: 200px; | 
 |  |  |           @include ellipsis; | 
 |  |  |           margin-left: 12px; | 
 |  |  |           font-size: 30px; | 
 |  |  |         } | 
 |  |  |       } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     .reset-localtion { | 
 |  |  |       font-weight: 400; | 
 |  |  |       font-size: 24px; | 
 |  |  |       color: boleGetCssVar('color', 'primary'); | 
 |  |  |       line-height: 28px; | 
 |  |  |     } | 
 |  |  |   } | 
 |  |  |  | 
 |  |  |   .home-banner-wrapper { | 
 |  |  |     .banner-img { | 
 |  |  |       width: 100%; | 
 |  |  |       height: 260px; | 
 |  |  |       object-fit: cover; | 
 |  |  |     } | 
 |  |  |   } | 
 |  |  |  | 
 |  |  |   .home-header { | 
 |  |  |     padding: 0 boleGetCssVar('size', 'body-padding-h'); | 
 |  |  |   } | 
 |  |  |  | 
 |  |  |   .home-list { | 
 |  |  |     @include infiniteLoadingInTabBarPage; | 
 |  |  |   } | 
 |  |  | } | 
 |  |  | </style> |