|  |  |  | 
|---|
|  |  |  | ></BlSearchbar> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="city-btn" @click="goCitySelect"> | 
|---|
|  |  |  | <Location2 :size="16" /> | 
|---|
|  |  |  | <img :src="IconLocaltion" class="city-btn-icon" /> | 
|---|
|  |  |  | <div class="city-btn-text">{{ locationCity }}</div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="home-banner-wrapper"> | 
|---|
|  |  |  | <!-- <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> --> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <ProTabs | 
|---|
|  |  |  | v-model="queryState.orderType" | 
|---|
|  |  |  | 
|---|
|  |  |  | <Menu> | 
|---|
|  |  |  | <MenuItem title="筛选" ref="selectItem"> | 
|---|
|  |  |  | <HomeQueryMenuView | 
|---|
|  |  |  | v-model:gender="queryState.gender" | 
|---|
|  |  |  | v-model:query="queryMenuState" | 
|---|
|  |  |  | @close="handleMenuSelectClose" | 
|---|
|  |  |  | ></HomeQueryMenuView> | 
|---|
|  |  |  | </MenuItem> | 
|---|
|  |  |  | 
|---|
|  |  |  | :key="queryState.orderType" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template #renderItem="{ item }"> | 
|---|
|  |  |  | <TaskCard @click="goTaskDetail(item)" /> | 
|---|
|  |  |  | <TaskCard @click="goTaskDetail(item)" v-bind="item" /> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </InfiniteLoading> | 
|---|
|  |  |  | </PageLayoutWithBg> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script setup lang="ts"> | 
|---|
|  |  |  | import { useUser, useTaskList, HomeOrderType } from '@/hooks'; | 
|---|
|  |  |  | import { useUserStore } from '@/stores/modules/user'; | 
|---|
|  |  |  | import { RectDown, Location2 } from '@nutui/icons-vue-taro'; | 
|---|
|  |  |  | import { useUser } from '@/hooks'; | 
|---|
|  |  |  | import Taro from '@tarojs/taro'; | 
|---|
|  |  |  | import { LocationUtils, trim } from '@12333/utils'; | 
|---|
|  |  |  | import { setLocationCity } from '@/utils'; | 
|---|
|  |  |  | import _ from 'lodash'; | 
|---|
|  |  |  | import IconLogo from '@/assets/home/icon-logo.png'; | 
|---|
|  |  |  | import { TaskCard, ProTabs, ProTabPane } from '@12333/components'; | 
|---|
|  |  |  | import HomeQueryMenuView from './HomeQueryMenuView.vue'; | 
|---|
|  |  |  | import IconLocaltion from '@/assets/task/icon-localtion.png'; | 
|---|
|  |  |  | import { useAllAreaList, useTaskList, HomeOrderType } from '@12333/hooks'; | 
|---|
|  |  |  | import { useAccessLogin } from '@/hooks'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { locationCity } = useUser(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const userStore = useUserStore(); | 
|---|
|  |  |  | const { findAreaCodeFromName } = useAllAreaList(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { searchValue, queryState, handleSearch, infiniteLoadingProps } = useTaskList(); | 
|---|
|  |  |  | const { searchValue, queryState, handleSearch, infiniteLoadingProps, queryMenuState } = useTaskList( | 
|---|
|  |  |  | { | 
|---|
|  |  |  | cityCode: computed(() => findAreaCodeFromName(locationCity.value)), | 
|---|
|  |  |  | enabled: computed(() => !!findAreaCodeFromName(locationCity.value)), | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | onMounted(async () => { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | await setLocationCity(); | 
|---|
|  |  |  | } catch (error) {} | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function goCitySelect() { | 
|---|
|  |  |  | Taro.navigateTo({ | 
|---|
|  |  |  | 
|---|
|  |  |  | selectItem.value?.toggle?.(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function goTaskDetail(item: API.FrontOrderList) { | 
|---|
|  |  |  | function goTaskDetail(item: API.GetTaskInfosQueryResultItem) { | 
|---|
|  |  |  | Taro.navigateTo({ | 
|---|
|  |  |  | url: `${RouterPath.taskDetail}?id=${item.id}`, | 
|---|
|  |  |  | url: `${RouterPath.taskDetail}?id=${item.id}&from=apply`, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const goTaskApply = useAccessLogin((item: API.GetTaskInfosQueryResultItem) => { | 
|---|
|  |  |  | console.log('item: ', item); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <style lang="scss"> | 
|---|
|  |  |  | 
|---|
|  |  |  | padding-left: 36px; | 
|---|
|  |  |  | color: boleGetCssVar('text-color', 'primary'); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .city-btn-icon { | 
|---|
|  |  |  | width: 40px; | 
|---|
|  |  |  | height: 40px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .city-btn-text { | 
|---|
|  |  |  | max-width: 200px; | 
|---|
|  |  |  | @include ellipsis; | 
|---|