1
This commit is contained in:
@@ -22,6 +22,7 @@ import Participants from "./components/Participants";
|
||||
import SupplementalNotes from "./components/SupplementalNotes";
|
||||
import OrganizerInfo from "./components/OrganizerInfo";
|
||||
import SharePopup from "./components/SharePopup";
|
||||
import EmptyState from "./components/EmptyState";
|
||||
import { navto, toast } from "@/utils/helper";
|
||||
import ArrowLeft from "@/static/detail/icon-arrow-left.svg";
|
||||
// import Logo from "@/static/detail/icon-logo-go.svg";
|
||||
@@ -29,6 +30,7 @@ import styles from "./index.module.scss";
|
||||
|
||||
function Index() {
|
||||
const [detail, setDetail] = useState<any>({});
|
||||
const [showEmptyState, setShowEmptyState] = useState(false);
|
||||
const { params } = useRouter();
|
||||
const [currentLocation, setCurrentLocation] = useState<[number, number]>([
|
||||
0, 0,
|
||||
@@ -95,10 +97,11 @@ function Index() {
|
||||
if (res.code === 0) {
|
||||
setDetail(res.data);
|
||||
fetchUserInfoById(res.data.publisher_id);
|
||||
setShowEmptyState(false);
|
||||
}
|
||||
} catch (e) {
|
||||
if (e.message === "球局不存在") {
|
||||
handleBack();
|
||||
setShowEmptyState(true);
|
||||
}
|
||||
}
|
||||
Taro.hideLoading();
|
||||
@@ -172,6 +175,20 @@ function Index() {
|
||||
setGlass(top > 20);
|
||||
}, 16);
|
||||
|
||||
// 如果显示空状态,渲染空状态页面
|
||||
if (showEmptyState) {
|
||||
return (
|
||||
<EmptyState
|
||||
onGoToOtherGames={() => {
|
||||
Taro.switchTab({
|
||||
url: '/main_pages/index',
|
||||
});
|
||||
}}
|
||||
onGoToHome={handleBack}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<ScrollView
|
||||
className={styles["detail-page"]}
|
||||
|
||||
Reference in New Issue
Block a user