| | |
| | | <div class="home-header"> |
| | | <div class="home-searchbar-wrapper"> |
| | | <div class="searchbar-container"> |
| | | <BlSearchbar v-model.trim="searchValue" placeholder="搜索任务"></BlSearchbar> |
| | | <BlSearchbar |
| | | v-model.trim="searchValue" |
| | | placeholder="搜索任务" |
| | | @search="handleSearch" |
| | | @change="handleSearch" |
| | | ></BlSearchbar> |
| | | </div> |
| | | <div class="city-btn" @click="goCitySelect"> |
| | | <Location2 :size="16" /> |
| | |
| | | v-model="queryState.orderType" |
| | | name="home-tab" |
| | | :showPaneContent="false" |
| | | :showSmile="false" |
| | | class="home-tabs" |
| | | isTransparent |
| | | title-gutter="12" |
| | | title-gutter="8" |
| | | title-scroll |
| | | > |
| | | <ProTabPane :title="`推荐`" :pane-key="HomeOrderType.Recommend"></ProTabPane> |
| | | <ProTabPane :title="`最新`" :pane-key="HomeOrderType.LastShelfTime"></ProTabPane> |
| | | <template #right> |
| | | <Menu> |
| | | <MenuItem |
| | | v-model="queryState.orderByProperty" |
| | | title="筛选" |
| | | ref="selectItem" |
| | | :options="[ |
| | | { text: '排序', value: 'userId' }, |
| | | { text: '按关注时间', value: 'creationTime' }, |
| | | ]" |
| | | /> |
| | | <MenuItem title="筛选" ref="selectItem"> |
| | | <HomeQueryMenuView |
| | | v-model:gender="queryState.gender" |
| | | @close="handleMenuSelectClose" |
| | | ></HomeQueryMenuView> |
| | | </MenuItem> |
| | | </Menu> |
| | | </template> |
| | | </ProTabs> |
| | |
| | | :key="queryState.orderType" |
| | | > |
| | | <template #renderItem="{ item }"> |
| | | <TaskCard /> |
| | | <TaskCard @click="goTaskDetail(item)" /> |
| | | </template> |
| | | </InfiniteLoading> |
| | | </PageLayoutWithBg> |
| | |
| | | import _ from 'lodash'; |
| | | import IconLogo from '@/assets/home/icon-logo.png'; |
| | | import { useInfiniteLoading } from '@12333/hooks'; |
| | | import { OrderInputType } from '@12333/constants'; |
| | | import { OrderInputType, Gender } from '@12333/constants'; |
| | | import * as orderServices from '@12333/services/api/Order'; |
| | | import { TaskCard, ProTabs, ProTabPane } from '@12333/components'; |
| | | import { HomeOrderType } from './constants'; |
| | | import HomeQueryMenuView from './HomeQueryMenuView.vue'; |
| | | |
| | | const { locationCity } = useUser(); |
| | | |
| | | Taro.usePageScroll(() => { |
| | | console.log('11', 11); |
| | | }); |
| | | |
| | | const searchValue = ref(''); |
| | | |
| | | const queryState = reactive({ |
| | | searchValueTrim: '', |
| | | orderType: HomeOrderType.Recommend, |
| | | orderByProperty: 'userId', |
| | | gender: '' as any as Gender, |
| | | }); |
| | | |
| | | const handleSearch = _.debounce(function () { |
| | |
| | | queryKey: ['orderServices/getFrontOrderList', queryState], |
| | | } |
| | | ); |
| | | |
| | | const selectItem = ref(); |
| | | |
| | | function handleMenuSelectClose() { |
| | | selectItem.value?.toggle?.(); |
| | | } |
| | | |
| | | function goTaskDetail(item: API.FrontOrderList) { |
| | | Taro.navigateTo({ |
| | | url: `${RouterPath.taskDetail}?id=${item.id}`, |
| | | }); |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |