diff --git a/src/components/search-city/index.tsx b/src/components/search-city/index.tsx index 3463812..b03b1f4 100644 --- a/src/components/search-city/index.tsx +++ b/src/components/search-city/index.tsx @@ -53,10 +53,17 @@ export interface SearchCityProps { onSelectCity: (cityCode: string) => void; currentCity?: string; forGroup?: boolean; + banner?: string; offset?: number; } -export default function SearchCity({ onSelectCity, currentCity = '', forGroup = false, offset = 0 }: SearchCityProps) { +export default function SearchCity({ + onSelectCity, + currentCity = '', + banner = '', + forGroup = false, + offset = 0, +}: SearchCityProps) { const [winHeight, indexItemHeight] = useHeight(); const [touchAnchor, setTouchAnchor] = useState(); const [touchMoving, setTouchMoving] = useState(false); @@ -134,13 +141,13 @@ export default function SearchCity({ onSelectCity, currentCity = '', forGroup =
- {forGroup && ( + {forGroup && banner ? (
-
点击城市名称,进本地通告群,免费招主播
+
{banner}
- )} + ) : null} {CITY_LIST.map(item => { return ( diff --git a/src/pages/group-v2/index.less b/src/pages/group-v2/index.less index 7c1345e..000b1fa 100644 --- a/src/pages/group-v2/index.less +++ b/src/pages/group-v2/index.less @@ -2,77 +2,7 @@ @import '@/styles/variables.less'; .group-v2-page { - padding: 24px; - - - &__header { - display: flex; - flex-direction: row; - justify-content: center; - align-items: center; - margin-bottom: 32px; - - &__left-line, - &__right-line { - width: 88px; - height: 1px; - } - - &__left-line { - background: linear-gradient(270deg, #CCCCCC -0.05%, rgba(204, 204, 204, 0) 99.95%); - } - - &__right-line { - background: linear-gradient(90deg, #CCCCCC 0%, rgba(204, 204, 204, 0) 100%); - } - - &__title { - font-size: 28px; - line-height: 40px; - font-weight: 400; - color: @blColorG2; - margin: 0 16px; - } - } - - &__group-card { - .flex-row(); - width: 100%; - padding: 32px; - background: #FFF; - border-radius: 16px; - margin-top: 24px; - box-sizing: border-box; - - &:first-child { - margin-top: 0; - } - - - &__avatar { - width: 88px; - height: 88px; - border-radius: 6px; - border: 4px solid #D9D9D9; - } - - &__title { - flex: 1; - font-size: 32px; - line-height: 40px; - font-weight: 500; - color: @blColor; - align-self: flex-start; - margin-left: 36px; - } - - &__button { - .button(@width: 176px; @height: 56px; @fontSize: 28px; @fontWeight: 500); - } - } - - &__bottom-padding { - width: 100%; - height: 24px; - } -} \ No newline at end of file + padding-bottom: 200px; + height: 100vh; + box-sizing: border-box; +} diff --git a/src/pages/group-v2/index.tsx b/src/pages/group-v2/index.tsx index 704231d..be3f6d0 100644 --- a/src/pages/group-v2/index.tsx +++ b/src/pages/group-v2/index.tsx @@ -1,39 +1,23 @@ -import { Image } from '@tarojs/components'; -import { NodesRef, useLoad, useShareAppMessage } from '@tarojs/taro'; +import { useLoad, useShareAppMessage } from '@tarojs/taro'; -import { List } from '@taroify/core'; import { useCallback } from 'react'; import HomePage from '@/components/home-page'; -import LoginButton from '@/components/login-button'; -import { APP_TAB_BAR_ID } from '@/constants/app'; +import SearchCity from '@/components/search-city'; import { GROUPS } from '@/constants/group'; import useInviteCode from '@/hooks/use-invite-code'; -import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height'; -import { GroupItem } from '@/types/group'; import { openCustomerServiceChat } from '@/utils/common'; +import { getCurrentCityCode } from '@/utils/location'; import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner'; import { getPageQuery } from '@/utils/route'; import { getCommonShareMessage } from '@/utils/share'; - import './index.less'; const PREFIX = 'group-v2-page'; -const LIST_CONTAINER_CLASS = `${PREFIX}__list-container`; -const CALC_LIST_PROPS: IUseListHeightProps = { - selectors: [`.${LIST_CONTAINER_CLASS}`, `#${APP_TAB_BAR_ID}`], - calc: (rects: [NodesRef.BoundingClientRectCallbackResult, NodesRef.BoundingClientRectCallbackResult]) => { - const [rect, diffRect] = rects; - return diffRect.top - rect.top; - }, -}; export default function GroupV2() { - const listHeight = useListHeight(CALC_LIST_PROPS); const inviteCode = useInviteCode(); - const handleClick = useCallback((group: GroupItem) => openCustomerServiceChat(group.serviceUrl), []); - useLoad(() => { const query = getPageQuery(); getInviteCodeFromQueryAndUpdate(query); @@ -41,32 +25,23 @@ export default function GroupV2() { useShareAppMessage(() => getCommonShareMessage(true, inviteCode)); + const handleSelectCity = useCallback(cityCode => { + const group = GROUPS.find(g => String(g.cityCode) === cityCode); + if (group) { + openCustomerServiceChat(group.serviceUrl); + } + }, []); + return (
-
-
-
进本地通告群,高薪通告早知道
-
-
-
- - {GROUPS.map(group => ( -
- -
{group.title}
- handleClick(group)}> - 我要进群 - -
- ))} -
- -
+
); diff --git a/src/pages/start/index.config.ts b/src/pages/start/index.config.ts index cd37b3f..b52af90 100644 --- a/src/pages/start/index.config.ts +++ b/src/pages/start/index.config.ts @@ -1,3 +1,4 @@ export default definePageConfig({ navigationBarTitleText: '', + navigationStyle: 'custom', }); diff --git a/src/pages/start/index.less b/src/pages/start/index.less index 45026e7..bce2f8b 100644 --- a/src/pages/start/index.less +++ b/src/pages/start/index.less @@ -6,6 +6,12 @@ height: 100vh; .flex-column(); + &.color-bg { + background: linear-gradient(180deg, #efecff 0%, #f7f5ff 100%); + padding-top: 347px; + display: block; + } + &__app { margin-top: 50%; } @@ -22,4 +28,68 @@ color: @blColorG2; margin-top: 32px; } -} \ No newline at end of file + + &__role-app { + padding: 64px; + } + + &__greet { + font-size: 28px; + line-height: 56px; + color: @blColorG1; + margin-bottom: 14px; + } + + &__title { + font-weight: 500; + font-size: 48px; + line-height: 57px; + color: @blColor; + margin-bottom: 75px; + } + + &__card { + background: rgba(255, 255, 255, 0.5); + border: 2px solid #ffffff; + border-radius: 16px; + padding: 56px 40px 56px; + .flex-row(); + + & + & { + margin-top: 64px; + } + } + + &__avatar { + width: 140px; + height: 140px; + border-radius: 50%; + } + + &__content { + padding-left: 34px; + .flex-column(); + flex: 1; + align-items: start; + + .title { + font-weight: 600; + font-size: 40px; + line-height: 48px; + + color: @blColor; + + margin-bottom: 16px; + } + .desc { + font-size: 28px; + line-height: 40px; + color: @blColorG1; + } + } + + &__arrow { + width: 24px; + height: 24px; + } +} diff --git a/src/pages/start/index.tsx b/src/pages/start/index.tsx index f405183..6fef234 100644 --- a/src/pages/start/index.tsx +++ b/src/pages/start/index.tsx @@ -1,23 +1,76 @@ import { Image } from '@tarojs/components'; -import { useLoad } from '@tarojs/taro'; -import { switchDefaultTab } from '@/utils/app'; +import { useLoad } from '@tarojs/taro'; +import Slogan from '@/components/slogan'; +import { PageUrl, RoleType } from '@/constants/app'; +import { ANCHOR_TAB_LIST, COMPANY_TAB_LIST } from '@/hooks/use-config'; +import store from '@/store'; +import { changeHomePage } from '@/store/actions'; +import { getRoleType, switchDefaultTab, switchRoleType } from '@/utils/app'; +import { switchTab } from '@/utils/route'; import './index.less'; const PREFIX = 'page-start'; export default function Start() { + const mode = getRoleType(); useLoad(() => { switchDefaultTab(); }); + const handleAnchor = async () => { + await switchRoleType(RoleType.Anchor); + store.dispatch(changeHomePage(ANCHOR_TAB_LIST[0].type)); + await switchTab(ANCHOR_TAB_LIST[0].pagePath as PageUrl); + }; + + const handleCompany = async () => { + await switchRoleType(RoleType.Company); + store.dispatch(changeHomePage(COMPANY_TAB_LIST[0].type)); + await switchTab(COMPANY_TAB_LIST[0].pagePath as PageUrl); + }; return ( -
-
- -
每天推荐海量高薪通告
-
+
+ {mode && ( +
+ +
每天推荐海量高薪通告
+
+ )} + {!mode && ( + <> +
+
Hi,很高兴见到你
+
请选择您的身份
+
+ +
+
我是主播
+
我要找工作
+
+ +
+
+ +
+
我是企业
+
我要招主播
+
+ +
+
+ + + )}
); } diff --git a/src/pages/user-batch-publish/index.tsx b/src/pages/user-batch-publish/index.tsx index 0c56a2d..d9b03a8 100644 --- a/src/pages/user-batch-publish/index.tsx +++ b/src/pages/user-batch-publish/index.tsx @@ -30,7 +30,13 @@ export default function BizService() {
- + diff --git a/src/store/reducers/app.ts b/src/store/reducers/app.ts index b4b7b34..158157b 100644 --- a/src/store/reducers/app.ts +++ b/src/store/reducers/app.ts @@ -18,10 +18,10 @@ const DEFAULT_LOCATION: LocationInfo = { longitude: 113.280637, }; -const defaultAppMode = Taro.getStorageSync(CacheKey.APP_MODE_NEW) || RoleType.Anchor; +const defaultAppMode = Taro.getStorageSync(CacheKey.APP_MODE_NEW); const INIT_STATE: AppState = { roleType: defaultAppMode, - homePageType: defaultAppMode === RoleType.Anchor ? PageType.JOB : PageType.Anchor, + homePageType: defaultAppMode === RoleType.Company ? PageType.Anchor : PageType.JOB, location: Taro.getStorageSync(CacheKey.CACHE_LOCATION_INFO) || DEFAULT_LOCATION, }; diff --git a/src/utils/app.ts b/src/utils/app.ts index 2bac602..d2374dc 100644 --- a/src/utils/app.ts +++ b/src/utils/app.ts @@ -25,6 +25,9 @@ export const isCompanyMode = () => getRoleType() === RoleType.Company; export const switchDefaultTab = async () => { await sleep(1); const mode = getRoleType(); + if (!mode) { + return; + } const tabList = mode === RoleType.Anchor ? ANCHOR_TAB_LIST : COMPANY_TAB_LIST; const item = tabList[0]; store.dispatch(changeHomePage(item.type));