@funhub/platform 0.2.2 → 0.2.3-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/detail/collect_nor.mjs +2 -0
- package/dist/assets/icons/detail/collect_sel.mjs +2 -0
- package/dist/assets/icons/detail/share.mjs +2 -0
- package/dist/assets/icons/eye-off-icon.mjs +1 -1
- package/dist/assets/icons/marquee-enter.mjs +2 -0
- package/dist/assets/icons/right_arrow.mjs +2 -0
- package/dist/assets/icons/search/avatar.mjs +2 -0
- package/dist/assets/images/marquee.mjs +2 -0
- package/dist/biz.d.mts +4 -11
- package/dist/biz.mjs +1 -1
- package/dist/common.d.mts +2 -5
- package/dist/common.mjs +1 -1
- package/dist/components/biz/business/advertisement/ad-match.mjs +1 -1
- package/dist/components/biz/business/advertisement/banner-ad/client.mjs +1 -1
- package/dist/components/biz/business/advertisement/banner-ad/material.d.mts +2 -2
- package/dist/components/biz/business/advertisement/banner-ad/material.mjs +1 -1
- package/dist/components/biz/business/advertisement/banner-ad/schema.d.mts +4 -9
- package/dist/components/biz/business/advertisement/banner-ad/schema.mjs +1 -1
- package/dist/components/biz/business/advertisement/feed-ad/index.d.mts +31 -1
- package/dist/components/biz/business/advertisement/feed-ad/index.mjs +1 -1
- package/dist/components/biz/business/advertisement/floating-ad/client.mjs +1 -1
- package/dist/components/biz/business/advertisement/floating-ad/material.mjs +1 -1
- package/dist/components/biz/business/advertisement/icon-ad/client.mjs +1 -1
- package/dist/components/biz/business/advertisement/icon-ad/material.d.mts +1 -1
- package/dist/components/biz/business/advertisement/icon-ad/material.mjs +1 -1
- package/dist/components/biz/business/advertisement/icon-ad/schema.d.mts +1 -7
- package/dist/components/biz/business/advertisement/icon-ad/schema.mjs +1 -1
- package/dist/components/biz/business/advertisement/index.d.mts +2 -2
- package/dist/components/biz/business/advertisement/popup-ad/client.mjs +2 -2
- package/dist/components/biz/business/advertisement/popup-ad/index.d.mts +1 -1
- package/dist/components/biz/business/advertisement/popup-ad/material.d.mts +2 -2
- package/dist/components/biz/business/advertisement/popup-ad/schema.d.mts +15 -14
- package/dist/components/biz/business/advertisement/popup-ad/schema.mjs +1 -1
- package/dist/components/biz/business/advertisement/text-ad/client.mjs +1 -1
- package/dist/components/biz/business/advertisement/text-ad/material.d.mts +1 -1
- package/dist/components/biz/business/advertisement/text-ad/material.mjs +1 -1
- package/dist/components/biz/business/advertisement/text-ad/schema.d.mts +1 -5
- package/dist/components/biz/business/advertisement/text-ad/schema.mjs +1 -1
- package/dist/components/biz/business/banner-carousel/client.d.mts +2 -2
- package/dist/components/biz/business/banner-carousel/client.mjs +1 -1
- package/dist/components/biz/business/channel-list/client.mjs +1 -1
- package/dist/components/biz/business/channel-list/default-props.mjs +1 -1
- package/dist/components/biz/business/detail/shared/detail-introduction.mjs +2 -0
- package/dist/components/biz/business/detail/shared/detail-operate.mjs +1 -1
- package/dist/components/biz/business/detail/shared/editor-preview.mjs +1 -1
- package/dist/components/biz/business/detail/shared/registry.d.mts +1 -36
- package/dist/components/biz/business/detail/shared/registry.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-actions/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-info/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/client.d.mts +13 -1
- package/dist/components/biz/business/detail/video-detail-recommend/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/material.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-icon/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/client.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.d.mts +3 -4
- package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-logo-search/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-search/client.mjs +1 -1
- package/dist/components/biz/business/header-search/shared/avatar.mjs +1 -1
- package/dist/components/biz/business/header-search/shared/logo.mjs +1 -1
- package/dist/components/biz/business/header-search/shared/search.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.d.mts +8 -0
- package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-grid/material.d.mts +8 -0
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.d.mts +8 -0
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/material.d.mts +8 -0
- package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-preview.mjs +1 -1
- package/dist/components/biz/business/index.d.mts +3 -12
- package/dist/components/biz/business/large-feature-grid/card-item.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/schema.mjs +1 -1
- package/dist/components/biz/business/marquee/client.mjs +1 -1
- package/dist/components/biz/business/marquee/marquee.module.mjs +6 -2
- package/dist/components/biz/business/marquee/material.d.mts +1 -1
- package/dist/components/biz/business/marquee/schema.d.mts +1 -1
- package/dist/components/biz/business/profile/index.d.mts +1 -1
- package/dist/components/biz/business/profile/profile-header/client.d.mts +1 -2
- package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/index.d.mts +1 -1
- package/dist/components/biz/business/profile/profile-header/user-profile-avatar.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/user-profile-cover-background.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/shell.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/history-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.d.mts +1 -5
- package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/utils.mjs +1 -1
- package/dist/components/biz/business/search-history/client.mjs +1 -1
- package/dist/components/biz/business/search-history/schema.mjs +1 -1
- package/dist/components/biz/business/search-input/client.mjs +1 -1
- package/dist/components/biz/business/shortcut-grid/client.mjs +1 -1
- package/dist/components/biz/business/tab-bar/client.mjs +1 -1
- package/dist/components/common/collection-popup/collection-create-modal.mjs +2 -0
- package/dist/components/common/collection-popup/index.d.mts +0 -1
- package/dist/components/common/collection-popup/index.mjs +1 -1
- package/dist/components/common/icons/setting.mjs +1 -1
- package/dist/components/common/list/collection-list/collection-list-item.d.mts +0 -8
- package/dist/components/common/list/collection-list/collection-list-item.mjs +1 -1
- package/dist/components/common/list/collection-list/collection-list.d.mts +0 -6
- package/dist/components/common/list/collection-list/collection-list.mjs +1 -1
- package/dist/components/common/series-episodes/index.d.mts +1 -3
- package/dist/components/common/series-episodes/index.mjs +1 -1
- package/dist/components/common/skeleton/search-video-card-skeleton.mjs +2 -0
- package/dist/components/common/tab-bar/index.mjs +1 -1
- package/dist/components/pages/collection-detail/detail.mjs +1 -1
- package/dist/components/pages/edit/page.mjs +1 -1
- package/dist/components/pages/home/client.mjs +1 -1
- package/dist/components/pages/login/login-client.mjs +1 -1
- package/dist/components/pages/login/register.mjs +1 -1
- package/dist/components/pages/login/verify.mjs +4 -1
- package/dist/components/pages/search/page-client.mjs +1 -1
- package/dist/components/pages/search/search-result/index.mjs +1 -1
- package/dist/components/pages/search/search-result/search-all.mjs +1 -1
- package/dist/components/pages/search/search-result/search-user.mjs +1 -1
- package/dist/components/pages/search/search-result/search-video-info.mjs +1 -1
- package/dist/components/pages/search/search-utils.mjs +2 -0
- package/dist/components/pages/search/top-header.mjs +1 -1
- package/dist/components/pages/search-result/page-client.mjs +1 -1
- package/dist/components/pages/search-result/search-all.mjs +1 -1
- package/dist/components/pages/search-result/search-result-skeleton.mjs +2 -0
- package/dist/components/pages/search-result/search-tab.mjs +1 -1
- package/dist/components/pages/search-result/search-user.mjs +1 -1
- package/dist/components/pages/search-result/search-video.mjs +2 -0
- package/dist/components/pages/settings/_components/reset-password-drawer.mjs +2 -2
- package/dist/components/pages/settings/_components/settings.mjs +1 -1
- package/dist/components/pages/video-list/video-list-client.mjs +1 -1
- package/dist/components/pages/video-list/video-list-item.mjs +2 -0
- package/dist/components/pages/video-list/video-list-skeleton.d.mts +3 -2
- package/dist/components/pages/video-list/video-list-skeleton.mjs +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/box.d.mts +1 -1
- package/dist/components/ui/button.d.mts +1 -1
- package/dist/i18n/locales/en.mjs +2 -2
- package/dist/i18n/locales/zh-CN.mjs +2 -2
- package/dist/materials.d.mts +1 -6
- package/dist/materials.mjs +1 -1
- package/dist/service/generated/client.d.mts +2 -38
- package/dist/service/generated/client.mjs +1 -1
- package/dist/service/generated/tanstack.d.mts +2 -47
- package/dist/service/generated/tanstack.mjs +1 -1
- package/dist/service.d.mts +3 -3
- package/dist/service.mjs +1 -1
- package/dist/types.d.mts +9 -662
- package/dist/utils/helper.d.mts +1 -1
- package/dist/utils/helper.mjs +1 -1
- package/package.json +2 -7
- package/theme.css +59 -170
- package/dist/assets/icons/channel-list/channel-active-indicator.mjs +0 -2
- package/dist/assets/icons/common/header-menu.mjs +0 -2
- package/dist/assets/icons/common/header-search-icon.mjs +0 -2
- package/dist/assets/icons/common/right_arrow_thin.mjs +0 -2
- package/dist/assets/icons/marquee-close.mjs +0 -2
- package/dist/assets/icons/marquee-speaker.mjs +0 -2
- package/dist/assets/images/shortcut-grid/shortcut-grid-card-bg-primary.mjs +0 -2
- package/dist/components/biz/business/detail/video-detail-recommend/shared.mjs +0 -2
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/client.d.mts +0 -8
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/client.mjs +0 -2
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/index.d.mts +0 -5
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/material.d.mts +0 -45
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/material.mjs +0 -2
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/schema.d.mts +0 -9
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/schema.mjs +0 -2
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/server.d.mts +0 -11
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/server.mjs +0 -2
- package/dist/components/biz/business/header-search/shared/header-action.mjs +0 -2
- package/dist/components/biz/business/header-search/shared/header-search-icon.mjs +0 -2
- package/dist/components/biz/business/header-search/shared/header-shell.mjs +0 -2
- package/dist/components/biz/business/hot-recommend/client.d.mts +0 -17
- package/dist/components/biz/business/hot-recommend/client.mjs +0 -2
- package/dist/components/biz/business/hot-recommend/index.d.mts +0 -5
- package/dist/components/biz/business/hot-recommend/material.d.mts +0 -24
- package/dist/components/biz/business/hot-recommend/material.mjs +0 -2
- package/dist/components/biz/business/hot-recommend/schema.d.mts +0 -23
- package/dist/components/biz/business/hot-recommend/schema.mjs +0 -2
- package/dist/components/biz/business/hot-recommend/server.d.mts +0 -11
- package/dist/components/biz/business/hot-recommend/server.mjs +0 -2
- package/dist/components/biz/business/profile/profile-main/empty-state.mjs +0 -2
- package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/video-waterfall.mjs +0 -2
- package/dist/components/biz/business/ranking-recommend/client.d.mts +0 -17
- package/dist/components/biz/business/ranking-recommend/client.mjs +0 -70
- package/dist/components/biz/business/ranking-recommend/material.d.mts +0 -35
- package/dist/components/biz/business/ranking-recommend/material.mjs +0 -2
- package/dist/components/biz/business/ranking-recommend/schema.d.mts +0 -35
- package/dist/components/biz/business/ranking-recommend/schema.mjs +0 -2
- package/dist/components/biz/business/ranking-recommend/server.d.mts +0 -11
- package/dist/components/biz/business/ranking-recommend/server.mjs +0 -2
- package/dist/components/biz/business/ranking-recommend/shared/query.mjs +0 -2
- package/dist/components/biz/business/ranking-recommend/shared.d.mts +0 -15
- package/dist/components/biz/business/ranking-recommend/shared.mjs +0 -2
- package/dist/components/biz/business/search-waterfall-recommend/client.d.mts +0 -9
- package/dist/components/biz/business/search-waterfall-recommend/client.mjs +0 -2
- package/dist/components/biz/business/search-waterfall-recommend/index.d.mts +0 -4
- package/dist/components/biz/business/search-waterfall-recommend/material.d.mts +0 -40
- package/dist/components/biz/business/search-waterfall-recommend/material.mjs +0 -2
- package/dist/components/biz/business/search-waterfall-recommend/server.d.mts +0 -8
- package/dist/components/biz/business/search-waterfall-recommend/server.mjs +0 -2
- package/dist/components/common/collection-popup/create-collection-sheet.d.mts +0 -41
- package/dist/components/common/collection-popup/create-collection-sheet.mjs +0 -2
- package/dist/components/common/list/collection-list/collection-select-icon.mjs +0 -2
- package/dist/components/common/list/waterfall-recommend/index.d.mts +0 -2
- package/dist/components/common/list/waterfall-recommend/waterfall-recommend.d.mts +0 -99
- package/dist/components/common/list/waterfall-recommend/waterfall-recommend.mjs +0 -2
- package/dist/components/pages/collection-detail/_components/collection-detail-video-card.mjs +0 -2
- package/dist/components/pages/login/auth-page-styles.mjs +0 -6
- package/dist/components/pages/search/search-result/shared.mjs +0 -2
- package/dist/components/pages/search-result/search-empty.mjs +0 -2
- package/dist/components/pages/search-result/search-video-info.mjs +0 -2
- package/dist/components/pages/search-result/shared.mjs +0 -2
- package/dist/components/pages/search-result/top-header.mjs +0 -2
- package/dist/components/pages/video-list/video-list-recommend-item.mjs +0 -2
- package/dist/theme-tokens.d.mts +0 -9
- package/dist/theme-tokens.mjs +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetCollectionInfo as n,
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetCollectionInfo as n,gUserViewUserInfo as r,pCommunityDeleteCollection as i,pCommunityRemoveContentFromCollection as a,pCommunitySubscribeCollection as o,pInteractionBatchDeleteCollects as s}from"../../../service/generated/client.mjs";import{useRouter as ee}from"../../../utils/use-compatible-router.mjs";import{Box as c}from"../../ui/box.mjs";import{Checkbox as te}from"../../ui/checkbox.mjs";import{Drawer as ne,DrawerContent as re,DrawerDescription as ie,DrawerTitle as ae}from"../../ui/drawer.mjs";import{List as oe}from"../../ui/list.mjs";import{Text as l}from"../../ui/text.mjs";import{useLoginModalStore as se}from"../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as ce,useMutation as u,useRequest as d,useUpdateRequest as le}from"../../../hooks/query/use-query.mjs";import{ShareDrawer as f}from"../../common/share-popup/share-drawer.mjs";import{SharePlatformEnum as p}from"../../../types/share.mjs";import m from"../../../utils/share-manager.mjs";import{DeleteConfirmDialog as ue}from"../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{HeaderNav as de}from"../../common/header-nav/client.mjs";import{MoreIcon as fe}from"../../common/icons/more.mjs";import{CollectionDetailCard as pe}from"./_components/collection-detail-card.mjs";import{useEffect as me,useMemo as h,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{toast as y}from"sonner";import{useSearchParams as b}from"next/navigation";import{useTranslations as he}from"next-intl";function x(e){if(e.cover_image)return e.cover_image;let t=``;return e.medias?.find(e=>e?(!e.is_video&&!t&&e.media_url&&(t=e.media_url),!!e.cover_image):!1)?.cover_image||t}function S(e){let t=e.detail.info?.video_duration;if(typeof t==`number`&&Number.isFinite(t)&&t>0)return Math.floor(t);let n=e.medias?.find(e=>{let t=e?.video_duration;return typeof t==`number`&&Number.isFinite(t)&&t>0})?.video_duration;return typeof n==`number`&&Number.isFinite(n)&&n>0?Math.floor(n):0}function C(e){let t=e.detail.info?.play_count;if(typeof t==`number`&&Number.isFinite(t))return Math.max(0,Math.floor(t));let n=e.detail.view_count||e.viewCount;return typeof n==`number`&&Number.isFinite(n)?Math.max(0,Math.floor(n)):0}function ge(e){let t=e.detail,n=t.info,r=String(n?.cover_image||t.cover_image||x(e)||``),i=String(n?.text||n?.title||t.title||t.content||``),a=t.author_score??0,o=Array.isArray(t.tags)?t.tags:[];return{id:e.content_id?String(e.content_id):String(e.id),title:i,type:typeof e.type==`number`?e.type:0,coverImage:r,score:a,collectedAt:t.create_time==null?void 0:String(t.create_time),tags:o,duration:S(e),viewCount:C(e),publishTime:String(t.create_time??t.update_time??``),is_more_link:e.is_more_link??n?.is_more_link??!1,authorName:``}}function w({id:x}){let S=he(`components.pages.collectionDetail`),C=ee(),w=b(),{userId:T,isLogin:E}=t(),{open:D}=se(),O=ce();le();let k=d([`collection-detail`,x],()=>n({collection_id:x})),A=k.data?.data?.data?.collection?.user_id,j=!!(A&&T&&String(A)===String(T)),_e=d([`user-info`,A],()=>r({target_user_id:A,user_id:A})),[ve,M]=g(!1),[N,P]=g(!1),[F,I]=g(!1),[L,R]=g(!1),[z,B]=g(!1),[V,H]=g(()=>new Set),[U,W]=g(null);me(()=>{!N&&L&&(I(!0),R(!1))},[N,L]);let G=k.data?.data?.data?.collection,K=G?.contents,q=h(()=>K?K.map(e=>({content_id:e.content_id,is_more_link:e.is_more_link,id:Number(e.content_id),detail:e,type:Number(e.source_type??0),medias:e.medias,cover_image:e.cover_image,viewCount:e.view_count})):[],[K]).map(ge),J=h(()=>new Set(q.map(e=>e.id)),[q]),Y=J.size>0&&V.size===J.size;G?.cover_image,G?.content_count,G?.is_subscribe;let{mutateAsync:ye,isPending:be}=u(async e=>await o({collection_id:x,subscribe:e})),{mutateAsync:xe,isPending:Se}=u(async e=>await a({collection_id:x,content_id:e})),{mutateAsync:Ce,isPending:X}=u(async e=>await i({collection_id:e})),{mutateAsync:we,isPending:Z}=u(async e=>await s({app_id:0,user_id:T,folder_id:x,content_type:1,content_ids:e})),Q=_e.data?.data;Q?.avatar,Q?.nick_name;let Te=j&&G?.is_default===!1;function Ee(e){W({kind:`content`,id:e.id,type:e.type,title:e.title,isCollected:!0}),M(!0)}function De(){if(j){P(!0);return}W({kind:`collection`,id:x}),M(!0)}function Oe(){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}if(!j){y.error(S(`detail.operationFailed`));return}P(!1),H(new Set),B(!0)}function ke(){H(new Set),B(!1)}function Ae(e){H(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function je(){if(Y){H(new Set);return}H(new Set(J))}async function Me(){if(!(V.size===0||Z)){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}try{let e=await we(Array.from(V));if(e.code===0){y.success(S(`detail.uncollectSuccess`)),O([`collection-detail`,x]),O([`user-profile`,`mine`]),O([`user-profile`,`profile`,A]),H(new Set),B(!1);return}y.error(e.message||S(`detail.uncollectFailed`))}catch(e){console.error(`批量取消收藏失败`,e),y.error(S(`detail.operationFailed`))}}}function Ne(e){if(typeof window>`u`)return``;if(e.kind===`collection`)return`${window.location.origin}/collection/${e.id}`;let t=e.title?encodeURIComponent(e.title):`detail`,n=e.type===1?`/video/${e.id}/${t}`:`/post/${e.id}`;return`${window.location.origin}${n}`}function $(e){if(!U)return;let t=Ne(U);t&&m.showSharePopup({type:e,data:{id:U.id},copyUrl:t})}function Pe(){$(p.WECHAT)}function Fe(){$(p.QQ)}function Ie(){$(p.WECHAT_MOMENTS)}function Le(){if(!Se){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}!U||U.kind!==`content`||xe(U.id).then(e=>{if(e.code===0){y.success(S(`detail.uncollectSuccess`)),O([`collection-detail`,x]),W(e=>e&&{...e,isCollected:!1});return}y.error(e.message||S(`detail.uncollectFailed`))}).catch(e=>{console.error(`取消收藏失败`,e),y.error(S(`detail.operationFailed`))})}}function Re(){let e=new URLSearchParams(w.toString());e.set(`id`,x),e.set(`type`,`edit`),C.push(`/collection/create?${e.toString()}`),P(!1),M(!1)}function ze(){if(!X){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}if(!Te){y.error(S(`detail.defaultCollectionDeleteNotSupported`));return}R(!0),P(!1)}}async function Be(){if(!X)try{let e=await Ce(x);if(e.code===0){y.success(S(`detail.deleteSuccess`)),O([`collection-detail`,x]),O([`user-profile`,`mine`]),O([`user-profile`,`profile`,A]),I(!1),P(!1),M(!1),C.back();return}y.error(e.message||S(`detail.deleteFailed`))}catch(e){console.error(`删除合集失败`,e),y.error(S(`detail.operationFailed`))}}return v(c,{className:`flex flex-col bg-bg1 min-h-screen ${z?`pb-28`:`pb-6`}`,children:[_(de,{title:G?.title??``,onBack:()=>C.back(),rightChild:j?z?_(`button`,{type:`button`,onClick:ke,className:`px-2 py-1 text-sm text-text1`,children:S(`detail.done`)}):_(`button`,{type:`button`,onClick:De,className:`p-2`,children:_(fe,{})}):void 0}),_(c,{className:`px-4 flex items-start gap-4`,children:v(c,{className:`flex-1 flex flex-col gap-2`,children:[_(c,{className:`flex items-center justify-between`}),_(c,{className:`text-text2 text-sm break-all text-ellipsis line-clamp-1`,children:G?.description})]})}),_(c,{className:`px-4 ${z?`pb-20`:``}`,children:_(oe,{loading:k.isLoading,hasMore:!1,emptyText:S(`detail.emptyContent`),className:`divide-y divide-text1/5`,children:q.map(e=>_(pe,{...e,onOpenShare:Ee,isEditMode:z,isSelected:V.has(e.id),onToggleSelection:Ae},e.id))})}),z&&v(c,{className:`fixed bottom-0 left-0 right-0 z-10 flex items-center justify-between border-t border-text1/10 bg-bg1 px-4 py-3`,children:[v(c,{className:`flex items-center gap-2`,children:[_(te,{checked:Y,onCheckedChange:je}),_(l,{className:`text-sm text-text1`,children:S(`detail.selectAll`)})]}),_(e,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:V.size>0?`default`:`outline`,disabled:V.size===0||Z,onClick:Me,children:S(Z?`detail.deleting`:`detail.delete`)})]}),v(ne,{open:N,onOpenChange:P,children:[_(ae,{className:`hidden`,children:S(`detail.collectionManageTitle`)}),_(ie,{className:`hidden`,children:S(`detail.collectionManageTitle`)}),v(re,{className:`z-[2000]`,children:[v(c,{className:`px-4 py-5`,children:[_(l,{className:`text-base font-bold text-text1 text-center `,children:S(`detail.collectionManageTitle`)}),v(c,{className:`mt-4 border-t border-text1/10`,children:[_(`button`,{className:`w-full text-left py-4 border-b border-text1/10`,onClick:Re,children:_(l,{className:`text-text1`,children:S(`detail.editCollection`)})}),_(`button`,{className:`w-full text-left py-4 border-b border-text1/10`,onClick:Oe,children:_(l,{className:`text-text1`,children:S(`detail.manageCollection`)})}),_(`button`,{className:`w-full text-left py-4 ${X?`opacity-60 cursor-not-allowed`:``}`,onClick:ze,disabled:X,children:_(l,{className:`text-destructive`,children:S(X?`detail.deleting`:`detail.deleteCollection`)})})]})]}),_(e,{className:`w-full h-auto py-4 text-lg text-text1`,size:`lg`,onClick:()=>P(!1),variant:`secondary`,children:S(`detail.cancel`)})]})]}),_(f,{isShowCollect:U?.kind===`content`&&j&&E,isCollected:U?.isCollected,open:ve,onOpenChange:M,onShareWeChat:Pe,onShareQQ:Fe,onShareMoments:Ie,onUncollect:Le}),_(ue,{open:F,onOpenChange:I,onConfirm:Be,title:S(`detail.deleteCollection`),isConfirming:X})]})}export{w as CollectionDetail};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gUserGetUserEditInfo as t,gUserGetUserInfo as n,pUserEditUserInfo as r}from"../../../service/generated/client.mjs";import{uploadFile as i}from"../../../utils/upload-file.mjs";import{Avatar as ee,AvatarFallback as te,AvatarImage as ne}from"../../ui/avatar.mjs";import{Box as a}from"../../ui/box.mjs";import{InputGroup as
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gUserGetUserEditInfo as t,gUserGetUserInfo as n,pUserEditUserInfo as r}from"../../../service/generated/client.mjs";import{uploadFile as i}from"../../../utils/upload-file.mjs";import{Avatar as ee,AvatarFallback as te,AvatarImage as ne}from"../../ui/avatar.mjs";import{Box as a}from"../../ui/box.mjs";import{InputGroup as o,InputGroupAddon as s,InputGroupTextarea as c}from"../../ui/input-group.mjs";import{Field as l,FieldLabel as u}from"../../ui/field.mjs";import{Text as d}from"../../ui/text.mjs";import{useDeleteRequest as re,useMutation as ie,useRequest as ae}from"../../../hooks/query/use-query.mjs";import{HeaderNav as oe}from"../../common/header-nav/client.mjs";import{PickerDrawer as se}from"../../common/picker/picker-drawer/picker-drawer.mjs";import{GenderPicker as ce}from"../../common/picker/gender-picker/gender-picker.mjs";import{ImageCropModal as le}from"../../common/image-crop-modal/image-crop-modal.mjs";import{useEffect as f,useRef as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{toast as _}from"sonner";import{useTranslations as ue}from"next-intl";import{produce as de}from"immer";const fe={0:`secret`,1:`male`,2:`female`},v={male:1,female:2,secret:0},y=[`image/jpeg`,`image/png`],pe=/^[\u4E00-\u9FFF\w.-]+$/;function me(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return y.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function b(e){return e?v[e]===void 0?fe[e]??`secret`:e:`secret`}function he(e){if(!e)return;if(v[e]!==void 0)return v[e];let t=Number(e);return Number.isNaN(t)?void 0:t}function ge(e){return{nickname:e?.nick_name??``,gender:b(e?.gender?.toString()),signature:e?.signature??``,avatar:e?.avatar??``}}function _e(e){if(!e)return;e.focus();let t=e.value.length;e.setSelectionRange(t,t)}function ve({id:fe}){let v=ue(`components.pages.edit`),{userId:y,userInfo:b,setUserInfo:ve}=e(),x=fe??y,S=re(),ye={male:v(`page.genderMale`),female:v(`page.genderFemale`),secret:v(`page.genderSecret`)},C=p(null),w=p(null),T=p(null),E=p(null),[D,O]=m(()=>ge()),[k,A]=m(!1),[be,j]=m(null),[xe,M]=m(!1),[N,P]=m(``),[F,I]=m(!1),[L,R]=m(``),[Se,z]=m(!1),[B,V]=m(`secret`),[H,Ce]=m(!1),[U,W]=m(``),we={code:0,message:``,data:{}},Te={code:0,message:``,data:{}},{data:Ee,isLoading:G}=ae([`user-edit-info`,x],()=>x?t({user_id:x}):Promise.resolve(we)),{data:De}=ae([`user-info-basic`,x],()=>x?n({user_id:x}):Promise.resolve(Te)),{mutateAsync:Oe,isPending:ke}=ie(async e=>r(e)),Ae=k||ke||be!==null,K=G||Ae,q=K?`cursor-not-allowed opacity-60`:`cursor-pointer`,je=De?.data?.display_id||b?.display_id||`--`,J=D.gender||`secret`,Me=K||L.trim()===D.nickname,Ne=K||B===J,Pe=K||U===D.signature;f(()=>{let e=Ee?.data;e&&O(ge(e))},[Ee]),f(()=>{if(!F)return;let e=window.setTimeout(()=>{_e(w.current)},250);return()=>{window.clearTimeout(e)}},[F]),f(()=>{if(!H)return;let e=window.setTimeout(()=>{_e(T.current)},250);return()=>{window.clearTimeout(e)}},[H]),f(()=>()=>{N&&URL.revokeObjectURL(N)},[N]);function Y(e,t){O(de(n=>{n[e]=t}))}function Fe(){N&&(URL.revokeObjectURL(N),P(``))}function Ie(){x&&(S([`user-edit-info`,x]),S([`user-info-basic`,x]),S([`user-profile`,`mine`]),S([`user-profile`,`mine`,x]),S([`user-profile`,`profile`,x]))}function X(e){!x||x!==y||ve({...b,user_id:x,...e})}function Le(){_.info(v(`page.editBlockedWhileSaving`))}function Z(){return G?!0:Ae?(Le(),!0):!1}function Re(e){return E.current?(Le(),!1):(E.current=e,j(e),!0)}function ze(e){E.current===e&&(E.current=null,j(null))}async function Q(e,t){if(!Re(e))return!1;let n=_.loading(v(`page.savingInProgress`));try{return await t()}finally{_.dismiss(n),ze(e)}}function Be(e,t){let n={...D,...t},r={nickname:[`nick_name`,n.nickname||void 0],avatar:[`avatar`,n.avatar||void 0],signature:[`signature`,n.signature||void 0],gender:[`gender`,he(n.gender)]},i=Object.keys(r).filter(t=>t!==e).map(e=>r[e]);return i.push(r[e]),Object.fromEntries(i)}async function $(e,t){if(!x)return _.error(v(`page.userNotFound`)),!1;let n=Be(e,t);try{return await Oe({user_id:x,...n}),Ie(),!0}catch(e){return console.error(`更新用户信息失败`,e),_.error(v(`page.updateFailed`)),!1}}function Ve(){Z()||k||C.current?.click()}function He(e){if(Z()){e.target&&(e.target.value=``);return}let t=e.target.files?.[0];if(t){if(!me(t)){_.error(v(`page.imageTypeInvalid`)),e.target&&(e.target.value=``);return}P(URL.createObjectURL(t)),M(!0),e.target&&(e.target.value=``)}}async function Ue(e){await Q(`avatar`,async()=>{try{A(!0);let t=await i(new File([e],`avatar.jpg`,{type:`image/jpeg`}),1);return await $(`avatar`,{avatar:t.objectKey})?(Y(`avatar`,t.objectKey),X({avatar:t.objectKey}),We(),_.success(v(`page.avatarUpdateSuccess`)),!0):!1}catch(e){return console.error(`上传头像失败`,e),_.error(v(`page.avatarUploadFailed`)),!1}finally{A(!1)}})}function We(){M(!1),Fe()}function Ge(){Z()||(R(D.nickname),I(!0))}function Ke(e){let t=e.target.value;t.length>24||R(t)}function qe(e){return e?e.length<2?v(`page.nicknameTooShort`):pe.test(e)?``:v(`page.nicknameInvalidChars`):v(`page.nicknameRequired`)}async function Je(e){if(Me)return!1;let t=e.trim(),n=qe(t);return n?(_.error(n),!1):await Q(`nickname`,async()=>$(`nickname`,{nickname:t}))?(Y(`nickname`,t),X({nick_name:t}),R(t),_.success(v(`page.nicknameUpdateSuccess`)),!0):!1}function Ye(){Z()||(V(J),z(!0))}function Xe(){z(!1)}function Ze(e){V(e)}async function Qe(e){let t=e||B||`secret`;if(t===J)return!1;let n=he(t);return await Q(`gender`,async()=>$(`gender`,{gender:t}))?(Y(`gender`,t),X({gender:n}),V(t),_.success(v(`page.genderUpdateSuccess`)),!0):!1}function $e(){Z()||(W(D.signature),Ce(!0))}function et(e){let t=e.target.value;t.length>100||W(t)}function tt(e){let t=e.trim();return t.length>0&&t.length<2?v(`page.signatureTooShort`):``}async function nt(e){if(Pe)return!1;let t=tt(e);return t?(_.error(t),!1):await Q(`signature`,async()=>$(`signature`,{signature:e}))?(Y(`signature`,e),X({signature:e}),W(e),_.success(v(`page.signatureUpdateSuccess`)),!0):!1}return g(a,{className:`bg-bg2 !min-h-screen`,children:[h(oe,{className:`!bg-bg2`,title:v(`page.title`)}),g(a,{onClick:Ve,className:`flex bg-bg2 flex-col py-3 items-center justify-center gap-3 ${q}`,children:[h(`input`,{ref:C,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:He}),g(ee,{className:`w-21 h-21`,children:[h(ne,{src:D.avatar}),h(te,{})]}),g(d,{className:`text-sm text-text2`,children:[`ID:`,` `,G?v(`page.loading`):k?v(`page.avatarUploading`):`${je}`]})]}),g(a,{className:`pb-3`,children:[h(l,{className:`bg-bg2 px-3 ${q}`,onClick:Ge,children:g(`div`,{className:`flex items-center justify-between gap-3`,children:[h(u,{children:v(`page.label`)}),h(d,{className:`text-text2 text-sm text-right max-w-[65%] line-clamp-1 text-ellipsis`,children:D.nickname||v(`page.nicknamePlaceholder`)})]})}),h(l,{className:`!bg-bg2 px-3 border-none ${q}`,onClick:Ye,children:g(`div`,{className:`flex items-center justify-between gap-3`,children:[h(u,{children:v(`page.genderLabel`)}),h(d,{className:`text-text2 text-sm`,children:ye[J]||v(`page.genderSecret`)})]})}),h(`div`,{className:`h-2 bg-bg1`}),h(l,{className:`border-none px-3 bg-bg2! mt-2 ${q}`,onClick:$e,children:g(`div`,{className:`flex items-center justify-between gap-3`,children:[h(u,{children:v(`page.signatureLabel`)}),h(d,{className:`text-text2 text-sm text-right max-w-[65%] line-clamp-1 text-ellipsis`,children:D.signature||v(`page.signaturePlaceholder`)})]})})]}),h(se,{open:F,onClose:()=>I(!1),title:v(`page.label`),confirmText:v(`page.submit`),onConfirm:e=>Je(String(e)),confirmDisabled:Me,children:({onValueChange:e})=>h(a,{className:`px-4 py-4 min-h-[230px]`,children:g(o,{children:[h(c,{ref:w,className:`!bg-bg1 p-2.5`,rows:4,maxLength:24,placeholder:v(`page.nicknamePlaceholder`),value:L,onChange:t=>{Ke(t),e(t.target.value)},disabled:K}),h(s,{className:`!bg-bg1`,align:`block-end`,children:h(`div`,{className:`text-right w-full`,children:g(`span`,{className:`text-xs`,children:[L.length,`/`,24]})})})]})})}),h(ce,{open:Se,onClose:Xe,value:B,onValueChange:Ze,onConfirm:Qe,confirmDisabled:Ne}),h(se,{open:H,onClose:()=>Ce(!1),title:v(`page.signatureLabel`),confirmText:v(`page.submit`),onConfirm:e=>nt(String(e)),confirmDisabled:Pe,children:({onValueChange:e})=>h(a,{className:`px-4 py-4 min-h-[230px]`,children:g(o,{children:[h(c,{ref:T,className:`!bg-bg1 p-2.5`,rows:4,maxLength:100,placeholder:v(`page.signaturePlaceholder`),value:U,onChange:t=>{et(t),e(t.target.value)},disabled:K}),h(s,{className:`!bg-bg1`,align:`block-end`,children:h(`div`,{className:`text-right w-full`,children:g(`span`,{className:`text-xs`,children:[U.length,`/`,100]})})})]})})}),h(le,{open:xe,onClose:We,imageSrc:N,onConfirm:Ue,cropShape:`round`})]})}export{ve as EditClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{gContentGetAppChannelBlock as e,gContentGetAppChannelBlockData as t,gContentListVisibleFloatingBall as n}from"../../../service/generated/client.mjs";import{useRouter as r}from"../../../utils/use-compatible-router.mjs";import{useRequest as i}from"../../../hooks/query/use-query.mjs";import{useRequireLogin as a}from"../../../hooks/use-auth.mjs";import{queryKey as o}from"../../../constants/query-key.mjs";import{useKeepAliveState as s}from"../../common/keep-scroll-position/index.mjs";import{
|
|
2
|
+
"use client";import{gContentGetAppChannelBlock as e,gContentGetAppChannelBlockData as t,gContentListVisibleFloatingBall as n}from"../../../service/generated/client.mjs";import{useRouter as r}from"../../../utils/use-compatible-router.mjs";import{useRequest as i}from"../../../hooks/query/use-query.mjs";import{useRequireLogin as a}from"../../../hooks/use-auth.mjs";import{queryKey as o}from"../../../constants/query-key.mjs";import{useKeepAliveState as s}from"../../common/keep-scroll-position/index.mjs";import{FloatingAd as c}from"../../biz/business/advertisement/floating-ad/client.mjs";import{extractDataByComponentType as l}from"../../biz/utils/transformers/data.mjs";import{useEffect as u,useLayoutEffect as d,useMemo as f,useRef as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";function _(){if(typeof document>`u`)return 0;let e=document.querySelector(`[data-top-nav-root="true"]`);return e&&e.getBoundingClientRect().height||0}function v({currentChannelId:v,isPGC:y}){let b=r(),x=a(),{data:S}=i(o.GET_CONTENT_LIST(v),()=>e({channel_id:v})),{data:C}=i([o.FLOATING_BALL],()=>n()),w=f(()=>S?.data?.blocks||[],[S?.data?.blocks]),T=f(()=>{let e=w.findIndex(e=>e.type===4),t=e>=0?w[e]:null;return{index:e,block:t,blockId:t?.id||``}},[w]),{data:E}=i([o.GUESS_YOU_LIKE_USER_DATA,T.blockId],()=>t({block_id:T.blockId}),{enabled:!!T.blockId}),D=f(()=>{if(T.index<0)return w;let e=E?.data.block?.data?.users||[];return w.map((t,n)=>n===T.index?{...t,data:{...t.data||{},users:e}}:t)},[w,E,T.index]),[O,k]=s(`home-scroll-top-${v}`,0),A=p({restored:!1,lastScrollTop:O,key:v,rafId:null}),j=p(k),M=p(O);u(()=>{j.current=k},[k]),u(()=>{M.current=O},[O]),u(()=>{A.current.key!==v&&(A.current.restored=!1,A.current.lastScrollTop=O,M.current=O,A.current.key=v)},[v,O]);let N=D.length>0;d(()=>{if(!N||A.current.restored||O<=0)return;let e=_(),t=Math.max(0,O+e);window.requestAnimationFrame(()=>{window.scrollTo({top:t}),A.current.restored=!0,A.current.lastScrollTop=t})},[N,v,O]),u(()=>{let e=A.current;function t(){e.restored=!0,e.rafId!==null&&window.cancelAnimationFrame(e.rafId),e.rafId=window.requestAnimationFrame(()=>{e.rafId=null;let t=window.scrollY??document.documentElement.scrollTop??0,n=_(),r=Math.max(0,t-n);Math.abs(t-e.lastScrollTop)>1&&(e.lastScrollTop=t,j.current(r))})}return window.addEventListener(`scroll`,t,{passive:!0}),()=>{e.rafId!==null&&(window.cancelAnimationFrame(e.rafId),e.rafId=null),window.removeEventListener(`scroll`,t)}},[v]);let P=f(()=>l(D,y),[D,y]),F=f(()=>C?.data?.ball_infos?.find(e=>e.channel_id===v),[C?.data?.ball_infos,v]);return g(m,{children:[F&&h(c,{ad:{materialUrl:F.material_url||``,jumpUrl:F.jump_url||``,name:F.name||``},onClick:()=>{x(()=>{F?.jump_url&&b.push(F.jump_url)})}}),P.map(e=>{let t=e.component,n=e.data.block_id||`block-${e.data.title||``}`;return h(t,{data:e.data},n)})]})}export{v as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{ensureGuestIdentity as t}from"../../../store/modules/user-store.mjs";import{Box as n}from"../../ui/box.mjs";import{Checkbox as r}from"../../ui/checkbox.mjs";import{Input as i}from"../../ui/input.mjs";import{Text as a}from"../../ui/text.mjs";import{CloseIcon as o}from"../../../assets/icons/close-icon.mjs";import{EyeIcon as s}from"../../../assets/icons/eye-icon.mjs";import{EyeOffIcon as c}from"../../../assets/icons/eye-off-icon.mjs";import{AgreementDialog as l}from"./agreement-dialog.mjs";import{
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{ensureGuestIdentity as t}from"../../../store/modules/user-store.mjs";import{Box as n}from"../../ui/box.mjs";import{Checkbox as r}from"../../ui/checkbox.mjs";import{Input as i}from"../../ui/input.mjs";import{Text as a}from"../../ui/text.mjs";import{CloseIcon as o}from"../../../assets/icons/close-icon.mjs";import{EyeIcon as s}from"../../../assets/icons/eye-icon.mjs";import{EyeOffIcon as c}from"../../../assets/icons/eye-off-icon.mjs";import{AgreementDialog as l}from"./agreement-dialog.mjs";import{useCallback as u,useMemo as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{useTranslations as h}from"next-intl";function g(g){let _=h(`components.pages.login`),{onClose:v,onForgotPassword:y,onRegister:b,onSubmit:x,errorText:S}=g,[C,w]=f(``),[T,E]=f(``),[D,O]=f(!1),[k,A]=f(!1),[j,M]=f(!1),[N,P]=f(null),F=d(()=>C.trim().length>0&&T.length>0&&j&&!k,[C,T,j,k]),I=u(()=>{t(!0),b?.()},[b]);async function L(){if(F)try{A(!0),await x?.({email:C.trim(),password:T})}finally{A(!1)}}return m(n,{className:`min-h-screen w-full h-full bg-bg1 text-text1 flex flex-col`,children:[m(n,{className:`flex justify-between items-center h-[60px] px-[16px]`,children:[p(e,{type:`button`,onClick:v,"aria-label":_(`loginClient.close`),className:`cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:p(o,{className:`w-[16px] h-[16px] text-text1/80`,"aria-hidden":`true`,focusable:`false`})}),p(e,{type:`button`,onClick:y,className:`text-[14px] text-text2 hover:text-text1 bg-transparent !p-0 !px-0 !py-0`,children:_(`loginClient.forgotPassword`)})]}),m(n,{className:`px-[24px] flex flex-1 flex-col mt-[15px]`,children:[m(n,{className:`flex flex-col`,children:[p(a,{className:`text-[24px] leading-[32px] font-bold`,children:_(`loginClient.title`)}),m(a,{className:`text-[14px] leading-[22px] mt-[12px] text-text1/80`,children:[_(`loginClient.noAccount`),`?`,p(e,{type:`button`,onClick:I,className:`cursor-pointer text-theme5 hover:opacity-90 bg-transparent !p-0 !px-0 !py-0`,children:_(`loginClient.registerLink`)})]})]}),m(`form`,{className:`mt-[38px] space-y-[16px]`,autoComplete:`off`,onSubmit:e=>{e.preventDefault(),L()},children:[p(n,{className:`flex items-center px-[28px] rounded-[50px] h-[66px] bg-line1 border border-line1`,children:p(i,{placeholder:_(`loginClient.emailPlaceholder`),type:`email`,name:`funhub-login-email`,value:C,onChange:e=>w(e.target.value),autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`!bg-transparent !px-0 !py-0 !rounded-none !text-text1 placeholder:!text-text3 leading-[26px] text-[18px]`})}),m(n,{className:`flex items-center justify-between px-[28px] rounded-[50px] h-[66px] bg-line1 border border-line1`,children:[p(i,{placeholder:_(`loginClient.passwordPlaceholder`),type:D?`text`:`password`,name:`funhub-login-password`,value:T,onChange:e=>E(e.target.value),autoComplete:`new-password`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`flex-1 !bg-transparent !px-0 !py-0 !rounded-none !text-text1 placeholder:!text-text3 leading-[26px] text-[18px]`}),p(e,{type:`button`,className:`ml-[10px] cursor-pointer select-none bg-transparent !p-0 !px-0 !py-0`,"aria-label":_(D?`loginClient.hidePassword`:`loginClient.showPassword`),onClick:()=>O(e=>!e),children:p(D?s:c,{className:`w-[20px] h-[20px] text-text3`,"aria-hidden":`true`,focusable:`false`})})]})]}),p(n,{className:`h-[22px] mt-[16px] mb-[22px] ml-[12px] text-[14px] text-theme5`,children:S}),m(n,{className:`mt-auto flex flex-col items-center w-full pb-[55px]`,children:[m(n,{className:`flex items-center justify-center gap-2 flex-wrap mb-[16px] w-full`,children:[p(r,{checked:j,onCheckedChange:e=>M(e===!0),"aria-label":_(`loginClient.agreeToTerms`),className:`shrink-0`}),m(a,{as:`span`,className:`text-[14px] text-text2`,children:[_(`loginClient.agreeToTermsPrefix`),m(e,{type:`button`,variant:`link`,className:`inline text-theme6 !p-0 !h-auto font-normal underline-offset-2 hover:underline bg-transparent`,onClick:()=>P(`terms`),children:[`《`,_(`loginClient.userAgreement`),`》`]}),_(`loginClient.and`),m(e,{type:`button`,variant:`link`,className:`inline text-theme6 !p-0 !h-auto font-normal underline-offset-2 hover:underline bg-transparent`,onClick:()=>P(`privacy`),children:[`《`,_(`loginClient.privacyPolicy`),`》`]})]})]}),p(e,{type:`button`,onClick:L,disabled:!F,className:`w-full h-[60px] !rounded-[30px] !text-[18px] font-bold leading-[26px] bg-theme6 disabled:bg-theme6/40 disabled:text-text3 active:opacity-90 !px-0 !py-0`,children:_(k?`loginClient.loggingIn`:`loginClient.login`)})]})]}),p(l,{type:N,onClose:()=>P(null)})]})}export{g as LoginClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{pUserSendEmailCode as t}from"../../../service/generated/client.mjs";import{Box as n}from"../../ui/box.mjs";import{Checkbox as r}from"../../ui/checkbox.mjs";import{Input as i}from"../../ui/input.mjs";import{Text as a}from"../../ui/text.mjs";import{useLoginModalStore as o}from"../../../store/modules/login-modal-store.mjs";import{LeftArrowIcon as s}from"../../../assets/icons/left-arrow-icon.mjs";import{AgreementDialog as c}from"./agreement-dialog.mjs";import{
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{pUserSendEmailCode as t}from"../../../service/generated/client.mjs";import{Box as n}from"../../ui/box.mjs";import{Checkbox as r}from"../../ui/checkbox.mjs";import{Input as i}from"../../ui/input.mjs";import{Text as a}from"../../ui/text.mjs";import{useLoginModalStore as o}from"../../../store/modules/login-modal-store.mjs";import{LeftArrowIcon as s}from"../../../assets/icons/left-arrow-icon.mjs";import{AgreementDialog as c}from"./agreement-dialog.mjs";import{useMemo as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useTranslations as p}from"next-intl";function m(m){let h=p(`components.pages.login`),{onClose:g,onLogin:_,onVerify:v}=m,{setVerifyStep:y}=o(),[b,x]=u(``),[S,C]=u(!1),[w,T]=u(``),[E,D]=u(!1),[O,k]=u(null),A=l(()=>b.trim().length>0&&E&&!S,[b,E,S]);function j(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function M(e){x(e),w&&T(``)}async function N(){if(A)try{C(!0),T(``);let e=b.trim();if(!j(e)){T(h(`register.invalidEmail`));return}await t({email:e}),y(`register-verify`),v?.(e)}catch(e){T(e.message??h(`register.sendFailed`))}finally{C(!1)}}return f(n,{className:`min-h-screen w-full h-full bg-bg1 text-text1 flex flex-col`,children:[f(n,{className:`flex justify-between items-center h-[60px] px-[16px]`,children:[d(e,{type:`button`,onClick:g,"aria-label":h(`register.back`),className:`cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:d(s,{className:`w-[16px] h-[16px] text-text1/80`,"aria-hidden":`true`,focusable:`false`})}),d(a,{className:`text-[14px] text-text2`})]}),f(n,{className:`px-[24px] flex flex-1 flex-col mt-[15px]`,children:[f(n,{className:`flex flex-col`,children:[d(a,{className:`text-[24px] leading-[32px] font-bold`,children:h(`register.title`)}),f(a,{className:`text-[14px] leading-[22px] mt-[12px] text-text1/80`,children:[h(`register.hasAccount`),`?`,d(e,{type:`button`,onClick:_,className:`cursor-pointer text-theme5 hover:opacity-90 bg-transparent !p-0 !px-0 !py-0`,children:h(`register.loginLink`)})]})]}),f(n,{className:`mt-[38px]`,children:[d(n,{className:`flex items-center px-[28px] rounded-[50px] h-[66px] bg-line1 border border-line1`,children:d(i,{placeholder:h(`register.emailPlaceholder`),type:`email`,name:`funhub-register-email`,value:b,onChange:e=>M(e.target.value),autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`!bg-transparent !px-0 !py-0 !rounded-none !text-text1 placeholder:!text-text3 leading-[26px] text-[18px]`})}),d(n,{className:`h-[22px] mt-[16px] mb-[22px] ml-[12px] text-[14px] text-theme5`,children:w})]}),f(n,{className:`mt-auto flex flex-col items-center w-full pb-[55px]`,children:[f(n,{className:`flex items-center justify-center gap-2 flex-wrap mb-[16px] w-full`,children:[d(r,{checked:E,onCheckedChange:e=>D(e===!0),"aria-label":h(`loginClient.agreeToTerms`),className:`shrink-0`}),f(a,{as:`span`,className:`text-[14px] text-text2`,children:[h(`loginClient.agreeToTermsPrefix`),f(e,{type:`button`,variant:`link`,className:`inline text-theme6 !p-0 !h-auto font-normal underline-offset-2 hover:underline bg-transparent`,onClick:()=>k(`terms`),children:[`《`,h(`loginClient.userAgreement`),`》`]}),h(`loginClient.and`),f(e,{type:`button`,variant:`link`,className:`inline text-theme6 !p-0 !h-auto font-normal underline-offset-2 hover:underline bg-transparent`,onClick:()=>k(`privacy`),children:[`《`,h(`loginClient.privacyPolicy`),`》`]})]})]}),d(e,{type:`button`,onClick:N,disabled:!A,className:`w-full h-[60px] !rounded-[30px] !text-[18px] font-bold leading-[26px] bg-theme6 disabled:bg-theme6/40 disabled:text-text3 active:opacity-90 !px-0 !py-0`,children:h(S?`register.sending`:`register.getCode`)})]})]}),d(c,{type:O,onClose:()=>k(null)})]})}export{m as Register};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{getCookie as t}from"../../../utils/common.mjs";import{pUserSendEmailCode as n,pUserSendResetPasswordEmailCode as r,pUserVerifyForgetEmailCode as i,pUserVerifyResetPasswordEmailCode as a}from"../../../service/generated/client.mjs";import{pUserRegisterByVerifyEmailCodeCompat as o}from"../../../service/register-by-verify-email-code.mjs";import{Box as s}from"../../ui/box.mjs";import{Text as c}from"../../ui/text.mjs";import{useLoginModalStore as l}from"../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as u}from"../../../hooks/query/use-query.mjs";import{useSetAuthFields as d,useUserId as f}from"../../../hooks/use-auth.mjs";import{LeftArrowIcon as p}from"../../../assets/icons/left-arrow-icon.mjs";import{
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{getCookie as t}from"../../../utils/common.mjs";import{pUserSendEmailCode as n,pUserSendResetPasswordEmailCode as r,pUserVerifyForgetEmailCode as i,pUserVerifyResetPasswordEmailCode as a}from"../../../service/generated/client.mjs";import{pUserRegisterByVerifyEmailCodeCompat as o}from"../../../service/register-by-verify-email-code.mjs";import{Box as s}from"../../ui/box.mjs";import{Text as c}from"../../ui/text.mjs";import{useLoginModalStore as l}from"../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as u}from"../../../hooks/query/use-query.mjs";import{useSetAuthFields as d,useUserId as f}from"../../../hooks/use-auth.mjs";import{LeftArrowIcon as p}from"../../../assets/icons/left-arrow-icon.mjs";import{useCallback as m,useEffect as h,useMemo as g,useRef as _,useState as v}from"react";import{jsx as y,jsxs as b}from"react/jsx-runtime";import{toast as x}from"sonner";import{useTranslations as S}from"next-intl";function C(e){let[t,n]=e.split(`@`);return!t||!n?e:`${t.slice(0,3)}***${t.length>3?t.slice(-1):``}@${n}`}function w(w){let T=S(`components.pages.login`),{email:E,onClose:D,onPassword:O}=w,{verifyStep:k,resolveLogin:A}=l(),[j,M]=v([,,,,,,].fill(``)),[N,P]=v(0),[F,I]=v(!1),[L,R]=v(60),[z,B]=v(!1),[V,H]=v(``),U=_(null),W=f(),G=d(),K=u(),q=g(()=>C(E),[E]),J=m(async()=>{if(k===`reset-password`)return await a({user_id:W,email_code:j.join(``)});if(k===`forgot-password`)return await i({email:E,email_code:j.join(``)});if(k===`register-verify`){let e=await t(`guestUserId`);return await o({email:E,email_code:j.join(``),user_id:e})}throw Error(T(`verify.invalidCode`))},[k,j,W,E,T]),Y=g(()=>j.every(e=>e!==``)&&!F,[j,F]);h(()=>{if(L<=0)return;let e=setInterval(()=>{R(e=>e-1)},1e3);return()=>clearInterval(e)},[L]),h(()=>{U.current?.focus()},[]);let X=m(e=>{let t=e.target.value.replace(/\D/g,``);if(t.length===0)return;let n=[...j],r=t.split(``),i=N;for(let e of r)i<6&&(n[i]=e,i++);M(n),P(Math.min(i,5)),H(``)},[j,N]),Z=m(e=>{if(e.key===`Backspace`){e.preventDefault();let t=[...j];j[N]?t[N]=``:N>0&&(t[N-1]=``,P(N-1)),M(t),H(``)}else e.key===`ArrowLeft`&&N>0?P(N-1):e.key===`ArrowRight`&&N<5&&P(N+1)},[j,N]),Q=m(e=>{P(e),U.current?.focus()},[]);async function $(){if(!(L>0||z))try{B(!0),k===`reset-password`?await r({user_id:W}):await n({email:E}),R(60),H(``)}finally{B(!1)}}async function ee(){if(Y)try{I(!0);let e=await J();if(k===`register-verify`){let t=e?.data;if(t?.user_id){G({token:t.token??``,expireTime:t.expire_time??0,userId:t.user_id}),x.success(T(`index.loginSuccess`)),K([`user-profile`,`mine`]),A(!0);return}}O?.(E)}catch(e){H(e.message??T(`verify.invalidCode`))}finally{I(!1)}}return b(s,{className:`min-h-screen w-full h-full bg-bg1 text-text1 flex flex-col`,children:[b(s,{className:`flex justify-between items-center h-[60px] px-[16px]`,children:[y(e,{type:`button`,onClick:D,"aria-label":T(`verify.back`),className:`cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:y(p,{className:`w-[16px] h-[16px] text-text1/80`,"aria-hidden":`true`,focusable:`false`})}),y(c,{className:`text-[14px] text-text2`})]}),b(s,{className:`px-[24px] flex flex-col mt-[15px]`,children:[b(s,{className:`flex flex-col`,children:[y(c,{className:`text-[24px] leading-[32px] font-bold`,children:T(`verify.title`)}),b(s,{className:`mt-[12px] flex items-center`,children:[b(c,{className:`text-[14px] leading-[14px] text-text1/80`,children:[T(`verify.sentTo`),` `,q]}),y(e,{type:`button`,onClick:$,disabled:L>0||z,className:`ml-[8px] rounded-[19px] !px-[8px] !py-[8px] text-[12px] leading-[12px] cursor-pointer bg-line1 text-text1/80 disabled:cursor-not-allowed`,children:L>0?`${T(`verify.resend`)} (${L}s)`:T(`verify.resend`)})]})]}),b(`form`,{className:`mt-[38px]`,onSubmit:e=>{e.preventDefault(),ee()},children:[b(s,{className:`h-14 sm:h-16 md:h-20 relative`,children:[y(`input`,{ref:U,type:`text`,inputMode:`numeric`,pattern:`[0-9]*`,value:``,onChange:X,onKeyDown:Z,className:`absolute opacity-0 pointer-events-none w-full h-full border-none outline-none bg-transparent text-base caret-transparent`,autoComplete:`one-time-code`}),y(s,{className:`w-full flex justify-between items-center`,children:j.map((e,t)=>y(s,{onClick:()=>Q(t),className:`
|
|
3
|
+
w-14 h-14 sm:w-16 sm:h-16 md:w-20 md:h-20 rounded-xl border-2 flex items-center justify-center cursor-pointer transition-all duration-200
|
|
4
|
+
${t===N?`border-theme3 bg-theme3`:`border-transparent bg-bg2`}
|
|
5
|
+
`,children:y(c,{className:`select-none font-semibold text-2xl sm:text-3xl leading-none text-text1`,children:e})},t))})]}),y(s,{className:`h-[22px] mt-[16px] mb-[22px] ml-[12px] text-[14px] text-theme5`,children:V}),y(e,{type:`submit`,disabled:!Y,className:`w-full h-[60px] !rounded-[30px] !text-[18px] font-bold leading-[26px] bg-theme6 disabled:bg-theme6/40 disabled:text-text3 active:opacity-90 !px-0 !py-0`,children:T(F?`verify.verifying`:`verify.nextStep`)})]})]})]})}export{w as Verify};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as r}from"../../../service/generated/client.mjs";import{useRouter as i}from"../../../utils/use-compatible-router.mjs";import{
|
|
2
|
+
"use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as r}from"../../../service/generated/client.mjs";import{useRouter as i}from"../../../utils/use-compatible-router.mjs";import{Text as a}from"../../ui/text.mjs";import{useRequest as o}from"../../../hooks/query/use-query.mjs";import{eventKey as s}from"../../../constants/event-key.mjs";import{useSearchHistory as c}from"../../../hooks/use-search-history.mjs";import{SearchHistoryClient as l}from"../../biz/business/search-history/client.mjs";import u from"./hot-recommend.mjs";import d from"./hot-search.mjs";import f from"./search-result/index.mjs";import p from"./top-header.mjs";import{memo as m,useEffect as h,useMemo as g,useState as _}from"react";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";import{usePathname as x,useSearchParams as S}from"next/navigation";import{useTranslations as C}from"next-intl";const w=[{labelKey:`tabs.all`,value:`all`},{labelKey:`tabs.video`,value:`video`},{labelKey:`tabs.post`,value:`info`},{labelKey:`tabs.user`,value:`user`}],T=m(({searchType:e,onChange:t,tabList:n})=>y(`nav`,{className:`w-full h-[42px] bg-bg1 flex items-center px-[3px] sticky top-[53px] left-0 z-50`,children:n.map(n=>y(a,{className:`h-[30px] rounded-[15px] leading-[30px] px-[9px] text-[16px] bg-transparent transition-all duration-150 ${e===n.value?`text-theme5 !text-[20px] font-bold`:`text-text2`}`,onClick:()=>{e!==n.value&&t(n.value)},children:n.label},n.value))}));function E(){let a=C(`components.pages.search.pageClient`),{userInfo:m}=n(),E=m?.user_id||`guest`,D=S(),O=x(),k=i(),A=D.get(`q`)?.toString()||``,{data:j,refetch:M}=o([`hotSearchKey`],()=>r({user_id:E})),N=g(()=>j?.data?.recommend_list??[],[j]),[P,F]=_(A),I=g(()=>w.map(e=>({value:e.value,label:a(e.labelKey)})),[a]),[L,R]=_(A),[z,B]=_(0),[V,H]=_(w[0].value),[,U]=_([]),{history:W,addHistory:G}=c({storageKey:E}),K=g(()=>P.trim()===``?N.length>0||W.length>0||P.trim()===``:!1,[N,P,W]),q=g(()=>P.trim()!==``&&!K,[P,K]);return h(()=>(t.on(s.EXCHANGE_SEARCH_TYPE,H),()=>{t.off(s.EXCHANGE_SEARCH_TYPE,H)}),[H]),b(`div`,{className:`w-full min-h-screen bg-bg1 pb-[12px]`,children:[y(p,{setSearchInputVal:t=>{t!==P&&(U([]),F(t),e({q:t}))},initInputVal:L,initInputVersion:z,addSearchHistory:G}),K&&b(`div`,{className:`w-full pt-[8px]`,children:[W.length>0&&y(l,{title:a(`searchHistory`),rows:2,storageKey:E,onHistoryClick:e=>{R(e),B(e=>e+1);let t=new URLSearchParams(D.toString());t.set(`q`,e),k.push(`${O}?${t.toString()}`)}}),y(d,{initHotSearchKeywordList:N,onRefreshHotKey:async()=>(await M()).data??{code:0,message:``,data:{recommend_list:[]}},onClick:e=>{R(e.title||``),B(e=>e+1),G(e.title)}})]}),y(u,{isShow:P.trim()===``}),q&&b(v,{children:[y(T,{searchType:V,tabList:I,onChange:e=>{H(e),U([])}}),y(f,{inputVal:P,searchType:V},`${V}-${P}`)]})]})}export{E as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import e from"./search-user.mjs";import t from"./search-video-info.mjs";import n from"./search-all.mjs";import{jsx as r}from"react/jsx-runtime";function i({searchType:i,inputVal:a
|
|
2
|
+
"use client";import e from"./search-user.mjs";import t from"./search-video-info.mjs";import n from"./search-all.mjs";import{jsx as r}from"react/jsx-runtime";function i({searchType:i,inputVal:a}){return i===`user`?r(e,{inputVal:a}):i===`all`?r(n,{inputVal:a}):r(t,{searchType:i,inputVal:a})}export{i as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import e from"../../../../utils/event-bus.mjs";import{gContentGetRecommendVideoList as t}from"../../../../service/generated/client.mjs";import{
|
|
2
|
+
"use client";import e from"../../../../utils/event-bus.mjs";import{gContentGetRecommendVideoList as t}from"../../../../service/generated/client.mjs";import{Box as n}from"../../../ui/box.mjs";import{List as r}from"../../../ui/list.mjs";import{usePaginated as i,useRefetchQuery as a,useRequest as o,useUpdateRequest as s}from"../../../../hooks/query/use-query.mjs";import{eventKey as c}from"../../../../constants/event-key.mjs";import{UserActivityList as l}from"../../../common/list/user-activity-list/user-activity-list.mjs";import{UserList as u}from"./search-user.mjs";import{mapRecommendContentToUserActivityItem as d}from"../search-utils.mjs";import{VideoList as f}from"./search-video-info.mjs";import{useCallback as p,useMemo as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{useTranslations as v}from"next-intl";function y({inputVal:y}){let b=v(`components.pages.search.searchResult`),{data:x=[]}=o([`searchByKeyForAll`,y,3],async()=>(await t({data_type:2,extra_params:JSON.stringify({type:3,keywords:y}),page:1,page_size:5})).data.videos?.list),S=[`searchByKeyForAll`,y,4],{data:C=[]}=o(S,async()=>(await t({data_type:2,extra_params:JSON.stringify({type:4,keywords:y}),page:1,page_size:5})).data.users?.list),w=m(()=>[`searchByKeyForAll`,y,2],[y]),T=p(async e=>await t({data_type:2,extra_params:JSON.stringify({type:2,keywords:y}),page:e||1,page_size:10}),[y,10]),E=i({key:w,initialPageParam:1,async queryFn(e){return(await T(e))?.data?.contents??{has_more:!1,total:0,list:[]}},getNextPageParam(e,t){if(e.has_more)return t.length+1}}),D=m(()=>E.data?.pages.flatMap(e=>e.list??[])??[],[E.data?.pages]),O=async e=>{if(e!==!1)try{E&&await E.fetchNextPage()}catch(e){console.error(`获取信息列表失败`,e)}},k=s(),A=s(),j=a(),M=e=>{k(S,t=>e)},N=p(e=>{A(w,t=>{if(!t)return t;let n=t.pages.map(t=>({...t,list:(t.list??[]).map(t=>t.content_id===e.content_id?e:t)}));return{...t,pages:n}})},[w,A]),P=p(()=>{j(w)},[w,j]),F=p(e=>({...d(e),onLikeSuccess(t){N({...e,like_count:String(t.count),dislike_count:t.dislikeCount===void 0?e.dislike_count:String(t.dislikeCount),interaction:{...e.interaction,is_liked:t.isLiked,is_dislike:t.isDisliked??e.interaction?.is_dislike}})},onDislikeSuccess(t){N({...e,like_count:t.likeCount===void 0?e.like_count:String(t.likeCount),dislike_count:String(t.count),interaction:{...e.interaction,is_dislike:t.isDisliked,is_liked:t.isLiked??e.interaction?.is_liked}})}}),[N]),I=m(()=>D.map(F),[F,D]),L=m(()=>D.length===0&&!E.hasNextPage&&x.length===0&&C.length===0,[D.length,E.hasNextPage,C.length,x.length]),R=m(()=>x.length===0&&C.length===0,[C.length,x.length]);return L?g(n,{className:`w-full pt-[12px]`,children:g(r,{loading:E.isFetching,loadMore:O,hasMore:E.hasNextPage,empty:`nodata`,emptyText:b(`searchAll.emptyResult`),children:[]})}):_(n,{className:`w-full pt-[12px] ${R?`!pt-0`:``}`,children:[C.length>0&&g(u,{list:C,onUpdate:M}),x.length>0&&_(h,{children:[g(f,{list:x}),_(n,{className:`w-fit h-[46px] leading-[46px] mx-auto mt-[-12px] text-[14px] text-text2`,onClick:()=>{e.emit(c.EXCHANGE_SEARCH_TYPE,`video`)},children:[b(`searchAll.more`),` `,y,` `,b(`searchAll.relatedSuffix`)]})]}),I.length>0&&g(n,{className:`w-full`,children:g(l,{list:I,loading:E.isFetching,loadMore:O,hasMore:E.hasNextPage,emptyText:b(`searchAll.emptyResult`),showGroupHeaders:!1,onActionSuccess:P})})]})}export{y as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../../store/modules/user-store.mjs";import{gContentGetRecommendVideoList as t
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../../store/modules/user-store.mjs";import{gContentGetRecommendVideoList as t}from"../../../../service/generated/client.mjs";import{Image as n}from"../../../ui/image.mjs";import{Box as r}from"../../../ui/box.mjs";import{Item as i}from"../../../ui/item.mjs";import{List as a}from"../../../ui/list.mjs";import{Skeleton as o}from"../../../ui/skeleton.mjs";import{usePaginated as s,useUpdateRequest as c}from"../../../../hooks/query/use-query.mjs";import{useRequireLogin as l}from"../../../../hooks/use-auth.mjs";import{FollowButton as u}from"../../(follow)/_components/follow-button/index.mjs";import{memo as d,useCallback as f,useMemo as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useTranslations as g}from"next-intl";import _ from"next/link";function v(){return m(r,{className:`w-full px-[12px] pt-[12px]`,children:Array.from({length:6}).map((e,t)=>h(r,{className:`w-full h-[56px] flex items-center justify-between mb-[12px]`,children:[h(r,{className:`flex items-center`,children:[m(o,{className:`w-[56px] h-[56px] rounded-[28px]`}),h(r,{className:`ml-[8px]`,children:[m(o,{className:`w-[120px] h-[18px] mb-[8px]`}),m(o,{className:`w-[72px] h-[14px]`})]})]}),m(o,{className:`w-[76px] h-[34px] rounded-[18px]`})]},`search-user-skeleton-${t}`))})}const y=d(({item:t,onUpdate:i})=>{let a=g(`components.pages.search.searchResult`),{userInfo:o}=e(),s=f(e=>{i({...t,is_following:e?1:0})},[t,i]);return h(r,{className:`w-full h-[56px] bg-bg1 flex flex-row items-center justify-between mb-[12px]`,children:[h(_,{className:`cursor-pointer flex flex-row items-center justify-center`,href:`/profile/${t.user_id}`,children:[m(r,{className:`w-[56px] h-[56px] rounded-[28px] overflow-hidden bg-bg2 relative`,children:m(n,{src:t.avatar||``,fill:!0,objectFit:`cover`,alt:t.nick_name})}),h(r,{className:`flex flex-col ml-[8px]`,children:[m(`span`,{className:`text-text1 text-[16px] leading-[24px] h-[24px] font-bold overflow-hidden max-w-[200px] line-clamp-1`,children:t.nick_name}),h(`span`,{className:`text-text2 leading-[22px] text-[14px]`,children:[t.follower_count??0,a(`searchUser.followersSuffix`)]})]})]}),o.user_id!==t.user_id&&m(u,{userId:t.user_id,hasFollow:!!t.is_following,onChange:s})]})});y.displayName=`UserItem`;const b=d(({list:e,onUpdate:t})=>{let n=l(),i=f(n=>{let r=e.findIndex(e=>e.user_id===n.user_id);if(r!==-1){let i=[...e];i[r]=n,t(i)}},[e,t]);return m(r,{className:`px-[12px]`,children:e.map((e,t)=>m(y,{item:e,onUpdate:e=>{n(()=>{i(e)})}},String(e.user_id??t)))})});b.displayName=`UserList`;const x=d(({inputVal:e})=>{let n=g(`components.pages.search.searchResult`),o=l(),u=f(async n=>await t({data_type:2,extra_params:JSON.stringify({type:4,keywords:e}),page:n||1,page_size:20}),[e,20]),d=p(()=>[`searchByKeyForUser`,e,4],[e]),h=s({key:d,initialPageParam:1,async queryFn(e){return(await u(e))?.data?.users??{has_more:!1,total:0,list:[]}},getNextPageParam(e,t){if(e.has_more)return t.length+1}}),_=c(),b=f((e,t)=>{e&&_(d,n=>{if(n){let r=n.pages.map(n=>({...n,list:(n.list??[]).map(n=>n.user_id===e?{...n,is_following:t?1:0}:n)}));return{...n,pages:r}}return n})},[_,d]),x=h.data?.pages.flatMap(e=>e.list??[])??[],S=h.isPending||h.isFetching;return S&&x.length===0?m(v,{}):m(r,{className:`w-full px-[12px] pt-[12px]`,children:m(a,{loading:S,hasMore:h.hasNextPage??!1,loadMore:async e=>{if(e!==!1)try{h&&await h.fetchNextPage()}catch(e){console.error(`获取用户列表失败`,e)}},empty:`nodata`,emptyText:n(`searchUser.emptyResult`),children:x.map((e,t)=>m(i,{children:m(y,{item:e,onUpdate:e=>{o(()=>{b(e.user_id||``,!!e.is_following)})}})},String(e.user_id??t)))})})});export{b as UserList,x as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{gContentGetRecommendVideoList as e}from"../../../../service/generated/client.mjs";import{
|
|
2
|
+
"use client";import{gContentGetRecommendVideoList as e}from"../../../../service/generated/client.mjs";import{Image as t}from"../../../ui/image.mjs";import{Box as n}from"../../../ui/box.mjs";import{EmptyState as r}from"../../../ui/empty.mjs";import{Text as i}from"../../../ui/text.mjs";import{usePaginated as a,useRefetchQuery as o,useUpdateRequest as s}from"../../../../hooks/query/use-query.mjs";import{formatVideoDuration as c,getPostDetailPagePath as l}from"../../../../utils/tools.mjs";import{apiCollectCustom as u}from"../../../../utils/api-collect.mjs";import{UserActivityList as d}from"../../../common/list/user-activity-list/user-activity-list.mjs";import f from"../../../../assets/icons/view.mjs";import{SearchVideoCardSkeleton as p}from"../../../common/skeleton/search-video-card-skeleton.mjs";import{mapRecommendContentToUserActivityItem as m}from"../search-utils.mjs";import{memo as h,useCallback as g,useMemo as _}from"react";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{useTranslations as b}from"next-intl";import x from"next/link";const S=h(()=>v(p,{count:3,uniqueKeyPrefix:`search-video-info-skeleton`}));S.displayName=`SearchVideoListSkeleton`;function C(e){let t=Number(e||0);return Number.isNaN(t)||t<=0?`0`:t>=1e4?`${(t/1e4).toFixed(1)}w`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function w(e){let t=Number(e.episode_count||0),n=Number.isFinite(t)&&t>0,r=String(e.update_status??``).trim();return!n||t<=1?c(Number(e.duration||0)):r===`1`?`全${t}集`:`更新至${t}集`}const T=h(({item:e})=>{let r=e.name||``,a=e.img_x||e.img_y||``,o=w(e);return y(x,{className:`mb-[12px] block border-b border-line1 px-[12px] pb-[12px]`,href:l({id:e.video_id,contentType:0}),onClick:()=>{e.video_id},children:[y(n,{className:`relative w-full overflow-hidden rounded-[12px] bg-neutral-800`,style:{aspectRatio:`16/9`},children:[a&&v(t,{src:a,alt:r||`封面`,fill:!0,objectFit:`cover`}),v(n,{className:`absolute inset-x-0 bottom-0 h-[40px] bg-gradient-to-t from-black/80 to-transparent z-0 pointer-events-none`}),y(n,{className:`absolute bottom-0 left-[8px] mb-[6px] z-10 flex items-center gap-[4px]`,children:[v(f,{className:`h-[14px] w-[14px] text-white`}),v(i,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:C(e.play_count)})]}),o&&v(n,{className:`absolute bottom-0 right-[8px] mb-[6px] z-10 flex items-center`,children:v(i,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:o})})]}),y(n,{className:`flex items-center justify-between gap-[12px] pt-[10px] px-2`,children:[y(n,{className:`flex-1 min-w-0`,children:[v(i,{as:`h3`,className:`text-[16px] font-semibold leading-[24px] text-text1 line-clamp-1`,children:r}),e.description&&v(i,{as:`p`,className:`mt-[4px] text-[13px] leading-[20px] text-text2 line-clamp-1`,children:e.description})]}),v(i,{className:`shrink-0 rounded-[20px] border border-[#FD4C5E] px-[24px] py-[8px] text-[14px] font-normal text-[#FD4C5E]`,children:`观看`})]})]})});T.displayName=`VideoItem`;const E=h(({list:e})=>v(n,{className:`w-full px-[12px] pt-[12px]`,children:e.map((e,t)=>v(T,{item:e},String(e.video_id??t)))}));E.displayName=`VideoList`;const D=h(({list:e,onUpdate:t,onActionSuccess:n})=>{let r=g(n=>{let r=e.findIndex(e=>e.content_id===n.content_id);if(r!==-1){let i=[...e];i[r]=n,t(i)}},[e,t]);return v(d,{list:_(()=>e.map(e=>({...m(e),onLikeSuccess(t){r({...e,like_count:String(t.count),dislike_count:t.dislikeCount===void 0?e.dislike_count:String(t.dislikeCount),interaction:{...e.interaction,is_liked:t.isLiked,is_dislike:t.isDisliked??e.interaction?.is_dislike}})},onDislikeSuccess(t){r({...e,like_count:t.likeCount===void 0?e.like_count:String(t.likeCount),dislike_count:String(t.count),interaction:{...e.interaction,is_dislike:t.isDisliked,is_liked:t.isLiked??e.interaction?.is_liked}})}})),[r,e]),showGroupHeaders:!1,onActionSuccess:n})});D.displayName=`InfoList`;const O=h(({searchType:t,inputVal:i})=>{let c=b(`components.pages.search.searchResult`),l=g(async n=>await e({data_type:2,extra_params:JSON.stringify({type:t===`video`?3:2,keywords:i}),page:n||1,page_size:20}),[i,20,t]),u=_(()=>[`searchByKeyForVideoInfo`,i,t===`video`?3:2],[i,t]),f=a({key:u,initialPageParam:1,async queryFn(e){let n=await l(e);return(t===`video`?n?.data?.videos:n?.data?.contents)??{has_more:!1,total:0,list:[]}},getNextPageParam(e,t){if(e.has_more)return t.length+1}}),p=_(()=>{let e=f.data?.pages??[],t=[];for(let n of e){let e=n.list??[];t.push(...e)}return t},[f.data?.pages]),h=_(()=>p,[p,t]),y=s(),x=o(),C=g(e=>{y(u,t=>{if(!t)return t;let n=t.pages.map(t=>({...t,list:(t.list??[]).map(t=>t.content_id===e.content_id?e:t)}));return{...t,pages:n}})},[u,y]),w=g(()=>{x(u)},[u,x]),T=g(e=>({...m(e),onLikeSuccess(t){C({...e,like_count:String(t.count),dislike_count:t.dislikeCount===void 0?e.dislike_count:String(t.dislikeCount),interaction:{...e.interaction,is_liked:t.isLiked,is_dislike:t.isDisliked??e.interaction?.is_dislike}})},onDislikeSuccess(t){C({...e,like_count:t.likeCount===void 0?e.like_count:String(t.likeCount),dislike_count:String(t.count),interaction:{...e.interaction,is_dislike:t.isDisliked,is_liked:t.isLiked??e.interaction?.is_liked}})}}),[C]),D=_(()=>h.map(T),[T,h]),O=f.isPending||f.isFetching,k=t===`video`&&O&&h.length===0;return v(n,{className:`w-full`,children:t===`video`?k?v(S,{}):h.length>0?v(E,{list:h}):v(r,{type:`no-content`,text:c(`searchVideoInfo.noRelevantContent`),className:`mt-[12px]`}):v(d,{list:D,loading:O,hasMore:f.hasNextPage??!1,loadMore:async e=>{if(e!==!1)try{f&&await f.fetchNextPage()}catch(e){console.error(`获取内容列表失败`,e)}},showGroupHeaders:!1,emptyText:c(`searchVideoInfo.noRelevantContent`),onActionSuccess:w})})});O.displayName=`SearchInfoOrVideoList`;export{E as VideoList,O as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
function e(e){let t=e.author,n=(Array.isArray(e.medias)?e.medias:[]).map(t=>{let n=t?.media_url??``,r=!!t?.is_video,i=t?.cover_image||e.cover_image||(r?``:n);return{...t,media_url:n,is_video:r,cover_image:i}}).filter(e=>!!(e?.media_url||e?.cover_image)),r=(Array.isArray(e.images)?e.images:[]).map(e=>typeof e==`string`?e:e&&typeof e==`object`&&(e.url||e.image_url||e.media_url)||``).filter(e=>!!e).map(e=>({media_url:e,is_video:!1,cover_image:``})),i=n.length?n:r;return{type:Number(e.type??1),content_id:e.content_id??``,author:{avatar:t?.avatar_url??t?.avatar??``,nick_name:t?.nickname??t?.username??``,user_id:t?.user_id??e.user_id??``},create_time:Number(e.create_time??0),content:e.content??``,medias:i,like_count:Number(e.like_count??0),dislike_count:Number(e.dislike_count??0),comment_count:Number(e.comment_count??0),is_liked:e.interaction?.is_liked??!1,is_dislike:e.interaction?.is_dislike??!1}}export{e as mapRecommendContentToUserActivityItem};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useRouter as e}from"../../../utils/use-compatible-router.mjs";import{Input as t}from"../../ui/input.mjs";import{toast as n}from"../../../ui.mjs";import{useKeepAliveEffect as r,useKeepAliveState as i}from"../../common/keep-scroll-position/index.mjs";import{isPCEnv as a}from"../../../utils/tools.mjs";import{LeftArrowIcon as o}from"../../common/icons/left-arrow.mjs";import s from"../../../assets/icons/search.mjs";import c from"../../../assets/icons/clear.mjs";import{memo as l,useCallback as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useSearchParams as p}from"next/navigation";import{useTranslations as m}from"next-intl";function h(){}const g=l(({setSearchInputVal:l,initInputVal:g,initInputVersion:_,addSearchHistory:v,clearCallback:y=h})=>{let b=m(`components.pages.search`),x=e(),[S,C]=i(`search-input-val`,``),w=p().get(`q`),T=e=>{
|
|
2
|
+
"use client";import{useRouter as e}from"../../../utils/use-compatible-router.mjs";import{Input as t}from"../../ui/input.mjs";import{toast as n}from"../../../ui.mjs";import{useKeepAliveEffect as r,useKeepAliveState as i}from"../../common/keep-scroll-position/index.mjs";import{isPCEnv as a}from"../../../utils/tools.mjs";import{LeftArrowIcon as o}from"../../common/icons/left-arrow.mjs";import s from"../../../assets/icons/search.mjs";import c from"../../../assets/icons/clear.mjs";import{memo as l,useCallback as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useSearchParams as p}from"next/navigation";import{useTranslations as m}from"next-intl";function h(){}const g=l(({setSearchInputVal:l,initInputVal:g,initInputVersion:_,addSearchHistory:v,clearCallback:y=h})=>{let b=m(`components.pages.search`),x=e(),[S,C]=i(`search-input-val`,``),w=p().get(`q`),T=e=>{let t=e.target.value;C(t)},E=u(e=>{l(e),v(e)},[v,l]);r(()=>{g&&(C(g),E(g))},[g,_],`search-init-input-effect`),r(()=>{w&&(C(w),E(w))},[w],`search-url-params-effect`);function D(){if(n.dismiss(),window.location.search.split(`from_code=`)[1]){x.push(`/`);return}x.back()}return d(`div`,{className:`app-top-nav relative w-full h-[55px]`,children:d(`header`,{className:`fixed top-0 left-0 right-0 z-50 bg-bg1`,style:{willChange:`transform`,transform:`translateZ(0)`},children:f(`div`,{className:`mx-auto flex h-[55px] items-center gap-[12px] px-[12px] py-[8px]`,children:[d(`button`,{type:`button`,"aria-label":`返回`,className:`flex shrink-0 items-center justify-center text-text1`,onClick:D,children:d(o,{className:`h-[16px] w-[16px]`})}),d(`div`,{className:`h-[40px] flex-1 rounded-[20px] bg-[linear-gradient(175deg,rgba(253,76,94,0.4)_0%,rgba(255,119,131,0.4)_100%)] p-px`,children:f(`div`,{className:`relative h-full w-full overflow-hidden rounded-[19px] bg-bg1`,children:[d(`div`,{className:`absolute inset-0 bg-bg2 opacity-50`}),d(s,{className:`absolute left-[12px] top-1/2 z-[1] h-[14px] w-[14px] -translate-y-1/2 text-text3`}),d(t,{placeholder:b(`topHeader.placeholder`),maxLength:20,value:S,className:`!relative !z-[1] !h-full !w-full !rounded-none !border-0 !bg-transparent !px-0 !pl-[34px] !pr-[34px] !py-0 !text-[14px] !leading-[22px] !text-text1 placeholder:!text-text3`,onChange:T,onKeyDown:e=>{if(e.key===`Enter`){if(e.preventDefault(),!S)return;E(S)}}}),S&&d(c,{className:`absolute right-[12px] top-1/2 z-10 h-[15px] w-[15px] -translate-y-1/2 text-text3`,onClick:()=>{a()||(C(``),l(``),y())}})]})}),d(`button`,{type:`button`,className:`flex shrink-0 items-center justify-center text-[16px] leading-[24px] text-text1`,onClick:()=>{S&&E(S)},children:b(`topHeader.search`)})]})})})});export{g as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{
|
|
2
|
+
"use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{useRouter as r}from"../../../utils/use-compatible-router.mjs";import{Box as i}from"../../ui/box.mjs";import{eventKey as a}from"../../../constants/event-key.mjs";import{useSearchHistory as o}from"../../../hooks/use-search-history.mjs";import s from"../search/top-header.mjs";import c from"./search-user.mjs";import l from"./search-video.mjs";import u from"./search-all.mjs";import{SORT_OPTIONS as d,SearchTab as f}from"./search-tab.mjs";import{useEffect as p,useMemo as m,useState as h}from"react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{useSearchParams as y}from"next/navigation";const b=[{label:`综合`,value:`all`},{label:`视频`,value:`video`},{label:`用户`,value:`user`}];function x(){let x=r(),{userInfo:S}=n(),C=S?.user_id||`guest`,w=y().get(`q`)?.toString()||``,[T,E]=h(w),[D,O]=h(0);p(()=>{E(w),O(e=>e+1)},[w]);let[k,A]=h(b[0].value),[j,M]=h(d[0].value),[N,P]=h(0),[,F]=h([]),{addHistory:I}=o({storageKey:C}),L=m(()=>T.trim()!==``,[T]);p(()=>(t.on(a.EXCHANGE_SEARCH_TYPE,A),()=>{t.off(a.EXCHANGE_SEARCH_TYPE,A)}),[A]);function R(){x.back()}return v(i,{className:`w-full min-h-screen bg-bg1 pb-[12px] overscroll-y-none`,children:[_(s,{setSearchInputVal:t=>{t!==T&&(F([]),E(t),e({q:t}))},initInputVal:w,initInputVersion:D,addSearchHistory:I,clearCallback:R}),_(f,{searchType:k,tabList:b,onChange:e=>{A(e),F([])},sort:j,onSortChange:e=>{M(e),P(e=>e+1)}}),L&&v(g,{children:[k===`user`&&_(c,{mode:`user`,inputVal:T,sort:j,refreshVersion:N}),k===`all`&&_(u,{searchInputVal:T,sort:j,refreshVersion:N}),k===`video`&&_(l,{mode:`video`,inputVal:T,sort:j,refreshVersion:N})]}),!L&&_(i,{className:`w-full pt-[12px]`})]})}export{x as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import
|
|
2
|
+
"use client";import{gContentGetRecommendVideoList as e}from"../../../service/generated/client.mjs";import{gContentGetRecommendVideoListKey as t}from"../../../service/generated/tanstack.mjs";import{Box as n}from"../../ui/box.mjs";import{List as r}from"../../ui/list.mjs";import{useRequest as i}from"../../../hooks/query/use-query.mjs";import{SearchResultSkeleton as a}from"./search-result-skeleton.mjs";import o from"./search-user.mjs";import s from"./search-video.mjs";import{useMemo as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{useTranslations as d}from"next-intl";function f(e,t=1){return JSON.stringify({type:1,keywords:e,sort:t})}function p({searchInputVal:p,sort:m,refreshVersion:h}){let g=d(`components.pages.search.searchResult`),_=c(()=>f(p,m),[p,m]),{data:v,isFetching:y,isLoading:b}=i(c(()=>[...t({data_type:2,extra_params:_,page:1,page_size:10}),h],[h,_]),async()=>(await e({data_type:2,extra_params:_,page:1,page_size:10})).data??{}),x=c(()=>v?.videos?.list??[],[v]),S=c(()=>!!v?.videos?.has_more,[v]),C=c(()=>v?.users?.list??[],[v]),w=x.length===0&&C.length===0&&!y;return x.length===0&&C.length===0&&(b||y)?l(a,{}):w?l(n,{className:`w-full pt-[12px]`,children:l(r,{loading:y,empty:`nodata`,emptyText:g(`searchAll.emptyResult`)})}):u(n,{className:`w-full`,children:[C.length>0&&l(o,{mode:`all`,list:C}),l(s,{mode:`all`,list:x,hasMore:S})]})}export{p as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{Box as t}from"../../ui/box.mjs";import{Text as n}from"../../ui/text.mjs";import{Popover as r,PopoverContent as i,PopoverTrigger as a}from"../../ui/popover.mjs";import o from"../../../assets/icons/search/filter.mjs";import{memo as s,useState as c}from"react";import{ChevronUpIcon as l}from"lucide-react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";const p=[{label:`综合`,value:1},{label:`最新`,value:2},{label:`最热`,value:3}],m=s(({searchType:s,onChange:m,tabList:h,sort:g,onSortChange:_})=>{let[v,y]=c(!1);return f(u,{children:[f(t,{as:`nav`,className:`w-full h-[42px] bg-bg1 flex items-center justify-between px-[3px] fixed top-[54px] left-0 right-0 z-40`,children:[d(t,{className:`flex items-center`,children:h.map(e=>d(n,{className:`h-[30px] rounded-[15px] leading-[30px] px-[9px] text-[16px] bg-transparent transition-all duration-150 ${s===e.value?`text-theme5 !text-[20px] font-bold`:`text-text2`}`,onClick:()=>{s!==e.value&&m(e.value)},children:e.label},e.value))}),f(r,{open:v,onOpenChange:y,children:[d(a,{"aria-label":`排序筛选`,className:`shrink-0 w-7 h-7 rounded-[min(var(--radius-md),12px)] inline-flex items-center justify-center`,children:d(o,{className:`w-[16px] h-[16px]`})}),f(i,{side:`bottom`,align:`end`,className:`w-[100vw] bg-muted`,children:[d(n,{as:`p`,className:`text-[14px] font-medium text-text1 mb-[12px]`,children:`排序方式`}),f(t,{className:`flex flex-col gap-[8px]`,children:[d(t,{className:`flex justify-between gap-[8px]`,children:p.map(t=>d(e,{variant:g===t.value?`default`:`outline`,size:`sm`,className:`w-[100px]`,onClick:()=>{_(t.value),y(!1)},children:t.label},t.value))}),f(e,{variant:`ghost`,size:`sm`,className:`w-full justify-center gap-[4px] text-text2`,onClick:()=>y(!1),children:[d(l,{className:`w-[14px] h-[14px]`}),`收起`]})]})]})]})]}),d(t,{className:`w-full h-[42px]`})]})});m.displayName=`SearchTab`;export{p as SORT_OPTIONS,m as SearchTab};
|