Leon 2 лет назад
Родитель
Сommit
2d54c1a5c3

+ 1 - 0
src/components/input/LimitPickers.tsx

@@ -228,6 +228,7 @@ const Component = forwardRef((props: {
             <Text className='modal_title' style={{ color: color }}>{props.title ? props.title : '测试标题 '}</Text>
             <View style={{ backgroundColor: 'transparent', position: 'relative' }}>
                 <PickerView
+                    itemStyle={{ color: '#fff',margin:0,padding:0 }}
                     value={values}
                     className="picker"
                     maskClass="picker-mask"

+ 1 - 0
src/components/input/PickerViews.tsx

@@ -53,6 +53,7 @@ const Component = forwardRef((props: {
         <Text className='modal_title' style={{ color: color }}>{props.title ? props.title : '测试标题 '}</Text>
         <PickerView value={v}
             // color='#fff'
+            itemStyle={{color:'#fff'}}
             style={{color:'#fff'}}
             onChange={onPickerChange}
             indicatorStyle='height: 50px;'

+ 0 - 1
src/features/auth/components/login.tsx

@@ -77,7 +77,6 @@ export default function Login(props: { register: () => void }) {
         if (isLoginButtonDisabled) {
             return;
         }
-        console.log('begin login')
         login(name, password).then(res => {
             dispatch(loginSuccess(res))
             clientId()

+ 33 - 7
src/pages/clock/demoA.tsx

@@ -1,15 +1,41 @@
-// import { View } from "@tarojs/components";
+import { View, PickerView, PickerViewColumn } from "@tarojs/components";
 import { useEffect, useLayoutEffect, useRef, useState } from "react";
-import { LayoutChangeEvent, View,Text } from "react-native";
+import { LayoutChangeEvent, Text } from "react-native";
 
 export default function DemoA() {
-    useEffect(()=>{
-        alert('a')
-    },[])
+    useEffect(() => {
+    }, [])
+
+    const years = [0,1,2,3,4,5]
+    const months = [0,1,2,3,4,5]
+    const days = [0,1,2,3,4,5]
 
     return (
-        <View style={{  backgroundColor: 'blue', height:100,width:200 }} >
-            <Text style={{color:'red',fontSize:50}}>hello world</Text>
+        <View style={{ backgroundColor: 'blue', height: 800, width: 375 }} >
+            <Text style={{ color: 'red', fontSize: 50 }}>hello world</Text>
+            <PickerView title="hhhh" itemStyle={{color:'#fff'}} indicatorStyle='height: 50px;' style='width: 100%; height: 300px;color:white' value={[0,1,2,3,4]} onChange={(e)=>{}}>
+                <PickerViewColumn style={{color:'#fff'}}>
+                    {years.map(item => {
+                        return (
+                            <View style={{color:'white',opacity:0,backgroundColor:'pink'}}>{item}年</View>
+                        );
+                    })}
+                </PickerViewColumn>
+                <PickerViewColumn>
+                    {months.map(item => {
+                        return (
+                            <View>{item}月</View>
+                        )
+                    })}
+                </PickerViewColumn>
+                <PickerViewColumn>
+                    {days.map(item => {
+                        return (
+                            <View>{item}日</View>
+                        )
+                    })}
+                </PickerViewColumn>
+            </PickerView>
         </View>
     );
 }

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

@@ -10,7 +10,7 @@ import Profile from '../account/Profile'
 import ChooseAuth from '@/pages/account/ChooseAuth'
 import Auth from '@/pages/account/Auth'
 import Setting from '@/pages/account/Setting'
-import SetSchedule  from '@/pages/clock/SetSchedule'
+import SetSchedule from '@/pages/clock/SetSchedule'
 import ChooseScenario from '@/pages/clock/ChooseScenario'
 import RecordsHistory from '@/pages/common/RecordsHistory'
 import Food from '@/pages/food/Food'
@@ -57,10 +57,11 @@ const App: React.FC = () => {
 */
 
 export default function RNMain() {
-  const ClockPage = ()=> <Clock />
-  const MetricPage = ()=> <Metric />
-  const WorkoutPage = ()=> <Workout />
-  const ProfilePage = ()=> <Profile />
+  const ClockPage = () => <Clock />
+  const MetricPage = () => <Metric />
+  const WorkoutPage = () => <Workout />
+  const ProfilePage = () => <Profile />
+  const DemoAPage = () => <DemoA />
   // const FoodPage = ()=><Food/>
 
   function tabNavigator() {
@@ -76,9 +77,10 @@ export default function RNMain() {
         tabBarInactiveTintColor: 'gray', // 非活动标签的颜色
       })}>
         <Tab.Screen name="Clock" component={ClockPage} />
+        <Tab.Screen name='DemoA' component={DemoAPage} />
         {/* <Tab.Screen name="Food" component={FoodPage} /> */}
         <Tab.Screen name="Metric" component={MetricPage} />
-        <Tab.Screen name="Workout" component={WorkoutPage}/>
+        <Tab.Screen name="Workout" component={WorkoutPage} />
         <Tab.Screen name="Profile" component={ProfilePage} />
       </Tab.Navigator>
     )
@@ -99,14 +101,14 @@ export default function RNMain() {
         headerStyle: {
           backgroundColor: 'black',
           borderBottomWidth: 0, // 隐藏导航条底部边框
-          borderBottomColor:'red'
+          borderBottomColor: 'red'
         },
         headerTintColor: 'white',
         tabBarStyle: { backgroundColor: 'black' }, // tabbar的背景色
         tabBarActiveTintColor: 'white', // 活动标签的颜色
         tabBarInactiveTintColor: 'gray', // 非活动标签的颜色
       })}>
-        <Stack.Screen name='Main' component={tabNavigator} options={{ headerShown: false }}/>
+        <Stack.Screen name='Main' component={tabNavigator} options={{ headerShown: false }} />
         <Stack.Screen name='ChooseAuth' component={ChooseAuth} />
         <Stack.Screen name='Auth' component={Auth} />
         <Stack.Screen name='Setting' component={Setting} />