fix: 问题修复
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { useState, useEffect, useRef } from "react";
|
||||
import { View, Text, Image } from "@tarojs/components";
|
||||
import { View, Text, Image, ScrollView } from "@tarojs/components";
|
||||
import Taro, { useRouter, useDidShow } from "@tarojs/taro";
|
||||
import classnames from "classnames";
|
||||
import { throttle } from "@tarojs/runtime";
|
||||
// 导入API服务
|
||||
import { withAuth, Comments } from "@/components";
|
||||
import DetailService from "@/services/detailService";
|
||||
@@ -18,9 +20,9 @@ import Participants from "./components/Participants";
|
||||
import SupplementalNotes from "./components/SupplementalNotes";
|
||||
import OrganizerInfo from "./components/OrganizerInfo";
|
||||
import SharePopup from "./components/SharePopup";
|
||||
import { navto, toast } from "./utils/helper";
|
||||
import { navto, toast } from "@/utils/helper";
|
||||
import ArrowLeft from "@/static/detail/icon-arrow-left.svg";
|
||||
import Logo from "@/static/detail/icon-logo-go.svg";
|
||||
// import Logo from "@/static/detail/icon-logo-go.svg";
|
||||
import styles from "./index.module.scss";
|
||||
|
||||
function Index() {
|
||||
@@ -35,7 +37,7 @@ function Index() {
|
||||
const myInfo = useUserInfo();
|
||||
|
||||
const { statusNavbarHeightInfo } = useGlobalState();
|
||||
const { statusBarHeight, navBarHeight } = statusNavbarHeightInfo;
|
||||
const { statusBarHeight, navBarHeight, totalHeight } = statusNavbarHeightInfo;
|
||||
|
||||
const isMyOwn = userInfo.id === myInfo.id;
|
||||
|
||||
@@ -150,14 +152,33 @@ function Index() {
|
||||
? { backgroundImage: `url(${detail?.image_list?.[0]})` }
|
||||
: {};
|
||||
|
||||
const [glass, setGlass] = useState(false);
|
||||
|
||||
const onScroll = throttle((e) => {
|
||||
const top = e.detail.scrollTop;
|
||||
setGlass(top > 20);
|
||||
}, 16);
|
||||
|
||||
return (
|
||||
<View className={styles["detail-page"]}>
|
||||
<ScrollView
|
||||
className={styles["detail-page"]}
|
||||
scrollY
|
||||
onScroll={onScroll}
|
||||
onScrollToUpper={() => {
|
||||
setGlass(false);
|
||||
}}
|
||||
enhanced
|
||||
showScrollbar={false}
|
||||
>
|
||||
{/* custom navbar */}
|
||||
<view
|
||||
className={styles["custom-navbar"]}
|
||||
<View
|
||||
className={classnames(
|
||||
styles["custom-navbar"],
|
||||
glass ? styles.glass : ""
|
||||
)}
|
||||
style={{
|
||||
height: `${statusBarHeight}px`,
|
||||
paddingTop: `${navBarHeight}px`,
|
||||
height: `${totalHeight}px`,
|
||||
paddingTop: `${statusBarHeight}px`,
|
||||
}}
|
||||
>
|
||||
<View className={styles["detail-navigator"]}>
|
||||
@@ -170,14 +191,14 @@ function Index() {
|
||||
src={ArrowLeft}
|
||||
/>
|
||||
</View>
|
||||
<View className={styles["detail-navigator-icon"]}>
|
||||
{/* <View className={styles["detail-navigator-icon"]}>
|
||||
<Image
|
||||
className={styles["detail-navigator-logo-icon"]}
|
||||
src={Logo}
|
||||
/>
|
||||
</View>
|
||||
</View> */}
|
||||
</View>
|
||||
</view>
|
||||
</View>
|
||||
<View className={styles["detail-page-bg"]} style={backgroundImage} />
|
||||
{/* swiper */}
|
||||
<Carousel detail={detail} />
|
||||
@@ -238,6 +259,7 @@ function Index() {
|
||||
getCommentCount={
|
||||
commentRef.current && commentRef.current.getCommentCount
|
||||
}
|
||||
currentUserInfo={myInfo}
|
||||
/>
|
||||
{/* share popup */}
|
||||
<SharePopup
|
||||
@@ -248,7 +270,7 @@ function Index() {
|
||||
userInfo={userInfo}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</ScrollView>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user