|
|
@@ -1,361 +1,361 @@
|
|
|
-import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
|
-import {
|
|
|
- Image,
|
|
|
- View,
|
|
|
- Text,
|
|
|
- Video,
|
|
|
- Swiper,
|
|
|
- SwiperItem,
|
|
|
-} from "@tarojs/components";
|
|
|
-import classNames from "classnames";
|
|
|
-import Taro, {
|
|
|
- FC,
|
|
|
- nextTick,
|
|
|
- pxTransform,
|
|
|
- useDidHide,
|
|
|
- useDidShow,
|
|
|
-} from "@tarojs/taro";
|
|
|
-import { Menu } from "./components/Menu";
|
|
|
-import BtmBgImg from "../../images/img_city-min.png";
|
|
|
-import CloudImg from "../../images/img_cloud-min.png";
|
|
|
-import LeftIcon from "../../images/icon_blue_left@2x-min.png";
|
|
|
-import RightIcon from "../../images/icon_blue_right@2x-min.png";
|
|
|
-import { Swiper as SightSwiper, SwiperMethods } from "./components/Swiper";
|
|
|
-import { SearchLayout } from "./components/SearchLayout";
|
|
|
-import { SightDetailLayout } from "./components/SightDetailLayout";
|
|
|
-import { SIGHT_LIST, SORT_MAP_ID } from "./constants";
|
|
|
-import { getSignListApi } from "../../api";
|
|
|
-import { VisitCard } from "./components/VisitCard";
|
|
|
-import { getSceneUrl, login } from "../../utils";
|
|
|
-import baseStore from "../../store/base";
|
|
|
-import SearchIcon from "../../images/icon_search_white@2x-min.png";
|
|
|
-import { VideoWrap } from "../../components/Video";
|
|
|
-import "./index.scss";
|
|
|
-import { AtIcon } from "taro-ui";
|
|
|
-
|
|
|
-const PointIcon = memo(() => {
|
|
|
- return (
|
|
|
- <>
|
|
|
- {SIGHT_LIST.map((item) => (
|
|
|
- <View
|
|
|
- key={item.id}
|
|
|
- className={classNames("home__point-icon", [
|
|
|
- Math.round(Math.random()) ? "" : "red",
|
|
|
- ])}
|
|
|
- style={{
|
|
|
- top: pxTransform(item.pos.y),
|
|
|
- left: pxTransform(item.pos.x),
|
|
|
- }}
|
|
|
- />
|
|
|
- ))}
|
|
|
- </>
|
|
|
- );
|
|
|
-});
|
|
|
-
|
|
|
-const bgScale = Math.round(1558 / 778);
|
|
|
-const system = Taro.getSystemInfoSync();
|
|
|
-const imgHeight = bgScale * system.windowWidth;
|
|
|
-const offsetHeight =
|
|
|
- imgHeight > system.screenHeight ? imgHeight - system.screenHeight : 0;
|
|
|
-
|
|
|
-const HomePage: FC = () => {
|
|
|
- const [loading, setLoading] = useState(true);
|
|
|
- const [videoMetaLoaded, setVideoMetaLoaded] = useState(false);
|
|
|
- const [curSwiper, setCurSwiper] = useState(0);
|
|
|
- const [loaded, setLoaded] = useState(false);
|
|
|
- const [visitVisible, setVisitVisible] = useState(false);
|
|
|
- const [showMenu, setShowMenu] = useState(false);
|
|
|
- const [showSearch, setShowSearch] = useState(false);
|
|
|
- const [showSight, setShowSight] = useState(false);
|
|
|
- const swiperRef = useRef<SwiperMethods>(null);
|
|
|
- const [curSwiperItem, setCurSwiperItem] = useState(10);
|
|
|
- const [item, setItem] = useState(
|
|
|
- SIGHT_LIST.find((i) => i.id === SORT_MAP_ID[curSwiperItem])
|
|
|
- );
|
|
|
- const audioContext = useRef<Taro.InnerAudioContext>();
|
|
|
-
|
|
|
- const realItem = useMemo(
|
|
|
- () => SIGHT_LIST.find((i) => i.id === SORT_MAP_ID[curSwiperItem]),
|
|
|
- [curSwiperItem]
|
|
|
- );
|
|
|
-
|
|
|
- const createBgAudio = () => {
|
|
|
- const audio = Taro.createInnerAudioContext();
|
|
|
- audio.autoplay = loaded;
|
|
|
- audio.loop = true;
|
|
|
- audio.volume = 0.3;
|
|
|
- audio.src =
|
|
|
- "https://houseoss.4dkankan.com/project/wx-csbwg-public/audios/ysdt-bg.mp3";
|
|
|
- audioContext.current = audio;
|
|
|
- };
|
|
|
-
|
|
|
- const openSearch = (closeMenu?: boolean) => {
|
|
|
- closeMenu && setShowMenu(false);
|
|
|
- setShowSearch(true);
|
|
|
- if (!closeMenu) {
|
|
|
- swiperRef.current?.setIsRunning(false);
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- const handleDetail = useCallback(
|
|
|
- async (id?: number) => {
|
|
|
- swiperRef.current?.setIsRunning(false);
|
|
|
- const target = SIGHT_LIST.find(
|
|
|
- (i) => i.id === (id || SORT_MAP_ID[curSwiperItem])
|
|
|
- );
|
|
|
- const data = await getSignListApi({
|
|
|
- searchKey: target?.title,
|
|
|
- type: "scene",
|
|
|
- });
|
|
|
- setItem(data[0] || target);
|
|
|
- setShowSight(true);
|
|
|
- },
|
|
|
- [curSwiperItem]
|
|
|
- );
|
|
|
-
|
|
|
- const closeDetail = () => {
|
|
|
- setShowSight(false);
|
|
|
- curSwiper === 0 && swiperRef.current?.setIsRunning(true);
|
|
|
- };
|
|
|
-
|
|
|
- const closeMenu = () => {
|
|
|
- setShowMenu(false);
|
|
|
- curSwiper === 0 && swiperRef.current?.setIsRunning(true);
|
|
|
- };
|
|
|
-
|
|
|
- const handleLoaded = () => {
|
|
|
- nextTick(() => {
|
|
|
- setLoaded(true);
|
|
|
- swiperRef.current?.setIsRunning(true);
|
|
|
- audioContext.current?.play();
|
|
|
- });
|
|
|
- };
|
|
|
-
|
|
|
- useDidShow(() => {
|
|
|
- createBgAudio();
|
|
|
-
|
|
|
- loaded &&
|
|
|
- !showMenu &&
|
|
|
- !showSearch &&
|
|
|
- !showSight &&
|
|
|
- swiperRef.current?.setIsRunning(true);
|
|
|
- });
|
|
|
- useDidHide(() => {
|
|
|
- audioContext.current?.destroy();
|
|
|
- audioContext.current = undefined;
|
|
|
-
|
|
|
- swiperRef.current?.setIsRunning(false);
|
|
|
- });
|
|
|
-
|
|
|
- useEffect(() => {
|
|
|
- return () => {
|
|
|
- audioContext.current?.destroy();
|
|
|
- };
|
|
|
- }, []);
|
|
|
-
|
|
|
- return (
|
|
|
- <>
|
|
|
- <View
|
|
|
- className="home__menu-btn"
|
|
|
- onClick={() => {
|
|
|
- setShowMenu(true);
|
|
|
- swiperRef.current?.setIsRunning(false);
|
|
|
- }}
|
|
|
- />
|
|
|
-
|
|
|
- <Menu
|
|
|
- show={showMenu}
|
|
|
- onClose={closeMenu}
|
|
|
- openSearch={openSearch.bind(undefined, true)}
|
|
|
- />
|
|
|
-
|
|
|
- <Image
|
|
|
- src={SearchIcon}
|
|
|
- className="home__search"
|
|
|
- onClick={() => openSearch()}
|
|
|
- />
|
|
|
-
|
|
|
- <Swiper
|
|
|
- vertical
|
|
|
- current={curSwiper}
|
|
|
- style={{ height: "100vh" }}
|
|
|
- onChange={(v) => {
|
|
|
- setCurSwiper(v.detail.current);
|
|
|
- swiperRef.current?.setIsRunning(v.detail.current === 0);
|
|
|
- }}
|
|
|
- >
|
|
|
- <SwiperItem className="home-container">
|
|
|
- <View className="home">
|
|
|
- <View
|
|
|
- className="home-main"
|
|
|
- style={{
|
|
|
- top: `${-offsetHeight}px`,
|
|
|
- }}
|
|
|
- >
|
|
|
- {realItem && (
|
|
|
- <View
|
|
|
- className="home__point"
|
|
|
- style={{
|
|
|
- top: pxTransform(realItem.pos.y),
|
|
|
- left: pxTransform(realItem.pos.x),
|
|
|
- }}
|
|
|
- />
|
|
|
- )}
|
|
|
-
|
|
|
- <PointIcon />
|
|
|
-
|
|
|
- <SightSwiper
|
|
|
- ref={swiperRef}
|
|
|
- curSwiperItem={curSwiperItem}
|
|
|
- setCurSwiperItem={setCurSwiperItem}
|
|
|
- handleDetail={handleDetail}
|
|
|
- />
|
|
|
-
|
|
|
- <View className="home-toggle">
|
|
|
- <Image
|
|
|
- className="home-toggle__icon"
|
|
|
- src={LeftIcon}
|
|
|
- onClick={() => swiperRef.current?.toPrev()}
|
|
|
- />
|
|
|
-
|
|
|
- <View className="home-toggle-inner">
|
|
|
- <View className="home-toggle-label">
|
|
|
- <Text className="home-toggle-label__title limit-line">
|
|
|
- {realItem?.title}
|
|
|
- </Text>
|
|
|
- <Text>{realItem?.address}</Text>
|
|
|
- </View>
|
|
|
-
|
|
|
- <View
|
|
|
- className="home-toggle__detail"
|
|
|
- onClick={() => handleDetail()}
|
|
|
- />
|
|
|
- </View>
|
|
|
-
|
|
|
- <Image
|
|
|
- className="home-toggle__icon"
|
|
|
- src={RightIcon}
|
|
|
- onClick={() => swiperRef.current?.toNext()}
|
|
|
- />
|
|
|
- </View>
|
|
|
- </View>
|
|
|
-
|
|
|
- <View className="home-main__btn" onClick={() => setCurSwiper(1)}>
|
|
|
- <View className="flashing">
|
|
|
- <View>探索锡善云城</View>
|
|
|
- <View className="reflect">探索锡善云城</View>
|
|
|
- </View>
|
|
|
- </View>
|
|
|
-
|
|
|
- <Image
|
|
|
- className="home__bg"
|
|
|
- src="https://houseoss.4dkankan.com/project/wx-csbwg-public/images/img_map%402x-min.jpg"
|
|
|
- mode="widthFix"
|
|
|
- style={{
|
|
|
- top: `${-offsetHeight}px`,
|
|
|
- }}
|
|
|
- />
|
|
|
- <Image className="home__btm-bg" src={BtmBgImg} mode="widthFix" />
|
|
|
- <Image className="home__cloud" src={CloudImg} mode="heightFix" />
|
|
|
- </View>
|
|
|
- </SwiperItem>
|
|
|
-
|
|
|
- <SwiperItem className="home2">
|
|
|
- <Image
|
|
|
- className="home2__btn"
|
|
|
- src="https://houseoss.4dkankan.com/project/wx-csbwg-public/images/btn_start%402x-min.png"
|
|
|
- mode="widthFix"
|
|
|
- onClick={async () => {
|
|
|
- const userInfo = baseStore.userInfo;
|
|
|
-
|
|
|
- if (!userInfo) {
|
|
|
- await login();
|
|
|
- }
|
|
|
-
|
|
|
- if (userInfo.invite === 0) {
|
|
|
- setVisitVisible(true);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- Taro.navigateTo({
|
|
|
- url:
|
|
|
- "/pages/iframe/index?url=" +
|
|
|
- encodeURIComponent(getSceneUrl()),
|
|
|
- });
|
|
|
- }}
|
|
|
- />
|
|
|
-
|
|
|
- <Video
|
|
|
- className="home2__bg"
|
|
|
- src="https://houseoss.4dkankan.com/project/wx-csbwg-public/videos/city.mp4"
|
|
|
- autoplay
|
|
|
- muted
|
|
|
- loop
|
|
|
- controls={false}
|
|
|
- objectFit="cover"
|
|
|
- enableProgressGesture={false}
|
|
|
- />
|
|
|
- </SwiperItem>
|
|
|
- </Swiper>
|
|
|
-
|
|
|
- {!loaded && (
|
|
|
- <VideoWrap
|
|
|
- className={classNames("home-loading")}
|
|
|
- src="https://houseoss.4dkankan.com/project/wx-csbwg-public/videos/ysdt.mp4"
|
|
|
- autoplay
|
|
|
- controls={false}
|
|
|
- onLoadedMetaData={() => {
|
|
|
- setVideoMetaLoaded(true);
|
|
|
- setTimeout(() => {
|
|
|
- setLoading(false);
|
|
|
- }, 1000);
|
|
|
- }}
|
|
|
- onEnded={handleLoaded}
|
|
|
- onError={handleLoaded}
|
|
|
- />
|
|
|
- )}
|
|
|
-
|
|
|
- <SearchLayout
|
|
|
- isOpened={showSearch}
|
|
|
- onClose={() => {
|
|
|
- setShowSearch(false);
|
|
|
- if (curSwiper === 0) {
|
|
|
- swiperRef.current?.setIsRunning(true);
|
|
|
- }
|
|
|
- }}
|
|
|
- openDetail={(item) => {
|
|
|
- swiperRef.current?.setIsRunning(false);
|
|
|
- setItem(item);
|
|
|
- setShowSight(true);
|
|
|
- }}
|
|
|
- />
|
|
|
-
|
|
|
- {item && (
|
|
|
- <SightDetailLayout
|
|
|
- item={item}
|
|
|
- isOpened={showSight}
|
|
|
- onClose={closeDetail}
|
|
|
- />
|
|
|
- )}
|
|
|
-
|
|
|
- <VisitCard
|
|
|
- isOpened={visitVisible}
|
|
|
- onClose={() => setVisitVisible(false)}
|
|
|
- />
|
|
|
-
|
|
|
- <View
|
|
|
- className={classNames("ld-page", { hide: videoMetaLoaded })}
|
|
|
- style={{ zIndex: loading ? 999 : -1 }}
|
|
|
- >
|
|
|
- <AtIcon
|
|
|
- className="ld-page__icon"
|
|
|
- value="loading"
|
|
|
- color="#589498"
|
|
|
- size={40}
|
|
|
- />
|
|
|
- </View>
|
|
|
- </>
|
|
|
- );
|
|
|
-};
|
|
|
-
|
|
|
-export default HomePage;
|
|
|
+import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
|
+import {
|
|
|
+ Image,
|
|
|
+ View,
|
|
|
+ Text,
|
|
|
+ Video,
|
|
|
+ Swiper,
|
|
|
+ SwiperItem,
|
|
|
+} from "@tarojs/components";
|
|
|
+import classNames from "classnames";
|
|
|
+import Taro, {
|
|
|
+ FC,
|
|
|
+ nextTick,
|
|
|
+ pxTransform,
|
|
|
+ useDidHide,
|
|
|
+ useDidShow,
|
|
|
+} from "@tarojs/taro";
|
|
|
+import { Menu } from "./components/Menu";
|
|
|
+import BtmBgImg from "../../images/img_city-min.png";
|
|
|
+import CloudImg from "../../images/img_cloud-min.png";
|
|
|
+import LeftIcon from "../../images/icon_blue_left@2x-min.png";
|
|
|
+import RightIcon from "../../images/icon_blue_right@2x-min.png";
|
|
|
+import { Swiper as SightSwiper, SwiperMethods } from "./components/Swiper";
|
|
|
+import { SearchLayout } from "./components/SearchLayout";
|
|
|
+import { SightDetailLayout } from "./components/SightDetailLayout";
|
|
|
+import { SIGHT_LIST, SORT_MAP_ID } from "./constants";
|
|
|
+import { getSignListApi } from "../../api";
|
|
|
+import { VisitCard } from "./components/VisitCard";
|
|
|
+import { getSceneUrl, login } from "../../utils";
|
|
|
+import baseStore from "../../store/base";
|
|
|
+import SearchIcon from "../../images/icon_search_white@2x-min.png";
|
|
|
+import { VideoWrap } from "../../components/Video";
|
|
|
+import "./index.scss";
|
|
|
+import { AtIcon } from "taro-ui";
|
|
|
+
|
|
|
+const PointIcon = memo(() => {
|
|
|
+ return (
|
|
|
+ <>
|
|
|
+ {SIGHT_LIST.map((item) => (
|
|
|
+ <View
|
|
|
+ key={item.id}
|
|
|
+ className={classNames("home__point-icon", [
|
|
|
+ Math.round(Math.random()) ? "" : "red",
|
|
|
+ ])}
|
|
|
+ style={{
|
|
|
+ top: pxTransform(item.pos.y),
|
|
|
+ left: pxTransform(item.pos.x),
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ ))}
|
|
|
+ </>
|
|
|
+ );
|
|
|
+});
|
|
|
+
|
|
|
+const bgScale = Math.round(1558 / 778);
|
|
|
+const system = Taro.getSystemInfoSync();
|
|
|
+const imgHeight = bgScale * system.windowWidth;
|
|
|
+const offsetHeight =
|
|
|
+ imgHeight > system.screenHeight ? imgHeight - system.screenHeight : 0;
|
|
|
+
|
|
|
+const HomePage: FC = () => {
|
|
|
+ const [loading, setLoading] = useState(true);
|
|
|
+ const [videoMetaLoaded, setVideoMetaLoaded] = useState(false);
|
|
|
+ const [curSwiper, setCurSwiper] = useState(0);
|
|
|
+ const [loaded, setLoaded] = useState(false);
|
|
|
+ const [visitVisible, setVisitVisible] = useState(false);
|
|
|
+ const [showMenu, setShowMenu] = useState(false);
|
|
|
+ const [showSearch, setShowSearch] = useState(false);
|
|
|
+ const [showSight, setShowSight] = useState(false);
|
|
|
+ const swiperRef = useRef<SwiperMethods>(null);
|
|
|
+ const [curSwiperItem, setCurSwiperItem] = useState(10);
|
|
|
+ const [item, setItem] = useState(
|
|
|
+ SIGHT_LIST.find((i) => i.id === SORT_MAP_ID[curSwiperItem])
|
|
|
+ );
|
|
|
+ const audioContext = useRef<Taro.InnerAudioContext>();
|
|
|
+
|
|
|
+ const realItem = useMemo(
|
|
|
+ () => SIGHT_LIST.find((i) => i.id === SORT_MAP_ID[curSwiperItem]),
|
|
|
+ [curSwiperItem]
|
|
|
+ );
|
|
|
+
|
|
|
+ const createBgAudio = () => {
|
|
|
+ const audio = Taro.createInnerAudioContext();
|
|
|
+ audio.autoplay = loaded;
|
|
|
+ audio.loop = true;
|
|
|
+ audio.volume = 0.3;
|
|
|
+ audio.src =
|
|
|
+ "https://wuxicharitymuseum.cn/wx-csbwg-public/audios/ysdt-bg.mp3";
|
|
|
+ audioContext.current = audio;
|
|
|
+ };
|
|
|
+
|
|
|
+ const openSearch = (closeMenu?: boolean) => {
|
|
|
+ closeMenu && setShowMenu(false);
|
|
|
+ setShowSearch(true);
|
|
|
+ if (!closeMenu) {
|
|
|
+ swiperRef.current?.setIsRunning(false);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ const handleDetail = useCallback(
|
|
|
+ async (id?: number) => {
|
|
|
+ swiperRef.current?.setIsRunning(false);
|
|
|
+ const target = SIGHT_LIST.find(
|
|
|
+ (i) => i.id === (id || SORT_MAP_ID[curSwiperItem])
|
|
|
+ );
|
|
|
+ const data = await getSignListApi({
|
|
|
+ searchKey: target?.title,
|
|
|
+ type: "scene",
|
|
|
+ });
|
|
|
+ setItem(data[0] || target);
|
|
|
+ setShowSight(true);
|
|
|
+ },
|
|
|
+ [curSwiperItem]
|
|
|
+ );
|
|
|
+
|
|
|
+ const closeDetail = () => {
|
|
|
+ setShowSight(false);
|
|
|
+ curSwiper === 0 && swiperRef.current?.setIsRunning(true);
|
|
|
+ };
|
|
|
+
|
|
|
+ const closeMenu = () => {
|
|
|
+ setShowMenu(false);
|
|
|
+ curSwiper === 0 && swiperRef.current?.setIsRunning(true);
|
|
|
+ };
|
|
|
+
|
|
|
+ const handleLoaded = () => {
|
|
|
+ nextTick(() => {
|
|
|
+ setLoaded(true);
|
|
|
+ swiperRef.current?.setIsRunning(true);
|
|
|
+ audioContext.current?.play();
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ useDidShow(() => {
|
|
|
+ createBgAudio();
|
|
|
+
|
|
|
+ loaded &&
|
|
|
+ !showMenu &&
|
|
|
+ !showSearch &&
|
|
|
+ !showSight &&
|
|
|
+ swiperRef.current?.setIsRunning(true);
|
|
|
+ });
|
|
|
+ useDidHide(() => {
|
|
|
+ audioContext.current?.destroy();
|
|
|
+ audioContext.current = undefined;
|
|
|
+
|
|
|
+ swiperRef.current?.setIsRunning(false);
|
|
|
+ });
|
|
|
+
|
|
|
+ useEffect(() => {
|
|
|
+ return () => {
|
|
|
+ audioContext.current?.destroy();
|
|
|
+ };
|
|
|
+ }, []);
|
|
|
+
|
|
|
+ return (
|
|
|
+ <>
|
|
|
+ <View
|
|
|
+ className="home__menu-btn"
|
|
|
+ onClick={() => {
|
|
|
+ setShowMenu(true);
|
|
|
+ swiperRef.current?.setIsRunning(false);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+
|
|
|
+ <Menu
|
|
|
+ show={showMenu}
|
|
|
+ onClose={closeMenu}
|
|
|
+ openSearch={openSearch.bind(undefined, true)}
|
|
|
+ />
|
|
|
+
|
|
|
+ <Image
|
|
|
+ src={SearchIcon}
|
|
|
+ className="home__search"
|
|
|
+ onClick={() => openSearch()}
|
|
|
+ />
|
|
|
+
|
|
|
+ <Swiper
|
|
|
+ vertical
|
|
|
+ current={curSwiper}
|
|
|
+ style={{ height: "100vh" }}
|
|
|
+ onChange={(v) => {
|
|
|
+ setCurSwiper(v.detail.current);
|
|
|
+ swiperRef.current?.setIsRunning(v.detail.current === 0);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <SwiperItem className="home-container">
|
|
|
+ <View className="home">
|
|
|
+ <View
|
|
|
+ className="home-main"
|
|
|
+ style={{
|
|
|
+ top: `${-offsetHeight}px`,
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {realItem && (
|
|
|
+ <View
|
|
|
+ className="home__point"
|
|
|
+ style={{
|
|
|
+ top: pxTransform(realItem.pos.y),
|
|
|
+ left: pxTransform(realItem.pos.x),
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+
|
|
|
+ <PointIcon />
|
|
|
+
|
|
|
+ <SightSwiper
|
|
|
+ ref={swiperRef}
|
|
|
+ curSwiperItem={curSwiperItem}
|
|
|
+ setCurSwiperItem={setCurSwiperItem}
|
|
|
+ handleDetail={handleDetail}
|
|
|
+ />
|
|
|
+
|
|
|
+ <View className="home-toggle">
|
|
|
+ <Image
|
|
|
+ className="home-toggle__icon"
|
|
|
+ src={LeftIcon}
|
|
|
+ onClick={() => swiperRef.current?.toPrev()}
|
|
|
+ />
|
|
|
+
|
|
|
+ <View className="home-toggle-inner">
|
|
|
+ <View className="home-toggle-label">
|
|
|
+ <Text className="home-toggle-label__title limit-line">
|
|
|
+ {realItem?.title}
|
|
|
+ </Text>
|
|
|
+ <Text>{realItem?.address}</Text>
|
|
|
+ </View>
|
|
|
+
|
|
|
+ <View
|
|
|
+ className="home-toggle__detail"
|
|
|
+ onClick={() => handleDetail()}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+
|
|
|
+ <Image
|
|
|
+ className="home-toggle__icon"
|
|
|
+ src={RightIcon}
|
|
|
+ onClick={() => swiperRef.current?.toNext()}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+
|
|
|
+ <View className="home-main__btn" onClick={() => setCurSwiper(1)}>
|
|
|
+ <View className="flashing">
|
|
|
+ <View>探索锡善云城</View>
|
|
|
+ <View className="reflect">探索锡善云城</View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+
|
|
|
+ <Image
|
|
|
+ className="home__bg"
|
|
|
+ src="https://wuxicharitymuseum.cn/wx-csbwg-public/images/img_map%402x-min.jpg"
|
|
|
+ mode="widthFix"
|
|
|
+ style={{
|
|
|
+ top: `${-offsetHeight}px`,
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <Image className="home__btm-bg" src={BtmBgImg} mode="widthFix" />
|
|
|
+ <Image className="home__cloud" src={CloudImg} mode="heightFix" />
|
|
|
+ </View>
|
|
|
+ </SwiperItem>
|
|
|
+
|
|
|
+ <SwiperItem className="home2">
|
|
|
+ <Image
|
|
|
+ className="home2__btn"
|
|
|
+ src="https://wuxicharitymuseum.cn/wx-csbwg-public/images/btn_start%402x-min.png"
|
|
|
+ mode="widthFix"
|
|
|
+ onClick={async () => {
|
|
|
+ const userInfo = baseStore.userInfo;
|
|
|
+
|
|
|
+ if (!userInfo) {
|
|
|
+ await login();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (userInfo.invite === 0) {
|
|
|
+ setVisitVisible(true);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ Taro.navigateTo({
|
|
|
+ url:
|
|
|
+ "/pages/iframe/index?url=" +
|
|
|
+ encodeURIComponent(getSceneUrl()),
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+
|
|
|
+ <Video
|
|
|
+ className="home2__bg"
|
|
|
+ src="https://wuxicharitymuseum.cn/wx-csbwg-public/videos/city.mp4"
|
|
|
+ autoplay
|
|
|
+ muted
|
|
|
+ loop
|
|
|
+ controls={false}
|
|
|
+ objectFit="cover"
|
|
|
+ enableProgressGesture={false}
|
|
|
+ />
|
|
|
+ </SwiperItem>
|
|
|
+ </Swiper>
|
|
|
+
|
|
|
+ {!loaded && (
|
|
|
+ <VideoWrap
|
|
|
+ className={classNames("home-loading")}
|
|
|
+ src="https://wuxicharitymuseum.cn/wx-csbwg-public/videos/ysdt.mp4"
|
|
|
+ autoplay
|
|
|
+ controls={false}
|
|
|
+ onLoadedMetaData={() => {
|
|
|
+ setVideoMetaLoaded(true);
|
|
|
+ setTimeout(() => {
|
|
|
+ setLoading(false);
|
|
|
+ }, 1000);
|
|
|
+ }}
|
|
|
+ onEnded={handleLoaded}
|
|
|
+ onError={handleLoaded}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+
|
|
|
+ <SearchLayout
|
|
|
+ isOpened={showSearch}
|
|
|
+ onClose={() => {
|
|
|
+ setShowSearch(false);
|
|
|
+ if (curSwiper === 0) {
|
|
|
+ swiperRef.current?.setIsRunning(true);
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ openDetail={(item) => {
|
|
|
+ swiperRef.current?.setIsRunning(false);
|
|
|
+ setItem(item);
|
|
|
+ setShowSight(true);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+
|
|
|
+ {item && (
|
|
|
+ <SightDetailLayout
|
|
|
+ item={item}
|
|
|
+ isOpened={showSight}
|
|
|
+ onClose={closeDetail}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+
|
|
|
+ <VisitCard
|
|
|
+ isOpened={visitVisible}
|
|
|
+ onClose={() => setVisitVisible(false)}
|
|
|
+ />
|
|
|
+
|
|
|
+ <View
|
|
|
+ className={classNames("ld-page", { hide: videoMetaLoaded })}
|
|
|
+ style={{ zIndex: loading ? 999 : -1 }}
|
|
|
+ >
|
|
|
+ <AtIcon
|
|
|
+ className="ld-page__icon"
|
|
|
+ value="loading"
|
|
|
+ color="#589498"
|
|
|
+ size={40}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ </>
|
|
|
+ );
|
|
|
+};
|
|
|
+
|
|
|
+export default HomePage;
|