|
|
@@ -40,15 +40,25 @@ import Header from '@/components/layout/Header'
|
|
|
import { TimeFormatter } from '@/utils/time_format'
|
|
|
import NoData from '@/components/view/NoData'
|
|
|
import { ColorType } from '@/context/themes/color'
|
|
|
+import { jumpPage } from '@/features/trackTimeDuration/hooks/Common'
|
|
|
// import TabBar from '../../components/Tabbar';
|
|
|
|
|
|
// import Rings from '@components/view/Rings';
|
|
|
|
|
|
+let useNavigation;
|
|
|
+if (process.env.TARO_ENV=='rn'){
|
|
|
+ useNavigation = require("@react-navigation/native").useNavigation
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
export default function IndexPage() {
|
|
|
- return <View >
|
|
|
- <View style={{width:100,height:100,borderWidth:2,borderColor:'pink'}}></View>
|
|
|
- </View>
|
|
|
+ let navigation;
|
|
|
+ if (useNavigation){
|
|
|
+ navigation = useNavigation()
|
|
|
+ }
|
|
|
+ return <View >
|
|
|
+ <View style={{ width: 100, height: 100, borderWidth: 2, borderColor: 'pink' }}></View>
|
|
|
+ </View>
|
|
|
const dispatch = useDispatch();
|
|
|
const { t } = useTranslation()
|
|
|
const [checkData, setCheckData] = useState(null)
|
|
|
@@ -71,7 +81,7 @@ export default function IndexPage() {
|
|
|
const [modalDetail2, setModalDetail2] = useState<any>({})
|
|
|
const [showSingleFastEnd, setShowSingleFastEnd] = useState(false)
|
|
|
const [consoleStatus, setConsoleStatus] = useState(consoleData.status)
|
|
|
-
|
|
|
+
|
|
|
|
|
|
global.dispatch = dispatch;
|
|
|
|
|
|
@@ -239,13 +249,11 @@ export default function IndexPage() {
|
|
|
|
|
|
function tapClock() {
|
|
|
if (!user.isLogin) {
|
|
|
- Taro.navigateTo({
|
|
|
- url: '/pages/account/ChooseAuth'
|
|
|
- })
|
|
|
+ jumpPage('/pages/account/ChooseAuth','ChooseAuth',navigation)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
function getCheckData() {
|
|
|
getClocks().then(res => {
|
|
|
@@ -303,7 +311,7 @@ export default function IndexPage() {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
function checkWXPubFollow() {
|
|
|
wxPubFollow().then(res => {
|
|
|
@@ -322,7 +330,7 @@ export default function IndexPage() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
function schedule() {
|
|
|
if (!user.isLogin) {
|
|
|
@@ -342,7 +350,7 @@ export default function IndexPage() {
|
|
|
return isNeed
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
global.showClockModal = (isShow: boolean, detail: any) => {
|
|
|
setShowModal(isShow)
|
|
|
@@ -367,7 +375,7 @@ export default function IndexPage() {
|
|
|
return <View />
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
function consoleView() {
|
|
|
if (!checkData) {
|
|
|
@@ -405,7 +413,7 @@ export default function IndexPage() {
|
|
|
</View>
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
function detail() {
|
|
|
@@ -436,9 +444,7 @@ export default function IndexPage() {
|
|
|
checkData && (checkData as any).latest_record &&
|
|
|
<SectionHeader top={48} bottom={24} title={t('feature.track_time_duration.record_fast_sleep.header.latest_record')}>
|
|
|
<Header title='' action={() => {
|
|
|
- Taro.navigateTo({
|
|
|
- url: '/pages/common/RecordsHistory?type=time&title=time'
|
|
|
- })
|
|
|
+ jumpPage('/pages/common/RecordsHistory?type=time&title=time')
|
|
|
}} />
|
|
|
</SectionHeader>
|
|
|
}
|