chenlei 1 gadu atpakaļ
vecāks
revīzija
fa58be7ca4

+ 3 - 7
src/api/index.ts

@@ -20,13 +20,6 @@ export const checkLoginApi = () => {
   return requestByGet("/api/show/checkLogin");
 };
 
-/**
- * 检查昵称是否违规
- */
-export const setVistorName = (name: string) => {
-  return requestByPost(`/api/show/saveNickname/${name}`);
-};
-
 export const feedbackApi = (params: any) => {
   return requestByPost("/api/cms/game/message", params, {
     meta: {
@@ -76,6 +69,9 @@ export const addVisitApi = (params: any) => {
   return requestByPost("/api/show/visit/addVisit", params);
 };
 
+/**
+ * 检查昵称是否违规
+ */
 export const validateNickName = (name: string) => {
   return requestByPost(`/api/show/saveNickname/${name}`, undefined, {
     meta: {

BIN
src/audios/xsyc-bg.mp3


BIN
src/audios/ysdt-bg.mp3


BIN
src/components/PageSwiper/images/Group35@2x-min.png


BIN
src/components/PageSwiper/images/Group36@2x-min.png


BIN
src/components/PageSwiper/images/Group37@2x-min.png


BIN
src/components/PageSwiper/images/LOGO@2x-min.png


BIN
src/components/PageSwiper/images/pic-or-2@2x-min.jpg


+ 8 - 1
src/components/PageSwiper/index.scss

@@ -44,7 +44,7 @@
     z-index: 2;
 
     &__logo {
-      height: 6vh;
+      height: 8vh;
     }
     &__tips {
       height: 2.5vh;
@@ -93,6 +93,13 @@
       // animation: linear fade-in 0.2s forwards;
       z-index: 1;
     }
+    &__label {
+      position: absolute;
+      top: 0;
+      right: 0;
+      width: 42px;
+      z-index: 1;
+    }
     &__img {
       width: 100%;
       height: 100%;

+ 45 - 18
src/components/PageSwiper/index.tsx

@@ -5,6 +5,9 @@ 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";
@@ -14,14 +17,24 @@ import { VideoWrap } from "../Video";
 import { AtIcon } from "taro-ui";
 import "./index.scss";
 
-const IMAGES = [
-  "https://houseoss.4dkankan.com/project/wx-csbwg-public/images/pic-or%402x-min.jpg",
-  "https://houseoss.4dkankan.com/project/wx-csbwg-public/images/pic-or-2%402x-min.jpg",
-  "https://houseoss.4dkankan.com/project/wx-csbwg-public/images/pic-or-3%402x-min.jpg",
+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 TITLE_IMAGES = [TitleImg2, TitleImg1, TitleImg3];
-
 const system = Taro.getSystemInfoSync();
 const getPX = (num: number) => num / (750 / system.windowWidth);
 const swipeOffsetX = getPX(390);
@@ -60,13 +73,13 @@ export const PageSwiper: FC = () => {
 
     switch (idx) {
       case 0:
-        setXSZCVideoVisible(true);
-        break;
-      case 1:
         Taro.navigateTo({
           url: "/pages/home/index",
         });
         break;
+      case 1:
+        setXSZCVideoVisible(true);
+        break;
       case 2:
         setBWGVideoVisible(true);
         break;
@@ -90,6 +103,10 @@ export const PageSwiper: FC = () => {
         "/subModule/pages/iframe/index?url=" +
         encodeURIComponent(getSceneUrl()),
     });
+
+    setTimeout(() => {
+      setXSZCVideoVisible(false);
+    }, 1000);
   };
 
   const handleBgLoaded = () => {
@@ -115,7 +132,7 @@ export const PageSwiper: FC = () => {
 
       <Image
         className="page-swiper__title"
-        src={TITLE_IMAGES[active]}
+        src={LIST[active].title}
         mode="heightFix"
       />
 
@@ -137,7 +154,7 @@ export const PageSwiper: FC = () => {
           setBgRotateY([...ROTATEY_MAP[current]]);
         }}
       >
-        {IMAGES.map((url, idx) => {
+        {LIST.map((item, idx) => {
           const isActive = active === idx;
           const bgPosition = moving.current
             ? Math.min(Math.max(bgPos[idx] - moveX * damping, 0), 100)
@@ -160,10 +177,21 @@ export const PageSwiper: FC = () => {
                 }}
                 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(${url})`,
+                    backgroundImage: `url(${item.img})`,
                     backgroundPosition: `${bgPosition}%`,
                   }}
                 ></View>
@@ -180,7 +208,7 @@ export const PageSwiper: FC = () => {
           mode="heightFix"
         />
         <View className="page-swiper-footer__text">
-          让我们一起创造温暖,传递心
+          让慈善之光照进心灵,照亮生活,照耀社会
         </View>
         <Image
           className="page-swiper-footer__tips"
@@ -218,10 +246,7 @@ export const PageSwiper: FC = () => {
           controls={false}
           objectFit="cover"
           src="https://houseoss.4dkankan.com/project/wx-csbwg-public/videos/xszc.mp4"
-          onEnded={() => {
-            goUnityPage();
-            setXSZCVideoVisible(false);
-          }}
+          onEnded={goUnityPage}
         />
       )}
 
@@ -235,7 +260,9 @@ export const PageSwiper: FC = () => {
             Taro.navigateTo({
               url: "/subModule/pages/museum/index",
             });
-            setBWGVideoVisible(false);
+            setTimeout(() => {
+              setBWGVideoVisible(false);
+            }, 1000);
           }}
         />
       )}

+ 7 - 2
src/components/Video/index.tsx

@@ -1,14 +1,19 @@
 import { Video, VideoProps, View } from "@tarojs/components";
 import Taro, { FC } from "@tarojs/taro";
+import classNames from "classnames";
 import "./index.scss";
 
 export interface VideoWrapProps extends Omit<VideoProps, "onEnded"> {
   onEnded: Function;
 }
 
-export const VideoWrap: FC<VideoWrapProps> = ({ onEnded, ...props }) => {
+export const VideoWrap: FC<VideoWrapProps> = ({
+  className,
+  onEnded,
+  ...props
+}) => {
   return (
-    <View className="video-wrap">
+    <View className={classNames("video-wrap", className)}>
       <Video
         className="video-wrap__video"
         enableProgressGesture={false}

+ 7 - 7
src/pages/home/components/Menu/index.tsx

@@ -39,11 +39,17 @@ export const Menu: FC<MenuProps> = observer((props) => {
         ],
       },
       {
-        label: "锡善城",
+        label: "锡善城",
         icon: CityIcon,
         activeIcon: ActCityIcon,
         children: [
           {
+            label: "慈善广场",
+            link:
+              "/subModule/pages/iframe/index?url=" +
+              encodeURIComponent(getSceneUrl(2)),
+          },
+          {
             label: "慈善博物馆",
             link:
               "/subModule/pages/iframe/index?url=" +
@@ -62,12 +68,6 @@ export const Menu: FC<MenuProps> = observer((props) => {
               encodeURIComponent(getSceneUrl(1)),
           },
           {
-            label: "慈善广场",
-            link:
-              "/subModule/pages/iframe/index?url=" +
-              encodeURIComponent(getSceneUrl(2)),
-          },
-          {
             label: "爱心林场",
             link:
               "/subModule/pages/iframe/index?url=" +

+ 34 - 28
src/pages/home/components/SearchLayout/index.tsx

@@ -17,6 +17,7 @@ export const SearchLayout: FC<SearchLayoutProps> = (props) => {
   const [keyword, setKeyword] = useState("");
   const [input, setInput] = useState("");
   const [list, setList] = useState<any>({});
+  const [loading, setLoading] = useState(false);
 
   useEffect(() => {
     if (props.isOpened) {
@@ -28,14 +29,19 @@ export const SearchLayout: FC<SearchLayoutProps> = (props) => {
     const _idx = idx ?? curTab;
     if (list[_idx]) return;
 
-    const data = await getSignListApi({
-      region: _idx === 0 ? "" : CITY_LIST[_idx].title,
-      type: "scene",
-    });
-    setList({
-      ...list,
-      [_idx]: data,
-    });
+    try {
+      setLoading(true);
+      const data = await getSignListApi({
+        region: _idx === 0 ? "" : CITY_LIST[_idx].title,
+        type: "scene",
+      });
+      setList({
+        ...list,
+        [_idx]: data,
+      });
+    } finally {
+      setLoading(false);
+    }
   };
 
   const handleTabClick = (idx: number) => {
@@ -91,28 +97,28 @@ export const SearchLayout: FC<SearchLayoutProps> = (props) => {
 
               return (
                 <AtTabsPane current={curTab} index={item.id}>
-                  {_list.length ? (
-                    _list.map((subItem) => (
-                      <View
-                        key={subItem.id}
-                        className="search-tab__item"
-                        onClick={props.openDetail.bind(undefined, subItem)}
-                      >
-                        <View className="search-tab__item-inner">
-                          <View className="search-tab__item-inner__label">
-                            {subItem.name}
-                          </View>
-                          <View className="limit-line">
-                            {subItem.description.slice(0, 50)}
+                  {_list.length
+                    ? _list.map((subItem) => (
+                        <View
+                          key={subItem.id}
+                          className="search-tab__item"
+                          onClick={props.openDetail.bind(undefined, subItem)}
+                        >
+                          <View className="search-tab__item-inner">
+                            <View className="search-tab__item-inner__label">
+                              {subItem.name}
+                            </View>
+                            <View className="limit-line">
+                              {subItem.description.slice(0, 50)}
+                            </View>
                           </View>
-                        </View>
 
-                        <View className="search-tab__item__more" />
-                      </View>
-                    ))
-                  ) : (
-                    <View className="search-tab__nomore">暂无内容</View>
-                  )}
+                          <View className="search-tab__item__more" />
+                        </View>
+                      ))
+                    : !loading && (
+                        <View className="search-tab__nomore">暂无内容</View>
+                      )}
                 </AtTabsPane>
               );
             })}

+ 1 - 1
src/pages/home/components/Swiper/index.tsx

@@ -142,7 +142,7 @@ export const Swiper = forwardRef<SwiperMethods, SwiperProps>(
         moving.current = false;
         loaded.current && setIsRunning(true);
         loaded.current = true;
-      }, 500);
+      }, 1000);
     }, []);
 
     return (

+ 5 - 11
src/pages/home/components/VisitCard/index.scss

@@ -50,18 +50,12 @@
 
     &__input {
       flex: 1;
-      padding: 0 0 0 42px;
-      margin: 0;
+      padding: 0 30px;
+      height: inherit;
       border-radius: 50px;
-
-      .at-input__container {
-        height: 100%;
-      }
-      .at-input__input {
-        height: 100%;
-        font-size: 23px;
-        color: #424a4a;
-      }
+      background: white;
+      font-size: 23px;
+      color: #424a4a;
     }
     &__visit {
       min-width: 154px;

+ 26 - 30
src/pages/home/components/VisitCard/index.tsx

@@ -1,6 +1,6 @@
-import { ScrollView, View, Image } from "@tarojs/components";
+import { ScrollView, View, Image, Input } from "@tarojs/components";
 import { FC } from "@tarojs/taro";
-import { AtButton, AtCurtain, AtInput } from "taro-ui";
+import { AtButton, AtCurtain } from "taro-ui";
 import { AtCurtainProps } from "taro-ui/types/curtain";
 import BorderImg from "./line@2x-min.png";
 import { useEffect, useState } from "react";
@@ -15,7 +15,6 @@ import WechatIcon from "../../../../images/icon_wechat@2x-min.png";
 import {
   handleVisitStateApi,
   setUserInfoApi,
-  setVistorName,
   validateNickName,
 } from "../../../../api";
 import baseStore from "../../../../store/base";
@@ -29,7 +28,7 @@ const formRules = {
 };
 
 export const VisitCard: FC<VisitCardProps> = (props) => {
-  const [loading, setLoading] = useState(false);
+  // const [loading, setLoading] = useState(false);
   const [wechatLoading, setWechatLoading] = useState(false);
   const [name, setName] = useState(`云城居民${createRandomString()}`);
 
@@ -44,7 +43,7 @@ export const VisitCard: FC<VisitCardProps> = (props) => {
   const handleValidate = async () => {
     const errors = await onValidateField(
       {
-        name,
+        name: name.trim(),
       },
       formRules
     );
@@ -78,8 +77,6 @@ export const VisitCard: FC<VisitCardProps> = (props) => {
         await login();
       }
 
-      await setVistorName(name);
-
       await setUserInfoApi({
         id: baseStore.userInfo.id,
         nickName: name,
@@ -95,25 +92,25 @@ export const VisitCard: FC<VisitCardProps> = (props) => {
     }
   };
 
-  const handleVisitor = async () => {
-    try {
-      if (!(await handleValidate())) return;
+  // const handleVisitor = async () => {
+  //   try {
+  //     if (!(await handleValidate())) return;
 
-      setLoading(true);
+  //     setLoading(true);
 
-      await setVistorName(name);
-      await setUserInfoApi({
-        id: baseStore.userInfo.id,
-        nickName: name,
-      });
+  //     await setVistorName(name);
+  //     await setUserInfoApi({
+  //       id: baseStore.userInfo.id,
+  //       nickName: name,
+  //     });
 
-      Taro.setStorageSync(NICKNAME_KEY, name);
-      baseStore.name = name;
-      goHomePage();
-    } finally {
-      setLoading(false);
-    }
-  };
+  //     Taro.setStorageSync(NICKNAME_KEY, name);
+  //     baseStore.name = name;
+  //     goHomePage();
+  //   } finally {
+  //     setLoading(false);
+  //   }
+  // };
 
   const goHomePage = () => {
     Taro.navigateTo({
@@ -142,28 +139,27 @@ export const VisitCard: FC<VisitCardProps> = (props) => {
 
       <View className="visit-card__input">
         {props.isOpened && (
-          <AtInput
+          <Input
             value={name}
             className="visit-card__input__input"
             name="name"
-            maxLength={6}
-            // @ts-ignore
+            maxlength={6}
             type="nickname"
             placeholder="请输入6个字以内昵称"
-            onChange={(val) => {
-              setName(val as string);
+            onInput={({ detail: { value } }) => {
+              setName(value as string);
             }}
           />
         )}
 
-        <AtButton
+        {/* <AtButton
           className="visit-card__input__visit"
           circle
           loading={loading}
           onClick={handleVisitor}
         >
           我是游客
-        </AtButton>
+        </AtButton> */}
       </View>
 
       <AtButton

+ 43 - 14
src/pages/home/index.tsx

@@ -1,4 +1,4 @@
-import { memo, useCallback, useMemo, useRef, useState } from "react";
+import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
 import {
   Image,
   View,
@@ -30,7 +30,9 @@ 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 (
@@ -58,10 +60,11 @@ 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 [hideLoading, setHideLoading] = useState(false);
   const [showMenu, setShowMenu] = useState(false);
   const [showSearch, setShowSearch] = useState(false);
   const [showSight, setShowSight] = useState(false);
@@ -70,12 +73,24 @@ const HomePage: FC = () => {
   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();
+    console.log(loaded);
+    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);
@@ -114,17 +129,18 @@ const HomePage: FC = () => {
     nextTick(() => {
       setLoaded(true);
       swiperRef.current?.setIsRunning(true);
-
-      setTimeout(() => {
-        setHideLoading(true);
-      }, 1000);
+      audioContext.current?.play();
     });
   };
 
   useDidShow(() => {
+    createBgAudio();
+
     loaded && swiperRef.current?.setIsRunning(true);
   });
   useDidHide(() => {
+    audioContext.current?.destroy();
+
     swiperRef.current?.setIsRunning(false);
   });
 
@@ -274,17 +290,18 @@ const HomePage: FC = () => {
       </Swiper>
 
       {!loaded && (
-        <Video
-          className={classNames("home-loading", {
-            hide: loaded,
-            close: hideLoading,
-          })}
-          src="https://houseoss.4dkankan.com/project/wx-csbwg-public/videos/loading.mp4"
+        <VideoWrap
+          className={classNames("home-loading")}
+          src="https://houseoss.4dkankan.com/project/wx-csbwg-public/videos/ysdt.mp4"
           autoplay
-          muted
           controls={false}
           objectFit="cover"
-          enableProgressGesture={false}
+          onLoadedMetaData={() => {
+            setVideoMetaLoaded(true);
+            setTimeout(() => {
+              setLoading(false);
+            }, 1000);
+          }}
           onEnded={handleLoaded}
           onError={handleLoaded}
         />
@@ -317,6 +334,18 @@ const HomePage: FC = () => {
         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>
     </>
   );
 };

BIN
src/subModule/components/CertLayout/cert-min.png


+ 63 - 5
src/subModule/components/CertLayout/index.tsx

@@ -49,6 +49,10 @@ export const CertLayout: FC<CertLayoutProps> = ({ name, date, ...props }) => {
           "https://houseoss.4dkankan.com/project/wx-csbwg-public/fonts/SourceHanSerifCN-SemiBold.otf",
           "SourceHanSerifCN-Bold"
         );
+        await loadFont(
+          "https://houseoss.4dkankan.com/project/wx-csbwg-public/fonts/SourceHanSansSCRegular.otf",
+          "SourceHanSansSCRegular"
+        );
       }
 
       Taro.createSelectorQuery()
@@ -71,22 +75,53 @@ export const CertLayout: FC<CertLayoutProps> = ({ name, date, ...props }) => {
 
           ctxText(
             ctx,
+            "特此授予锡善云城·热心市民".split("").join(" "),
+            `${7 * system.pixelRatio}px SourceHanSansSCRegular`,
+            "center",
+            "#424A4A",
+            canvas.width / 2,
+            800 / ratio
+          );
+
+          ctxText(
+            ctx,
             name.split("").join(" "),
-            `${14 * system.pixelRatio}px SourceHanSansCN-Bold`,
+            `${15 * system.pixelRatio}px SourceHanSansCN-Bold`,
             "center",
             "#CFC49E",
             canvas.width / 2,
-            342 / ratio
+            1020 / ratio
+          );
+
+          ctxTextWrap(
+            ctx,
+            "特此证明,感谢您的热情参与与慷慨支持。您的善举为社区带来了无限的温暖与希望。因您的无私奉献,特授予您热心市民称号,以表彰您对慈善事业的贡献。您的善行将永远激励着我们,为构建更美好的社会贡献一份力量。",
+            `${7 * system.pixelRatio}px SourceHanSansSCRegular`,
+            "center",
+            "#424A4A",
+            canvas.width / 2,
+            1200 / ratio,
+            460 * system.pixelRatio
           );
 
           ctxText(
             ctx,
             date,
-            `${5.5 * system.pixelRatio}px SourceHanSerifCN-Bold`,
+            `${6 * system.pixelRatio}px SourceHanSerifCN-Bold`,
             "left",
             "#424A4A",
-            248 / ratio,
-            550 / ratio
+            740 / ratio,
+            1660 / ratio
+          );
+
+          ctxText(
+            ctx,
+            "锡善云城",
+            `${6 * system.pixelRatio}px SourceHanSerifCN-Bold`,
+            "left",
+            "#424A4A",
+            1880 / ratio,
+            1660 / ratio
           );
 
           await new Promise((resolve, reject) => {
@@ -127,6 +162,29 @@ export const CertLayout: FC<CertLayoutProps> = ({ name, date, ...props }) => {
     }) as Promise<CanvasImageSource>;
   };
 
+  const ctxTextWrap = (ctx, text, font, align, color, x, y, maxWidth) => {
+    let line = "";
+    const lines: string[] = [];
+    const words = text.split("");
+    for (let i = 0; i < words.length; i++) {
+      const word = words[i];
+      const testLine = line + word;
+      const metrics = ctx.measureText(testLine);
+
+      if (metrics.width > maxWidth && i > 0) {
+        lines.push(line);
+        line = word;
+      } else {
+        line = testLine;
+      }
+    }
+    lines.push(line);
+
+    lines.forEach((t, idx) =>
+      ctxText(ctx, t, font, align, color, x, y + idx * 28)
+    );
+  };
+
   const ctxText = (ctx, text, font, align, color, x, y) => {
     ctx.beginPath();
     ctx.font = font;

BIN
src/subModule/pages/museum/images/bg@2x-min.jpg


+ 3 - 1
src/subModule/pages/order/index.tsx

@@ -62,7 +62,9 @@ const OrderPage: FC = () => {
     Taro.showModal({
       title: "提示",
       content: "确认是否捐赠",
-      async success() {
+      async success(res) {
+        if (res.cancel) return;
+
         try {
           setLoading(true);
           await redeemApi({

+ 6 - 0
src/subModule/pages/shopmall/components/Products/index.scss

@@ -34,6 +34,7 @@
     &__stock {
       color: #9ba2a0;
       font-size: 23px;
+      min-height: 34px;
     }
     &__ft {
       font-size: 23px;
@@ -60,4 +61,9 @@
       height: 80px;
     }
   }
+  &__more {
+    text-align: center;
+    font-size: 24px;
+    color: #525252;
+  }
 }

+ 8 - 6
src/subModule/pages/shopmall/components/Products/index.tsx

@@ -1,6 +1,6 @@
 import { Image, ScrollView, Text, View } from "@tarojs/components";
 import Taro, { FC, useDidShow } from "@tarojs/taro";
-import { useEffect, useRef, useState } from "react";
+import { useRef, useState } from "react";
 import BuyIcon from "../../../../images/icon_presents@2x-min.png";
 import IsBuyIcon from "../../../../images/icon_complete@2x-min.png";
 import { checkRedeemApi, getProductListApi } from "../../../../../api";
@@ -28,9 +28,9 @@ export const Products: FC<ProductsProps> = ({ point, openCertLayout }) => {
   const [certIsBuy, setCertIsBuy] = useState(false);
   const [list, setList] = useState<any[]>([]);
 
-  useEffect(() => {
+  useDidShow(() => {
     checkRedeem();
-  }, []);
+  });
 
   const checkRedeem = async () => {
     const data = await checkRedeemApi();
@@ -91,6 +91,7 @@ export const Products: FC<ProductsProps> = ({ point, openCertLayout }) => {
         <View className="products">
           {list.map((item) => {
             const imgUrl = `${baseUrl}${item.thumb}`;
+            const isCert = item.id === 1;
 
             return (
               <View
@@ -109,16 +110,16 @@ export const Products: FC<ProductsProps> = ({ point, openCertLayout }) => {
                     {item.name}
                   </View>
                   <View className="products-item__stock">
-                    库存:{item.stock}
+                    {!isCert ? <>库存:{item.stock}</> : ""}
                   </View>
                   <View className="products-item__ft">
                     <Text className="products-item__ft__price">
                       {item.score}
                     </Text>
-                    <Text>爱心</Text>
+                    <Text>爱心</Text>
                   </View>
 
-                  {item.id === 1 && certIsBuy ? (
+                  {isCert && certIsBuy ? (
                     <Image className="products-item__is-buy" src={IsBuyIcon} />
                   ) : (
                     <Image className="products-item__buy" src={BuyIcon} />
@@ -128,6 +129,7 @@ export const Products: FC<ProductsProps> = ({ point, openCertLayout }) => {
             );
           })}
         </View>
+        <View className="products__more">更多礼品敬请期待</View>
       </ScrollView>
     </>
   );

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

@@ -26,7 +26,9 @@ export const Ranking: FC<RankingProps> = ({ list }) => {
 
           <Image className="ranking-item__avatar" src={DefaultAvatar} />
 
-          <View className="ranking-item__name limit-line">{item.nickName}</View>
+          <View className="ranking-item__name limit-line">
+            {item.nickName.slice(0, 1)}***
+          </View>
 
           <View className="ranking-item__val">{item.pcs}</View>
         </View>

+ 1 - 1
src/utils/index.ts

@@ -8,7 +8,7 @@ export const NICKNAME_KEY = "nickname";
 export const USER_INFO_KEY = "userinfo";
 
 export const MUSEUM_URL =
-  "https://houseoss.4dkankan.com/project/wuxicishanbwg/index.html?m=SG-igv7wQAyyyG_01&showBack=1";
+  "https://sit-locbigsecen.4dage.com/wxScene/index.html?m=wxcs_SG-igv7wQAyyyG&showBack=1";
 
 export const getSceneUrl = (scene?: number) => {
   const name = getStorageSync(NICKNAME_KEY);

BIN
src/videos/city.mp4


BIN
src/videos/loading.mp4


BIN
src/videos/xszc.mp4


BIN
src/videos/ysdt.mp4