diff --git a/src/components/DefaultPopup/DefaultPopup.js b/src/components/DefaultPopup/DefaultPopup.js deleted file mode 100644 index b3dc99d..0000000 --- a/src/components/DefaultPopup/DefaultPopup.js +++ /dev/null @@ -1,211 +0,0 @@ -import "./style.scss"; -import React, { useState, useEffect } from "react"; - -import search from "./search.png"; -import close from "./close.png"; -import go from "./go.png"; -import arrow from "./arrow.png"; -import ShopsWithFilter from "../ShopsWithFilter/ShopsWithFilter"; -const STATES = { - init: 0, - moreFac: 1, - facList: 2, -}; -export const DefaultPopupStates = STATES; -const initMarginBottom = 47; -const DefaultPopup = ({ - state, - setState, - onSearch, - facilities, - onClickFac, - mall, - onClick, - setEnd, - hasTab, - blurMap = () => {}, -}) => { - const marginBottomStateMap = { - 0: 47, - 1: hasTab - ? window.innerHeight - 52 - 179 - 98 - : window.innerHeight - 52 - 179, - }; - const baseMarginBottom = marginBottomStateMap[state]; - const [facList, setFacList] = useState(null); - const [focused, setFocused] = useState(null); - const [start, setStart] = useState(null); - const [marginBottom, setMarginBottom] = useState(null); - const [doTransition, setdoTransition] = useState(false); - useEffect(() => { - setdoTransition(true); - setMarginBottom(baseMarginBottom); - setTimeout(() => { - setdoTransition(false); - }, 500); - }, [state]); - const handleTouchStart = (e) => { - if (start) return; - setStart({ - identifier: e.changedTouches[0].identifier, - y: e.changedTouches[0].clientY, - }); - }; - const handleTouchMove = (e) => { - if (!start) return; - const touch = Array.from(e.changedTouches).find( - ({ identifier }) => identifier === start.identifier - ); - if (!touch) return; - const delta = touch.clientY - start.y; - setMarginBottom(baseMarginBottom - delta); - }; - const handleTouchEnd = (e) => { - if (!start) return; - const touch = Array.from(e.changedTouches).find( - ({ identifier }) => identifier === start.identifier - ); - if (!touch) return; - setStart(null); - const delta = touch.clientY - start.y; - const newState = - state === STATES.init && delta < -100 - ? STATES.moreFac - : state === STATES.moreFac && delta > 100 - ? STATES.init - : state; - - if (state === newState) { - setdoTransition(true); - setMarginBottom(baseMarginBottom); - setTimeout(() => { - setdoTransition(false); - }, 500); - } else setState(newState); - }; - - return ( - <> - {state === STATES.init || state === STATES.moreFac ? ( -
-
- setState(state === STATES.moreFac ? STATES.init : STATES.moreFac) - } - > - -
- -
- -
- 搜索店铺 -
-
- {Object.entries(facilities).map(([name, list]) => ( -
{ - list.sort((a, b) => a.floorOrder - b.floorOrder); - setFacList(list); - setState(STATES.facList); - }} - > - - {name} -
- ))} -
-
- ) : ( - <> - { - e.preventDefault(); - e.stopPropagation(); - setState(STATES.init); - setFacList(null); - blurMap(); - }} - > -
- {facList && - facList.map((fac, i) => { - const showRow1 = - i === 0 || fac.floorName !== facList[i - 1].floorName; - const isActive = focused === fac.id; - return ( -
- {showRow1 && ( -
- {fac.floorName} -
- )} -
{ - setFocused(fac.id); - onClickFac(fac.id); - }} - > - {fac.name} - {fac.floorName} - {isActive && ( -
{ - e.stopPropagation(); - setState(STATES.init); - onClickFac(fac.id); - }} - > - GO -
- )} -
-
- ); - })} -
- - )} - {state !== STATES.facList && ( -
{ - setState(STATES.moreFac); - }} - > - { - setState(STATES.init); - onClick(e); - }} - wingHeight="calc(100vh - 310px)" - > -
- )} - - ); -}; -export default DefaultPopup; diff --git a/src/components/DefaultPopup/arrow.png b/src/components/DefaultPopup/arrow.png deleted file mode 100644 index 9f1fa29..0000000 Binary files a/src/components/DefaultPopup/arrow.png and /dev/null differ diff --git a/src/components/DefaultPopup/close.png b/src/components/DefaultPopup/close.png deleted file mode 100644 index 47bcaaf..0000000 Binary files a/src/components/DefaultPopup/close.png and /dev/null differ diff --git a/src/components/DefaultPopup/go.png b/src/components/DefaultPopup/go.png deleted file mode 100644 index d477721..0000000 Binary files a/src/components/DefaultPopup/go.png and /dev/null differ diff --git a/src/components/DefaultPopup/search.png b/src/components/DefaultPopup/search.png deleted file mode 100644 index 8d2e027..0000000 Binary files a/src/components/DefaultPopup/search.png and /dev/null differ diff --git a/src/components/DefaultPopup/style.scss b/src/components/DefaultPopup/style.scss deleted file mode 100644 index 51ecdc1..0000000 --- a/src/components/DefaultPopup/style.scss +++ /dev/null @@ -1,231 +0,0 @@ -.dp { - position: relative; - width: calc(100vw - 20px); - margin-left: 10px; - height: 179px; - border-top-left-radius: 24px; - border-top-right-radius: 24px; - text-align: center; - position: relative; - padding: 14px 0 0 0; - background: #ffffff; - box-shadow: 0px 12px 16px rgba(104, 110, 127, 0.08); - border-radius: 18px; - &::before { - position: absolute; - content: ""; - top: 0; - left: -10px; - right: -10px; - height: 236px; - background: linear-gradient( - 180deg, - rgba(243, 244, 248, 0) 0%, - #f3f4f8 41.53%, - #f3f4f8 100% - ); - z-index: -1; - } - &::after { - position: absolute; - content: ""; - left: -10px; - right: -10px; - top: 236px; - height: calc(100vh - 52px - 236px); - background: #f3f4f8; - z-index: -1; - } - &.more-fac { - .t1, - .t2 { - transform: rotate(180deg); - } - .facs { - max-height: 333px; - overflow-y: scroll; - } - } - .ts { - position: absolute; - margin: auto; - left: 0; - right: 0; - top: 0; - width: 24px; - height: 24px; - .t1 { - position: absolute; - margin: auto; - left: 0; - right: 0; - top: 3px; - width: 33px; - height: 7px; - border-radius: 5px; - } - } - - .search { - position: relative; - display: flex; - align-items: center; - margin: 0 14px; - height: 60px; - font-family: PingFang SC; - font-style: normal; - font-weight: 500; - font-size: 16px; - color: #323337; - text-align: left; - background: #f3f4f8; - border: 1px solid #edeff3; - box-sizing: border-box; - border-radius: 10px; - padding-left: 14px; - .icon { - width: 24px; - height: 24px; - } - .sep { - width: 1px; - height: 16px; - background: #c9cbd1; - margin: 0 14px; - } - } - - .facs { - display: inline-flex; - align-items: flex-start; - overflow-x: auto; - overflow-y: hidden; - width: 100%; - white-space: nowrap; - margin-top: 20px; - padding-left: 20px; - height: 75px; - .fac { - display: flex; - flex-direction: column; - justify-content: space-between; - height: 65px; - margin-right: 20px; - font-family: PingFang SC; - font-style: normal; - font-weight: 500; - font-size: 11px; - line-height: 15px; - text-align: center; - color: #474a56; - align-items: center; - img { - display: block; - width: 44px; - height: 44px; - } - } - } -} -.close { - position: absolute; - top: 16px; - right: 26px; - width: 24px; - height: 24px; - z-index: 10; -} -.dp1 { - position: relative; - margin: 0 10px 26px 10px; - height: 326px; - border-radius: 18px; - background: #ffffff; - box-shadow: 0px 12px 16px rgba(104, 110, 127, 0.08); - text-align: center; - padding: 14px; - overflow-x: hidden; - overflow-y: auto; - .row1, - .row2 { - text-align: left; - line-height: 48px; - height: 48px; - } - .row1 { - font-family: DINPro; - font-style: normal; - font-weight: bold; - font-size: 24px; - line-height: 48px; - height: 48px; - color: #323337; - padding: 0 16px; - &.has-border { - position: relative; - padding-top: 24px; - height: 72px; - &::after { - position: absolute; - content: ""; - top: 12px; - left: 0; - right: 0; - border-top: 1px dashed #edeff3; - } - } - } - .row2 { - display: flex; - position: relative; - padding-left: 16px; - font-family: PingFang SC; - font-style: normal; - font-weight: 500; - font-size: 16px; - color: #323337; - background: #f9f9fb; - border-radius: 12px; - &.has-margin { - margin-top: 4px; - } - &.active { - background: linear-gradient(180deg, #508af7 0%, #5ea5f9 100%); - color: #ffffff; - border-radius: 12px; - .meta { - color: #ffffff; - } - } - .meta { - margin-left: 16px; - font-family: DINPro; - font-style: normal; - font-weight: normal; - font-size: 17px; - color: #a1a5b3; - } - .go { - position: absolute; - top: 8px; - right: 8px; - width: 96px; - height: 32px; - background: #ffffff; - box-shadow: 0px 2px 6px rgba(93, 172, 249, 0.2); - border-radius: 8px; - font-family: PingFang SC; - font-style: normal; - font-weight: 600; - font-size: 16px; - line-height: 32px; - text-align: center; - color: #437af7; - } - } -} -.sf { - position: absolute; - top: 177px; - left: 0; -} diff --git a/src/components/Floors/Floors.js b/src/components/Floors/Floors.js index 4a8a77e..b154849 100644 --- a/src/components/Floors/Floors.js +++ b/src/components/Floors/Floors.js @@ -11,9 +11,7 @@ const Floors = ({ onClickFloor, popupHeight, showNav, - isNavEnd, - end, - hasCoupon, + start, }) => { const [list, setList] = useState([]); useEffect(() => { @@ -37,23 +35,17 @@ const Floors = ({ block: "center", }); }); - return !showNav ? ( -
+
- 上箭头 - 下箭头
) : (
diff --git a/src/components/Floors/Floors.scss b/src/components/Floors/Floors.scss index 78af184..b93ebfb 100644 --- a/src/components/Floors/Floors.scss +++ b/src/components/Floors/Floors.scss @@ -1,65 +1,55 @@ .floor-list { - position: absolute; - top: -172px; - left: 10px; - height: 160px; - width: 40px; - padding: 10px 0; + height: 72px; + width: 100vw; + flex: 0 0 72px; text-align: center; box-sizing: border-box; z-index: 1000; - background: #ffffff; - box-shadow: 0px 8px 8px rgba(104, 110, 127, 0.04); - border-radius: 12px; - &.has-coupon { - top: -211px; - } - .show-nav { - top: -442px; - } - &.nav-end { - top: -212px; - } + background: var(--guide-floorBg); + ul { - overflow-x: hidden; - overflow-y: auto; - height: 140px; + overflow-x: auto; + overflow-y: hidden; + width: 100vw; + height: 72px; + white-space: nowrap; &::-webkit-scrollbar { display: none; } } li { + position: relative; display: inline-block; - line-height: 32px; font-family: DINPro; font-style: normal; font-weight: normal; - font-size: 14px; + font-size: 16px; text-align: center; - color: #323337; - width: 32px; - height: 32px; - margin: 4px; - &.active { - background: linear-gradient(180deg, #508af7 0%, #5ea5f9 100%); - border-radius: 8px; - color: #fff; - } - } - img { - position: absolute; - width: 8px; - height: 3px; - margin: auto; - left: 0; - right: 0; - &.top { - top: 7px; + color: var(--guide-floorColor); + width: 58px; + line-height: 72px; + height: 72px; + &.current { + background: rgba(0, 0, 0, 0.1); + &::after { + position: absolute; + left: 0; + right: 0; + bottom: 0; + height: 20px; + display: flex; + content: "您在本层"; + background: var(--guide-currentBg); + font-weight: 700; + font-size: 8px; + color: var(--guide-currentColor); + align-items: center; + justify-content: center; + } } - &.bottom { - bottom: 7px; - transform-origin: center; - transform: rotate(180deg); + &.active { + background: var(--guide-floorActiveBg); + color: var(--guide-floorActiveColor); } } } diff --git a/src/components/HeadBar/HeadBar.js b/src/components/HeadBar/HeadBar.js deleted file mode 100644 index a873ffd..0000000 --- a/src/components/HeadBar/HeadBar.js +++ /dev/null @@ -1,184 +0,0 @@ -import React, { useState, useEffect } from "react"; -import ShopList from "../ShopList/ShopList.js"; -import "./HeadBar.scss"; -import { searchTypes } from "../Options/Options"; -import backpng from './back.png' - -const HeadBar = ({ - mall, - exit, - start, - end, - floors, - onSwap, - shop, - onSetStart, - onSetEnd, - isPick, - setIsPick, - blurMap, - showSearchType, - onClickSearchType, - searchType, - onIsTypingChange -}) => { - const [isTypingStart, setIsTypingStart] = useState(false); - const [isTypingEnd, setIsTypingEnd] = useState(false); - const isTyping = isTypingStart || isTypingEnd; - const [q, setQ] = useState(null); - const onlyShowStart = isTypingStart || (!start && isPick); - const onlyShowEnd = isTypingEnd || (!end && isPick); - const showStart = !onlyShowEnd; - const showEnd = !onlyShowStart; - const showBoth = !(isPick || isTyping); - const hasBoth = start && end; - const startValue = - q !== null ? q : isPick ? (shop ? shop.name : "") : start ? start.name : ""; - const endValue = - q !== null ? q : isPick ? (shop ? shop.name : "") : end ? end.name : ""; - - useEffect(() => { onIsTypingChange(isTyping) }, [isTyping]) - return ( -
blurMap()} - > -
{ - if (isPick) setIsPick(false); - else if (isTypingStart) { - setQ(null); - setIsTypingStart(false); - } else if (isTypingEnd) { - setQ(null); - setIsTypingEnd(false); - } else exit(); - }} - > - -
-
- {showBoth &&
} - {showStart && ( -
-
- setIsTypingStart(true)} - onChange={(e) => setQ(e.target.value)} - readOnly={isPick} - disabled={isPick} - placeholder={isPick ? "请点击地图选择起点" : "请输入起点"} - > - {(start || (isPick && shop)) && ( - - {floors[(start ? start : shop).floorOrder][1]} - - )} -
- {start === null && isPick && ( -
{ - setIsPick(false); - onSetStart(shop); - }} - > - 开始导航 -
- )} - {start === null && !isPick && !isTypingStart && ( -
{ - setQ(null); - setIsPick(true); - setIsTypingStart(false); - setIsTypingEnd(false); - }} - > - 地图选点 -
- )} -
-
- )} - {showEnd && ( -
-
- setIsTypingEnd(true)} - onChange={(e) => setQ(e.target.value)} - readOnly={isPick} - disabled={isPick} - placeholder={isPick ? "请点击地图选择终点" : "请输入终点"} - > - {((isPick && shop) || end) && ( - - {floors[(end ? end : shop).floorOrder][1]} - - )} -
- {end === null && isPick && ( -
{ - setIsPick(false); - onSetEnd(shop); - }} - > - 开始导航 -
- )} - {end === null && !isPick && !isTypingEnd && ( -
{ - setQ(null); - setIsPick(true); - setIsTypingEnd(false); - }} - > - 地图选点 -
- )} -
-
- )} - - {showBoth &&
onSwap()}>
} -
- {showBoth && !hasBoth && ( -
- 请在顶部选择{!start ? "起" : "终"}点 -
- )} - {isTyping && q && ( -
- { - if (isTypingStart) { - onSetStart(shop); - setQ(null); - setIsTypingStart(false); - } - if (isTypingEnd) { - onSetEnd(shop); - setQ(null); - setIsTypingEnd(false); - } - }} - top={"70px"} - isRow={true} - > -
- )} -
- ); -}; - -export default HeadBar; diff --git a/src/components/HeadBar/HeadBar.scss b/src/components/HeadBar/HeadBar.scss deleted file mode 100644 index 420bdd9..0000000 --- a/src/components/HeadBar/HeadBar.scss +++ /dev/null @@ -1,271 +0,0 @@ -.head-bar { - display: flex; - box-sizing: border-box; - width: calc(100vw - 20px); - margin-left: 10px; - margin-top: 10px; - font-size: 16px; - line-height: 44px; - position: relative; - z-index: 1; - height: 64px; - position: relative; - border-radius: 12px; - align-items: center; - pointer-events: auto; - &.double { - height: 114px; - .back { - height: 114px; - } - .content { - height: 114px; - } - } - - .back { - display: flex; - justify-content: center; - align-items: center; - position: relative; - background: #ffffff; - flex: 0 0 50px; - margin-right: 8px; - height: 64px; - border-radius: 12px; - img { - width: 32px; - height: 32px; - } - } - .content { - display: flex; - flex-direction: column; - justify-content: center; - background: #ffffff; - height: 64px; - z-index: 2; - flex: 1; - position: relative; - border-radius: 12px; - .dots { - position: absolute; - top: 0; - bottom: 0; - left: 23px; - width: 2px; - height: 2px; - border-radius: 50%; - background: #c9cbd1; - margin: auto 0; - &::before { - content: ""; - display: block; - position: absolute; - top: -6px; - width: 2px; - height: 2px; - border-radius: 50%; - background: #c9cbd1; - left: 0; - right: 0; - margin: 0 auto; - } - &::after { - content: ""; - display: block; - position: absolute; - bottom: -6px; - width: 2px; - height: 2px; - border-radius: 50%; - background: #c9cbd1; - left: 0; - right: 0; - margin: 0 auto; - } - } - .row { - position: relative; - line-height: 57px; - height: 57px; - padding-left: 48px; - padding-right: 49px; - &.start { - background: 16px center/16px 16px no-repeat url("./start.png"); - } - &.end { - background: 16px center/16px 16px no-repeat url("./end.png"); - } - &.single { - padding-right: 10px; - } - .text { - display: flex; - align-items: center; - input { - border: none; - background: transparent; - display: inline-block; - line-height: 57px; - outline: none; - width: 100%; - font-family: PingFang SC; - font-style: normal; - font-weight: 600; - font-size: 18px; - color: #323337; - } - ::placeholder { - font-size: 16px; - font-weight: 400; - color: #c9cbd1; - } - &.has-border { - border-top: 1px solid rgba(238, 238, 238, 0.7); - } - - .label { - display: inline-block; - flex: 0 0 30px; - text-align: right; - margin-left: 8px; - font-style: normal; - font-weight: bold; - font-size: 12px; - color: #b3aea7; - } - .right { - background: #f3f4f8; - border: 1px solid #edeff3; - box-sizing: border-box; - border-radius: 8px; - font-family: PingFang SC; - font-style: normal; - font-weight: 600; - font-size: 12px; - line-height: 33px; - color: #437af7; - flex: 0 0 80px; - text-align: center; - display: inline-block; - white-space: nowrap; - margin-left: 8px; - } - } - } - .switch { - position: absolute; - width: 49px; - height: 32px; - background-image: url("./switch.png"); - background-size: contain; - background-repeat: no-repeat; - background-position: center; - top: 0; - bottom: 0; - right: 0; - margin: auto 0; - } - } - .banner { - position: absolute; - display: flex; - background: rgba(0, 0, 0, 0.6); - width: 237px; - line-height: 40px; - height: 40px; - text-align: center; - bottom: -48px; - left: 0; - right: 0; - margin: auto; - font-family: PingFang SC; - font-style: normal; - font-weight: normal; - font-size: 14px; - color: #ffffff; - border-radius: 20px; - justify-content: center; - align-items: center; - &.start::before { - content: ""; - display: inline-block; - width: 16px; - height: 16px; - margin-right: 8px; - vertical-align: middle; - background-image: url("./start.png"); - background-size: contain; - } - &.end::before { - content: ""; - display: inline-block; - width: 16px; - height: 16px; - margin-right: 8px; - vertical-align: middle; - background-image: url("./end.png"); - background-size: contain; - } - &::after { - content: ""; - display: inline-block; - margin-left: 8px; - width: 16px; - height: 16px; - vertical-align: middle; - background-image: url("./arrow.png"); - background-size: contain; - } - } - .shop-list-wrapper { - position: absolute; - top: 64px; - left: -10px; - width: 100vw; - height: calc(100vh - 74px); - overflow-x: hidden; - overflow-y: auto; - } - .search-type { - position: absolute; - top: 100px; - width: 100vw; - height: 40px; - line-height: 40px; - background: #fff; - display: flex; - color: #404040; - left: 0; - font-size: 12px; - .el { - flex: 1 1 33%; - text-align: center; - span { - position: relative; - display: inline-block; - img { - width: 18px; - height: 18px; - vertical-align: middle; - margin-right: 8px; - } - &.active { - color: #0074ed; - } - &.active { - &::after { - content: ""; - position: absolute; - width: 100%; - height: 4px; - background: #0074ed; - bottom: 0; - left: 0; - } - } - } - } - } -} diff --git a/src/components/HeadBar/arrow.png b/src/components/HeadBar/arrow.png deleted file mode 100644 index 9ec8fc5..0000000 Binary files a/src/components/HeadBar/arrow.png and /dev/null differ diff --git a/src/components/HeadBar/back.png b/src/components/HeadBar/back.png deleted file mode 100644 index d521a25..0000000 Binary files a/src/components/HeadBar/back.png and /dev/null differ diff --git a/src/components/HeadBar/end.png b/src/components/HeadBar/end.png deleted file mode 100644 index 42c39c4..0000000 Binary files a/src/components/HeadBar/end.png and /dev/null differ diff --git a/src/components/HeadBar/start.png b/src/components/HeadBar/start.png deleted file mode 100644 index 3245896..0000000 Binary files a/src/components/HeadBar/start.png and /dev/null differ diff --git a/src/components/HeadBar/switch.png b/src/components/HeadBar/switch.png deleted file mode 100644 index a016373..0000000 Binary files a/src/components/HeadBar/switch.png and /dev/null differ diff --git a/src/components/Malls/Malls.js b/src/components/Malls/Malls.js deleted file mode 100644 index bf13189..0000000 --- a/src/components/Malls/Malls.js +++ /dev/null @@ -1,260 +0,0 @@ -import React, { useState, useEffect, useContext } from "react"; -import { ListView } from "antd-mobile"; -import Modal from "react-modal"; -import "./Malls.scss"; -import search from "./search.png"; -import pos from "./pos.png"; -import close_white from "./close_white.png"; -import up from "./up.png"; -import { - Mall, - cityMallsGetter, - CityMall, -} from "../../js/helpers/data-helper.js"; -import { MallCode } from "../../pages/Index/Index"; - -const getSectionData = (dataBlob, sectionID) => dataBlob[sectionID]; -const getRowData = (dataBlob, sectionID, rowID) => dataBlob[rowID]; - -function genData(ds, cityMalls) { - const dataBlob = {}; - const sectionIDs = []; - const rowIDs = []; - const groupByIndex = (list) => - list.reduce((acc, nxt) => { - acc[nxt.index] = acc[nxt.index] ? [...acc[nxt.index], nxt] : [nxt]; - return acc; - }, {}); - const data = groupByIndex(cityMalls); - Object.keys(data).forEach((item, index) => { - sectionIDs.push(item); - dataBlob[item] = item; - rowIDs[index] = []; - - data[item].forEach((city) => { - rowIDs[index].push(city.name); - dataBlob[city.name] = city; - }); - }); - return ds.cloneWithRowsAndSections(dataBlob, sectionIDs, rowIDs); -} - -const Malls = ({ isOpen, onRequestClose, setMallCode }) => { - const [q, setQ] = useState(""); - const [showList, setShowList] = useState(false); - const [cities, setCities] = useState([]); - const [currentMall, setCurrentMall] = useState(null); - const [currentCity, setCurrentCity] = useState(null); - const [currentMalls, setCurrentMalls] = useState([]); - const [isMallExpand, setIsMallExpand] = useState(false); - const [dataSource, setDataSource] = useState( - new ListView.DataSource({ - getRowData, - getSectionHeaderData: getSectionData, - rowHasChanged: (row1, row2) => row1 !== row2, - sectionHeaderHasChanged: (s1, s2) => s1 !== s2, - }) - ); - const mallCode = useContext(MallCode); - const setDefaultCityMall = (list) => { - setCurrentCity(list[0]); - setCurrentMall(list[0].malls[0]); - setCurrentMalls(list[0].malls); - }; - - useEffect(() => { - document.title = "城市商场选择"; - cityMallsGetter().then((cityMalls) => { - setCities(cityMalls); - setDataSource(genData(dataSource, cityMalls)); - - if (cityMalls.length) { - const city = cityMalls.find(({ malls }) => - malls.find(({ code }) => mallCode === code) - ); - if (city) { - setCurrentCity(city); - const mall = city.malls.find(({ code }) => mallCode === code); - if (mall) setCurrentMall(mall); - setCurrentMalls(city.malls); - } else setDefaultCityMall(cityMalls); - } - }); - }, [mallCode]); - - return ( - onRequestClose()} - > -
setIsMallExpand(false)}> -
- setQ(e.target.value)} - onFocus={() => setShowList(true)} - onBlur={() => !q && setShowList(false)} - > -
- - {q && ( - setQ("")} /> - )} - {showList && ( -
- {cities - .filter(({ name }) => name.includes(q)) - .map((city) => ( -
{ - setCurrentCity(city); - setCurrentMall(city.malls[0]); - setCurrentMalls(city.malls); - setShowList(false); - }} - > - {city.name} -
- ))} -
- )} - {!showList && ( -
-
-
- - {currentCity && {currentCity.name}} -    - {currentMall && {currentMall.name}} - -
- 当前定位城市 -
-
切换商场
-
{ - setIsMallExpand(false); - }} - > -
{ - e.stopPropagation(); - }} - > - {currentMalls.map((mall) => ( - { - console.log("setMallCode", mall.code); - setCurrentMall(mall); - setIsMallExpand(false); - setMallCode(mall.code); - onRequestClose(); - // Taro.reLaunch({ - // url: `/pages/index/index?mallId=${mall.id}` - // }); - }} - > - {mall.name} - - ))} - {!isMallExpand && ( -
{ - e.stopPropagation(); - setIsMallExpand(true); - }} - > - 更多 -
- )} - {isMallExpand && ( - { - e.stopPropagation(); - setIsMallExpand(false); - }} - > - )} -
- ( -
-
- {sectionData} -
-
- )} - renderHeader={() => ( -
-
切换城市
-
- {cities.map((city) => ( -
{ - setCurrentCity(city); - setCurrentMall(city.malls[0]); - setCurrentMalls(city.malls); - }} - > - {city.name} -
- ))} -
-
- )} - renderRow={(rowData) => ( -
{ - setCurrentCity(rowData); - setCurrentMalls(rowData.malls); - setCurrentMall(rowData.malls[0]); - }} - > - {rowData.name} -
- )} - quickSearchBarStyle={{ - position: "absolute", - top: 25, - }} - delayTime={10} - delayActivityIndicator={ -
- rendering... -
- } - /> -
-
- )} -
-
- ); -}; -export default Malls; diff --git a/src/components/Malls/Malls.scss b/src/components/Malls/Malls.scss deleted file mode 100644 index a42f0d0..0000000 --- a/src/components/Malls/Malls.scss +++ /dev/null @@ -1,242 +0,0 @@ -/*postcss-pxtransform disable*/ -.malls { - position: relative; - width: 100vw; - height: 100vh; - box-sizing: border-box; - color: #5a5a5a; - font-family: SourceHanSansCN-Medium, SourceHanSansCN; - background: #fff; - box-sizing: border-box; - .search-icon { - position: absolute; - width: 13px; - height: 13px; - top: 21px; - left: 26px; - z-index: 1; - } - .close { - position: absolute; - border-radius: 50%; - background: #8d8d8d; - width: 20px; - height: 20px; - top: 17px; - right: 19px; - } - .input-wrapper { - padding: 12px 14px 0 14px; - .input { - padding: 5px 30px; - background: #ececec; - border-radius: 100px; - height: 30px; - line-height: 20px; - font-size: 11px; - box-sizing: border-box; - border: none; - width: 100%; - outline: none; - } - ::placeholder { - color: #a9a9a9; - } - } - .list { - padding: 0 50px 0 15px; - line-height: 36px; - height: calc(100vh - 42px); - font-size: 12px; - overflow: scroll; - .item { - border-bottom: 1px solid #f4f4f4; - } - } - .main { - .r1 { - padding: 18px 15px; - line-height: 30px; - .left { - position: relative; - display: inline-block; - font-size: 14px; - background: rgba(244, 244, 244, 1); - border-radius: 8px; - border: 1px solid rgba(236, 236, 236, 1); - padding: 0 30px; - .pos { - position: absolute; - width: 14px; - height: 16px; - top: 7px; - left: 9px; - } - .up { - position: absolute; - right: 7.5px; - top: 12.5px; - width: 8px; - height: 5px; - transform-origin: center; - transform: rotate(90deg); - } - - Text + Text { - margin-left: 22px; - } - } - .right { - margin-left: 15px; - font-size: 11px; - font-weight: 400; - color: rgba(169, 169, 169, 1); - } - } - .r2 { - padding-left: 15px; - color: #a9a9a9; - font-size: 11px; - line-height: 11px; - font-weight: 400; - } - .malls-wrapper { - height: calc(100vh - 119px); - .malls1 { - position: relative; - margin-top: 11px; - padding-left: 15px; - padding-right: 60px; - height: 32px; - overflow: hidden; - background: #fff; - z-index: 10; - .more { - position: absolute; - line-height: 30px; - color: #a9a9a9; - right: 14px; - font-size: 11px; - top: 0; - } - &.expand { - box-shadow: 0px 15px 12px 0px rgba(0, 0, 0, 0.22); - padding-right: 15px; - padding-bottom: 17px; - overflow: auto; - height: auto; - } - .tag { - color: #878787; - font-size: 12px; - padding: 0 11px; - border-radius: 15px; - border: 1px solid rgba(236, 236, 236, 1); - line-height: 30px; - display: inline-block; - margin-bottom: 12px; - margin-right: 10px; - } - .fold { - position: absolute; - bottom: 0; - width: 8px; - height: 5px; - padding: 8px 6.5px; - left: 0; - right: 0; - margin: auto; - } - .fold::after { - content: ""; - position: absolute; - left: -5px; - right: -5px; - top: -5px; - bottom: -5px; - } - } - } - .am-indexed-list-container { - position: absolute; - top: 178px; - border-top: 1px solid #f4f4f4; - padding: 0 50px 0 15px; - height: calc(100vh - 178px); - width: 100vw; - box-sizing: border-box; - .am-indexed-list-quick-search-bar :first-child { - display: none !important; - } - .am-indexed-list-quick-search-bar { - top: 204px; - font-size: 11px; - transform: none; - right: 15px; - z-index: 1; - text-align: center; - li { - display: block; - padding: 0; - font-size: 11px; - color: #a9a9a9; - line-height: 15px; - height: 15px; - width: 15px; - } - li:active { - background: #0091ff; - - color: white; - border-radius: 50%; - } - } - .at-list::after { - content: none; - } - .am-indexed-list-section-body { - line-height: 36px; - color: #878787; - font-size: 12px; - font-weight: 400; - border-bottom: 1px solid #f4f4f4; - background: none; - padding: 0; - } - .am-indexed-list-section-header { - font-size: 12px; - font-weight: 400; - border-bottom: 1px solid #f4f4f4; - padding: 0; - } - .am-list-body { - color: #5a5a5a; - line-height: 36px; - } - } - .meta { - font-size: 11px; - font-weight: 400; - margin-top: 7px; - padding: 11px 0; - color: #a9a9a9; - } - .city-buttons { - display: grid; - grid-column-gap: 10px; - grid-row-gap: 11px; - grid-auto-rows: 30px; - grid-auto-columns: 70px; - grid-template-columns: 1fr 1fr 1fr 1fr; - .city-button { - display: inline-block; - color: #878787; - font-size: 12px; - line-height: 30px; - background: rgba(244, 244, 244, 1); - border-radius: 4px; - text-align: center; - } - } - } -} diff --git a/src/components/Malls/close_white.png b/src/components/Malls/close_white.png deleted file mode 100644 index ff30535..0000000 Binary files a/src/components/Malls/close_white.png and /dev/null differ diff --git a/src/components/Malls/pos.png b/src/components/Malls/pos.png deleted file mode 100644 index c28ff59..0000000 Binary files a/src/components/Malls/pos.png and /dev/null differ diff --git a/src/components/Malls/search.png b/src/components/Malls/search.png deleted file mode 100644 index 0980552..0000000 Binary files a/src/components/Malls/search.png and /dev/null differ diff --git a/src/components/Malls/up.png b/src/components/Malls/up.png deleted file mode 100644 index a10e018..0000000 Binary files a/src/components/Malls/up.png and /dev/null differ diff --git a/src/components/More/2d.png b/src/components/More/2d.png deleted file mode 100644 index 6ca3875..0000000 Binary files a/src/components/More/2d.png and /dev/null differ diff --git a/src/components/More/3d.png b/src/components/More/3d.png deleted file mode 100644 index 2c761d9..0000000 Binary files a/src/components/More/3d.png and /dev/null differ diff --git a/src/components/More/More.js b/src/components/More/More.js deleted file mode 100644 index e336aae..0000000 --- a/src/components/More/More.js +++ /dev/null @@ -1,53 +0,0 @@ -import React from "react"; -import { searchTypes, audioOptions } from "../Options/Options"; -import "./More.scss"; -import flat from "./2d.png"; -import thrD from "./3d.png"; - -const displayModes = [ - { - id: 0, - name: "2D", - bg: flat, - }, - { - id: 1, - name: "3D", - bg: thrD, - }, -]; -const More = ({ - showHeadBar, - displayMode, - searchType, - onClickDisplayMode, - onClickSearchType, -}) => { - return ( -
-
- {searchTypes.map(({ id, name, bg, bgb }) => ( -
{ - onClickSearchType(id); - }} - > - -
{name}
-
- ))} -
- -
onClickDisplayMode(displayMode == 0 ? 1 : 0)} - > - - {displayMode == 0 ? "2D" : "3D"} -
-
- ); -}; -export default More; diff --git a/src/components/More/More.scss b/src/components/More/More.scss deleted file mode 100644 index c9bf7a1..0000000 --- a/src/components/More/More.scss +++ /dev/null @@ -1,53 +0,0 @@ -.more { - position: absolute; - top: 10px; - right: 10px; - display: inline-flex; - flex-direction: column; - pointer-events: auto; - &.has-header-top { - top: 138px; - } - .types { - display: flex; - flex-direction: column; - width: 40px; - height: 160px; - background: #ffffff; - box-shadow: 0px 8px 8px rgba(104, 110, 127, 0.04); - border-radius: 12px; - justify-content: space-evenly; - align-items: center; - } - .btn { - display: inline-flex; - flex-direction: column; - width: 32px; - height: 48px; - font-family: PingFang SC; - font-style: normal; - font-weight: 500; - font-size: 10px; - line-height: 14px; - text-align: center; - color: #474a56; - background: #ffffff; - border-radius: 12px; - justify-content: center; - align-items: center; - img { - width: 24px; - height: 24px; - } - &.active { - background: linear-gradient(180deg, #508af7 0%, #5ea5f9 100%); - color: #fff; - } - &.big { - width: 40px; - height: 56px; - margin-top: 8px; - box-shadow: 0px 8px 8px rgba(104, 110, 127, 0.04); - } - } -} diff --git a/src/components/NavBottom/NavBottom.js b/src/components/NavBottom/NavBottom.js index c16ec4a..163e927 100644 --- a/src/components/NavBottom/NavBottom.js +++ b/src/components/NavBottom/NavBottom.js @@ -36,33 +36,13 @@ const getImgByRouteSearchText = (txt) => : straight; const NavBottom = ({ - routeSearchAnimationType, - switchType, onExit, end, meters, minutes, - paused, - puaseOrResume, - hidePause, - hideSwitch, routeSearchText, percent, - handleAR, }) => { - const [showText, setShowText] = useState(false); - const [showNav, setShowNav] = useState(true); - useEffect(() => { - setShowText(true); - let timeout = setTimeout(() => { - clearTimeout(timeout); - setShowText(false); - }, 3000); - return () => { - clearTimeout(timeout); - setShowText(false); - }; - }, [routeSearchAnimationType]); let progressNum = parseInt(percent * 100); if (isNaN(progressNum)) return; if (progressNum < 0) progressNum = 0; @@ -70,100 +50,47 @@ const NavBottom = ({ const progressText = progressNum + "%"; return ( -
-
-
setShowNav(true)} - > - - 导航 +
+
+ {routeSearchText} +
{routeSearchText}
+
+ 剩余{meters}米  {" "} + {minutes}分钟
+
setShowNav(false)} + className="bar" + style={{ + width: `calc((100vw - 52px) * ${progressNum / 100} + 16px)`, + }} + >
+ +
- - 目的地 + {progressText}
- {showText && !hideSwitch && ( -
- {routeSearchAnimationType === 1 - ? "已切转地图视角" - : "已切转方向标视角"} -
- )} - {!hideSwitch && ( - { - switchType(); - }} - /> - )} - {showNav ? ( -
- {routeSearchText} -
{routeSearchText}
-
- 剩余{meters}米  {" "} - {minutes}分钟 -
- 关闭 onExit()} - > -
-
-
- {progressText} -
- {!hidePause && ( - { - puaseOrResume(); - }} - /> - )} -
- ) : ( -
- {end.logoPath && } - 关闭 onExit()} - > -
{end.name}
-
-
{end.floorName}
{end.shopFormat}
-
-
- )} +
+ {end.logoPath && } + 关闭 onExit()} + > +
正在导航到...
+
{end.name}
+
); }; diff --git a/src/components/NavBottom/NavBottom.scss b/src/components/NavBottom/NavBottom.scss index 6dfe511..ac4a16c 100644 --- a/src/components/NavBottom/NavBottom.scss +++ b/src/components/NavBottom/NavBottom.scss @@ -1,55 +1,16 @@ .nav-bottom { position: absolute; width: calc(100vw - 20px); - left: 8px; - bottom: 26px; + left: 10px; + bottom: 22px; + height: 220px; + background: #ffffff; + box-shadow: 0px 15px 24px rgba(0, 0, 0, 0.05); border-radius: 18px; - height: 200px; - padding: 14px 0 0 14px; - background: #fff; z-index: 30; - .tabs { - position: absolute; - display: flex; - justify-content: center; - align-items: center; - bottom: 14px; - left: 14px; - right: 14px; - height: 56px; - background: #f3f4f8; - border-radius: 10px; - .tab { - display: flex; - width: calc((100vw - 20px - 28px - 12px) / 2); - height: 48px; - font-family: PingFang SC; - font-style: normal; - font-weight: 500; - font-size: 16px; - line-height: 22px; - color: #323337; - justify-content: center; - align-items: center; - img { - width: 20px; - height: 20px; - margin-right: 8px; - } - &.active { - background: linear-gradient(180deg, #508af7 0%, #5ea5f9 100%); - box-shadow: 0px 6px 12px rgba(93, 172, 249, 0.2); - border-radius: 10px; - color: #fff; - } - } - } .nav { - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 82px; + position: relative; + height: 110px; .dir { position: absolute; top: 14px; @@ -91,40 +52,23 @@ margin: 0 4px; } } - .exit { - position: absolute; - top: 20px; - right: 12px; - width: 48px; - height: 48px; - text-align: center; - border: 1px solid #e2e1df; - box-sizing: border-box; - border-radius: 12px; - font-style: normal; - font-weight: normal; - font-size: 14px; - line-height: 48px; - color: #6a6665; - } + .progress { position: absolute; - left: 20px; - right: 20px; - top: 108px; - height: 4px; - background: #edeff3; - border-radius: 5px; + left: 0; + right: 0; + bottom: -1px; + height: 2px; + background: rgba(0, 0, 0, 0.05); z-index: 1; } .bar { position: absolute; - left: 20px; - right: 20px; - top: 108px; + left: 0; + right: 0; + bottom: -2px; height: 4px; - background: #437af7; - border-radius: 5px; + background: #516dd8; z-index: 2; } @@ -132,21 +76,19 @@ display: flex; position: absolute; z-index: 3; - width: 33px; - height: 14px; - top: 103.5px; - background: #ffffff; + width: 32px; + height: 15px; + bottom: -7.5px; + background: linear-gradient(113.71deg, #435acd 0%, #749cf3 100%); text-align: center; - border: 2px solid #437af7; border-radius: 12px; font-family: DINPro; font-style: normal; font-weight: bold; font-size: 10px; - color: #437af7; + color: #fff; justify-content: center; align-items: center; - transform: translate(-50%, 0); } .close-icon { @@ -199,11 +141,8 @@ } } .destination { - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 82px; + position: relative; + height: 110px; .avatar { position: absolute; width: 80px; @@ -217,15 +156,15 @@ .close-icon { position: absolute; - top: 16px; - right: 16px; - width: 24px; - height: 24px; + top: 14px; + right: 14px; + width: 52px; + height: 82px; z-index: 10; } .name { position: absolute; - top: 24px; + top: 57px; left: 108px; font-family: PingFang SC; font-style: normal; @@ -233,7 +172,7 @@ font-size: 24px; line-height: 34px; color: #323337; - right: 20px; + right: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; @@ -241,95 +180,12 @@ .meta { display: flex; position: absolute; - top: 68px; + top: 29px; left: 108px; - right: 20px; - font-family: PingFang SC; - font-style: normal; - font-weight: 500; + font-weight: 600; font-size: 14px; line-height: 20px; - color: #a1a5b3; - align-items: center; - justify-content: space-between; + color: rgba(0, 0, 0, 0.4); } } - .switch { - position: absolute; - top: -52px; - right: 0; - height: 40px; - line-height: 40px; - color: #fff; - border-radius: 85px; - font-size: 12px; - font-family: SourceHanSansCN-Regular, SourceHanSansCN; - font-weight: 400; - background: rgba(0, 0, 0, 0.2); - padding-left: 12px; - padding-right: 42px; - animation: 3s ease-out fadeout; - @keyframes fadeout { - from { - opacity: 1; - } - to { - opacity: 0; - } - } - } - .switch-pic { - position: absolute; - top: -52px; - right: 0; - width: 40px; - height: 40px; - vertical-align: middle; - box-shadow: 0px 8px 8px rgba(104, 110, 127, 0.04); - } - .ar-btn { - display: flex; - flex-direction: row; - justify-content: center; - align-items: center; - position: absolute; - width: 111px; - height: 40px; - left: 0; - top: -52px; - background: #ffffff; - border-radius: 20px; - font-family: PingFang SC; - font-style: normal; - font-weight: 600; - font-size: 16px; - line-height: 40px; - color: #474a56; - img { - width: 24px; - height: 24px; - margin-right: 8px; - } - } - .br { - margin-bottom: 8px; - } - .gold { - font-weight: 400; - color: #b48764; - } - .big { - font-size: 20px; - font-family: DINPro-Bold, DINPro; - font-weight: bold; - margin: 0 5px; - } - .pause { - position: absolute; - width: 40px; - height: 40px; - top: -100px; - right: 0; - box-shadow: 0px 8px 8px rgba(104, 110, 127, 0.04); - } } diff --git a/src/components/NavBottom/close.png b/src/components/NavBottom/close.png index 47bcaaf..475f0c0 100644 Binary files a/src/components/NavBottom/close.png and b/src/components/NavBottom/close.png differ diff --git a/src/components/Options/2d.png b/src/components/Options/2d.png deleted file mode 100644 index a9e9f48..0000000 Binary files a/src/components/Options/2d.png and /dev/null differ diff --git a/src/components/Options/3d.png b/src/components/Options/3d.png deleted file mode 100644 index 271cd17..0000000 Binary files a/src/components/Options/3d.png and /dev/null differ diff --git a/src/components/Options/Options.js b/src/components/Options/Options.js deleted file mode 100644 index cc6be86..0000000 --- a/src/components/Options/Options.js +++ /dev/null @@ -1,137 +0,0 @@ -import React from "react"; -import Modal from "react-modal"; -import flat from "./2d.png"; -import thrD from "./3d.png"; -import on from "./on.png"; -import mute from "./mute.png"; -import ft from "./ft.png"; -import ftb from "./ftb.png"; -import ztb from "./ztb.png"; -import zt from "./zt.png"; -import shortest from "./shortest.png"; -import shortestb from "./shortestb.png"; -import ft1 from "./ft1.png"; -import ftb1 from "./ftb1.png"; -import ztb1 from "./ztb1.png"; -import zt1 from "./zt1.png"; -import shortest1 from "./shortest1.png"; -import shortestb1 from "./shortestb1.png"; -import "antd-mobile/lib/switch/style/css"; -import "./Options.scss"; - -export const displayModes = [ - { - id: 0, - name: "2D", - bg: flat, - }, - { - id: 1, - name: "3D", - bg: thrD, - }, -]; -export const searchTypes = [ - { - id: 0, - name: "最佳", - bg: shortest, - bgb: shortestb, - bg1: shortest1, - bgb1: shortestb1, - }, - { - id: 1, - name: "扶梯", - bg: ft, - bgb: ftb, - bg1: ft1, - bgb1: ftb1, - }, - { - id: 2, - name: "直梯", - bg: zt, - bgb: ztb, - bg1: zt1, - bgb1: ztb1, - }, -]; -export const audioOptions = [ - { - id: 0, - name: "语音", - bg: on, - }, - { - id: 1, - name: "语音", - bg: mute, - }, -]; - -const Options = ({ - show, - hide, - onClickDisplayMode, - onClickSearchType, - onClickPlayAudioMode, - showHeadBar, -}) => ( - hide()} - > -
- {displayModes.map(({ id, name, bg }) => ( -
{ - onClickDisplayMode(id); - hide(); - }} - > -
-
{name}
-
- ))} - -
-
-
- {searchTypes.map(({ id, name, bg }) => ( -
{ - onClickSearchType(id); - hide(); - }} - > -
-
{name}
-
- ))} -
-
-); -export default Options; diff --git a/src/components/Options/Options.scss b/src/components/Options/Options.scss deleted file mode 100644 index 7e656ec..0000000 --- a/src/components/Options/Options.scss +++ /dev/null @@ -1,106 +0,0 @@ -.modal { - position: absolute; - width: 168px; - height: 136px; - background: #ffffff; - border-radius: 8px; - box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.08); - outline: none; - right: 59px; - top: 12px; - overflow: hidden; - padding-top: 16px; - &.has-header-bar { - top: 112px; - } - .title { - background: #f4f4f4; - padding: 0 19px; - color: #878787; - font-family: SourceHanSansCN-Regular, SourceHanSansCN; - font-weight: 400; - line-height: 40px; - font-size: 11px; - } - .row { - display: flex; - flex: 1; - flex-direction: row; - margin-bottom: 18px; - .col { - flex: 1; - text-align: center; - .up { - width: 22px; - height: 22px; - margin: auto; - } - .down { - font-size: 12px; - font-family: SourceHanSansCN, SourceHanSansCN-Regular; - font-weight: 400; - text-align: center; - color: #696969; - line-height: 20px; - } - &.active { - .down { - color: #0074ed; - } - } - } - } - .bottom { - position: absolute; - bottom: 0; - width: 100%; - line-height: 52px; - padding: 0 20px; - background: #f4f4f4; - color: #404040; - font-size: 12px; - font-family: SourceHanSansCN-Regular, SourceHanSansCN; - font-weight: 400; - .am-switch { - position: absolute; - top: 16px; - right: 20px; - input[type="checkbox"]:checked + .checkbox:after { - transform: translateX(22px); - } - .checkbox { - width: 42px; - height: 20px; - border-radius: 20px; - &:before { - content: " "; - position: absolute; - left: 1.5px; - top: 1.5px; - width: 39px; - height: 17px; - border-radius: 17px; - box-sizing: border-box; - background: #fff; - z-index: 1; - transition: all 200ms; - transform: scale(1); - } - &:after { - content: " "; - height: 17px; - width: 17px; - border-radius: 17px; - background: #fff; - position: absolute; - z-index: 2; - left: 1.5px; - top: 1.5px; - transform: translateX(0); - transition: all 200ms; - box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.21); - } - } - } - } -} diff --git a/src/components/Options/ft.png b/src/components/Options/ft.png deleted file mode 100644 index 2f683c9..0000000 Binary files a/src/components/Options/ft.png and /dev/null differ diff --git a/src/components/Options/ft1.png b/src/components/Options/ft1.png deleted file mode 100644 index bd5fa36..0000000 Binary files a/src/components/Options/ft1.png and /dev/null differ diff --git a/src/components/Options/ftb.png b/src/components/Options/ftb.png deleted file mode 100644 index eade7d3..0000000 Binary files a/src/components/Options/ftb.png and /dev/null differ diff --git a/src/components/Options/ftb1.png b/src/components/Options/ftb1.png deleted file mode 100644 index 7110881..0000000 Binary files a/src/components/Options/ftb1.png and /dev/null differ diff --git a/src/components/Options/mute.png b/src/components/Options/mute.png deleted file mode 100644 index f50d910..0000000 Binary files a/src/components/Options/mute.png and /dev/null differ diff --git a/src/components/Options/on.png b/src/components/Options/on.png deleted file mode 100644 index 993edb6..0000000 Binary files a/src/components/Options/on.png and /dev/null differ diff --git a/src/components/Options/shortest.png b/src/components/Options/shortest.png deleted file mode 100644 index b628c9f..0000000 Binary files a/src/components/Options/shortest.png and /dev/null differ diff --git a/src/components/Options/shortest1.png b/src/components/Options/shortest1.png deleted file mode 100644 index 38c696d..0000000 Binary files a/src/components/Options/shortest1.png and /dev/null differ diff --git a/src/components/Options/shortestb.png b/src/components/Options/shortestb.png deleted file mode 100644 index 7b58d1f..0000000 Binary files a/src/components/Options/shortestb.png and /dev/null differ diff --git a/src/components/Options/shortestb1.png b/src/components/Options/shortestb1.png deleted file mode 100644 index 0698732..0000000 Binary files a/src/components/Options/shortestb1.png and /dev/null differ diff --git a/src/components/Options/zt.png b/src/components/Options/zt.png deleted file mode 100644 index 2cbf13a..0000000 Binary files a/src/components/Options/zt.png and /dev/null differ diff --git a/src/components/Options/zt1.png b/src/components/Options/zt1.png deleted file mode 100644 index 17be274..0000000 Binary files a/src/components/Options/zt1.png and /dev/null differ diff --git a/src/components/Options/ztb.png b/src/components/Options/ztb.png deleted file mode 100644 index 95d9154..0000000 Binary files a/src/components/Options/ztb.png and /dev/null differ diff --git a/src/components/Options/ztb1.png b/src/components/Options/ztb1.png deleted file mode 100644 index f786a63..0000000 Binary files a/src/components/Options/ztb1.png and /dev/null differ diff --git a/src/components/Popup/Popup.js b/src/components/Popup/Popup.js index b63f7a3..7b88487 100644 --- a/src/components/Popup/Popup.js +++ b/src/components/Popup/Popup.js @@ -1,64 +1,100 @@ -import React from "react"; -import desc from "./desc.png"; -import closeButton from "./close.png"; +import React, { useState, useEffect } from "react"; import "./Popup.scss"; -import navpng from "./nav.png"; -import arpng from "./ar.png"; -import couponTop from "./couponTop.png"; -const Popup = ({ - showPopup, - defaultPopup, - floors, - closePopup, - shop, - showDetail, - setEnd, - handleAR, - onClickCoupon, -}) => ( -
- {floors} - {defaultPopup} - {showPopup && ( -
- {shop.hasCoupon && ( - onClickCoupon(shop)} - > - )} - 关闭 closePopup()} - > -
- {shop.logoPath && ( -
- )} -
-
{shop.name}
-
- {shop.shopFormat ? shop.shopFormat : " "} - {shop.floorName} -
-
-
+import ShopList from "../ShopList/ShopList.js"; +const Popup = ({ mall, sceneIndex, onClick, floors, shop, onClickActive }) => { + const [long, setLong] = useState(false); + const [height, setHeight] = useState(false); + const [start, setStart] = useState(null); + const [doTransition, setdoTransition] = useState(false); + const baseHeight = long ? window.innerHeight : 312; + useEffect(() => { + setdoTransition(true); + setHeight(baseHeight); + setTimeout(() => { + setdoTransition(false); + }, 500); + }, [long]); + const handleTouchStart = (e) => { + if (start) return; + setStart({ + identifier: e.changedTouches[0].identifier, + y: e.changedTouches[0].clientY, + }); + }; + const handleTouchMove = (e) => { + if (!start) return; + const touch = Array.from(e.changedTouches).find( + ({ identifier }) => identifier === start.identifier + ); + if (!touch) return; + const delta = touch.clientY - start.y; + setHeight(baseHeight - delta); + }; + const handleTouchEnd = (e) => { + if (!start) return; + const touch = Array.from(e.changedTouches).find( + ({ identifier }) => identifier === start.identifier + ); + if (!touch) return; + setStart(null); + const delta = touch.clientY - start.y; + const nxtLong = + !long && delta < -100 ? true : long && delta > 100 ? false : long; -
-
setEnd()}> - 导航动画 -
-
+ if (long === nxtLong) { + setdoTransition(true); + setHeight(baseHeight); + setTimeout(() => { + setdoTransition(false); + }, 500); + } else setLong(nxtLong); + }; + + useEffect(() => { + if (shop) { + if (long) { + setLong(false); + setTimeout(() => { + const domEl = document.getElementById("shop" + shop.houseNum); + if (domEl) + domEl.scrollIntoView({ behavior: "smooth", block: "center" }); + }, 500); + } else { + const domEl = document.getElementById("shop" + shop.houseNum); + if (domEl) + domEl.scrollIntoView({ behavior: "smooth", block: "center" }); + } + } + }, [shop]); + return ( +
+ {floors} +
+
- )} -
-); +
+ ); +}; export default Popup; diff --git a/src/components/Popup/Popup.scss b/src/components/Popup/Popup.scss index 3253f05..a6588c5 100644 --- a/src/components/Popup/Popup.scss +++ b/src/components/Popup/Popup.scss @@ -3,196 +3,27 @@ width: 100vw; left: 0; bottom: 0; + height: 312px; z-index: 10000; box-sizing: border-box; - &.noshow { - padding: 0; + display: flex; + flex-direction: column; + background: var(--global-background); + &::before { + content: ""; + position: absolute; + width: 36px; + height: 4px; + background: rgba(0, 0, 0, 0.2); + border-radius: 10px; + top: -10px; + left: 0; + right: 0; + margin: auto; } - .popup { - position: relative; - width: calc(100vw - 20px); - margin-left: 10px; - margin-bottom: 26px; - background: #ffffff; - box-shadow: 0px 12px 16px rgba(104, 110, 127, 0.08); - border-radius: 18px; - height: 200px; - background: #fff; - .couponTop { - position: absolute; - left: 0; - right: 0; - top: -40px; - z-index: -1; - width: 100%; - object-fit: contain; - } - .close-icon { - position: absolute; - top: 16px; - right: 16px; - width: 24px; - height: 24px; - z-index: 10; - } - .r1 { - display: flex; - width: 100%; - padding: 14px 20px 0 14px; - height: 110px; - .avatar { - width: 80px; - height: 80px; - background: #ffffff; - box-shadow: 0px 8px 16px rgba(104, 110, 127, 0.08); - border-radius: 6px; - margin-right: 22px; - background-size: 64px 64px; - background-position: center; - background-repeat: no-repeat; - } - .popupname { - font-family: PingFang SC; - font-style: normal; - font-weight: 600; - font-size: 24px; - line-height: 34px; - color: #323337; - margin-top: 10px; - margin-bottom: 10px; - width: calc(100vw - 187px); - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - - .popupdesc { - display: flex; - align-items: center; - justify-content: space-between; - font-family: PingFang SC; - font-style: normal; - font-weight: 500; - font-size: 14px; - line-height: 20px; - color: #a1a5b3; - } - } - - .tabs { - position: relative; - display: flex; - padding: 20px 14px; - padding-bottom: 0; - &::after { - content: ""; - position: absolute; - top: 0; - left: 20px; - right: 20px; - border-top: 1px dashed #edeff3; - } - .tab { - position: relative; - display: flex; - justify-content: center; - align-items: center; - flex: 1; - height: 56px; - background: linear-gradient(180deg, #508af7 0%, #5ea5f9 100%); - border-radius: 10px; - text-align: center; - font-family: PingFang SC; - font-style: normal; - font-weight: 600; - font-size: 16px; - line-height: 22px; - color: #ffffff; - img { - width: 20px; - height: 20px; - margin-right: 8px; - } - } - .tab + .tab { - margin-left: 14px; - } - } - - .meta { - line-height: 12px; - vertical-align: middle; - img { - width: 12px; - } - .title { - color: #7e7e7e; - font-size: 12px; - margin-left: 5px; - } - } - .detail { - color: #a9a9a9; - font-size: 12px; - line-height: 16px; - padding-right: 17px; - padding-bottom: 30px; - .title { - margin-bottom: 4px; - color: #7e7e7e; - font-size: 14px; - line-height: 14px; - } - .content { - max-height: 64px; - overflow: scroll; - } - } - - .navbtn { - position: absolute; - top: 46px; - right: 14px; - text-align: center; - &::before { - content: ""; - display: block; - position: absolute; - top: 9px; - left: 0; - right: 0; - margin: 0 auto; - width: 74px; - height: 30px; - background: linear-gradient( - 90deg, - rgba(46, 177, 255, 1) 0%, - rgba(61, 140, 255, 1) 100% - ); - border-radius: 17px; - opacity: 0.5; - filter: blur(4px); - z-index: -2; - } - &::after { - content: "去这里"; - display: block; - top: 0; - right: 0; - z-index: 2; - background: linear-gradient( - 90deg, - rgba(46, 177, 255, 1) 0%, - rgba(61, 140, 255, 1) 100% - ); - border-radius: 17px; - line-height: 34px; - padding: 0 18px; - font-size: 12px; - font-family: SourceHanSansCN-Medium, SourceHanSansCN; - font-weight: 500; - color: #fff; - } - } + .listWrapper { + flex: 1; + overflow-x: hidden; + overflow-y: auto; } } diff --git a/src/components/Popup/ar.png b/src/components/Popup/ar.png deleted file mode 100644 index 67fba04..0000000 Binary files a/src/components/Popup/ar.png and /dev/null differ diff --git a/src/components/Popup/close.png b/src/components/Popup/close.png deleted file mode 100644 index 47bcaaf..0000000 Binary files a/src/components/Popup/close.png and /dev/null differ diff --git a/src/components/Popup/couponTop.png b/src/components/Popup/couponTop.png deleted file mode 100644 index 81a8e5d..0000000 Binary files a/src/components/Popup/couponTop.png and /dev/null differ diff --git a/src/components/Popup/desc.png b/src/components/Popup/desc.png deleted file mode 100644 index 179b09c..0000000 Binary files a/src/components/Popup/desc.png and /dev/null differ diff --git a/src/components/Popup/nav.png b/src/components/Popup/nav.png deleted file mode 100644 index 2b93600..0000000 Binary files a/src/components/Popup/nav.png and /dev/null differ diff --git a/src/components/Shop/Shop.js b/src/components/Shop/Shop.js index 49cca2f..072f1ca 100644 --- a/src/components/Shop/Shop.js +++ b/src/components/Shop/Shop.js @@ -1,17 +1,21 @@ import React from "react"; import "./Shop.scss"; import { LazyLoadImage } from "react-lazy-load-image-component"; +import activeBg from "./active.png"; const Shop = ({ name, - floorName, shopFormat, + floor, hasBorderTop, onClick, logoPath, isRow, houseNum, + isActive, + onClickActive, }) => (
onClick()} className={ "shop" + @@ -19,19 +23,31 @@ const Shop = ({ (isRow ? " is-row" : "") } > + {isActive && !isRow && ( +
{ + e.stopPropagation(); + onClickActive(); + }} + > + +
{name}
+
+ )} {isRow ? ( <>
{name}
-
{shopFormat}
-
{houseNum}
+
+ {shopFormat}
+ {floor} +
+
) : ( <>
{name}
-
- {shopFormat} {floorName} -
)}
diff --git a/src/components/Shop/Shop.scss b/src/components/Shop/Shop.scss index 0951497..1868d89 100644 --- a/src/components/Shop/Shop.scss +++ b/src/components/Shop/Shop.scss @@ -1,91 +1,100 @@ /*postcss-pxtransform disable*/ .shop { + position: relative; font-size: 0; line-height: 0; overflow: hidden; + background: var(--brand-background); + border-radius: 6px; + .active { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: linear-gradient(99.5deg, #f0b92b 0%, #f9d556 100%); + .avatar { + display: block; + width: 100%; + height: calc((100vw - 55px) / 4); + padding: 8px; + background: #ffffff; + box-sizing: border-box; + border-radius: 4px; + } + .r1 { + color: rgba(0, 0, 0, 0.8); + } + } &.is-row { position: relative; - height: 66px; - background: #ffffff; + height: 80px; + background: rgba(255, 255, 255, 0.6); border-radius: 12px; + .rowRight { + position: absolute; + right: 12px; + top: 0; + bottom: 0; + margin: auto; + width: 56px; + height: 44px; + background: center / cover no-repeat url(./rowRight.png); + } .avatar { position: absolute; - width: 50px; - height: 50px; + width: 64px; + height: 64px; top: 8px; left: 8px; - border: 1px solid #e9d7ad; box-sizing: border-box; border-radius: 6px; - padding: 7px; } .name { position: absolute; - top: 10px; - left: 66px; - font-style: normal; - font-weight: bold; + top: 14px; + left: 92px; + font-weight: 600; font-size: 16px; line-height: 22px; - color: #333333; - } - .houseNum { - position: absolute; - left: 67px; - bottom: 13px; - font-style: normal; - font-weight: 500; - font-size: 10px; - line-height: 13px; - color: #b3aea7; + color: rgba(0, 0, 0, 0.8); } - .format { + .meta { + display: flex; position: absolute; - top: 11px; - right: 16px; - font-style: normal; - font-weight: bold; + top: 49px; + left: 92px; + font-weight: 600; font-size: 12px; line-height: 17px; - color: #b3aea7; + color: rgba(0, 0, 0, 0.4); + align-items: center; + .sep { + display: inline-block; + margin: 0 12px; + width: 1px; + height: 10px; + background: rgba(0, 0, 0, 0.1); + } } } .avatar { - width: calc((100vw - 96px - 18px - 10px - 11px) / 3); - height: calc((100vw - 96px - 18px - 10px - 11px) / 3); + display: block; + width: 100%; + height: calc((100vw - 55px) / 4); padding: 8px; background: #ffffff; box-sizing: border-box; - border-radius: 6px; + border-radius: 4px; } .r1 { - padding: 0 4px; - margin-top: 4px; - font-family: PingFang SC; - font-style: normal; - font-weight: 500; + font-weight: 600; font-size: 12px; - line-height: 17px; - color: #323337; + line-height: 25px; + padding: 0 6px; + color: var(--brand-color, rgba(0, 0, 0, 0.8)); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } - .r2 { - margin-top: 4px; - display: flex; - justify-content: space-between; - font-family: PingFang SC; - font-style: normal; - font-weight: 500; - font-size: 9px; - line-height: 13px; - color: #a1a5b3; - padding: 0 4px; - span { - font-weight: normal; - font-size: 10px; - color: #a1a5b3; - } - } } diff --git a/src/components/Shop/active.png b/src/components/Shop/active.png new file mode 100644 index 0000000..4352b4e Binary files /dev/null and b/src/components/Shop/active.png differ diff --git a/src/components/Shop/rowRight.png b/src/components/Shop/rowRight.png new file mode 100644 index 0000000..4a596b9 Binary files /dev/null and b/src/components/Shop/rowRight.png differ diff --git a/src/components/ShopList/ShopList.js b/src/components/ShopList/ShopList.js index 85a81c8..564cd99 100644 --- a/src/components/ShopList/ShopList.js +++ b/src/components/ShopList/ShopList.js @@ -1,4 +1,4 @@ -import React, { useState, useRef } from "react"; +import React, { useState, useRef, useEffect } from "react"; import Shop from "../Shop/Shop"; import "./ShopList.scss"; import InfiniteScroll from "react-infinite-scroller"; @@ -7,10 +7,11 @@ const ShopList = ({ mall, q, onClick, - top, isRow = false, format = null, floorOrder = null, + shop: activeShop, + onClickActive, }) => { const [index, setIndex] = useState(0); const shops = mall.shopInfo.reduce( @@ -52,7 +53,12 @@ const ShopList = ({ (format === null ? true : shopFormat === format) && (floorOrder === null ? true : floorOrder1 === floorOrder) ); + const formatMap = filteredShops.reduce((acc, nxt) => { + if (!acc[nxt.shopFormat]) return { ...acc, [nxt.shopFormat]: 1 }; + return { ...acc, [nxt.shopFormat]: acc[nxt.shopFormat] + 1 }; + }, {}); const listRef = useRef(null); + return (
{filteredShops.map((shop, i) => ( - onClick(shop)} - isRow={isRow} - > + <> + {(i === 0 || + filteredShops[i - 1].shopFormat !== shop.shopFormat) && + !isRow && ( +
+ {shop.shopFormat} + + /{formatMap[shop.shopFormat]}个 + +
+ )} + onClick(shop)} + isRow={isRow} + isActive={activeShop && shop.houseNum === activeShop.houseNum} + onClickActive={() => onClickActive(shop)} + > + ))}
END
diff --git a/src/components/ShopList/ShopList.scss b/src/components/ShopList/ShopList.scss index ac9f31d..6224096 100644 --- a/src/components/ShopList/ShopList.scss +++ b/src/components/ShopList/ShopList.scss @@ -2,7 +2,7 @@ width: 100%; padding: 0 10px; &.is-row { - padding: 0 8px; + padding: 0 14px; .list { display: grid; gap: 8px; @@ -11,29 +11,21 @@ } .list { display: grid; - gap: 12px 9px; - grid-template-columns: 1fr 1fr 1fr; + gap: 20px 9px; + grid-template-columns: 1fr 1fr 1fr 1fr; padding: 10px 0; - } - .search-his { - position: relative; - padding: 0 14px 0 15px; - color: #5a5a5a; - font-weight: 400; - font-size: 12px; - line-height: 45px; - background: #fff; - .button { - float: right; - color: #4d9fdd; - } - &::after { - content: ""; - position: absolute; - display: block; - width: calc(100vw - 29px); - bottom: 0; - border-top: 1px solid #f7f7f7; + .format { + grid-column: 1 / 5; + font-weight: 600; + font-size: 24px; + line-height: 34px; + color: var(--brand-floorNameColor); + .meta { + font-weight: 600; + font-size: 14px; + line-height: 20px; + color: var(--brand-floorMetaColor); + } } } .end { diff --git a/src/components/ShopTabs/ShopTabs.js b/src/components/ShopTabs/ShopTabs.js deleted file mode 100644 index bc0a186..0000000 --- a/src/components/ShopTabs/ShopTabs.js +++ /dev/null @@ -1,24 +0,0 @@ -import React from "react"; -import "./ShopTabs.scss"; -import floor from "./floor.png"; -import floorActive from "./floor_active.png"; -import format from "./format.png"; -import formatActive from "./format_active.png"; -export default ({ tab, onSetTab }) => ( -
-
onSetTab("业态")} - className={["tab", tab === "业态" ? "active" : ""].join(" ")} - > - - 业态 -
-
onSetTab("楼层")} - className={["tab", tab === "楼层" ? "active" : ""].join(" ")} - > - - 楼层 -
-
-); diff --git a/src/components/ShopTabs/ShopTabs.scss b/src/components/ShopTabs/ShopTabs.scss deleted file mode 100644 index 8553412..0000000 --- a/src/components/ShopTabs/ShopTabs.scss +++ /dev/null @@ -1,32 +0,0 @@ -.shop-tabs { - display: flex; - width: calc(100vw - 20px); - height: 56px; - background: #edeff3; - border-radius: 12px; - justify-content: space-around; - align-items: center; - .tab { - display: flex; - width: calc((100vw - 20px - 8px - 3px) / 2); - height: 48px; - justify-content: center; - align-items: center; - font-family: PingFang SC; - font-style: normal; - font-weight: 500; - font-size: 16px; - line-height: 22px; - color: #7a7e8d; - &.active { - background: #ffffff; - border-radius: 8px; - color: #323337; - } - img { - width: 20px; - height: 20px; - margin-right: 8px; - } - } -} diff --git a/src/components/ShopTabs/floor.png b/src/components/ShopTabs/floor.png deleted file mode 100644 index 80971d3..0000000 Binary files a/src/components/ShopTabs/floor.png and /dev/null differ diff --git a/src/components/ShopTabs/floor_active.png b/src/components/ShopTabs/floor_active.png deleted file mode 100644 index 5c66320..0000000 Binary files a/src/components/ShopTabs/floor_active.png and /dev/null differ diff --git a/src/components/ShopTabs/format.png b/src/components/ShopTabs/format.png deleted file mode 100644 index deeb6f1..0000000 Binary files a/src/components/ShopTabs/format.png and /dev/null differ diff --git a/src/components/ShopTabs/format_active.png b/src/components/ShopTabs/format_active.png deleted file mode 100644 index 14d01c5..0000000 Binary files a/src/components/ShopTabs/format_active.png and /dev/null differ diff --git a/src/components/ShopsWithFilter/ShopsWithFilter.js b/src/components/ShopsWithFilter/ShopsWithFilter.js deleted file mode 100644 index 8c2eb92..0000000 --- a/src/components/ShopsWithFilter/ShopsWithFilter.js +++ /dev/null @@ -1,103 +0,0 @@ -import React, { useState, useEffect } from "react"; -import ShopList from "../ShopList/ShopList.js"; -import "./ShopsWithFilter.scss"; -import ShopTabs from "../ShopTabs/ShopTabs"; -import SideBar from "../SideBar/SideBar"; -const ShopsWithFilter = ({ - mall, - onClick, - reset, - onReset = () => {}, - wingHeight, -}) => { - const [tab, setTab] = useState("业态"); - const [format, setFormat] = useState(null); - const [floorOrder, setFloorOrder] = useState(null); - useEffect(() => { - if (reset) { - setFormat(null); - setFloorOrder(null); - setTab("业态"); - onReset(); - } - }, [reset]); - const formats = mall - ? mall.shopInfo.reduce( - (acc, { shopList }) => - shopList.reduce( - (acc1, nxt) => - acc1.includes(nxt.shopFormat) - ? [...acc1] - : [...acc1, nxt.shopFormat], - acc - ), - [] - ) - : []; - const floors = mall ? mall.floorData : []; - const floorNameOrderMap = floors.reduce( - (acc, nxt) => ({ ...acc, [nxt.name]: nxt.floorOrder }), - {} - ); - const floorOrderNameMap = floors.reduce( - (acc, nxt) => ({ ...acc, [nxt.floorOrder]: nxt.name }), - {} - ); - return ( - <> -
- { - setFormat(null); - setFloorOrder(null); - setTab(el); - }} - > -
- -
-
- { - if (tab === "业态") { - setFormat(el === "全部业态" ? null : el); - } else { - setFloorOrder(el === "全部楼层" ? null : floorNameOrderMap[el]); - } - }} - list={ - tab === "业态" - ? ["全部业态", ...formats] - : [ - "全部楼层", - ...floors - .filter(({ url }) => url !== null) - .map(({ name }) => name), - ] - } - > -
-
- -
-
- - ); -}; -export default ShopsWithFilter; diff --git a/src/components/ShopsWithFilter/ShopsWithFilter.scss b/src/components/ShopsWithFilter/ShopsWithFilter.scss deleted file mode 100644 index 7f782b1..0000000 --- a/src/components/ShopsWithFilter/ShopsWithFilter.scss +++ /dev/null @@ -1,22 +0,0 @@ -.wings { - display: flex; - width: 100vw; - height: calc(100vh - 156px); - border-top: 1px solid #edeff3; - margin-top: 8px; - .left { - width: 96px; - flex: 0 0 96px; - height: 100%; - background: #edeff3; - overflow-x: hidden; - overflow-y: auto; - } - .right { - flex: 1; - height: 100%; - background: #f3f4f8; - overflow-x: hidden; - overflow-y: auto; - } -} diff --git a/src/components/SideBar/SideBar.js b/src/components/SideBar/SideBar.js deleted file mode 100644 index d84867c..0000000 --- a/src/components/SideBar/SideBar.js +++ /dev/null @@ -1,15 +0,0 @@ -import React from "react"; -import "./SideBar.scss"; -export default ({ list, active, onSetActive }) => ( -
- {list.map((el) => ( -
onSetActive(el)} - > - {el} -
- ))} -
-); diff --git a/src/components/SideBar/SideBar.scss b/src/components/SideBar/SideBar.scss deleted file mode 100644 index e9df43e..0000000 --- a/src/components/SideBar/SideBar.scss +++ /dev/null @@ -1,20 +0,0 @@ -.side-bar { - width: 100%; - .option { - display: flex; - justify-content: center; - align-items: center; - width: 100%; - height: 48px; - font-family: PingFang SC; - font-style: normal; - font-weight: 500; - font-size: 12px; - color: #474a56; - &.active { - background: #ffffff; - color: #437af7; - font-weight: 600; - } - } -} diff --git a/src/js/helpers/data-helper.js b/src/js/helpers/data-helper.js index 8738f7a..47b456a 100644 --- a/src/js/helpers/data-helper.js +++ b/src/js/helpers/data-helper.js @@ -40,7 +40,7 @@ const getMallInfo = async () => { shopInfoUrl: `${baseUrl}/api/guide/v1/web/getMapInfo?projectCode=${code}`, }; - const [cdnUrl, mapDataJSON, [buildingList, serverShopInfo], facs] = + const [cdnUrl, mapDataJSON, [buildingList, serverShopInfo], facs, theme] = await Promise.all([ (async () => { try { @@ -92,6 +92,19 @@ const getMallInfo = async () => { return []; } })(), + (async () => { + try { + const { + data: { data: theme }, + } = await axios.get( + `${baseUrl}/api/guide/v1/web/getProjectBindingTheme?projectCode=${code}` + ); + return theme; + } catch (error) { + console.error(error); + return {}; + } + })(), ]); const mapData = JSON.parse(mapDataJSON)[0]; mall.floors = buildingList[0].floorList.map(({ floor, floorOrder }) => ({ @@ -122,7 +135,7 @@ const getMallInfo = async () => { return acc; }, []) .map((shopList, floorOrder) => ({ floorOrder, shopList })); - console.log(shopInfo); + shopInfo.forEach(({ shopList }) => shopList.forEach((shop) => { shop.initialsCn = shop.name @@ -150,7 +163,15 @@ const getMallInfo = async () => { mapData.buildArr.forEach(({ mapData: { parkArea } }) => { parkArea.forEach(({ parkNum }) => mall.lots.push(parkNum)); }); - console.log(mapData); + + const r = document.querySelector(":root"); + Object.entries(theme).forEach(([cat, obj]) => { + Object.entries(obj).forEach(([k, v]) => { + if (cat === "image") theme[cat][k] = cdnUrl + v; + else r.style.setProperty(`--${cat}-${k}`, v); + }); + }); + console.log(mapData, shopInfo, theme); Object.assign(mall, { floorData: mall.floors, shopInfo, @@ -159,6 +180,7 @@ const getMallInfo = async () => { acc[floorOrder] = [url, name]; return acc; }, new Array()), + theme, }); const mallInfo = { mall, shopInfo, images }; mallInfos.set(mall.code, mallInfo); diff --git a/src/pages/Car/Car.js b/src/pages/Car/Car.js deleted file mode 100644 index 50d305c..0000000 --- a/src/pages/Car/Car.js +++ /dev/null @@ -1,212 +0,0 @@ -import React, { useState, useEffect } from "react"; -import car from "./car.png"; -import axios from "axios"; -import "./Car.scss"; -import plus from "./plus.svg"; -import Keyboard from "../Keyboard/Keyboard"; -import platepng from "./plate.png"; -import plateActive from "./plate_active.png"; -import lot from "./lot.png"; -import lotActive from "./lot_active.png"; - -const Car = ({ lots, onLot = () => {}, plate, hasReverse }) => { - const [isPlate, setIsPlate] = useState(hasReverse); - const [qArr, setQArr] = useState(hasReverse ? ["苏", "A"] : []); - const [opened, setOpened] = useState(false); - const [showKeyBoard, setShowKeyBoard] = useState(true); - const [focusedIndex, setFocusedIndex] = useState(hasReverse ? 2 : 0); - const [isNum, setIsNum] = useState(true); - const q = qArr.join(""); - const setQ = (str) => setQArr(str.split("")); - useEffect(() => { - if (!opened) { - setOpened(true); - if (plate) { - setQ(plate); - setFocusedIndex(null); - } - setShowKeyBoard(!plate); - } - }, [opened]); - const toPlate = () => { - if (!hasReverse) - return window.weui.toast("敬请期待", { - className: "toast", - }); - setQ("苏A"); - setIsPlate(true); - setFocusedIndex(2); - setShowKeyBoard(true); - }; - const toLot = () => { - setQ(""); - setFocusedIndex(0); - setIsPlate(false); - setShowKeyBoard(true); - }; - - const handleSubmit = async () => { - if (isPlate) { - if (!q) { - return window.weui.toast("请输入正确车牌号", { - className: "toast", - }); - } - const { - data: { data, code, msg }, - } = { data: { data: null, code: "201", msg: "123" } }; - if (code !== "200") - return window.weui.toast(msg, { - className: "toast", - }); - else { - if (!lots.includes(data.spaceNo)) - return window.weui.toast(`未找到车位号:${data.spaceNo}`, { - className: "toast", - }); - return onLot(data.spaceNo); - } - } - // if (!q || !lots.includes(floor + q.toUpperCase())) { - if (!q || !lots.includes(q.toUpperCase())) { - return window.weui.toast("请输入正确车位号", { - className: "toast", - }); - } - // onLot(floor + q.toUpperCase()); - onLot(q.toUpperCase()); - }; - return ( -
- -
-
-
-
-
- - 车牌查找 -
-
- - 车位查找 -
-
- {isPlate ? ( -
- {new Array(8).fill(0).map((_, i) => ( -
{ - setIsNum(i !== 0); - setFocusedIndex(i); - setShowKeyBoard(true); - }} - > - {i === 7 && !qArr[i] ? ( - <> - - - ) : ( - qArr[i] - )} -
- ))} -
- ) : ( -
- {new Array(4).fill(0).map((_, i) => ( -
{ - setIsNum(true); - setFocusedIndex(i); - setShowKeyBoard(true); - }} - > - {qArr[i]} -
- ))} -
- )} - - {!isPlate && ( - <> - {/*
setFloor(floor1)}> - {floor1} -
-
{floor}
-
setFloor(floor3)}> - {floor3} -
*/} - - )} -
- 寻车 -
-
-
-
- {showKeyBoard && ( - { - setFocusedIndex(null); - setShowKeyBoard(false); - }} - onSetIsNum={(val) => setIsNum(val)} - onInput={(val) => { - qArr[focusedIndex] = val; - setQArr([...qArr]); - if (isPlate) { - switch (focusedIndex) { - case 6: - case 7: - setShowKeyBoard(false); - break; - default: - setIsNum(true); - setFocusedIndex(focusedIndex + 1); - break; - } - } else { - switch (focusedIndex) { - case 3: - setShowKeyBoard(false); - break; - default: - setIsNum(true); - setFocusedIndex(focusedIndex + 1); - break; - } - } - }} - onBackspace={() => { - qArr[focusedIndex] = ""; - setQArr([...qArr]); - setFocusedIndex(Math.max(0, focusedIndex - 1)); - }} - onFinish={handleSubmit} - > - )} -
- ); -}; -export default Car; diff --git a/src/pages/Car/Car.scss b/src/pages/Car/Car.scss deleted file mode 100644 index 9795f78..0000000 --- a/src/pages/Car/Car.scss +++ /dev/null @@ -1,255 +0,0 @@ -.car { - position: relative; - width: 100vw; - height: calc(100vh - 98px); - background: #f3f4f8; - pointer-events: auto; - .car-img { - position: absolute; - width: 220px; - height: 220px; - left: 0; - right: 0; - bottom: auto; - margin: auto; - top: 16px; - } - .car-modal { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - z-index: 10; - } - .content { - position: absolute; - left: 2.6667vw; - right: 2.6667vw; - width: calc(100vw - 4.2667vw); - height: 458px; - bottom: 10px; - padding-top: 34px; - background: #ffffff; - box-shadow: 0px 12px 16px rgba(104, 110, 127, 0.08); - border-radius: 18px; - overflow: hidden; - - .form { - position: absolute; - top: 14px; - left: 3.7333vw; - right: 3.7333vw; - bottom: 14px; - z-index: 3; - text-align: left; - .platenum { - display: flex; - justify-content: center; - position: absolute; - top: 102px; - left: -3.7333vw; - right: -3.7333vw; - text-align: center; - } - .lots { - position: absolute; - top: 95px; - left: 0; - right: 0; - display: inline-flex; - justify-content: center; - } - .box { - width: 9.6vw; - height: 64px; - background: #f3f4f8; - font-family: Noto IKEA Simplified Chinese; - font-style: normal; - font-weight: bold; - font-size: 18px; - text-align: center; - color: #323337; - border-radius: 8px; - display: flex; - justify-content: center; - align-items: center; - align-content: center; - flex-direction: column; - &.big { - width: 12.8vw; - } - &.active { - border: 2px solid #437af7; - box-shadow: 0px 6px 12px rgba(93, 172, 249, 0.2); - } - &.sp { - background: none; - border: 1px solid #c9cbd1; - &.active { - border: 2px solid #437af7; - box-shadow: 0px 6px 12px rgba(93, 172, 249, 0.2); - } - } - .plus { - position: relative; - width: 6.4vw; - margin: 0; - } - } - .box + .box { - margin-left: 1.0667vw; - } - .box + .box.more-margin { - margin-left: 5.0667vw; - } - .input { - position: absolute; - font-family: Noto IKEA Simplified Chinese; - font-style: normal; - font-weight: bold; - font-size: 16px; - top: 114px; - width: 216px; - left: calc((100vw - 28px - 216px) / 2); - background: transparent; - height: 40px; - line-height: 40px; - color: #474747; - border: none; - outline: none; - text-align: center; - &.right { - text-align: left; - left: calc((100vw - 28px - 216px + 63px) / 2); - } - } - ::placeholder { - font-family: Noto IKEA Simplified Chinese; - font-style: normal; - font-weight: normal; - font-size: 14px; - color: #b3aea7; - } - .dec1 { - position: absolute; - top: 154px; - bottom: auto; - right: auto; - width: 223px; - height: 21px; - left: calc((100vw - 28px - 216px) / 2); - &.right { - left: calc((100vw - 28px - 216px + 63px) / 2); - } - } - .dec2 { - position: absolute; - top: 132px; - bottom: auto; - right: auto; - width: 11.7333vw; - height: 21px; - left: calc((100vw - 7.4667vw - 57.6vw - 16.8vw) / 2); - pointer-events: none; - } - .floor1, - .floor2, - .floor3 { - position: absolute; - left: calc((100vw - 7.4667vw - 57.6vw - 16.8vw) / 2); - font-family: Noto IKEA Simplified Chinese; - font-style: normal; - font-weight: bold; - font-size: 4.2667vw; - color: #474747; - width: 9.8667vw; - text-align: center; - } - .floor1, - .floor3 { - color: rgba(113, 112, 110, 0.2); - font-size: 3.2vw; - line-height: 4.8vw; - height: 4.8vw; - } - .floor1 { - top: 77px; - } - .floor2 { - top: 101px; - line-height: 6.4vw; - height: 6.4vw; - } - .floor3 { - top: 134px; - } - .btns { - display: grid; - grid-template-columns: 1fr 1fr; - position: absolute; - top: 129px; - left: 24px; - right: 24px; - gap: 0 16px; - } - .btn { - display: flex; - justify-content: center; - align-items: center; - position: absolute; - height: 56px; - left: 1.0667vw; - right: 1.0667vw; - margin: auto; - bottom: 14px; - background: linear-gradient(180deg, #508af7 0%, #5ea5f9 100%); - box-shadow: 0px 6px 12px rgba(93, 172, 249, 0.2); - border-radius: 16px; - font-family: PingFang SC; - font-style: normal; - font-weight: bold; - font-size: 16px; - line-height: 22px; - text-align: center; - color: #ffffff; - } - - .tabs { - display: flex; - width: 100%; - padding: 4px; - background: #edeff3; - border-radius: 12px; - } - .tab { - display: flex; - justify-content: center; - align-items: center; - flex: 1; - height: 48px; - font-family: PingFang SC; - font-style: normal; - font-weight: bold; - font-size: 16px; - line-height: 22px; - color: #7a7e8d; - img { - position: relative; - margin: 0; - margin-right: 8px; - width: 24px; - height: 24px; - } - } - .tab.active { - background: #ffffff; - border-radius: 10px; - color: #323337; - } - .tab + .tab { - margin-left: 4px; - } - } - } -} diff --git a/src/pages/Car/back.png b/src/pages/Car/back.png deleted file mode 100644 index 8204fcc..0000000 Binary files a/src/pages/Car/back.png and /dev/null differ diff --git a/src/pages/Car/car.png b/src/pages/Car/car.png deleted file mode 100644 index 6375281..0000000 Binary files a/src/pages/Car/car.png and /dev/null differ diff --git a/src/pages/Car/lot.png b/src/pages/Car/lot.png deleted file mode 100644 index 0c6d48a..0000000 Binary files a/src/pages/Car/lot.png and /dev/null differ diff --git a/src/pages/Car/lot_active.png b/src/pages/Car/lot_active.png deleted file mode 100644 index f8dbdcf..0000000 Binary files a/src/pages/Car/lot_active.png and /dev/null differ diff --git a/src/pages/Car/plate.png b/src/pages/Car/plate.png deleted file mode 100644 index d49db23..0000000 Binary files a/src/pages/Car/plate.png and /dev/null differ diff --git a/src/pages/Car/plate_active.png b/src/pages/Car/plate_active.png deleted file mode 100644 index 469f001..0000000 Binary files a/src/pages/Car/plate_active.png and /dev/null differ diff --git a/src/pages/Car/plus.svg b/src/pages/Car/plus.svg deleted file mode 100644 index 28ae8ac..0000000 --- a/src/pages/Car/plus.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/pages/Index/Index.js b/src/pages/Index/Index.js index b83f2f2..bb2d6c2 100644 --- a/src/pages/Index/Index.js +++ b/src/pages/Index/Index.js @@ -4,7 +4,6 @@ import { useHistory, useLocation } from "react-router-dom"; import { getMallInfo } from "../../js/helpers/data-helper"; import "./Index.scss"; import Floors from "../../components/Floors/Floors"; -import HeadBar from "../../components/HeadBar/HeadBar"; import Popup from "../../components/Popup/Popup"; import pos from "./pos.png"; import offline from "./offline.png"; @@ -12,17 +11,10 @@ import compass from "./compass.png"; import Shops from "../Shops/Shops"; import NavBottom from "../../components/NavBottom/NavBottom"; import Modal from "react-modal"; -import DefaultPopup, { - DefaultPopupStates, -} from "../../components/DefaultPopup/DefaultPopup"; -import More from "../../components/More/More"; -import arpng from "./ar.png"; export const MallCode = React.createContext(null); // const vConsole = new window.VConsole(); let focusdDevice; -let memberID; -let isShop; const Index = () => { const history = useHistory(); @@ -38,51 +30,19 @@ const Index = () => { const [mallCode, setMallCode] = useState(null); const startParams = params.get("s"); let endId = params.get("e"); - const openid = params.get("openid"); - if (params.get("memberID")) memberID = params.get("memberID"); - if (params.get("isShop")) isShop = params.get("isShop"); - const plate = params.get("plate"); const [navigation, setNavigation] = useState(false); const [inAnimation, setInAnimation] = useState(false); - const [displayMode, setDisplayMode] = useState(1); - const [searchType, setSearchType] = useState(0); - const [showOptions, setShowOptions] = useState(false); const [showShops, setShowShops] = useState(false); const [routeSearchText, setRouteSearchText] = useState(""); const [percent, setPercent] = useState(0); const [elevations, setElevations] = useState([]); const [paused, setPaused] = useState(false); - const [playAudio, setPlayAudio] = useState(false); const [online, setOnline] = useState(true); const [azimuthAngle, setAzimuthAngle] = useState(0); const [follow, setFollow] = useState(false); - const [facilities, setFacilities] = useState(null); - const [defaultPopupState, setDefaultPopupState] = useState( - DefaultPopupStates.init - ); const [start, _setStart] = useState(null); const [end, _setEnd] = useState(null); - const [isPick, _setIsPick] = useState(false); const [doFocus, _setDoFocus] = useState(0); - const [showARPrompt, setShowARPrompt] = useState(false); - const [ARshop, setARShop] = useState(null); - const [isTyping, setIsTyping] = useState(null); - const [showFindCar, setShowFindCar] = useState(false); - - useEffect(() => { - if (shop) { - const e = shop.houseNum - ? shop.houseNum - : shop.isDevice - ? `${shop.floorOrder}_${shop.navPoint}_${shop.name}` - : encodeURIComponent(shop.id); - history.replace( - `/?openid=${openid}&e=${e}&name=${shop.name}${ - shop.floorName ? "(" + shop.floorName + ")" : "" - }` - ); - } - }, [shop]); useEffect(() => { if (!map) return; @@ -105,7 +65,6 @@ const Index = () => { } } if (!endId) return; - if (endId === "findcar") return setShowFindCar(true); if (mall.mcShopIDHouseNumMap && mall.mcShopIDHouseNumMap[endId]) endId = mall.mcShopIDHouseNumMap[endId]; @@ -176,12 +135,6 @@ const Index = () => { _setEnd(data); }; - const isPickRef = useRef(isPick); - const setIsPick = (data) => { - isPickRef.current = data; - _setIsPick(data); - }; - useEffect(() => { let offlineListener = () => setOnline(false); let onlineListener = () => setOnline(true); @@ -193,6 +146,18 @@ const Index = () => { }; }); + useEffect(() => { + const end = endRef.current; + if (!inAnimation && map && end) { + setShop(end); + const timeout = setTimeout(() => { + map.focusShopByHouseNum(end.houseNum); + }, 500); + exitFromNav(); + return () => clearTimeout(timeout); + } + }, [inAnimation]); + const [_, dispatchLS] = useReducer( ({ lastSearch }, { type, data }) => { switch (type) { @@ -216,7 +181,6 @@ const Index = () => { const handleFocus = ({ data, preventDefault }) => { const start = startRef.current; const end = endRef.current; - const isPick = isPickRef.current; const doFocus = doFocusRef.current; if (doFocus === 2) { setDoFocus(1); @@ -225,8 +189,6 @@ const Index = () => { } if (start && end) { preventDefault(); - } else if (((start && !end) || (!start && end)) && !isPick) { - preventDefault(); } else { if (follow) { map.setFollow(false); @@ -237,13 +199,6 @@ const Index = () => { setDoFocus(0); }; - const swap = async () => { - if (navigation && start && end) await navigation.stop(); - if (start && end) map.startNavigate({ start: end, end: start }); - setStart(end); - setEnd(start); - }; - const handleBlur = () => { if (focusdDevice) { focusdDevice.blur(); @@ -251,7 +206,7 @@ const Index = () => { } const doFocus = doFocusRef.current; if (doFocus === 1) return; - history.replace(`/?openid=${openid}`); + history.replace(`/`); setShop(null); }; @@ -269,7 +224,7 @@ const Index = () => { routeSearchAnimationType: 2, routeSearchZoom: 2, maxZoom: 4, - playAudio, + playAudio: false, needSpotLight, scale, floorHeights: { @@ -349,7 +304,6 @@ const Index = () => { dispatchLS({ type: "addLine", data: floorOrder }); }, onLoad: (map) => { - setDisplayMode(1); setMap(map); }, onAzimuthAngleChange: (angle) => @@ -359,81 +313,32 @@ const Index = () => { useEffect(() => { if (!mallCode) { - getMallInfo({ memberID }).then((result) => { + getMallInfo().then((result) => { if (!mallCode) setMallCode(result.mall.code); setMallInfo(result); }); } }, [mallCode]); - const showPopup = - shop !== null && - !isPick && - defaultPopupState !== DefaultPopupStates.facList; - const hasCoupon = showPopup && shop && shop.hasCoupon; - const showHeadBar = (start || end) && !inAnimation; - const showHeadBarSearchType = showHeadBar && start && end; const showNav = inAnimation && start && end; - const showDefaultPopup = !showPopup && !showHeadBar && !showNav && facilities; - const isNavEnd = showHeadBar && start && end; const exitFromNav = () => { - map.setStart(null); map.setEnd(null); map.recycle(); - setIsPick(false); navigation && navigation.stop && navigation.stop(); dispatchLS({ type: "set", data: null }); - setStart(null); setEnd(null); }; - useEffect(() => { - if (navigation) { - if (openid) { - const isShop = "intro" in end; - const isP = end.isP; - const isDevice = end.isDevice; - } - } - }, [navigation]); - useEffect(() => { if (mallInfo) { loadMap(); } }, [mallInfo]); - useEffect(() => { - if (map) { - let facs = map.getAllFacilities(); - facs = facs - .filter(({ url, typeName }) => url && typeName) - .reduce( - (acc, nxt) => - acc[nxt.typeName] - ? { ...acc, [nxt.typeName]: [...acc[nxt.typeName], nxt] } - : { ...acc, [nxt.typeName]: [nxt] }, - {} - ); - setFacilities(facs); - } - }, [map]); - return ( -
+
{!online && ( { )} -
- {!(start || end) && ( -
- 图左 - {mall && mall.city} -
- {mall && mall.name} -
- )} - {showHeadBar && ( - { - setStart(shop); - map.startNavigate({ start: shop, end }); - }} - onSetEnd={(shop) => { - setEnd(shop); - map.startNavigate({ start, end: shop }); - }} - blurMap={() => { - map.blurShop(); - map.blurFacility(); - }} - searchType={searchType} - onClickSearchType={(id) => { - if (id === searchType) return; - setSearchType(id); - map && map.changeSearchType(id); - }} - showSearchType={start && end} - onIsTypingChange={setIsTyping} - > - )} + {mall && ( +
+ {!(start || end) && ( + <> +
+ 图左 + {mall && mall.city} +
+ {mall && mall.name} +
+
setShowShops(true)} + >
+ + )} - {((!(start && end) && !isTyping) || showHeadBarSearchType) && ( - { - if (id === displayMode) return; - setDisplayMode(id); - map && map.changeDisplayMode(id); - }} - onClickSearchType={(id) => { - if (id === searchType) return; - setSearchType(id); - map && map.changeSearchType(id); - }} - > - )} - {!isTyping && !showHeadBar && ( - <> +
{ map && !showNav && map.changeFloor(sceneIndex, true) } /> - - )} -
+
+
+ )}
{ }} onClose={() => setShowShops(false)} > - { - setShowShops(true); - }} - onClickFac={(id) => { - setDoFocus(2); - map && map.focusFacilityById(id); - }} - setEnd={(fac) => { - setEnd(fac); - setShop(null); - }} - blurMap={() => { - setShop(null); - map.blurShop(); - map.blurFacility(); - }} - mall={mall} - onClick={({ houseNum }) => { - setShowShops(false); - setDoFocus(2); - map.focusShopByHouseNum(houseNum); - }} - > - ) - } - floors={ - mall && - sceneIndex !== null && - (defaultPopupState !== DefaultPopupStates.moreFac || - !showDefaultPopup) && ( - - ) - } - shop={shop} - closePopup={() => { - setShop(null); - history.replace(`/?openid=${openid}`); - map.blurShop(); - map.blurFacility(); - }} - showDetail={() => setShop({ ...shop, showDetail: true })} - setEnd={() => { - setEnd(shop); - setShop(null); - }} - handleAR={(shop) => { - setARShop(shop); - setShowARPrompt(true); - }} - > + {mall && !showNav && ( + { + setShowShops(false); + setDoFocus(2); + map.focusShopByHouseNum(houseNum); + }} + floors={ + mall && + sceneIndex !== null && ( + + ) + } + onClickActive={(end) => { + setEnd(end); + map.startNavigate({ + start, + end, + }); + }} + > + )} {showNav && ( { routeSearchText={routeSearchText} percent={percent} elevations={elevations} - handleAR={(shop) => { - setARShop(shop); - setShowARPrompt(true); - }} > )} - {isNavEnd && ( -
{ - map.startNavigate({ start, end }); - }} - > - 开始导航 -
- )}
); diff --git a/src/pages/Index/Index.scss b/src/pages/Index/Index.scss index ee7777f..31d4675 100644 --- a/src/pages/Index/Index.scss +++ b/src/pages/Index/Index.scss @@ -158,23 +158,13 @@ body { position: fixed; width: 100vw; height: 100vh; + background: #dee6f6; &.hasTab { height: calc(100vh - 84px); } overscroll-behavior: none; - &.t1, - &.t2 { - .qmmap { - margin-top: -88px; - } - } - &.t3 { - .qmmap { - margin-top: -160px; - } - } .hud { position: fixed; z-index: 3000; @@ -186,18 +176,29 @@ body { &.bg { background: #f0f0f0; } - .compass { + .compass-wrapper { position: absolute; - top: 52px; - left: 10px; - width: 34px; - height: 34px; - transform-origin: center; + bottom: 326px; + right: 14px; + width: 40px; + height: 40px; + display: flex; pointer-events: auto; - &.has-nav-text-top { - top: 50px; + background: #ffffff; + box-shadow: 0px 8px 8px rgba(104, 110, 127, 0.04); + border-radius: 8px; + justify-content: center; + align-items: center; + &.inNav { + bottom: 256px; + } + .compass { + width: 32px; + height: 32px; + transform-origin: center; } } + .car { display: flex; justify-content: center; @@ -218,13 +219,11 @@ body { } .top-left { position: absolute; - top: 10px; - left: 10px; + top: 8px; + left: 14px; display: inline-flex; border-radius: 20px; background: #fff; - font-family: PingFang SC; - font-style: normal; font-weight: 500; font-size: 14px; line-height: 20px; @@ -242,47 +241,54 @@ body { .border { width: 1px; height: 10px; - background: #c9cbd1; + background: rgba(0, 0, 0, 0.2); margin: 0 8px; } } .top-right { position: absolute; - top: 12px; + width: 168px; + height: 50px; + top: 8px; right: 14px; - border-radius: 15px; - color: #a9a9a9; - background: #fff; - line-height: 30px; - padding: 0 12px 0 35px; - font-size: 11px; - z-index: 1; - } - .top-right img { - position: absolute; - top: 9px; - left: 13px; - width: 13px; + border-radius: 12px; + box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.03); + background: center / cover no-repeat url(./topRight.png); + pointer-events: auto; } } .qmmap-container { .wrapper { .focus-text { - background: linear-gradient(180deg, #508af7 0%, #5ea5f9 100%); - padding: 0 12px; - border: 1px solid #437af7; - border-radius: 20px; - height: 25px; + display: flex; + align-items: baseline; + background: #516dd8; + border: none; + padding: 0 14px; + border-radius: 100px; + height: 30px; + line-height: 30px; + font-weight: 700; + font-size: 12px; + &::after { + display: inline-block; + content: "GO"; + font-size: 15px; + height: 12px; + line-height: 12px; + border-left: 1px solid rgba(255, 255, 255, 0.2); + margin-left: 9px; + padding-left: 7px; + } .down-arrow-wrapper { - width: 6px; - height: 6px; - background-image: url(./arrow.png); - background-size: contain; - background-repeat: no-repeat; - background-position: center; + width: 10px; + height: 10px; + background: #516dd8; + transform-origin: center; + transform: rotate(45deg); border: none; - bottom: -6px; + bottom: -3px; overflow: visible; .down-arrow { display: none; @@ -307,6 +313,7 @@ body { position: absolute; top: 0; left: 0; + margin-top: -120px; overscroll-behavior: none; overflow: hidden; transition: margin-top 0.5s ease; diff --git a/src/pages/Index/ar.png b/src/pages/Index/ar.png deleted file mode 100644 index 59fa775..0000000 Binary files a/src/pages/Index/ar.png and /dev/null differ diff --git a/src/pages/Index/more.png b/src/pages/Index/more.png deleted file mode 100644 index 67f31a5..0000000 Binary files a/src/pages/Index/more.png and /dev/null differ diff --git a/src/pages/Index/tabs/Tabs.js b/src/pages/Index/tabs/Tabs.js deleted file mode 100644 index 4b64054..0000000 --- a/src/pages/Index/tabs/Tabs.js +++ /dev/null @@ -1,15 +0,0 @@ -import act from "./act.svg"; -import actActive from "./actActive.svg"; -import car from "./car.svg"; -import carActive from "./carActive.svg"; -import map from "./map.svg"; -import mapActive from "./mapActive.svg"; -import my from "./my.svg"; -import myActive from "./myActive.svg"; -const TabMap = { - 活动: { logo: act, logoActive: actActive }, - 寻车: { logo: car, logoActive: carActive }, - 地图: { logo: map, logoActive: mapActive }, - 我的: { logo: my, logoActive: myActive }, -}; -export default TabMap; diff --git a/src/pages/Index/tabs/act.svg b/src/pages/Index/tabs/act.svg deleted file mode 100644 index def3bc2..0000000 --- a/src/pages/Index/tabs/act.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/pages/Index/tabs/actActive.svg b/src/pages/Index/tabs/actActive.svg deleted file mode 100644 index 9eee6e2..0000000 --- a/src/pages/Index/tabs/actActive.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/pages/Index/tabs/car.svg b/src/pages/Index/tabs/car.svg deleted file mode 100644 index 6fd05f2..0000000 --- a/src/pages/Index/tabs/car.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/pages/Index/tabs/carActive.svg b/src/pages/Index/tabs/carActive.svg deleted file mode 100644 index ad8b844..0000000 --- a/src/pages/Index/tabs/carActive.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/pages/Index/tabs/map.svg b/src/pages/Index/tabs/map.svg deleted file mode 100644 index 0f046e9..0000000 --- a/src/pages/Index/tabs/map.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/pages/Index/tabs/mapActive.svg b/src/pages/Index/tabs/mapActive.svg deleted file mode 100644 index 282eb92..0000000 --- a/src/pages/Index/tabs/mapActive.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/pages/Index/tabs/my.svg b/src/pages/Index/tabs/my.svg deleted file mode 100644 index 3fc3ba8..0000000 --- a/src/pages/Index/tabs/my.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/pages/Index/tabs/myActive.svg b/src/pages/Index/tabs/myActive.svg deleted file mode 100644 index 87bddfb..0000000 --- a/src/pages/Index/tabs/myActive.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/pages/Index/topRight.png b/src/pages/Index/topRight.png new file mode 100644 index 0000000..5d8221d Binary files /dev/null and b/src/pages/Index/topRight.png differ diff --git a/src/pages/Keyboard/Keyboard.js b/src/pages/Keyboard/Keyboard.js deleted file mode 100644 index 6835679..0000000 --- a/src/pages/Keyboard/Keyboard.js +++ /dev/null @@ -1,104 +0,0 @@ -import React from "react"; -import "./Keyboard.scss"; -const N1 = "1234567890"; -const N2 = "QWERTYUIOP"; -const N3 = "ASDFGHJKL"; -const N4 = "ZXCVBNM"; -const C1 = "京津渝沪冀晋辽吉黑苏"; -const C2 = "浙皖闽赣鲁豫鄂湘粤琼"; -const C3 = "川贵云陕甘青蒙桂宁新"; -const C4 = "藏使领警学港澳"; -const Keyboard = ({ - isNum, - onInput, - onBackspace, - onSetIsNum, - onClose, - onFinish, -}) => { - return ( -
-
-
- 取消 -
-
- 完成 -
-
- {isNum ? ( -
-
- {N1.split("").map((key) => ( -
onInput(key)}> - {key} -
- ))} -
-
- {N2.split("").map((key) => ( -
onInput(key)}> - {key} -
- ))} -
-
- {N3.split("").map((key) => ( -
onInput(key)}> - {key} -
- ))} -
-
-
onSetIsNum(false)}> - 字 -
- {N4.split("").map((key) => ( -
onInput(key)}> - {key} -
- ))} -
-
-
- ) : ( -
-
- {C1.split("").map((key) => ( -
onInput(key)}> - {key} -
- ))} -
-
- {C2.split("").map((key) => ( -
onInput(key)}> - {key} -
- ))} -
-
- {C3.split("").map((key) => ( -
onInput(key)}> - {key} -
- ))} -
-
-
onSetIsNum(true)}> - ABC -
- {C4.split("").map((key) => ( -
onInput(key)}> - {key} -
- ))} -
-
-
- )} -
-
- ); -}; -export default Keyboard; diff --git a/src/pages/Keyboard/Keyboard.scss b/src/pages/Keyboard/Keyboard.scss deleted file mode 100644 index 58f4048..0000000 --- a/src/pages/Keyboard/Keyboard.scss +++ /dev/null @@ -1,128 +0,0 @@ -.keyboard { - position: absolute; - bottom: -98px; - left: 0; - right: 0; - display: flex; - flex-direction: column; - width: 100vw; - height: 294px; - z-index: 10; - .bar { - display: flex; - flex: 0 0 40px; - justify-content: space-between; - line-height: 40px; - background: #ffffff; - box-shadow: 0px -1px 12px rgba(0, 0, 0, 0.05); - .btn1 { - position: relative; - flex: 0 0 80px; - text-align: center; - font-family: Noto IKEA Simplified Chinese; - font-style: normal; - font-weight: normal; - font-size: 16px; - color: #4f4f4f; - &::after { - content: ""; - position: absolute; - top: 14px; - right: 0; - width: 1px; - height: 14px; - background: #e0e0e0; - } - } - .btn2 { - position: relative; - flex: 0 0 80px; - text-align: center; - font-family: Noto IKEA Simplified Chinese; - font-style: normal; - font-weight: bold; - font-size: 16px; - color: #437af7; - &::after { - content: ""; - position: absolute; - top: 14px; - left: 0; - width: 1px; - height: 14px; - background: #e0e0e0; - } - } - } - .safe { - flex: 0 0 34px; - background: #d1d5db; - } - .plane { - flex: 1; - background: #d1d5db; - .row { - display: flex; - width: 100vw; - justify-content: center; - padding-top: 12px; - } - .key { - width: 8.5333vw; - height: 40px; - font-family: Noto IKEA Simplified Chinese; - font-style: normal; - font-weight: normal; - font-size: 16px; - line-height: 40px; - text-align: center; - color: #333333; - background: #ffffff; - box-shadow: 0px 1px 0px #898a8d; - border-radius: 4px; - &.bold { - font-weight: bold; - } - &:active { - background: #0166b3; - box-shadow: 0px 2px 1px rgba(0, 0, 0, 0.2); - color: #ffffff; - } - } - .key + .key { - margin-left: 1.0667vw; - } - .key1 { - width: 13.3333vw; - height: 40px; - background: linear-gradient(180deg, #508af7 0%, #5ea5f9 100%); - color: #fff; - box-shadow: 0px 2px 1px rgba(0, 0, 0, 0.2); - border-radius: 4px; - font-family: Noto IKEA Simplified Chinese; - font-style: normal; - font-weight: normal; - font-size: 16px; - line-height: 40px; - text-align: center; - } - .key1 + .key { - margin-left: 1.0667vw; - } - .key2 { - width: 13.3333vw; - height: 40px; - background: #adb3bc; - color: #fff; - box-shadow: 0px 2px 1px rgba(0, 0, 0, 0.2); - border-radius: 4px; - background-image: url(./backspace.png); - background-repeat: no-repeat; - background-size: 20px; - background-position: center; - } - .key + .key2 { - margin-left: 1.0667vw; - } - } -} diff --git a/src/pages/Keyboard/backspace.png b/src/pages/Keyboard/backspace.png deleted file mode 100644 index 48f92ad..0000000 Binary files a/src/pages/Keyboard/backspace.png and /dev/null differ diff --git a/src/pages/Shops/Shops.js b/src/pages/Shops/Shops.js index 2757633..191abab 100644 --- a/src/pages/Shops/Shops.js +++ b/src/pages/Shops/Shops.js @@ -5,17 +5,13 @@ import ShopList from "../../components/ShopList/ShopList.js"; import search from "./search.png"; import close from "./close.png"; import back from "./back.png"; -import ShopsWithFilter from "../../components/ShopsWithFilter/ShopsWithFilter"; const Shops = ({ mall, isOpen, onRequestClose, onClick, onClose }) => { const [q, setQ] = useState(""); - const [resetShopsWithFilter, setResetShopsWithFilter] = useState(false); - useEffect(() => { - setResetShopsWithFilter(true); - }, [q]); + return ( onRequestClose()} @@ -26,7 +22,6 @@ const Shops = ({ mall, isOpen, onRequestClose, onClick, onClose }) => { value={q} className="input" onChange={(e) => setQ(e.target.value)} - placeholder="查找店铺" /> 搜索图标 {q && ( @@ -40,16 +35,6 @@ const Shops = ({ mall, isOpen, onRequestClose, onClick, onClose }) => { > )}
- {!q && ( - setResetShopsWithFilter(false)} - wingHeight="calc(100vh - 157px)" - > - )} - {q && (
diff --git a/src/pages/Shops/Shops.scss b/src/pages/Shops/Shops.scss index 92d0c1a..46ec1da 100644 --- a/src/pages/Shops/Shops.scss +++ b/src/pages/Shops/Shops.scss @@ -1,7 +1,7 @@ .shops { width: 100vw; height: 100vh; - background: #f5f5f5; + background: #dee6f6; position: relative; font-family: SourceHanSansCN-Regular, SourceHanSansCN; outline: none; @@ -9,27 +9,24 @@ position: relative; display: flex; width: 100vw; - padding: 16px 10px 0 10px; + padding: 8px 14px 0 14px; align-items: center; .back { - flex: 0 0 60px; - height: 60px; + flex: 0 0 72px; + height: 72px; } .input { flex: 1; - width: calc(100vw - 20px - 60px - 14px); + width: calc(100vw - 114px); margin-left: 14px; background: #fff; - padding: 0 48px 0 60px; - font-family: PingFang SC; - font-style: normal; + padding: 0 72px 0 64px; font-weight: 600; - font-size: 16px; - line-height: 22px; - color: #323337; - border-radius: 10px; + font-size: 20px; + color: rgba(0, 0, 0, 0.8); + border-radius: 12px; box-sizing: border-box; - height: 60px; + height: 72px; border: none; outline: none; &::placeholder { @@ -43,45 +40,22 @@ .search { position: absolute; top: 30px; - left: 98px; - width: 32px; - height: 32px; + left: 116px; + width: 28px; + height: 28px; pointer-events: none; } .close { position: absolute; - width: 36px; - height: 36px; - top: 28px; - right: 22px; - } - } - .wings { - display: flex; - width: 100vw; - height: calc(100vh - 156px); - border-top: 1px solid #edeff3; - margin-top: 8px; - .left { - width: 96px; - flex: 0 0 96px; - height: calc(100vh - 157px); - background: #edeff3; - overflow-x: hidden; - overflow-y: auto; - } - .right { - flex: 1; - height: calc(100vh - 157px); - background: #f3f4f8; - overflow-x: hidden; - overflow-y: auto; + width: 38px; + height: 38px; + top: 25px; + right: 31px; } } .search-list { width: 100vw; - height: calc(100vh - 98px); - margin-top: 6px; + height: calc(100vh - 80px); overflow-x: hidden; overflow-y: auto; } diff --git a/src/pages/Shops/back.png b/src/pages/Shops/back.png index 158751d..d073d99 100644 Binary files a/src/pages/Shops/back.png and b/src/pages/Shops/back.png differ diff --git a/src/pages/Shops/close.png b/src/pages/Shops/close.png index f522294..13790b6 100644 Binary files a/src/pages/Shops/close.png and b/src/pages/Shops/close.png differ diff --git a/src/pages/Shops/search.png b/src/pages/Shops/search.png index 8d2e027..8762f4b 100644 Binary files a/src/pages/Shops/search.png and b/src/pages/Shops/search.png differ diff --git a/yarn.lock b/yarn.lock index cf54b6d..16c7b87 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5947,6 +5947,11 @@ html-webpack-plugin@4.5.0: tapable "^1.1.3" util.promisify "1.0.0" +html5-qrcode@^2.3.0: + version "2.3.4" + resolved "https://registry.npmmirror.com/html5-qrcode/-/html5-qrcode-2.3.4.tgz#7e2b4575a23b10ff5e26d2bf147c8027c1ece389" + integrity sha512-VPZrOTG8XR9HmIAhSSiGtJVPErZxKy/DuGc9cPQLburCWZEbvxQGJP9y4K4P+8vdalLtYB/vM5YP1BdWQKZ8jQ== + htmlparser2@^3.10.1: version "3.10.1" resolved "https://registry.npm.taobao.org/htmlparser2/download/htmlparser2-3.10.1.tgz?cache=0&sync_timestamp=1607394274032&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhtmlparser2%2Fdownload%2Fhtmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" @@ -7433,6 +7438,11 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" +lodash.throttle@^4.1.1: + version "4.1.1" + resolved "https://registry.npmmirror.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" + integrity sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ== + lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.npm.taobao.org/lodash.uniq/download/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" @@ -9512,6 +9522,11 @@ q@^1.1.2: resolved "https://registry.npm.taobao.org/q/download/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= +qrcodejs2@^0.0.2: + version "0.0.2" + resolved "https://registry.npmmirror.com/qrcodejs2/-/qrcodejs2-0.0.2.tgz#465afe5e39f19facecb932c11f7a186109146ae1" + integrity sha512-+Y4HA+cb6qUzdgvI3KML8GYpMFwB24dFwzMkS/yXq6hwtUGNUnZQdUnksrV1XGMc2mid5ROw5SAuY9XhI3ValA== + qs@6.7.0: version "6.7.0" resolved "https://registry.npm.taobao.org/qs/download/qs-6.7.0.tgz?cache=0&sync_timestamp=1610598174727&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" @@ -9771,6 +9786,14 @@ react-is@^17.0.1: resolved "https://registry.npm.taobao.org/react-is/download/react-is-17.0.1.tgz#5b3531bd76a645a4c9fb6e693ed36419e3301339" integrity sha1-WzUxvXamRaTJ+25pPtNkGeMwEzk= +react-lazy-load-image-component@^1.5.1: + version "1.5.6" + resolved "https://registry.npmmirror.com/react-lazy-load-image-component/-/react-lazy-load-image-component-1.5.6.tgz#a4b84257be21b1825680b4e158d167c08aeda5ff" + integrity sha512-M0jeJtOlTHgThOfgYM9krSqYbR6ShxROy/KVankwbw9/amPKG1t5GSGN1sei6Cyu8+QJVuyAUvQ+LFtCVTTlKw== + dependencies: + lodash.debounce "^4.0.8" + lodash.throttle "^4.1.1" + react-lifecycles-compat@^3.0.0, react-lifecycles-compat@^3.0.4: version "3.0.4" resolved "https://registry.npm.taobao.org/react-lifecycles-compat/download/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"