chenlei 1 rok pred
rodič
commit
ca7d15f0d9
33 zmenil súbory, kde vykonal 342 pridanie a 342 odobranie
  1. 6 19
      src/app.config.ts
  2. 0 271
      src/components/PageSwiper/index.tsx
  3. 1 0
      src/components/Video/index.tsx
  4. 0 0
      src/pages/banner/images/Group23@2x-min.png
  5. 0 0
      src/pages/banner/images/Group35@2x-min.png
  6. 0 0
      src/pages/banner/images/Group36@2x-min.png
  7. 0 0
      src/pages/banner/images/Group37@2x-min.png
  8. 0 0
      src/pages/banner/images/LOGO@2x-min.png
  9. 0 0
      src/pages/banner/images/Mask-group@2x-min.png
  10. 0 0
      src/pages/banner/images/bg@2x-min.jpg
  11. 0 0
      src/pages/banner/images/pic-or-2@2x-min.jpg
  12. 0 0
      src/pages/banner/images/pic-or-3@2x-min.jpg
  13. 0 0
      src/pages/banner/images/pic-or@2x-min.jpg
  14. 0 0
      src/pages/banner/images/tab1@2x-min.png
  15. 0 0
      src/pages/banner/images/tab2@2x-min.png
  16. 0 0
      src/pages/banner/images/tab3@2x-min.png
  17. 2 2
      src/components/PageSwiper/index.scss
  18. 273 3
      src/pages/banner/index.tsx
  19. 6 13
      src/pages/home/components/Menu/index.tsx
  20. 3 0
      src/pages/home/components/SearchLayout/index.scss
  21. 1 3
      src/pages/home/components/VisitCard/index.tsx
  22. 6 4
      src/pages/home/index.tsx
  23. 0 0
      src/pages/iframe/index.config.ts
  24. 26 0
      src/pages/iframe/index.tsx
  25. 0 3
      src/pages/login/index.tsx
  26. 0 7
      src/pages/temp/index.tsx
  27. 1 1
      src/pages/temp/index.config.ts
  28. 14 0
      src/pages/tempp/index.tsx
  29. 0 12
      src/subModule/pages/iframe/index.tsx
  30. 2 3
      src/subModule/pages/museum/index.tsx
  31. 1 1
      src/subModule/pages/shopmall/components/Records/index.tsx
  32. BIN
      src/videos/xszc.mp4
  33. BIN
      src/videos/ysdt.mp4

+ 6 - 19
src/app.config.ts

@@ -1,5 +1,10 @@
 export default defineAppConfig({
-  pages: ["pages/banner/index", "pages/home/index", "pages/temp/index"],
+  pages: [
+    "pages/tempp/index",
+    "pages/banner/index",
+    "pages/home/index",
+    "pages/iframe/index",
+  ],
   subpackages: [
     {
       root: "subModule",
@@ -7,7 +12,6 @@ export default defineAppConfig({
         "pages/shopmall/index",
         "pages/feedback/index",
         "pages/order/index",
-        "pages/iframe/index",
         "pages/portrait-iframe/index",
         "pages/museum/index",
         "pages/protocol/index",
@@ -20,21 +24,4 @@ export default defineAppConfig({
     navigationBarTitleText: "锡善云城",
     navigationBarTextStyle: "black",
   },
-  tabBar: {
-    list: [
-      {
-        pagePath: "pages/banner/index",
-        text: "",
-      },
-      // {
-      //   pagePath: "pages/home/index",
-      //   text: "首页",
-      // },
-      {
-        pagePath: "pages/temp/index",
-        text: "",
-      },
-    ],
-    custom: true,
-  },
 });

+ 0 - 271
src/components/PageSwiper/index.tsx

@@ -1,271 +0,0 @@
-import { Swiper, SwiperItem, View, Image, Video } from "@tarojs/components";
-import Taro, { FC, pxTransform } from "@tarojs/taro";
-import classNames from "classnames";
-import { useRef, useState } from "react";
-import TitleImg1 from "./images/tab2@2x-min.png";
-import TitleImg2 from "./images/tab1@2x-min.png";
-import TitleImg3 from "./images/tab3@2x-min.png";
-import LabelImg1 from "./images/Group35@2x-min.png";
-import LabelImg2 from "./images/Group37@2x-min.png";
-import LabelImg3 from "./images/Group36@2x-min.png";
-import LogoImg from "./images/LOGO@2x-min.png";
-import FootPageImg from "./images/Group23@2x-min.png";
-import baseStore from "../../store/base";
-import { getSceneUrl, login } from "../../utils";
-import { VisitCard } from "../../pages/home/components/VisitCard";
-import { VideoWrap } from "../Video";
-import { AtIcon } from "taro-ui";
-import "./index.scss";
-
-const LIST = [
-  {
-    title: TitleImg1,
-    img: "https://houseoss.4dkankan.com/project/wx-csbwg-public/images/pic-or-2%402x-min.jpg",
-    label: LabelImg1,
-  },
-  {
-    title: TitleImg2,
-    img: "https://houseoss.4dkankan.com/project/wx-csbwg-public/images/pic-or%402x-min.jpg",
-    label: LabelImg2,
-  },
-  {
-    title: TitleImg3,
-    img: "https://houseoss.4dkankan.com/project/wx-csbwg-public/images/pic-or-3%402x-min.jpg",
-    label: LabelImg3,
-  },
-];
-
-const system = Taro.getSystemInfoSync();
-const getPX = (num: number) => num / (750 / system.windowWidth);
-const swipeOffsetX = getPX(390);
-const damping = 50 / swipeOffsetX;
-const rotateDamping = 20 / swipeOffsetX;
-
-const POS_MAP = {
-  0: [50, 100, 200],
-  1: [0, 50, 100],
-  2: [-100, 0, 50],
-};
-
-const ROTATEY_MAP = {
-  0: [0, -20, -40],
-  1: [20, 0, -20],
-  2: [40, 20, 0],
-};
-
-export const PageSwiper: FC = () => {
-  const [loaded, setLoaded] = useState(false);
-  const [loading, setLoading] = useState(true);
-  // 背景视频是否报错
-  const [videoError, setVideoError] = useState(false);
-  const [XSZCVideoVisible, setXSZCVideoVisible] = useState(false);
-  const [BWGVideoVisible, setBWGVideoVisible] = useState(false);
-  const [active, setActive] = useState(1);
-  const [moveX, setMoveX] = useState(0);
-  const [bgPos, setBgPos] = useState([...POS_MAP[1]]);
-  const [bgRotateY, setBgRotateY] = useState([...ROTATEY_MAP[1]]);
-  const moving = useRef(false);
-  const isFirstMove = useRef(true);
-  const [visitVisible, setVisitVisible] = useState(false);
-
-  const handleClick = (idx: number) => {
-    if (idx !== active) return;
-
-    switch (idx) {
-      case 0:
-        Taro.navigateTo({
-          url: "/pages/home/index",
-        });
-        break;
-      case 1:
-        setXSZCVideoVisible(true);
-        break;
-      case 2:
-        setBWGVideoVisible(true);
-        break;
-    }
-  };
-
-  const goUnityPage = async () => {
-    const userInfo = baseStore.userInfo;
-
-    if (!userInfo) {
-      await login();
-    }
-
-    if (userInfo.invite === 0) {
-      setVisitVisible(true);
-      setXSZCVideoVisible(false);
-    } else {
-      Taro.navigateTo({
-        url:
-          "/subModule/pages/iframe/index?url=" +
-          encodeURIComponent(getSceneUrl()),
-      });
-
-      setTimeout(() => {
-        setXSZCVideoVisible(false);
-      }, 1000);
-    }
-  };
-
-  const handleBgLoaded = () => {
-    setLoaded(true);
-    setTimeout(() => {
-      setLoading(false);
-    }, 1000);
-  };
-
-  return (
-    <View className={classNames("page-swiper", { "is-error": videoError })}>
-      <View
-        className={classNames("ld-page", { hide: loaded })}
-        style={{ zIndex: loading ? 999 : -1 }}
-      >
-        <AtIcon
-          className="ld-page__icon"
-          value="loading"
-          color="#589498"
-          size={40}
-        />
-      </View>
-
-      <Image
-        className="page-swiper__title"
-        src={LIST[active].title}
-        mode="heightFix"
-      />
-
-      <Swiper
-        className="banner"
-        current={active}
-        display-multiple-items={1}
-        nextMargin={pxTransform(180)}
-        previousMargin={pxTransform(180)}
-        onTransition={({ detail: { dx } }) => {
-          moving.current = true;
-          setMoveX(dx - (isFirstMove.current ? swipeOffsetX : 0));
-        }}
-        onAnimationFinish={({ detail: { current } }) => {
-          moving.current = false;
-          isFirstMove.current = false;
-          setActive(current);
-          setBgPos([...POS_MAP[current]]);
-          setBgRotateY([...ROTATEY_MAP[current]]);
-        }}
-      >
-        {LIST.map((item, idx) => {
-          const isActive = active === idx;
-          const bgPosition = moving.current
-            ? Math.min(Math.max(bgPos[idx] - moveX * damping, 0), 100)
-            : bgPos[idx];
-          const rotateY = moving.current
-            ? Math.min(
-                Math.max(bgRotateY[idx] + moveX * rotateDamping, -20),
-                20
-              )
-            : bgRotateY[idx];
-
-          return (
-            <SwiperItem key={idx} className="banner-swiper-item">
-              <View
-                className={classNames("banner-item", {
-                  active: isActive,
-                })}
-                style={{
-                  transform: `rotateY(${rotateY}deg)`,
-                }}
-                onClick={handleClick.bind(undefined, idx)}
-              >
-                {!isActive && (
-                  <Image
-                    className="banner-item__label"
-                    src={item.label}
-                    mode="widthFix"
-                    style={{
-                      right: idx <= active ? 0 : "unset",
-                      left: idx > active ? 0 : "unset",
-                    }}
-                  />
-                )}
-                <View
-                  className="banner-item__img"
-                  style={{
-                    backgroundImage: `url(${item.img})`,
-                    backgroundPosition: `${bgPosition}%`,
-                  }}
-                ></View>
-              </View>
-            </SwiperItem>
-          );
-        })}
-      </Swiper>
-
-      <View className="page-swiper-footer">
-        <Image
-          className="page-swiper-footer__logo"
-          src={LogoImg}
-          mode="heightFix"
-        />
-        <View className="page-swiper-footer__text">
-          让慈善之光照进心灵,照亮生活,照耀社会
-        </View>
-        <Image
-          className="page-swiper-footer__tips"
-          src={FootPageImg}
-          mode="heightFix"
-        />
-      </View>
-
-      {!videoError && (
-        <Video
-          className="page-swiper__bg"
-          src="https://houseoss.4dkankan.com/project/wx-csbwg-public/videos/bg%403x.mp4"
-          autoplay
-          muted
-          loop
-          controls={false}
-          enableProgressGesture={false}
-          objectFit="cover"
-          onLoadedMetaData={handleBgLoaded}
-          onError={() => {
-            setVideoError(true);
-            handleBgLoaded();
-          }}
-        />
-      )}
-
-      <VisitCard
-        isOpened={visitVisible}
-        onClose={() => setVisitVisible(false)}
-      />
-
-      {XSZCVideoVisible && (
-        <VideoWrap
-          autoplay
-          controls={false}
-          objectFit="cover"
-          src="https://houseoss.4dkankan.com/project/wx-csbwg-public/videos/xszc.mp4"
-          onEnded={goUnityPage}
-        />
-      )}
-
-      {BWGVideoVisible && (
-        <VideoWrap
-          autoplay
-          controls={false}
-          objectFit="cover"
-          src="https://houseoss.4dkankan.com/project/wx-csbwg-public/videos/bwg.mp4"
-          onEnded={() => {
-            Taro.navigateTo({
-              url: "/subModule/pages/museum/index",
-            });
-            setTimeout(() => {
-              setBWGVideoVisible(false);
-            }, 1000);
-          }}
-        />
-      )}
-    </View>
-  );
-};

+ 1 - 0
src/components/Video/index.tsx

@@ -17,6 +17,7 @@ export const VideoWrap: FC<VideoWrapProps> = ({
       <Video
         className="video-wrap__video"
         enableProgressGesture={false}
+        objectFit="contain"
         onWaiting={() => {
           Taro.showLoading();
         }}

src/components/PageSwiper/images/Group23@2x-min.png → src/pages/banner/images/Group23@2x-min.png


src/components/PageSwiper/images/Group35@2x-min.png → src/pages/banner/images/Group35@2x-min.png


src/components/PageSwiper/images/Group36@2x-min.png → src/pages/banner/images/Group36@2x-min.png


src/components/PageSwiper/images/Group37@2x-min.png → src/pages/banner/images/Group37@2x-min.png


src/components/PageSwiper/images/LOGO@2x-min.png → src/pages/banner/images/LOGO@2x-min.png


src/components/PageSwiper/images/Mask-group@2x-min.png → src/pages/banner/images/Mask-group@2x-min.png


src/components/PageSwiper/images/bg@2x-min.jpg → src/pages/banner/images/bg@2x-min.jpg


src/components/PageSwiper/images/pic-or-2@2x-min.jpg → src/pages/banner/images/pic-or-2@2x-min.jpg


src/components/PageSwiper/images/pic-or-3@2x-min.jpg → src/pages/banner/images/pic-or-3@2x-min.jpg


src/components/PageSwiper/images/pic-or@2x-min.jpg → src/pages/banner/images/pic-or@2x-min.jpg


src/components/PageSwiper/images/tab1@2x-min.png → src/pages/banner/images/tab1@2x-min.png


src/components/PageSwiper/images/tab2@2x-min.png → src/pages/banner/images/tab2@2x-min.png


src/components/PageSwiper/images/tab3@2x-min.png → src/pages/banner/images/tab3@2x-min.png


+ 2 - 2
src/components/PageSwiper/index.scss

@@ -86,8 +86,8 @@
       content: "";
       position: absolute;
       top: -60px;
-      left: 0;
-      right: 0;
+      left: -60px;
+      right: -60px;
       bottom: -60px;
       background: url("./images/Mask-group@2x-min.png") no-repeat center / cover;
       // animation: linear fade-in 0.2s forwards;

+ 273 - 3
src/pages/banner/index.tsx

@@ -1,8 +1,278 @@
-import { FC } from "@tarojs/taro";
-import { PageSwiper } from "../../components/PageSwiper";
+import { Swiper, SwiperItem, View, Image, Video } from "@tarojs/components";
+import Taro, { FC, pxTransform, useDidShow } from "@tarojs/taro";
+import classNames from "classnames";
+import { useEffect, useRef, useState } from "react";
+import TitleImg1 from "./images/tab2@2x-min.png";
+import TitleImg2 from "./images/tab1@2x-min.png";
+import TitleImg3 from "./images/tab3@2x-min.png";
+import LabelImg1 from "./images/Group35@2x-min.png";
+import LabelImg2 from "./images/Group37@2x-min.png";
+import LabelImg3 from "./images/Group36@2x-min.png";
+import LogoImg from "./images/LOGO@2x-min.png";
+import FootPageImg from "./images/Group23@2x-min.png";
+import baseStore from "../../store/base";
+import { getSceneUrl, login } from "../../utils";
+import { VisitCard } from "../../pages/home/components/VisitCard";
+import { VideoWrap } from "../../components/Video";
+import { AtIcon } from "taro-ui";
+import "./index.scss";
+
+const LIST = [
+  {
+    title: TitleImg1,
+    img: "https://houseoss.4dkankan.com/project/wx-csbwg-public/images/pic-or-2%402x-min.jpg",
+    label: LabelImg1,
+  },
+  {
+    title: TitleImg2,
+    img: "https://houseoss.4dkankan.com/project/wx-csbwg-public/images/pic-or%402x-min.jpg",
+    label: LabelImg2,
+  },
+  {
+    title: TitleImg3,
+    img: "https://houseoss.4dkankan.com/project/wx-csbwg-public/images/pic-or-3%402x-min.jpg",
+    label: LabelImg3,
+  },
+];
+
+const system = Taro.getSystemInfoSync();
+const getPX = (num: number) => num / (750 / system.windowWidth);
+const swipeOffsetX = getPX(390);
+const damping = 50 / swipeOffsetX;
+const rotateDamping = 20 / swipeOffsetX;
+
+const POS_MAP = {
+  0: [50, 100, 200],
+  1: [0, 50, 100],
+  2: [-100, 0, 50],
+};
+
+const ROTATEY_MAP = {
+  0: [0, -20, -40],
+  1: [20, 0, -20],
+  2: [40, 20, 0],
+};
 
 const BannerPage: FC = () => {
-  return <PageSwiper />;
+  const [loaded, setLoaded] = useState(false);
+  const [loading, setLoading] = useState(true);
+  // 背景视频是否报错
+  const [videoError, setVideoError] = useState(false);
+  const [XSZCVideoVisible, setXSZCVideoVisible] = useState(false);
+  const [BWGVideoVisible, setBWGVideoVisible] = useState(false);
+  const [active, setActive] = useState(1);
+  const [moveX, setMoveX] = useState(0);
+  const [bgPos, setBgPos] = useState([...POS_MAP[1]]);
+  const [bgRotateY, setBgRotateY] = useState([...ROTATEY_MAP[1]]);
+  const moving = useRef(false);
+  const isFirstMove = useRef(true);
+  const [visitVisible, setVisitVisible] = useState(false);
+
+  useEffect(() => {
+    console.log("mount", Taro.getSystemInfoSync());
+
+    return () => {
+      console.log("unmount");
+    };
+  }, []);
+
+  const handleClick = (idx: number) => {
+    if (idx !== active) return;
+
+    switch (idx) {
+      case 0:
+        Taro.navigateTo({
+          url: "/pages/home/index",
+        });
+        break;
+      case 1:
+        setXSZCVideoVisible(true);
+        break;
+      case 2:
+        setBWGVideoVisible(true);
+        break;
+    }
+  };
+
+  const goUnityPage = async () => {
+    const userInfo = baseStore.userInfo;
+
+    if (!userInfo) {
+      await login();
+    }
+
+    if (userInfo.invite === 0) {
+      setVisitVisible(true);
+      setXSZCVideoVisible(false);
+    } else {
+      Taro.navigateTo({
+        url: "/pages/iframe/index?url=" + encodeURIComponent(getSceneUrl()),
+      });
+
+      setTimeout(() => {
+        setXSZCVideoVisible(false);
+      }, 1000);
+    }
+  };
+
+  const handleBgLoaded = () => {
+    setLoaded(true);
+    setTimeout(() => {
+      setLoading(false);
+    }, 1000);
+  };
+
+  return (
+    <View className={classNames("page-swiper", { "is-error": videoError })}>
+      <View
+        className={classNames("ld-page", { hide: loaded })}
+        style={{ zIndex: loading ? 999 : -1 }}
+      >
+        <AtIcon
+          className="ld-page__icon"
+          value="loading"
+          color="#589498"
+          size={40}
+        />
+      </View>
+
+      <Image
+        className="page-swiper__title"
+        src={LIST[active].title}
+        mode="heightFix"
+      />
+
+      <Swiper
+        className="banner"
+        current={active}
+        display-multiple-items={1}
+        nextMargin={pxTransform(180)}
+        previousMargin={pxTransform(180)}
+        onTransition={({ detail: { dx } }) => {
+          moving.current = true;
+          setMoveX(dx - (isFirstMove.current ? swipeOffsetX : 0));
+        }}
+        onAnimationFinish={({ detail: { current } }) => {
+          moving.current = false;
+          isFirstMove.current = false;
+          setActive(current);
+          setBgPos([...POS_MAP[current]]);
+          setBgRotateY([...ROTATEY_MAP[current]]);
+        }}
+      >
+        {LIST.map((item, idx) => {
+          const isActive = active === idx;
+          const bgPosition = moving.current
+            ? Math.min(Math.max(bgPos[idx] - moveX * damping, 0), 100)
+            : bgPos[idx];
+          const rotateY = moving.current
+            ? Math.min(
+                Math.max(bgRotateY[idx] + moveX * rotateDamping, -20),
+                20
+              )
+            : bgRotateY[idx];
+
+          return (
+            <SwiperItem key={idx} className="banner-swiper-item">
+              <View
+                className={classNames("banner-item", {
+                  active: isActive,
+                })}
+                style={{
+                  transform: `rotateY(${rotateY}deg)`,
+                }}
+                onClick={handleClick.bind(undefined, idx)}
+              >
+                {!isActive && (
+                  <Image
+                    className="banner-item__label"
+                    src={item.label}
+                    mode="widthFix"
+                    style={{
+                      right: idx <= active ? 0 : "unset",
+                      left: idx > active ? 0 : "unset",
+                    }}
+                  />
+                )}
+                <View
+                  className="banner-item__img"
+                  style={{
+                    backgroundImage: `url(${item.img})`,
+                    backgroundPosition: `${bgPosition}%`,
+                  }}
+                ></View>
+              </View>
+            </SwiperItem>
+          );
+        })}
+      </Swiper>
+
+      <View className="page-swiper-footer">
+        <Image
+          className="page-swiper-footer__logo"
+          src={LogoImg}
+          mode="heightFix"
+        />
+        <View className="page-swiper-footer__text">
+          让慈善之光照进心灵,照亮生活,照耀社会
+        </View>
+        <Image
+          className="page-swiper-footer__tips"
+          src={FootPageImg}
+          mode="heightFix"
+        />
+      </View>
+
+      {!videoError && (
+        <Video
+          className="page-swiper__bg"
+          src="https://houseoss.4dkankan.com/project/wx-csbwg-public/videos/bg%403x.mp4"
+          autoplay
+          muted
+          loop
+          controls={false}
+          enableProgressGesture={false}
+          objectFit="cover"
+          onLoadedMetaData={handleBgLoaded}
+          onError={() => {
+            setVideoError(true);
+            handleBgLoaded();
+          }}
+        />
+      )}
+
+      <VisitCard
+        isOpened={visitVisible}
+        onClose={() => setVisitVisible(false)}
+      />
+
+      {XSZCVideoVisible && (
+        <VideoWrap
+          autoplay
+          controls={false}
+          src="https://houseoss.4dkankan.com/project/wx-csbwg-public/videos/xszc.mp4"
+          onEnded={goUnityPage}
+        />
+      )}
+
+      {BWGVideoVisible && (
+        <VideoWrap
+          autoplay
+          controls={false}
+          objectFit="cover"
+          src="https://houseoss.4dkankan.com/project/wx-csbwg-public/videos/bwg.mp4"
+          onEnded={() => {
+            Taro.navigateTo({
+              url: "/subModule/pages/museum/index",
+            });
+            setTimeout(() => {
+              setBWGVideoVisible(false);
+            }, 1000);
+          }}
+        />
+      )}
+    </View>
+  );
 };
 
 export default BannerPage;

+ 6 - 13
src/pages/home/components/Menu/index.tsx

@@ -46,32 +46,26 @@ export const Menu: FC<MenuProps> = observer((props) => {
           {
             label: "慈善广场",
             link:
-              "/subModule/pages/iframe/index?url=" +
-              encodeURIComponent(getSceneUrl(2)),
+              "/pages/iframe/index?url=" + encodeURIComponent(getSceneUrl(2)),
           },
           {
             label: "慈善博物馆",
-            link:
-              "/subModule/pages/iframe/index?url=" +
-              encodeURIComponent(MUSEUM_URL),
+            link: "/pages/iframe/index?url=" + encodeURIComponent(MUSEUM_URL),
           },
           {
             label: "慈善云学校",
             link:
-              "/subModule/pages/iframe/index?url=" +
-              encodeURIComponent(getSceneUrl(0)),
+              "/pages/iframe/index?url=" + encodeURIComponent(getSceneUrl(0)),
           },
           {
             label: "慈善堂",
             link:
-              "/subModule/pages/iframe/index?url=" +
-              encodeURIComponent(getSceneUrl(1)),
+              "/pages/iframe/index?url=" + encodeURIComponent(getSceneUrl(1)),
           },
           {
             label: "爱心林场",
             link:
-              "/subModule/pages/iframe/index?url=" +
-              encodeURIComponent(getSceneUrl(3)),
+              "/pages/iframe/index?url=" + encodeURIComponent(getSceneUrl(3)),
           },
         ],
       },
@@ -83,8 +77,7 @@ export const Menu: FC<MenuProps> = observer((props) => {
           {
             label: "个人设定",
             link:
-              "/subModule/pages/iframe/index?url=" +
-              encodeURIComponent(getSceneUrl(4)),
+              "/pages/iframe/index?url=" + encodeURIComponent(getSceneUrl(4)),
           },
           {
             label: "用户反馈",

+ 3 - 0
src/pages/home/components/SearchLayout/index.scss

@@ -55,6 +55,9 @@
       font-size: 24px;
       color: white;
     }
+    &::after {
+      display: none;
+    }
   }
   &__cancel {
     display: flex;

+ 1 - 3
src/pages/home/components/VisitCard/index.tsx

@@ -114,9 +114,7 @@ export const VisitCard: FC<VisitCardProps> = (props) => {
 
   const goHomePage = () => {
     Taro.navigateTo({
-      url:
-        "/subModule/pages/iframe/index?url=" +
-        encodeURIComponent(getSceneUrl()),
+      url: "/pages/iframe/index?url=" + encodeURIComponent(getSceneUrl()),
     });
     // @ts-ignore
     props.onClose();

+ 6 - 4
src/pages/home/index.tsx

@@ -82,7 +82,6 @@ const HomePage: FC = () => {
   const createBgAudio = () => {
     const audio = Taro.createInnerAudioContext();
     audio.autoplay = loaded;
-    console.log("bg audio autoplay: ", loaded);
     audio.loop = true;
     audio.volume = 0.3;
     audio.src =
@@ -135,7 +134,11 @@ const HomePage: FC = () => {
   useDidShow(() => {
     createBgAudio();
 
-    loaded && swiperRef.current?.setIsRunning(true);
+    loaded &&
+      !showMenu &&
+      !showSearch &&
+      !showSight &&
+      swiperRef.current?.setIsRunning(true);
   });
   useDidHide(() => {
     audioContext.current?.destroy();
@@ -276,7 +279,7 @@ const HomePage: FC = () => {
 
               Taro.navigateTo({
                 url:
-                  "/subModule/pages/iframe/index?url=" +
+                  "/pages/iframe/index?url=" +
                   encodeURIComponent(getSceneUrl()),
               });
             }}
@@ -301,7 +304,6 @@ const HomePage: FC = () => {
           src="https://houseoss.4dkankan.com/project/wx-csbwg-public/videos/ysdt.mp4"
           autoplay
           controls={false}
-          objectFit="cover"
           onLoadedMetaData={() => {
             setVideoMetaLoaded(true);
             setTimeout(() => {

src/subModule/pages/iframe/index.config.ts → src/pages/iframe/index.config.ts


+ 26 - 0
src/pages/iframe/index.tsx

@@ -0,0 +1,26 @@
+import { WebView } from "@tarojs/components";
+import Taro, { FC, getCurrentPages, useRouter } from "@tarojs/taro";
+
+const IframePage: FC = () => {
+  const route = useRouter();
+
+  const handleMessage = (event) => {
+    console.log(event);
+    const pages = getCurrentPages();
+    const firstPage = pages[0];
+    console.log(firstPage);
+
+    Taro.reLaunch({
+      url: "/pages/banner/index",
+    });
+  };
+
+  return route.params.url ? (
+    <WebView
+      src={decodeURIComponent(route.params.url)}
+      onMessage={handleMessage}
+    />
+  ) : null;
+};
+
+export default IframePage;

+ 0 - 3
src/pages/login/index.tsx

@@ -13,7 +13,6 @@ import WechatIcon from "../../images/icon_wechat@2x-min.png";
 import {
   checkLoginApi,
   setUserInfoApi,
-  setVistorName,
   validateNickName,
   wechatLoginApi,
 } from "../../api";
@@ -92,8 +91,6 @@ const LoginPage: FC = () => {
         title: "登陆中...",
       });
 
-      await setVistorName(name);
-
       Taro.setStorageSync(NICKNAME_KEY, name);
       baseStore.name = name;
       goHomePage();

+ 0 - 7
src/pages/temp/index.tsx

@@ -1,7 +0,0 @@
-import { FC } from "@tarojs/taro";
-
-const TempPage: FC = () => {
-  return <></>;
-};
-
-export default TempPage;

+ 1 - 1
src/pages/temp/index.config.ts

@@ -1,3 +1,3 @@
 export default definePageConfig({
-  navigationBarTitleText: "",
+  navigationStyle: "custom",
 });

+ 14 - 0
src/pages/tempp/index.tsx

@@ -0,0 +1,14 @@
+import Taro, { FC } from "@tarojs/taro";
+import { useEffect } from "react";
+
+const TempPage: FC = () => {
+  useEffect(() => {
+    Taro.redirectTo({
+      url: "/pages/banner/index",
+    });
+  }, []);
+
+  return null;
+};
+
+export default TempPage;

+ 0 - 12
src/subModule/pages/iframe/index.tsx

@@ -1,12 +0,0 @@
-import { WebView } from "@tarojs/components";
-import { FC, useRouter } from "@tarojs/taro";
-
-const IframePage: FC = () => {
-  const route = useRouter();
-
-  return route.params.url ? (
-    <WebView src={decodeURIComponent(route.params.url)} />
-  ) : null;
-};
-
-export default IframePage;

+ 2 - 3
src/subModule/pages/museum/index.tsx

@@ -7,12 +7,11 @@ import "./index.scss";
 const MuseumPage: FC = () => {
   const goRoam = () => {
     Taro.navigateTo({
-      url:
-        "/subModule/pages/iframe/index?url=" + encodeURIComponent(MUSEUM_URL),
+      url: "/pages/iframe/index?url=" + encodeURIComponent(MUSEUM_URL),
     });
   };
 
-  return <View className="museum" />;
+  return <View className="museum" onClick={goRoam} />;
 };
 
 export default MuseumPage;

+ 1 - 1
src/subModule/pages/shopmall/components/Records/index.tsx

@@ -26,7 +26,7 @@ export const RecordsItem: FC<RecordsItemProps> = ({ data, index }) => {
         <View className="records-item__lf__date">
           {item.createTime}
 
-          {item.prizeName && (
+          {item.description && (
             <Text style={{ paddingLeft: pxTransform(20) }}>
               {item.description}
             </Text>

BIN
src/videos/xszc.mp4


BIN
src/videos/ysdt.mp4