增加加入空间时的提示弹窗
This commit is contained in:
parent
89f1a077d9
commit
e45d053599
|
@ -20,6 +20,7 @@ import SpaceIntroduceSkeleton from "./skeleton";
|
|||
import { usePreventScreenCapture } from "expo-screen-capture";
|
||||
import { useFocusEffect } from "@react-navigation/native";
|
||||
import { useImageViewer } from "../../context/ImageViewProvider";
|
||||
import MyModal from "../../components/MyModal";
|
||||
|
||||
export default function SpaceIntroduce({ navigation, route }) {
|
||||
usePreventScreenCapture();
|
||||
|
@ -29,6 +30,8 @@ export default function SpaceIntroduce({ navigation, route }) {
|
|||
|
||||
const { showImageViewer } = useImageViewer();
|
||||
|
||||
const [isWarnModalVisible, setIsWarnModalVisible] = useState(false);
|
||||
|
||||
const [data, setData] = useState({});
|
||||
const [isLoading, setIsloading] = useState(true);
|
||||
const getData = async () => {
|
||||
|
@ -345,14 +348,7 @@ export default function SpaceIntroduce({ navigation, route }) {
|
|||
onPress={
|
||||
data?.admission_price === 0
|
||||
? handleJoinFreeSpace
|
||||
: () =>
|
||||
navigation.navigate("WebWithoutHeader", {
|
||||
uri:
|
||||
process.env.EXPO_PUBLIC_WEB_URL +
|
||||
"/zone/pay/" +
|
||||
data?.id +
|
||||
"/h5_zone_admission/0",
|
||||
})
|
||||
: () => setIsWarnModalVisible(true)
|
||||
}
|
||||
style={tailwind(
|
||||
"flex flex-row items-center justify-center h-12 rounded-full px-10 bg-[#FF669E]"
|
||||
|
@ -393,6 +389,26 @@ export default function SpaceIntroduce({ navigation, route }) {
|
|||
setVisible={setShowVideo}
|
||||
url={data?.streamer_ext?.shorts?.videos[0]?.urls[0]}
|
||||
/>
|
||||
{/* 加入空间风险提示Modal */}
|
||||
<MyModal
|
||||
visible={isWarnModalVisible}
|
||||
setVisible={setIsWarnModalVisible}
|
||||
title="提醒"
|
||||
content="本空间内容为达人创建并维护,属于虚拟服务,不可退款,且空间内存在部分内容需要另行付费,请再次确认是否付费加入"
|
||||
cancel={() => {
|
||||
setIsWarnModalVisible(false);
|
||||
}}
|
||||
confirm={() => {
|
||||
setIsWarnModalVisible(false);
|
||||
navigation.navigate("WebWithoutHeader", {
|
||||
uri:
|
||||
process.env.EXPO_PUBLIC_WEB_URL +
|
||||
"/zone/pay/" +
|
||||
data?.id +
|
||||
"/h5_zone_admission/0",
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue