|
|
@@ -1,5 +1,5 @@
|
|
|
import { Component, PropsWithChildren, useEffect, useRef, useState } from 'react'
|
|
|
-import { View, Text, Button, Input, Picker, Swiper, SwiperItem, Icon } from '@tarojs/components'
|
|
|
+import { View, Text, Button, Input, Picker, Swiper, SwiperItem, Icon, PageContainer } from '@tarojs/components'
|
|
|
import '../index/index.scss'
|
|
|
import './Clock.scss'
|
|
|
// import './context/locales/index'
|
|
|
@@ -23,7 +23,7 @@ import trackTimeService from '@/store/trackTimeMachine';
|
|
|
import { setWXFollow } from '@/store/permission';
|
|
|
import Tooltip from '@/components/view/Tooltip'
|
|
|
import RequestType, { thirdPartRequest } from '@/services/thirdPartRequest'
|
|
|
-import { setConfigs } from '@/store/common'
|
|
|
+import { setConfigs, setTabbarStatus } from '@/store/common'
|
|
|
import RecordFastSleep from '@/features/trackTimeDuration/components/RecordFastSleep'
|
|
|
import Box from '@/components/layout/Box'
|
|
|
import Layout from '@/components/layout/layout'
|
|
|
@@ -70,14 +70,15 @@ export default function IndexPage() {
|
|
|
const [autoPlay, setAutoPlay] = useState(false)
|
|
|
|
|
|
const [showModal, setShowModal] = useState(false)
|
|
|
- const [modalDetail, setModalDetail] = useState<any>({})
|
|
|
+ const [modalDetail, setModalDetail] = useState<any>(null)
|
|
|
|
|
|
const [showModal2, setShowModal2] = useState(false)
|
|
|
- const [modalDetail2, setModalDetail2] = useState<any>({})
|
|
|
+ const [modalDetail2, setModalDetail2] = useState<any>(null)
|
|
|
const [showSingleFastEnd, setShowSingleFastEnd] = useState(false)
|
|
|
const [consoleStatus, setConsoleStatus] = useState(consoleData.status)
|
|
|
const [showLogin, setShowLogin] = useState(false)
|
|
|
- const [showTip,setShowTip] = useState(false)
|
|
|
+ const [showTip, setShowTip] = useState(false)
|
|
|
+ const [isModal1,setIsModal1] = useState(false)
|
|
|
|
|
|
let navigation;
|
|
|
if (useNavigation) {
|
|
|
@@ -268,7 +269,7 @@ export default function IndexPage() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- function tapLogin(e){
|
|
|
+ function tapLogin(e) {
|
|
|
jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
|
|
|
}
|
|
|
|
|
|
@@ -369,12 +370,14 @@ export default function IndexPage() {
|
|
|
|
|
|
global.showClockModal = (isShow: boolean, detail: any) => {
|
|
|
global.showModal = isShow
|
|
|
+ setIsModal1(true)
|
|
|
setShowModal(isShow)
|
|
|
setModalDetail(detail)
|
|
|
}
|
|
|
|
|
|
global.showClockModal2 = (isShow: boolean, detail: any) => {
|
|
|
global.showModal = isShow
|
|
|
+ setIsModal1(false)
|
|
|
setShowModal2(isShow)
|
|
|
setModalDetail2(detail)
|
|
|
}
|
|
|
@@ -430,14 +433,14 @@ export default function IndexPage() {
|
|
|
}
|
|
|
|
|
|
usePageScroll((e) => {
|
|
|
- if (e.scrollTop > 70) {
|
|
|
- setShowTip(true)
|
|
|
- }
|
|
|
- else {
|
|
|
- setShowTip(false)
|
|
|
- }
|
|
|
-
|
|
|
-})
|
|
|
+ if (e.scrollTop > 70) {
|
|
|
+ setShowTip(true)
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ setShowTip(false)
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
|
|
|
|
|
|
function detail() {
|
|
|
@@ -455,7 +458,7 @@ export default function IndexPage() {
|
|
|
</View>
|
|
|
</Box>
|
|
|
{
|
|
|
- !user.isLogin && showLogin && <View style={{ display: 'flex', alignItems: 'center', justifyContent: 'center',marginTop:rpxToPx(36) }}>
|
|
|
+ !user.isLogin && showLogin && <View style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', marginTop: rpxToPx(36) }}>
|
|
|
<ChooseScenarioBtn title='登录体验' background={ColorType.fast} onClick={tapLogin} />
|
|
|
</View>
|
|
|
}
|
|
|
@@ -492,12 +495,30 @@ export default function IndexPage() {
|
|
|
<View style={{ height: 100 }} />
|
|
|
</View>
|
|
|
|
|
|
- {
|
|
|
+ <PageContainer style={{ backgroundColor: '#1c1c1c' }}
|
|
|
+ overlayStyle='background-color:rgba(0,0,0,0.9)'
|
|
|
+ custom-style='background-color:#1c1c1c'
|
|
|
+ closeOnSlideDown={false}
|
|
|
+ onBeforeEnter={()=>{
|
|
|
+ dispatch(setTabbarStatus(false))
|
|
|
+ }}
|
|
|
+ onBeforeLeave={()=>{
|
|
|
+ dispatch(setTabbarStatus(true))
|
|
|
+ }}
|
|
|
+ onAfterLeave={() => { setShowModal(false); setShowModal2(false) }}
|
|
|
+ show={showModal || showModal2} round={true} overlay={true} position='bottom'
|
|
|
+ >
|
|
|
+ {
|
|
|
+ isModal1 ? modalDetail: modalDetail2
|
|
|
+ }
|
|
|
+ </PageContainer>
|
|
|
+
|
|
|
+ {/* {
|
|
|
showModal && modalDetail
|
|
|
}
|
|
|
{
|
|
|
showModal2 && modalDetail2
|
|
|
- }
|
|
|
+ } */}
|
|
|
|
|
|
</Layout>
|
|
|
)
|