浏览代码

rn 适配

leon 1 年之前
父节点
当前提交
8d96800891

+ 10 - 2
src/_health/base/new_timepicker.scss

@@ -1,7 +1,15 @@
-.pick_sel_item{
+/* #ifdef weapp */
+.pick_sel_item {
     height: 80px !important;
     background-color: #FF2E661A !important;
     border: solid 1px #ffffff00 !important;
     // border-radius: 40px !important;
     color: aqua !important;
-}
+}
+
+/* #endif */
+
+/* #ifdef rn */
+.pick_sel_item {}
+
+/* #endif */

+ 4 - 4
src/components/layout/layout.tsx

@@ -185,12 +185,12 @@ export default function Layout(props: {
                     scrollEventThrottle={400}
                     // scrollTop={scrollTop}
                     // scrollWithAnimation
-                    style={{ minHeight: Taro.getSystemInfoSync().screenHeight }}
+                    style={{ minHeight: Taro.getSystemInfoSync().screenHeight,backgroundColor:'#f5f5f5' }}
                     refreshControl={
                         props.showPullToRefresh ? <RefreshControl
-                            tintColor='white'
-                            colors={['white']} // 设置刷新指示器的颜色为白色
-                            progressBackgroundColor="white" // 设置刷新指示器的背景颜色为白色
+                            tintColor='black'
+                            colors={['black']} // 设置刷新指示器的颜色为白色
+                            progressBackgroundColor="black" // 设置刷新指示器的背景颜色为白色
                             refreshing={isRefreshing}
                             onRefresh={onRefresh}
                         /> : null

+ 1 - 1
src/pages/account/Profile.tsx

@@ -267,7 +267,7 @@ export default function Page() {
     }
 
     function detail() {
-        return <View style={{ display: 'flex', flexDirection: 'column' }}>
+        return <View style={{ display: 'flex', flexDirection: 'column',backgroundColor:'#f5f5f5' }}>
 
             <View className="profile_card" onClick={tapProfile}>
                 <View className="avatar" style={{

+ 18 - 4
src/pages/clock/Clock.scss

@@ -1,21 +1,35 @@
-.tabs{
+.tabs {
     display: flex;
     flex-direction: row;
     align-items: center;
     justify-content: center;
-    .item{
+
+    .item {
         margin: 0 20px;
     }
 }
 
-.navi-bar{
+/* #ifdef weapp */
+.navi-bar {
     position: fixed;
     left: 0;
     right: 0;
     top: 0;
 }
 
-.navi-streak{
+/* #endif */
+
+/* #ifdef rn */
+.navi-bar {
+    position: absolute;
+    left: 0;
+    right: 0;
+    top: 0;
+}
+
+/* #endif */
+
+.navi-streak {
     display: flex;
     flex-direction: row;
     align-items: center;

+ 6 - 31
src/pages/clock/ClockNew.tsx

@@ -156,7 +156,7 @@ export default function ClockNew() {
     }
 
     function detail() {
-
+        // return <View>11111</View>
         if (!health.windows) {
             return <View />
         }
@@ -209,35 +209,10 @@ export default function ClockNew() {
                 }
             </ScrollView>
         }
-        {/* <View className="tabs">
-            <View className="item" onClick={() => tapScroll(0)}> tab 0</View>
-            <View className="item" onClick={() => tapScroll(1)}>tab 1</View>
-            <View className="item" onClick={() => tapScroll(2)}>tab 2</View>
-        </View>
-        <ScrollView scrollX
-            scrollLeft={scrollLeft}
-            scrollWithAnimation={true}
-            pagingEnabled={true}
-            enableFlex
-            onScroll={scroll}
-            style={{ width: rpxToPx(750), display: 'flex', flexDirection: 'row', overflow: 'hidden' }}
-            enhanced>
-            <View style={{ display: 'flex', flexShrink: 0, width: rpxToPx(750) }}>
-                <MainDayNightCard count={count} />
-            </View>
-            <View style={{ display: 'flex', flexShrink: 0, width: rpxToPx(750) }}>
-                <MainFastEatCard count={count} />
-            </View>
-
-            <View style={{ display: 'flex', flexShrink: 0, width: rpxToPx(750) }}>
-                <MainSleepActiveCard count={count} />
-            </View>
-
-
-
-
-        </ScrollView> */}
-
-        <TabBar index={0} />
+        {
+            process.env.TARO_ENV == 'weapp' && <TabBar index={0} />
+        }
+
+        
     </View>
 }

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

@@ -132,14 +132,14 @@ export default function RNMain() {
 
         screenOptions={({ route }) => ({
           headerStyle: {
-            backgroundColor: 'white',
+            backgroundColor: '#f5f5f5',
             // borderBottomColor:'#ffffff33',
             // borderBottomWidth: 1, // 隐藏导航条底部边框
           },
-          headerTintColor: 'white',
-          tabBarStyle: { backgroundColor: 'white', borderTopColor: '#ffffff22', borderTopWidth: 1 / PixelRatio.get() }, // tabbar的背景色
-          tabBarActiveTintColor: 'white', // 活动标签的颜色
-          tabBarInactiveTintColor: 'gray', // 非活动标签的颜色
+          headerTintColor: 'black',
+          tabBarStyle: { backgroundColor: '#f5f5f5', borderTopColor: '#ffffff22', borderTopWidth: 1 / PixelRatio.get() }, // tabbar的背景色
+          tabBarActiveTintColor: '#000000', // 活动标签的颜色
+          tabBarInactiveTintColor: '#b2b2b2', // 非活动标签的颜色
         })}>
         <Tab.Screen name="Home" component={ClockPage} options={{
           tabBarIcon: ({ size, focused, color }) => {
@@ -147,12 +147,12 @@ export default function RNMain() {
               <Image
                 resizeMode='contain'
                 style={{ width: size, height: size }}
-                source={focused ? require('@assets/images/home_focus.png') : require('@assets/images/home_nonfocus.png')}
+                source={focused ? require('@assets/_health/home_sel.png') : require('@assets/_health/home.png')}
               />
             );
           },
         }} />
-        <Tab.Screen name="Reminders" component={NotificationSetting} options={{
+        {/* <Tab.Screen name="Reminders" component={NotificationSetting} options={{
           tabBarIcon: ({ size, focused, color }) => {
             return (
               <Image
@@ -173,7 +173,7 @@ export default function RNMain() {
               />
             );
           },
-        }} />
+        }} /> */}
         {/* <Tab.Screen name="Explore" component={ExplorePage} options={{
           tabBarIcon: ({ size, focused, color }) => {
             return (
@@ -226,7 +226,7 @@ export default function RNMain() {
               <Image
                 resizeMode='contain'
                 style={{ width: size, height: size }}
-                source={focused ? require('@assets/images/profile_focus.png') : require('@assets/images/profile_nonfocus.png')}
+                source={focused ? require('@assets/_health/user_sel.png') : require('@assets/_health/user.png')}
               />
             );
           },
@@ -246,6 +246,7 @@ export default function RNMain() {
         notification: 'red'
       }
     }}>
+      <StatusBar barStyle='dark-content' backgroundColor="#fff" />
       <Stack.Navigator screenOptions={({ route }) => ({
         headerStyle: {
           backgroundColor: 'black',