leon há 1 ano atrás
pai
commit
57376617f9

+ 16 - 13
src/_account/pages/ChooseAuth.tsx

@@ -204,20 +204,23 @@ export default function Page() {
                         onClick={login1}
                     />
             }
+            {
+                process.env.TARO_ENV == 'rn' && <View style={{ height: 30 }} />
+            }
+            {
+                process.env.TARO_ENV == 'rn' && <NewButton
+                    type={NewButtonType.fill}
+                    color={MainColorType.success}
+                    title={t('page.choose_auth.btn_signup')}
+                    width={rpxToPx(646)}
+                    height={rpxToPx(96)}
+                    onClick={createAccount1}
+                />
+                // <ChooseScenarioBtn disable={btnDisable} title={t('page.choose_auth.btn_signup')} onClick={createAccount1} background={ColorType.fast} />
+            }
         </View>
-        {/* {
-            process.env.TARO_ENV == 'weapp' ? <ChooseScenarioBtn disable={btnDisable} title={t('page.choose_auth.btn_wechat')} onClick={getCode} background={ColorType.fast} /> :
-                <ChooseScenarioBtn disable={btnDisable} title={t('page.choose_auth.btn_login')} onClick={login1} background={ColorType.fast} />
-        } */}
-
-        <View style={{ height: 30 }} />
-        {
-            process.env.TARO_ENV == 'rn' && <ChooseScenarioBtn disable={btnDisable} title={t('page.choose_auth.btn_signup')} onClick={createAccount1} background={ColorType.fast} />
-        }
-        {/* <ChooseScenarioBtn title={t('page.choose_auth.btn_wechat')} onClick={login} background={ColorType.fast} /> */}
-        {/* <View style={{ height: 100 }} /> */}
 
-        {/* <Buttons title='微信登录' onClick={login} btnStyle={{ width: 289, marginBottom: 30,backgroundColor:ColorType.fast }} /> */}
-        {/* <Buttons title='Create account' type={ButtonType.outline} onClick={createAccount} btnStyle={{ width: 289, marginBottom: 30 }} /> */}
+
+
     </View>;
 }

+ 1 - 1
src/_health/components/no_data.tsx

@@ -7,7 +7,7 @@ import { MainColorType } from "@/context/themes/color";
 import { IconError } from "@/components/basic/Icons";
 export default function NoData(props: { refresh: Function }) {
     const { t } = useTranslation()
-    return <View className="no_data_bg" style={{marginTop:rpxToPx(256)}}>
+    return <View className="no_data_bg" style={{marginTop:rpxToPx(256),width:rpxToPx(750),alignItems:'center'}}>
         <View style={{
             backgroundColor:MainColorType.g04,
             width:rpxToPx(108),

+ 13 - 10
src/_health/pages/timeline_detail.tsx

@@ -92,18 +92,21 @@ export default function TimelineDetail() {
     console.log('进入页面获取参数')
     console.log(router.params)
 
-    const launchObj = Taro.getLaunchOptionsSync()
-    console.log('launchObj', launchObj)
-
-    if (launchObj.shareTicket) {
-        Taro.getShareInfo({
-            shareTicket: launchObj.shareTicket,
-            success(result) {
-                console.log('share info', result)
-            },
-        })
+    if (process.env.TARO_ENV == 'weapp') {
+        const launchObj = Taro.getLaunchOptionsSync()
+        console.log('launchObj', launchObj)
+
+        if (launchObj.shareTicket) {
+            Taro.getShareInfo({
+                shareTicket: launchObj.shareTicket,
+                success(result) {
+                    console.log('share info', result)
+                },
+            })
+        }
     }
 
+
     if (process.env.TARO_ENV == 'weapp'/* && global.allowShare*/) {
         Taro.updateShareMenu({
             withShareTicket: true,

+ 0 - 57
src/components/navigation/TabBar_副本.scss

@@ -1,57 +0,0 @@
-
-/* #ifdef weapp */
-.tabbar{
-    display: flex;
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    right: 0;
-    height: 103px;
-    flex-direction: row;
-    justify-content: space-around;
-    background-color: #000;
-    // background-color: #000;
-    // background-color: red;
-    padding-bottom: constant(safe-area-inset-bottom);
-    /* 兼容 iOS < 11.2 */
-    padding-bottom: env(safe-area-inset-bottom);
-    border-top-color: rgba(255,255,255,0.2);
-    border-top-width: 1px;
-    border-top-style: solid;
-    z-index: 100;
-}
-
-/* #endif */
-
-/* #ifdef rn */
-
-/* #endif */
-
-.tabbar-item{
-    color: rgba(255,255,255,0.4);
-    font-size: 36px;
-    line-height: 36px;
-    display: flex;
-    flex: 1;
-    align-items: center;
-    justify-content: center;
-    font-weight: bold;
-    position: relative;
-}
-
-.tabbar-item-sel{
-    color: #ffffff;
-    font-size: 40px;
-    line-height: 40px;
-    font-weight: bold;
-    position: relative;
-}
-
-.food-tab-badge{
-    position: absolute;
-    width: 20px;
-    height: 20px;
-    border-radius: 10px;
-    right:-10px;
-    top:-10px;
-}

+ 0 - 80
src/components/navigation/TabBar_副本.tsx

@@ -1,80 +0,0 @@
-import { View, Text } from '@tarojs/components'
-import './TabBar.scss'
-import Taro from '@tarojs/taro';
-import { useState } from 'react';
-import { useSelector } from 'react-redux';
-import { ColorType } from '@/context/themes/color';
-
-export default function Component(props: { index: number }) {
-    const common = useSelector((state: any) => state.common);
-    const [selIndex] = useState(props.index)
-    function switchTab(index: number) {
-        switch (index) {
-            case 0:
-
-                Taro.switchTab({
-                    url: '/pages/clock/Clock'
-                })
-                break;
-            case 2:
-                Taro.switchTab({
-                    url: '/pages/notification/setting'
-                })
-                break;
-            case 1:
-                Taro.switchTab({
-                    url: '/pages/metric/Metric'
-                })
-                break;
-            // case 2:
-
-            //     Taro.switchTab({
-            //         // url: '/pages/activity/Activity'
-            //         url:'/pages/workout/Workout'
-            //     })
-            //     break;
-            case 3:
-                Taro.switchTab({
-                    url: '/pages/account/Profile'
-                })
-                break;
-            case 4:
-                Taro.switchTab({
-                    url: '/pages/food/Food'
-                })
-                break;
-        }
-    }
-
-    return <View className='tabbar'>
-        <View className={selIndex == 0 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(0)}>
-            <Text>首页</Text>
-        </View>
-        <View className={selIndex == 2 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(2)}>
-            <Text>提醒</Text>
-        </View>
-        {/* <View className={selIndex == 4 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(4)}>
-            <View style={{ position: 'relative' }}>
-                <Text>饮食</Text>
-                {
-                    common.showFoodTabBadge && process.env.TARO_ENV == 'weapp' && <View className='food-tab-badge' style={{ backgroundColor: ColorType.food }} />
-                }
-            </View>
-
-        </View>
-        <View className={selIndex == 2 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(2)}>
-            <Text>运动</Text>
-        </View> */}
-        {/* <View className={selIndex == 2 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(2)}>
-            <Text>发现</Text>
-        </View> */}
-        <View className={selIndex == 1 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(1)}>
-            <Text>指标</Text>
-        </View>
-
-
-        <View className={selIndex == 3 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(3)}>
-            <Text>我</Text>
-        </View>
-    </View>
-}

+ 50 - 32
src/pages/clock/ClockIndex.tsx

@@ -19,7 +19,16 @@ import { useTranslation } from "react-i18next";
 import NoData from "@/_health/components/no_data";
 
 var timer
+let useNavigation,LinearGradient;
+if (process.env.TARO_ENV == 'rn') {
+    useNavigation = require("@react-navigation/native").useNavigation
+    LinearGradient = require('react-native-linear-gradient').default
+}
 export default function ClockIndex() {
+    const systemInfo: any = Taro.getWindowInfo ? Taro.getWindowInfo() : Taro.getSystemInfoSync();
+    // const navigationBarHeight = systemInfo.statusBarHeight + 44;
+    const screenHeight = systemInfo.screenHeight
+
     const user = useSelector((state: any) => state.user);
     const record = useSelector((state: any) => state.record);
     const [loaded, setLoaded] = useState(false)
@@ -34,34 +43,13 @@ export default function ClockIndex() {
     const { t } = useTranslation()
     global.dispatch = dispatch;
 
-    // const list = [{
-    //     title: '饮食',
-    //     title_en: 'Eat',
-    //     icon: 'eat.svg',
-    //     scenario: 'EAT'
-    // }, {
-    //     title: '锻炼',
-    //     title_en: 'Exercise',
-    //     icon: 'exercise.svg',
-    //     scenario: 'ACTIVE'
-    // }, {
-    //     title: '断食',
-    //     title_en: 'Fast',
-    //     icon: 'fast.svg',
-    //     scenario: 'FAST'
-    // }, {
-    //     title: '睡眠',
-    //     title_en: 'Sleep',
-    //     icon: 'sleep.svg',
-    //     scenario: 'SLEEP'
-    // }, {
-    //     title: '指标',
-    //     title_en: 'Metrics',
-    //     icon: 'metrics.svg',
-    //     scenario: 'METRIC'
-    // }]
     dayjs.locale(global.language == 'en' ? 'en' : 'zh-cn');
 
+    let navigation;
+    if (useNavigation) {
+        navigation = useNavigation()
+    }
+
     useEffect(() => {
         getHomeData()
     }, [user.isLogin])
@@ -103,7 +91,7 @@ export default function ClockIndex() {
 
     function tapItem(index) {
         if (!user.isLogin) {
-            jumpPage('/_account/pages/ChooseAuth')
+            jumpPage('/_account/pages/ChooseAuth', 'ChooseAuth', navigation)
             return
         }
         var scenarioObj = scenarios[index]
@@ -172,11 +160,42 @@ export default function ClockIndex() {
         }
     } />
 
+    function bgView() {
+        if (process.env.TARO_ENV == 'weapp') {
+            return <View className="main_bg" style={{ background: getBackground() }} />
+        }
+        var time = record.time
+        if (!time) return <View />
+        const { background_colors } = time
+        if (!background_colors) {
+            return <View />
+        }
+        else if (background_colors.length == 1) {
+            return <View />
+        }
+        return <LinearGradient style={{
+            position: 'absolute',
+            left: 0,
+            top: 0,
+
+            width: rpxToPx(750),
+            height: screenHeight,
+            zIndex: 0,
+            pointerEvents: 'none'
+        }}
+            colors={[background_colors[0], background_colors[1]]}
+            start={{ x: 0, y: 0 }}
+            end={{ x: 0, y: 1 }} pointerEvents="none" />
+    }
+
     if (!loaded) return <View />
 
     return <View style={{ position: 'relative' }}>
-        <ScrollView style={{ height: '100vh' }} scrollY><View style={{ position: 'relative', overflow: 'hidden',minHeight:'101vh' }}>
-            <View className="main_bg" style={{ background: getBackground() }} />
+        {
+            bgView()
+        }
+        <ScrollView style={{ height: process.env.TARO_ENV == 'weapp' ? '100vh' : '100%' }} scrollY><View style={{ position: 'relative', overflow: 'hidden', minHeight: process.env.TARO_ENV == 'weapp' ? '101vh' : '100%' }}>
+
             <View className="h60 bold" style={{ marginLeft: rpxToPx(52), marginTop: rpxToPx(212) }}>{record.time ? record.time.greeting : ''}</View>
             <View style={{ display: 'flex', flexDirection: 'row' }}>
                 <View className="h44 bold" style={{ marginLeft: rpxToPx(52), marginTop: rpxToPx(66), marginBottom: rpxToPx(32), position: 'relative', paddingBottom: rpxToPx(20) }}>{t('health.check_in')}
@@ -198,9 +217,8 @@ export default function ClockIndex() {
                                 <View className="h36 bold">{item.title}</View>
                                 <View className="h50 bold">{itemTime(item)}</View>
                                 <View style={{ flex: 1 }} />
-                                <View style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
+                                <View style={{ display: 'flex',flexDirection:'row', justifyContent: 'space-between', alignItems: 'center', }}>
                                     <Image src={item.icon} style={{ width: rpxToPx(48), height: rpxToPx(48) }} />
-                                    {/* <IconNext width={rpxToPx(36)} color="#000" /> */}
                                     <Image src={item.action_icon} style={{ width: rpxToPx(36), height: rpxToPx(36) }} />
                                 </View>
                             </View>
@@ -208,7 +226,7 @@ export default function ClockIndex() {
                     })
                 }
             </View>
-            <View style={{height:100}}/>
+            <View style={{ height: 100 }} />
 
 
         </View>

+ 1 - 1
src/pages/moment/moment.scss

@@ -19,7 +19,7 @@
 .message_avatar {
     width: 56px;
     height: 56px;
-    border-radius: 28rpx;
+    border-radius: 28px;
 }
 
 .share_guide_bg {

+ 0 - 2
src/pages/moment/moment.tsx

@@ -27,8 +27,6 @@ export default function Friend() {
     const [loaded, setLoaded] = useState(false)
     const { t } = useTranslation()
 
-    const launchObj = Taro.getLaunchOptionsSync()
-
     global.dispatch2 = dispatch;
 
 

+ 24 - 89
src/pages/moment/moment_main.tsx

@@ -46,7 +46,7 @@ export default function MomentMain() {
     const user = useSelector((state: any) => state.user);
 
 
-    const observerObjBottom = Taro.createIntersectionObserver().relativeToViewport({ bottom: 100 })
+    // const observerObjBottom = Taro.createIntersectionObserver().relativeToViewport({ bottom: 100 })
     const [loading, setLoading] = useState(false)
     const [noMore, setNoMore] = useState(false)
     const [friends, setFriends] = useState<any>([])
@@ -54,6 +54,7 @@ export default function MomentMain() {
 
     const systemInfo: any = Taro.getWindowInfo ? Taro.getWindowInfo() : Taro.getSystemInfoSync();
     const navigationBarHeight = systemInfo.statusBarHeight + 44;
+    const screenHeight = systemInfo.screenHeight
 
     const [itemLayouts, setItemLayouts] = useState<any>([])
     const [itemHeights, setItemHeights] = useState<any>([])
@@ -83,7 +84,7 @@ export default function MomentMain() {
     const [endSignal, setEndSignal] = useState(0)
 
     const [closeGuide, setCloseGuide] = useState(false)
-    const [showGuide,setShowGuide] = useState(false)
+    const [showGuide, setShowGuide] = useState(false)
     const [showShareGuide, setShowShareGuide] = useState(false)
     const [shareInfo, setShareInfo] = useState<any>(null)
     const query = Taro.createSelectorQuery()
@@ -173,7 +174,7 @@ export default function MomentMain() {
 
     useEffect(() => {
         myFriends()
-        if (router.params.type == 'share') {
+        if (router.params && router.params.type == 'share') {
             if (global.shareTicket) {
                 Taro.getShareInfo({
                     shareTicket: global.shareTicket,
@@ -196,11 +197,14 @@ export default function MomentMain() {
             measureItemLayouts()
         }, 300)
 
-        observerObjBottom.observe('#footer', (res) => {
-            setEndSignal(endSignal => endSignal + 1)
-            // if (moments.length==0) return
-            // loadMore()
-        })
+        if (process.env.TARO_ENV == 'weapp') {
+            const observerObjBottom = Taro.createIntersectionObserver().relativeToViewport({ bottom: 100 })
+            observerObjBottom && observerObjBottom.observe('#footer', (res) => {
+                setEndSignal(endSignal => endSignal + 1)
+            })
+        }
+
+
     }, [moments])
 
     useEffect(() => {
@@ -378,7 +382,7 @@ export default function MomentMain() {
     }
 
     function friendGuide() {
-        return <View style={{ position: 'fixed', left: 0, top: 0, width: rpxToPx(750), height: '100vh', zIndex: 100 }}>
+        return <View style={{ position: process.env.TARO_ENV == 'weapp' ? 'fixed' : 'absolute', left: 0, top: 0, width: rpxToPx(750), height: process.env.TARO_ENV == 'weapp' ? '100vh' : screenHeight, zIndex: 100 }}>
             <View style={{ height: navigationBarHeight, width: rpxToPx(750), backgroundColor: '#fff' }} />
             {/* <View onClick={() => {
                 setCloseGuide(true)
@@ -397,18 +401,18 @@ export default function MomentMain() {
                 </View>
             }
 
-            <FriendGuide closeShare={()=>{
-                setTimeout(()=>{
+            <FriendGuide closeShare={() => {
+                setTimeout(() => {
                     setShowGuide(false)
-                },500)
-            }}/>
+                }, 500)
+            }} />
             {
                 process.env.TARO_ENV == 'weapp' && <TabBar index={4} />
             }</View>
     }
 
     function empty() {
-        return <View style={{ position: 'fixed', left: 0, top: 0, width: rpxToPx(750), height: '100vh', zIndex: 100 }}>
+        return <View style={{ position: process.env.TARO_ENV == 'weapp' ? 'fixed' : 'absolute', left: 0, top: 0, width: rpxToPx(750), height: process.env.TARO_ENV == 'weapp' ? '100vh' : screenHeight, zIndex: 100 }}>
             <View style={{ height: navigationBarHeight, width: rpxToPx(750), backgroundColor: '#fff' }} />
             {
                 user.isLogin && <View style={{
@@ -467,7 +471,7 @@ export default function MomentMain() {
     function listDetail() {
         return <View >
             <View style={{
-                position: 'fixed',
+                position: process.env.TARO_ENV == 'weapp' ? 'fixed' : 'absolute',
                 top: 0,
                 left: 0,
                 zIndex: 10,
@@ -479,7 +483,7 @@ export default function MomentMain() {
                     <View onClick={more} style={{ position: 'absolute', left: 10, top: 0, bottom: 0, width: 44, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
                         <IconMenu color="#000" width={rpxToPx(40)} />
                     </View>
-                    <View onClick={()=>{
+                    <View onClick={() => {
                         setShowGuide(true)
                     }} style={{ position: 'absolute', left: 54, top: 0, bottom: 0, width: 44, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
                         <Image src={require('@assets/_health/wechat.png')} style={{ width: rpxToPx(48), height: rpxToPx(48) }} />
@@ -601,78 +605,6 @@ export default function MomentMain() {
 
 
         return listDetail()
-        return <View >
-            <View style={{
-                position: 'fixed',
-                top: 0,
-                left: 0,
-                zIndex: 10,
-                height: navigationBarHeight, width: rpxToPx(750), backgroundColor: '#fff', display: 'flex',
-                flexDirection: 'column', justifyContent: 'flex-end'
-            }}>
-                <View style={{ height: 44, width: rpxToPx(750), position: 'relative', display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }}>
-                    <View>{t('health.moments')}</View>
-                    <View onClick={more} style={{ position: 'absolute', left: 0, top: 0, bottom: 0, width: 80, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>More</View>
-                </View>
-            </View>
-            <View style={{ backgroundColor: '#fff', minHeight: '100vh', paddingTop: navigationBarHeight, marginTop: rpxToPx(60), paddingBottom: 100 }}>
-                {
-                    dashBoard && dashBoard.new_message && <View className="new_message_bg">
-
-                        <View className="new_message" onClick={() => {
-                            jumpPage('/_moment/pages/message')
-                        }}>
-                            {
-                                dashBoard.new_message.avatars.map((item, index) => {
-                                    return <Image className="message_avatar" src={item} key={index} style={{ zIndex: 9 - index, marginLeft: index == 0 ? rpxToPx(8) : -15 }} />
-                                })
-                            }
-                            <View className="h26 bold" style={{ color: '#fff', minWidth: rpxToPx(260), textAlign: 'center' }}>{dashBoard.new_message.message_tip}</View>
-                        </View>
-                    </View>
-                }
-                {
-                    moments.map((item, index) => {
-                        if (itemLayouts.length >= index + 1 && pageTop > 0) {
-                            if (Math.abs(itemLayouts[index] - pageTop) > 2000) {
-                                return <View style={{ height: itemHeights[index] }} id={`history-${index}`}>
-                                </View>
-                            }
-                            // if (Math.abs(itemLayouts[index] - pageTop) > 1500) {
-                            //     return <View style={{
-                            //         height: itemHeights[index], display: 'flex',
-                            //         paddingLeft: rpxToPx(40),
-                            //         paddingRight: rpxToPx(40),
-                            //         boxSizing: 'border-box',
-                            //         flexDirection: 'row'
-                            //     }} id={`history-${index}`}>
-                            //         <TimelineDate timestamp={item.window_range.start_timestamp}
-                            //             pre_timestamp={index > 0 ? list[index - 1].window_range.start_timestamp : null}
-                            //         />
-                            //         <View style={{
-                            //             display: 'flex', flexDirection: 'column', flex: 1,
-                            //             width: rpxToPx(552), height: itemHeights[index] - rpxToPx(60), backgroundColor: '#fafafa'
-                            //         }}>
-                            //         </View>
-                            //     </View>
-                            // }
-
-                        }
-                        return <View key={index} id={`history-{index}`}>
-                            <MomentItem data={item} />
-                        </View>
-                    })
-                }
-
-                <ListFooter noMore={noMore} loading={loading} />
-
-            </View>
-
-
-            {
-                process.env.TARO_ENV == 'weapp' && <TabBar index={4} />
-            }
-        </View>
     }
 
     return <View>
@@ -680,7 +612,10 @@ export default function MomentMain() {
         {
             content()
         }
-        <MomentShare />
+        {
+            process.env.TARO_ENV == 'weapp' && <MomentShare />
+        }
+
 
     </View>
 

+ 6 - 1
src/pages/moment/moment_share.tsx

@@ -1,8 +1,13 @@
 import { useDispatch, useSelector } from "react-redux";
 import { useEffect, useState } from "react";
-import { View, Canvas } from "@tarojs/components";
+import { View } from "@tarojs/components";
 import Taro, { useDidShow } from "@tarojs/taro";
 
+let Canvas
+
+if (process.env.TARO_ENV == 'weapp'){
+    Canvas = require("@tarojs/components").Canvas
+}
 export default function MomentShare() {
     const user = useSelector((state: any) => state.user);
 

+ 9 - 63
src/pages/rn/RNMain.tsx

@@ -4,6 +4,7 @@ import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
 import { createStackNavigator } from '@react-navigation/stack';
 
 import Clock from '../clock/Clock'
+import Moment from '../moment/moment'
 import Metric from '../metric/Metric'
 
 import Profile from '../account/Profile'
@@ -74,7 +75,7 @@ const App: React.FC = () => {
 
 export default function RNMain() {
   const ClockPage = () => <Clock />
-  const ExplorePage = () => <Explore />
+  const MomentPage = () => <Moment />
   const MetricPage = () => <Metric />
   // const WorkoutPage = () => <Workout />
   const ProfilePage = () => <Profile />
@@ -135,6 +136,7 @@ export default function RNMain() {
           tabBarInactiveTintColor: '#b2b2b2', // 非活动标签的颜色
         })}>
         <Tab.Screen name="Home" component={ClockPage} options={{
+          headerShown: false,
           tabBarIcon: ({ size, focused, color }) => {
             return (
               <Image
@@ -145,74 +147,18 @@ export default function RNMain() {
             );
           },
         }} />
-        {/* <Tab.Screen name="Reminders" component={NotificationSetting} options={{
+        <Tab.Screen name="Moment" component={MomentPage} options={{
+          headerShown: false,
           tabBarIcon: ({ size, focused, color }) => {
             return (
               <Image
                 resizeMode='contain'
                 style={{ width: size, height: size }}
-                source={focused ? require('@assets/images/notification_focus.png') : require('@assets/images/notification_nonfocus.png')}
+                source={focused ? require('@assets/_health/social_sel.png') : require('@assets/_health/social.png')}
               />
             );
           },
         }} />
-        <Tab.Screen name="Metrics" component={MetricPage} options={{
-          tabBarIcon: ({ size, focused, color }) => {
-            return (
-              <Image
-                resizeMode='contain'
-                style={{ width: size, height: size }}
-                source={focused ? require('@assets/images/metric_focus.png') : require('@assets/images/metric_nonfocus.png')}
-              />
-            );
-          },
-        }} /> */}
-        {/* <Tab.Screen name="Explore" component={ExplorePage} options={{
-          tabBarIcon: ({ size, focused, color }) => {
-            return (
-              <Image
-                resizeMode='contain'
-                style={{ width: size, height: size }}
-                source={require('@assets/images/camera.png')}
-              />
-            );
-          },
-        }} /> */}
-        {/* <Tab.Screen name='DemoA' component={DemoAPage} /> */}
-        {/* <Tab.Screen name="Food" component={FoodPage} options={{
-          tabBarIcon: ({size,focused,color}) => {
-            return (
-              <Image
-              resizeMode='contain'
-                style={{ width: size, height: size }}
-                source={require('@assets/images/camera.png')}
-              />
-            );
-          },
-        }}/> */}
-        {/* <Tab.Screen name="Metrics" component={MetricPage} options={{
-          tabBarIcon: ({ size, focused, color }) => {
-            return (
-              <Image
-                resizeMode='contain'
-                style={{ width: size, height: size }}
-                source={require('@assets/images/camera.png')}
-              />
-            );
-          },
-        }} /> */}
-
-        {/* <Tab.Screen name="Workouts" component={WorkoutPage} options={{
-          tabBarIcon: ({size,focused,color}) => {
-            return (
-              <Image
-              resizeMode='contain'
-                style={{ width: size, height: size }}
-                source={require('@assets/images/camera.png')}
-              />
-            );
-          },
-        }}/> */}
         <Tab.Screen name="Profile" component={ProfilePage} options={{
           tabBarIcon: ({ size, focused, color }) => {
             return (
@@ -235,18 +181,18 @@ export default function RNMain() {
         primary: 'white',
         card: 'white',
         border: 'transparent',
-        background: 'white',
+        background: '#f5f5f5',
         notification: 'red'
       }
     }}>
       <StatusBar barStyle='dark-content' backgroundColor="#fff" />
       <Stack.Navigator screenOptions={({ route }) => ({
         headerStyle: {
-          backgroundColor: 'black',
+          backgroundColor: '#f5f5f5',
           borderBottomWidth: 0, // 隐藏导航条底部边框
           borderBottomColor: 'red'
         },
-        headerTintColor: 'white',
+        headerTintColor: 'black',
         tabBarStyle: { backgroundColor: 'black' }, // tabbar的背景色
         tabBarActiveTintColor: 'white', // 活动标签的颜色
         tabBarInactiveTintColor: 'gray', // 非活动标签的颜色

+ 3 - 3
src/services/http/request.ts

@@ -100,8 +100,6 @@ export async function request<T>(param: RequestParam): Promise<T> {
         }
         // header['Authorization'] = `Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmYXN0IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImIzNWJmMjFiMjc0ZmVhOWJkN2Y2ZjQzMGUxNDY4ZjQxIiwidHlwIjoiQmVhcmVyIiwic2Vzc2lvbl9zdGF0ZSI6IjFhZWE1M2UxN2ExNWJjZmZkZjc3ZGNhYWI5Zjc4MmNkIiwibmlja25hbWUiOiLnp4B-WGl1IiwiaWF0IjoxNzMzNTY4OTU5LCJleHAiOjIwNDkxMDE3NTl9.QoBTixnIHNx26alD5HKzzO441qOAlWMrmOMzprT99Mg`
 
-
-
         const timer = setTimeout(() => {
             requestTask && requestTask.abort();
             console.log('timeout');
@@ -138,7 +136,7 @@ export async function request<T>(param: RequestParam): Promise<T> {
         //     requestData.remove('showAlert')
         // }
 
-
+        debugger
         requestTask = Taro.request({
             url: url,
             method: method,
@@ -146,6 +144,7 @@ export async function request<T>(param: RequestParam): Promise<T> {
             timeout: kTimeout,
             data: data || {},
             success: (response: Resp | { [key: string]: any }) => {
+                debugger
                 clearTimeout(timer);
                 const { statusCode, data } = response;
 
@@ -226,6 +225,7 @@ export async function request<T>(param: RequestParam): Promise<T> {
                 }
             },
             fail: err => {
+                debugger
                 if ((err as any).statusCode >= 200 && (err as any).statusCode < 300) {
                     clearTimeout(timer);
                     resolve()