添加发布球局拦截
This commit is contained in:
@@ -11,6 +11,8 @@ import { EvaluateScene } from "@/store/evaluateStore";
|
||||
import { useUserInfo, useUserActions } from "@/store/userStore";
|
||||
import { usePickerOption } from "@/store/pickerOptionsStore";
|
||||
import { useGlobalState } from "@/store/global";
|
||||
import { useListState } from "@/store/listStore";
|
||||
import { useDictionaryStore } from "@/store/dictionaryStore";
|
||||
|
||||
interface MyselfPageContentProps {
|
||||
isActive?: boolean;
|
||||
@@ -41,6 +43,10 @@ const MyselfPageContent: React.FC<MyselfPageContentProps> = ({
|
||||
const [collapseProfile, setCollapseProfile] = useState(false);
|
||||
const [refreshing, setRefreshing] = useState(false);
|
||||
|
||||
const { area } = useListState();
|
||||
const supportedCitiesList =
|
||||
useDictionaryStore((s) => s.getDictionaryValue("supported_cities")) || [];
|
||||
|
||||
useEffect(() => {
|
||||
pickerOption.getCities();
|
||||
pickerOption.getProfessions();
|
||||
@@ -82,7 +88,6 @@ const MyselfPageContent: React.FC<MyselfPageContentProps> = ({
|
||||
console.log("notEndGames", notEndGames);
|
||||
|
||||
return { notEndGames, finishedGames };
|
||||
|
||||
},
|
||||
[]
|
||||
);
|
||||
@@ -100,7 +105,6 @@ const MyselfPageContent: React.FC<MyselfPageContentProps> = ({
|
||||
games_data = await UserService.get_participated_games(user_info.id);
|
||||
}
|
||||
|
||||
|
||||
const sorted_games = games_data.sort((a, b) => {
|
||||
return (
|
||||
new Date(a.original_start_time.replace(/\s/, "T")).getTime() -
|
||||
@@ -156,6 +160,16 @@ const MyselfPageContent: React.FC<MyselfPageContentProps> = ({
|
||||
};
|
||||
|
||||
const goPublish = () => {
|
||||
const [_, address] = area;
|
||||
if (!supportedCitiesList.includes(address)) {
|
||||
(Taro as any).showModal({
|
||||
title: "提示",
|
||||
content: "该城市尚未开放,您可加入社群或切换城市",
|
||||
showCancel: false,
|
||||
confirmText: "知道了",
|
||||
});
|
||||
return;
|
||||
}
|
||||
(Taro as any).navigateTo({
|
||||
url: "/publish_pages/publishBall/index",
|
||||
});
|
||||
@@ -258,15 +272,17 @@ const MyselfPageContent: React.FC<MyselfPageContentProps> = ({
|
||||
<View className={styles.gameTabsSection}>
|
||||
<View className={styles.tabContainer}>
|
||||
<View
|
||||
className={`${styles.tabItem} ${active_tab === "hosted" ? styles.active : ""
|
||||
}`}
|
||||
className={`${styles.tabItem} ${
|
||||
active_tab === "hosted" ? styles.active : ""
|
||||
}`}
|
||||
onClick={() => setActiveTab("hosted")}
|
||||
>
|
||||
<Text className={styles.tabText}>我主办的</Text>
|
||||
</View>
|
||||
<View
|
||||
className={`${styles.tabItem} ${active_tab === "participated" ? styles.active : ""
|
||||
}`}
|
||||
className={`${styles.tabItem} ${
|
||||
active_tab === "participated" ? styles.active : ""
|
||||
}`}
|
||||
onClick={() => setActiveTab("participated")}
|
||||
>
|
||||
<Text className={styles.tabText}>我参与的</Text>
|
||||
@@ -287,7 +303,7 @@ const MyselfPageContent: React.FC<MyselfPageContentProps> = ({
|
||||
btnImg="ICON_ADD"
|
||||
reload={goPublish}
|
||||
isShowNoData={game_records.length === 0}
|
||||
loadMoreMatches={() => { }}
|
||||
loadMoreMatches={() => {}}
|
||||
collapse={true}
|
||||
style={{
|
||||
paddingBottom: ended_game_records.length ? 0 : "90px",
|
||||
@@ -313,7 +329,7 @@ const MyselfPageContent: React.FC<MyselfPageContentProps> = ({
|
||||
error={null}
|
||||
errorImg="ICON_LIST_EMPTY_CARD"
|
||||
isShowNoData={ended_game_records.length === 0}
|
||||
loadMoreMatches={() => { }}
|
||||
loadMoreMatches={() => {}}
|
||||
collapse={true}
|
||||
style={{ paddingBottom: "90px", overflow: "hidden" }}
|
||||
listLoadErrorWrapperHeight="fit-content"
|
||||
|
||||
Reference in New Issue
Block a user