chenlei před 1 rokem
rodič
revize
a8073153dc

+ 20 - 0
src/api/index.ts

@@ -60,3 +60,23 @@ export const redeemApi = (params: any) => {
     },
   });
 };
+
+export const getSignListApi = (params: any) => {
+  return requestByGet("/api/show/visit/getList", params, {
+    meta: {
+      showLoading: true,
+    },
+  });
+};
+
+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: {
+      showError: true,
+    },
+  });
+};

+ 1 - 0
src/app.config.ts

@@ -8,6 +8,7 @@ export default defineAppConfig({
         "pages/feedback/index",
         "pages/order/index",
         "pages/iframe/index",
+        "pages/portrait-iframe/index",
       ],
     },
   ],

+ 2 - 1
src/app.tsx

@@ -45,7 +45,8 @@ initial({
         }
 
         if (response.code !== 0) {
-          const message = response.errorMessage ?? "系统出差中";
+          // @ts-ignore
+          const message = response.msg ?? "系统出差中";
           response.errorMessage = message;
           if (showError) {
             Taro.showToast({

binární
src/images/btn_s_blue@2x-min.png


binární
src/images/code.jpg


binární
src/images/img_map@2x-min.jpg


binární
src/images/img_map@2x-min.png


binární
src/images/loading-poster.jpg


+ 1 - 1
src/pages/home/components/Menu/index.scss

@@ -36,7 +36,7 @@
       margin-bottom: 20px;
       display: flex;
       align-items: center;
-      font-family: "Source Han Serif CN-Bold";
+      font-family: "Source Han Serif CN Heavy";
       font-size: 38px;
 
       &.is-active::after {

+ 74 - 55
src/pages/home/components/Menu/index.tsx

@@ -4,6 +4,7 @@ import Taro, { FC } from "@tarojs/taro";
 import { AtDrawer } from "taro-ui";
 import { AtDrawerProps } from "taro-ui/types/drawer";
 import { observer } from "mobx-react";
+import { getSceneUrl } from "../../../../utils";
 import baseStore from "../../../../store/base";
 import CloseIcon from "../../../../images/icon_back_menu@2x.png";
 import SearchIcon from "../../../../images/icon_search_black@2x-min.png";
@@ -16,74 +17,92 @@ import UserIcon from "../../../../images/icon_user_normal@2x-min.png";
 import ActUserIcon from "../../../../images/icon_user_active@2x-min.png";
 
 import "./index.scss";
+import { useMemo } from "react";
 
 export interface MenuProps extends AtDrawerProps {
   openSearch(): void;
 }
 
-const LIST = [
-  {
-    label: "要素地图",
-    icon: MapIcon,
-    activeIcon: ActMapIcon,
-    children: [
-      {
-        label: "全部遗存",
-        link: "",
-      },
-    ],
-  },
-  {
-    label: "锡善之城",
-    icon: CityIcon,
-    activeIcon: ActCityIcon,
-    children: [
-      {
-        label: "慈善博物馆",
-        link: "",
-      },
-      {
-        label: "慈善云学校",
-        link: "",
-      },
-      {
-        label: "慈善堂",
-        link: "",
-      },
-      {
-        label: "慈善广场",
-        link: "",
-      },
-      {
-        label: "爱心林场",
-        link: "",
-      },
-    ],
-  },
-  {
-    label: "用户中心",
-    icon: UserIcon,
-    activeIcon: ActUserIcon,
-    children: [
+export const Menu: FC<MenuProps> = observer((props) => {
+  const LIST = useMemo(
+    () => [
       {
-        label: "个人设定",
-        link: "",
+        label: "要素地图",
+        icon: MapIcon,
+        activeIcon: ActMapIcon,
+        children: [
+          {
+            label: "全部遗存",
+            link: "",
+          },
+        ],
       },
       {
-        label: "用户反馈",
-        link: "/subModule/pages/feedback/index",
-        needAuth: true,
+        label: "锡善之城",
+        icon: CityIcon,
+        activeIcon: ActCityIcon,
+        children: [
+          {
+            label: "慈善博物馆",
+            link:
+              "/subModule/pages/iframe/index?url=" +
+              encodeURIComponent(
+                "https://houseoss.4dkankan.com/project/wuxicishanbwg/index.html?m=TEST"
+              ),
+          },
+          {
+            label: "慈善云学校",
+            link:
+              "/subModule/pages/iframe/index?url=" +
+              encodeURIComponent(getSceneUrl(0)),
+          },
+          {
+            label: "慈善堂",
+            link:
+              "/subModule/pages/iframe/index?url=" +
+              encodeURIComponent(getSceneUrl(1)),
+          },
+          {
+            label: "慈善广场",
+            link:
+              "/subModule/pages/iframe/index?url=" +
+              encodeURIComponent(getSceneUrl(2)),
+          },
+          {
+            label: "爱心林场",
+            link:
+              "/subModule/pages/iframe/index?url=" +
+              encodeURIComponent(getSceneUrl(3)),
+          },
+        ],
       },
       {
-        label: "爱心币商城",
-        link: "/subModule/pages/shopmall/index",
-        needAuth: true,
+        label: "用户中心",
+        icon: UserIcon,
+        activeIcon: ActUserIcon,
+        children: [
+          {
+            label: "个人设定",
+            link:
+              "/subModule/pages/iframe/index?url=" +
+              encodeURIComponent(getSceneUrl(4)),
+          },
+          {
+            label: "用户反馈",
+            link: "/subModule/pages/feedback/index",
+            needAuth: true,
+          },
+          {
+            label: "爱心币商城",
+            link: "/subModule/pages/shopmall/index",
+            needAuth: true,
+          },
+        ],
       },
     ],
-  },
-];
+    []
+  );
 
-export const Menu: FC<MenuProps> = observer((props) => {
   return (
     <AtDrawer {...props} className="menu" width={Taro.pxTransform(550)}>
       <Image

+ 2 - 0
src/pages/home/components/RoundItem/index.scss

@@ -11,6 +11,7 @@
     left: 0;
     width: 100%;
     height: 100%;
+    opacity: 0.5;
 
     &.active {
       mask-image: radial-gradient(
@@ -19,6 +20,7 @@
         transparent calc(var(--radius) + 5%)
       );
       animation: scene-transition 0.5s ease-out forwards;
+      opacity: 1;
       z-index: 1;
     }
     &.hide {

+ 56 - 36
src/pages/home/components/SearchLayout/index.tsx

@@ -1,10 +1,11 @@
-import { useCallback, useMemo, useState } from "react";
+import { useCallback, useEffect, useState } from "react";
 import { FC } from "@tarojs/taro";
 import { AtFloatLayout, AtInput, AtTabs, AtTabsPane } from "taro-ui";
 import { AtFloatLayoutProps } from "taro-ui/types/float-layout";
 import { View } from "@tarojs/components";
 import { CITY_LIST, SIGHT_LIST } from "../../constants";
 import { debounce } from "../../../../utils";
+import { getSignListApi } from "../../../../api";
 import "./index.scss";
 
 export interface SearchLayoutProps extends AtFloatLayoutProps {
@@ -15,9 +16,31 @@ export const SearchLayout: FC<SearchLayoutProps> = (props) => {
   const [curTab, setCurTab] = useState(0);
   const [keyword, setKeyword] = useState("");
   const [input, setInput] = useState("");
+  const [list, setList] = useState<any>({});
+
+  useEffect(() => {
+    if (props.isOpened) {
+      getSignList();
+    }
+  }, [props.isOpened]);
+
+  const getSignList = async (idx?: number) => {
+    const _idx = idx ?? curTab;
+    if (list[_idx]) return;
+
+    const data = await getSignListApi({
+      region: CITY_LIST[_idx].title,
+      type: "scene",
+    });
+    setList({
+      ...list,
+      [_idx]: data,
+    });
+  };
 
   const handleTabClick = (idx: number) => {
     setCurTab(idx);
+    getSignList(idx);
   };
 
   const debounceSearch = useCallback(
@@ -34,17 +57,19 @@ export const SearchLayout: FC<SearchLayoutProps> = (props) => {
   return (
     <AtFloatLayout className="search-layout" {...props}>
       <View className="search-input">
-        <AtInput
-          clear
-          className="search-input__input"
-          name="keyword"
-          value={input}
-          placeholder="请输入要搜索的内容..."
-          onChange={(v) => {
-            setInput(v as string);
-            debounceSearch(v as string);
-          }}
-        />
+        {props.isOpened && (
+          <AtInput
+            clear
+            className="search-input__input"
+            name="keyword"
+            value={input}
+            placeholder="请输入要搜索的内容..."
+            onChange={(v) => {
+              setInput(v as string);
+              debounceSearch(v as string);
+            }}
+          />
+        )}
         <View className="search-input__cancel" onClick={props.onClose}>
           取消
         </View>
@@ -57,33 +82,28 @@ export const SearchLayout: FC<SearchLayoutProps> = (props) => {
         tabList={CITY_LIST}
         onClick={handleTabClick}
       >
-        {CITY_LIST.map((item) => (
+        {CITY_LIST.map((item, idx) => (
           <AtTabsPane current={curTab} index={item.id}>
-            {SIGHT_LIST.filter(
-              (i) =>
-                (keyword ? fakeSearch(i.title) : true) &&
-                i.parentCity === item.id
-            ).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.title}
+            {(list[idx] || [])
+              .filter((i) => (keyword ? fakeSearch(i.name) : true))
+              .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 className="limit-line">
-                    {(Array.isArray(subItem.content)
-                      ? subItem.content[0]
-                      : subItem.content
-                    ).slice(0, 50)}
-                  </View>
-                </View>
 
-                <View className="search-tab__item__more" />
-              </View>
-            ))}
+                  <View className="search-tab__item__more" />
+                </View>
+              ))}
           </AtTabsPane>
         ))}
       </AtTabs>

+ 34 - 5
src/pages/home/components/SightDetailLayout/index.tsx

@@ -1,17 +1,28 @@
+import { useEffect } from "react";
 import Taro, { FC } from "@tarojs/taro";
 import { AtFloatLayout } from "taro-ui";
 import { AtFloatLayoutProps } from "taro-ui/types/float-layout";
 import { Image, View } from "@tarojs/components";
 import BorderImg from "../../../../images/line01@2x.png";
 import CloseIcon from "../../../../images/icon_back@2x-min.png";
-import "./index.scss";
 import { SIGHT_LIST } from "../../constants";
+import { addVisitApi } from "../../../../api";
+import "./index.scss";
 
 export interface SightDetailLayoutProps extends AtFloatLayoutProps {
   item: (typeof SIGHT_LIST)[0];
 }
 
 export const SightDetailLayout: FC<SightDetailLayoutProps> = (props) => {
+  useEffect(() => {
+    if (props.isOpened) {
+      addVisitApi({
+        device: "wx",
+        id: props.item.id,
+      });
+    }
+  }, [props.isOpened]);
+
   const handlePreview = () => {
     Taro.previewImage({
       current: props.item.imgUrl,
@@ -22,7 +33,10 @@ export const SightDetailLayout: FC<SightDetailLayoutProps> = (props) => {
   return (
     <AtFloatLayout className="sight-layout" {...props}>
       <View className="sight-layout-head">
-        <View className="sight-layout-head__label">{props.item.title}</View>
+        <View className="sight-layout-head__label">
+          {/* @ts-ignore */}
+          {props.item.title || props.item.name}
+        </View>
         <View>{props.item.address}</View>
 
         <Image
@@ -34,7 +48,8 @@ export const SightDetailLayout: FC<SightDetailLayoutProps> = (props) => {
 
       <View className="sight-layout-main">
         <Image
-          src={props.item.imgUrl}
+          // @ts-ignore
+          src={props.item.imgUrl || props.item.thumb}
           className="sight-layout__img"
           mode="aspectFill"
           onClick={handlePreview}
@@ -43,7 +58,18 @@ export const SightDetailLayout: FC<SightDetailLayoutProps> = (props) => {
         <View className="sight-layout-toolbar">
           {/* <View className="sight-layout-toolbar__btn">全景浏览</View> */}
 
-          <View className="sight-layout-toolbar__btn">场景漫游</View>
+          <View
+            className="sight-layout-toolbar__btn"
+            onClick={() => {
+              Taro.navigateTo({
+                url: `/subModule/pages/portrait-iframe/index?url=${encodeURIComponent(
+                  props.item.link
+                )}`,
+              });
+            }}
+          >
+            场景漫游
+          </View>
         </View>
 
         {Array.isArray(props.item.content) ? (
@@ -53,7 +79,10 @@ export const SightDetailLayout: FC<SightDetailLayoutProps> = (props) => {
             </View>
           ))
         ) : (
-          <View className="sight-layout__text">{props.item.content}</View>
+          <View className="sight-layout__text">
+            {/* @ts-ignore */}
+            {props.item.content || props.item.description}
+          </View>
         )}
 
         <Image

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

@@ -1,7 +1,7 @@
 .sights {
   position: relative;
   left: 50%;
-  margin-top: -200px;
+  margin-top: -280px;
   width: 1000px;
   height: 1000px;
   transform: translateX(-50%);

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

@@ -150,6 +150,7 @@ export const Swiper = forwardRef<SwiperMethods, SwiperProps>(
         {itemStack.map((id, idx) => {
           const show =
             [...nexts, ...prevs].includes(id) || id === curSwiperItem;
+          const isActive = activeId === id;
 
           return (
             show && (
@@ -159,7 +160,7 @@ export const Swiper = forwardRef<SwiperMethods, SwiperProps>(
                 angle={(360 / 12) * idx}
                 bigR={Big_R}
                 minR={MIN_R}
-                isActive={activeId === id}
+                isActive={isActive}
                 isNear={nearIds.includes(id)}
               />
             )

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 78 - 78
src/pages/home/constants.ts


+ 47 - 9
src/pages/home/index.scss

@@ -1,11 +1,24 @@
 .home {
   position: relative;
-  top: -120px;
 
+  &-loading {
+    position: fixed;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    z-index: 998;
+
+    &.hide {
+      animation: loading-leave 1s ease-in forwards;
+    }
+  }
   &-container {
-    height: 100vh;
+    position: relative;
+    min-height: 100vh;
     overflow: hidden;
     background: linear-gradient(180deg, #99b6b4 0%, #fffaea 100%);
+    z-index: 1;
   }
   &__menu-btn {
     position: fixed;
@@ -59,7 +72,7 @@
     display: flex;
     align-items: center;
     gap: 20px;
-    margin-top: 160px;
+    margin-top: 150px;
     padding: 0 60px;
 
     &__icon {
@@ -76,6 +89,7 @@
       align-items: center;
       color: #589498;
       font-size: 24px;
+      letter-spacing: 7px;
       background: url("../../images/img_active_title@2x-min.png") no-repeat
         center bottom / contain;
 
@@ -88,15 +102,14 @@
       position: absolute;
       left: 50%;
       bottom: -78px;
-      width: 176px;
-      height: 58px;
-      line-height: 58px;
+      width: 192px;
+      height: 68px;
+      line-height: 62px;
       text-align: center;
       color: #589498;
       font-size: 24px;
-      box-shadow: 0px 2px 4px 0px rgba(88, 148, 152, 0.25);
-      border-radius: 50px;
-      border: 2px solid rgba(88, 148, 152, 0.5);
+      background: url("../../images/btn_s_blue@2x-min.png") no-repeat center /
+        contain;
       transform: translateX(-50%);
     }
   }
@@ -111,6 +124,31 @@
       center / contain;
     will-change: top left;
     transition: all linear 0.2s;
+    z-index: 2;
+
+    &-icon {
+      position: absolute;
+      top: 0;
+      left: 0;
+      width: 50px;
+      height: 70px;
+
+      &.red::after {
+        background: #c59797;
+      }
+      &::after {
+        content: "";
+        position: absolute;
+        left: 50%;
+        bottom: 0;
+        width: 10px;
+        height: 5px;
+        transform: translateX(-50%);
+        background: #97c59b;
+        border-radius: 25%;
+        overflow: hidden;
+      }
+    }
   }
 }
 

+ 127 - 85
src/pages/home/index.tsx

@@ -1,7 +1,6 @@
-import { useMemo, useRef, useState } from "react";
-import { Image, View, Text } from "@tarojs/components";
+import { memo, useMemo, useRef, useState } from "react";
+import { Image, View, Text, Video } from "@tarojs/components";
 import classNames from "classnames";
-import { AtIcon } from "taro-ui";
 import Taro, {
   FC,
   nextTick,
@@ -11,7 +10,7 @@ import Taro, {
 } from "@tarojs/taro";
 import { Menu } from "./components/Menu";
 import BtmBgImg from "../../images/img_map2@2x-min.png";
-import BgImg from "../../images/img_map@2x-min.png";
+import BgImg from "../../images/img_map@2x-min.jpg";
 import LeftIcon from "../../images/icon_blue_left@2x-min.png";
 import RightIcon from "../../images/icon_blue_right@2x-min.png";
 import ButtonImg from "../../images/btn_start@2x-min.png";
@@ -19,8 +18,29 @@ import { Swiper, SwiperMethods } from "./components/Swiper";
 import { SearchLayout } from "./components/SearchLayout";
 import { SightDetailLayout } from "./components/SightDetailLayout";
 import { SIGHT_LIST } from "./constants";
+import { getSignListApi } from "../../api";
+import { getSceneUrl } from "../../utils";
 import "./index.scss";
 
+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 HomePage: FC = () => {
   const [loaded, setLoaded] = useState(false);
   const [showMenu, setShowMenu] = useState(false);
@@ -42,9 +62,14 @@ const HomePage: FC = () => {
     setShowSearch(true);
   };
 
-  const handleDetail = () => {
+  const handleDetail = async () => {
     swiperRef.current?.setIsRunning(false);
-    setItem(SIGHT_LIST.find((i) => i.id === curSwiperItem));
+    const target = SIGHT_LIST.find((i) => i.id === curSwiperItem);
+    const data = await getSignListApi({
+      searchKey: target?.title,
+      type: "scene",
+    });
+    setItem(data[0] || target);
     setShowSight(true);
   };
 
@@ -73,112 +98,129 @@ const HomePage: FC = () => {
   });
 
   return (
-    <View className="home-container">
-      <View className={classNames("ld-page", { hide: loaded })}>
+    <>
+      <View className="home-container">
+        {/* <View className={classNames("ld-page", { hide: loaded })}>
         <AtIcon
           className="ld-page__icon"
           value="loading"
           color="#589498"
           size={40}
         />
-      </View>
+      </View> */}
 
-      <View className="home">
-        <View
-          className="home__menu-btn"
-          onClick={() => {
-            setShowMenu(true);
-            swiperRef.current?.setIsRunning(false);
-          }}
-        />
-
-        {item && (
+        <View className="home">
           <View
-            className="home__point"
-            style={{
-              top: pxTransform(item.pos.y),
-              left: pxTransform(item.pos.x),
+            className="home__menu-btn"
+            onClick={() => {
+              setShowMenu(true);
+              swiperRef.current?.setIsRunning(false);
             }}
           />
-        )}
 
-        <Menu show={showMenu} onClose={closeMenu} openSearch={openSearch} />
+          {realItem && (
+            <View
+              className="home__point"
+              style={{
+                top: pxTransform(realItem.pos.y),
+                left: pxTransform(realItem.pos.x),
+              }}
+            />
+          )}
+
+          <PointIcon />
 
-        <View className="home-main">
-          <Swiper
-            ref={swiperRef}
-            curSwiperItem={curSwiperItem}
-            setCurSwiperItem={setCurSwiperItem}
-          />
+          <Menu show={showMenu} onClose={closeMenu} openSearch={openSearch} />
 
-          <View className="home-toggle">
-            <Image
-              className="home-toggle__icon"
-              src={LeftIcon}
-              onClick={() => swiperRef.current?.toPrev()}
+          <View className="home-main">
+            <Swiper
+              ref={swiperRef}
+              curSwiperItem={curSwiperItem}
+              setCurSwiperItem={setCurSwiperItem}
             />
 
-            <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 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>
               </View>
 
-              <View className="home-toggle__detail" onClick={handleDetail}>
-                遗存详情
-              </View>
+              <Image
+                className="home-toggle__icon"
+                src={RightIcon}
+                onClick={() => swiperRef.current?.toNext()}
+              />
             </View>
 
-            <Image
-              className="home-toggle__icon"
-              src={RightIcon}
-              onClick={() => swiperRef.current?.toNext()}
-            />
+            <View className="home-main__btn">
+              <Image
+                mode="widthFix"
+                className="home-main__btn__btn"
+                src={ButtonImg}
+                onClick={() => {
+                  Taro.navigateTo({
+                    url:
+                      "/subModule/pages/iframe/index?url=" +
+                      encodeURIComponent(getSceneUrl()),
+                  });
+                }}
+              />
+            </View>
           </View>
 
-          <View className="home-main__btn">
-            <Image
-              mode="widthFix"
-              className="home-main__btn__btn"
-              src={ButtonImg}
-              onClick={() => {
-                Taro.navigateTo({
-                  url: "/subModule/pages/iframe/index?url=https://houseoss.4dkankan.com/project/wx-csbwg-public/web/index.html",
-                });
-              }}
-            />
-          </View>
+          <Image
+            className="home__bg"
+            src={BgImg}
+            mode="widthFix"
+            // onLoad={handleLoaded}
+          />
+          <Image className="home__btm-bg" src={BtmBgImg} mode="widthFix" />
         </View>
 
-        <Image
-          className="home__bg"
-          src={BgImg}
-          mode="widthFix"
-          onLoad={handleLoaded}
+        <SearchLayout
+          isOpened={showSearch}
+          onClose={() => setShowSearch(false)}
+          openDetail={(item) => {
+            swiperRef.current?.setIsRunning(false);
+            setItem(item);
+            setShowSight(true);
+          }}
         />
-        <Image className="home__btm-bg" src={BtmBgImg} mode="widthFix" />
+
+        {item && (
+          <SightDetailLayout
+            item={item}
+            isOpened={showSight}
+            onClose={closeDetail}
+          />
+        )}
       </View>
 
-      <SearchLayout
-        isOpened={showSearch}
-        onClose={() => setShowSearch(false)}
-        openDetail={(item) => {
-          swiperRef.current?.setIsRunning(false);
-          setItem(item);
-          setShowSight(true);
-        }}
+      <Video
+        className={classNames("home-loading", { hide: loaded })}
+        src="https://houseoss.4dkankan.com/project/wx-csbwg-public/videos/loading.mp4"
+        autoplay
+        muted
+        controls={false}
+        objectFit="cover"
+        onEnded={handleLoaded}
+        onError={handleLoaded}
       />
-
-      {item && (
-        <SightDetailLayout
-          item={item}
-          isOpened={showSight}
-          onClose={closeDetail}
-        />
-      )}
-    </View>
+    </>
   );
 };
 

+ 8 - 2
src/pages/login/index.scss

@@ -2,9 +2,15 @@
   position: relative;
   height: 100vh;
   overflow: hidden;
-  background: url("https://houseoss.4dkankan.com/project/wx-csbwg-public/images/bg_login%402x-min.png")
-    no-repeat center center / cover;
 
+  &__bg {
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    z-index: -1;
+  }
   &.is-loading {
     background-image: url("https://houseoss.4dkankan.com/project/wx-csbwg-public/images/bg_loading%402x-min.png");
   }

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

@@ -1,4 +1,4 @@
-import { Text, View, Image } from "@tarojs/components";
+import { Text, View, Image, Video } from "@tarojs/components";
 import Taro, { FC } from "@tarojs/taro";
 import { AtButton, AtForm, AtInput } from "taro-ui";
 import classNames from "classnames";
@@ -14,6 +14,7 @@ import {
   checkLoginApi,
   setUserInfoApi,
   setVistorName,
+  validateNickName,
   wechatLoginApi,
 } from "../../api";
 import baseStore from "../../store/base";
@@ -45,10 +46,13 @@ const LoginPage: FC = () => {
       return false;
     }
 
+    await validateNickName(name);
+
     return true;
   };
 
-  const handleUserInfo = async () => {
+  const handleUserInfo = async (e) => {
+    // console.log(e);
     if (!(await handleValidate())) return;
 
     Taro.login({
@@ -166,12 +170,23 @@ const LoginPage: FC = () => {
         <AtButton
           loading={wechatLoading}
           className="login__wechat-login"
-          onClick={handleUserInfo}
+          openType="getUserInfo"
+          onGetUserInfo={handleUserInfo}
         >
           <Image className="login__wechat-login__icon" src={WechatIcon} />
           微信一键登录
         </AtButton>
       </AtForm>
+
+      <Video
+        className="login__bg"
+        src="https://houseoss.4dkankan.com/project/wx-csbwg-public/videos/login.mp4"
+        autoplay
+        loop
+        muted
+        controls={false}
+        objectFit="cover"
+      />
     </View>
   );
 };

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

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

+ 3 - 0
src/subModule/pages/portrait-iframe/index.config.ts

@@ -0,0 +1,3 @@
+export default definePageConfig({
+  pageOrientation: "portrait",
+});

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

@@ -0,0 +1,12 @@
+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;

+ 3 - 0
src/subModule/pages/shanjuan/index.config.ts

@@ -0,0 +1,3 @@
+export default definePageConfig({
+  pageOrientation: "portrait",
+});

+ 10 - 0
src/subModule/pages/shanjuan/index.tsx

@@ -0,0 +1,10 @@
+import { WebView } from "@tarojs/components";
+import { FC } from "@tarojs/taro";
+
+const ShanjuanPage: FC = () => {
+  return (
+    <WebView src="https://houseoss.4dkankan.com/project/wuxicishanbwg/index.html?m=TEST" />
+  );
+};
+
+export default ShanjuanPage;

+ 9 - 1
src/utils/index.ts

@@ -1,9 +1,17 @@
-import Taro from "@tarojs/taro";
+import Taro, { getStorageSync } from "@tarojs/taro";
 import Schema, { Rules } from "async-validator";
 
 export const TOKEN_KEY = "token";
 export const NICKNAME_key = "nickname";
 
+export const getSceneUrl = (scene?: number) => {
+  const name = getStorageSync(NICKNAME_key);
+
+  return `https://app.4dage.com/projects/wxcs/web/index.html?platform=wx&name=${name}${
+    typeof scene === "number" ? `&scene=${scene}` : ""
+  }`;
+};
+
 export const createRandomString = () => {
   const characters =
     "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

binární
src/videos/loading.mp4


binární
src/videos/login.mp4