panhui пре 5 година
родитељ
комит
fba48749ff

+ 7 - 11
Utils/SvgUtilsNew.js

@@ -112,14 +112,10 @@ export default new Map([
       viewBox: '0 0 106 97',
       pathList: [
         {
-          fill: '#fff',
-          strokeWidth: 4,
+          fill: 'rgb(255, 194, 28)',
           fillRule: 'evenodd',
-          strokeLinecap: 'butt',
-          strokeLinejoin: 'miter',
-          stroke: 'rgb(180, 180, 180)',
           d:
-            'M20.421,1.999 L83.579,1.999 C87.212,1.999 90.158,4.951 90.158,8.593 L102.000,85.374 C102.000,89.586 98.140,92.999 93.379,92.999 L10.621,92.999 C5.859,92.999 2.000,89.586 2.000,85.374 L13.842,8.593 C13.842,4.951 16.787,1.999 20.421,1.999 Z',
+            'M18.421,-0.001 L81.579,-0.001 C85.212,-0.001 88.158,2.952 88.158,6.594 L100.000,83.375 C100.000,87.586 96.140,90.999 91.379,90.999 L8.621,90.999 C3.859,90.999 -0.000,87.586 -0.000,83.375 L11.842,6.594 C11.842,2.952 14.788,-0.001 18.421,-0.001 Z',
         },
         {
           fill: '#fff',
@@ -127,9 +123,9 @@ export default new Map([
           fillRule: 'evenodd',
           strokeLinecap: 'butt',
           strokeLinejoin: 'miter',
-          stroke: 'rgb(180, 180, 180)',
+          stroke: '#fff',
           d:
-            'M29.500,44.218 L75.812,44.218 C77.193,44.218 78.312,45.338 78.312,46.719 L78.312,48.281 C78.312,49.662 77.193,50.781 75.812,50.781 L29.500,50.781 C28.119,50.781 27.000,49.662 27.000,48.281 L27.000,46.719 C27.000,45.338 28.119,44.218 29.500,44.218 Z',
+            'M27.500,42.219 L73.812,42.219 C75.193,42.219 76.312,43.338 76.312,44.719 L76.312,46.281 C76.312,47.662 75.193,48.781 73.812,48.781 L27.500,48.781 C26.119,48.781 25.000,47.662 25.000,46.281 L25.000,44.719 C25.000,43.338 26.119,42.219 27.500,42.219 Z',
         },
         {
           fill: '#fff',
@@ -137,15 +133,15 @@ export default new Map([
           fillRule: 'evenodd',
           strokeLinecap: 'butt',
           strokeLinejoin: 'miter',
-          stroke: 'rgb(180, 180, 180)',
+          stroke: '#fff',
           d:
-            'M36.094,25.750 L69.250,25.750 C70.631,25.750 71.750,26.869 71.750,28.250 L71.750,29.812 C71.750,31.193 70.631,32.312 69.250,32.312 L36.094,32.312 C34.713,32.312 33.594,31.193 33.594,29.812 L33.594,28.250 C33.594,26.869 34.713,25.750 36.094,25.750 Z',
+            'M34.094,23.750 L67.250,23.750 C68.631,23.750 69.750,24.869 69.750,26.250 L69.750,27.812 C69.750,29.193 68.631,30.312 67.250,30.312 L34.094,30.312 C32.713,30.312 31.594,29.193 31.594,27.812 L31.594,26.250 C31.594,24.869 32.713,23.750 34.094,23.750 Z',
         },
       ],
     },
   ],
   [
-    'order5',
+    'order2',
     {
       viewBox: '0 0 106 97',
       pathList: [

+ 1 - 1
components/HomeHeader.js

@@ -1,7 +1,7 @@
 import * as React from 'react'
 import { StatusBar, Platform } from 'react-native'
 import Constants from 'expo-constants'
-import { Appbar, Menu, Divider } from 'react-native-paper'
+import { Appbar, Menu } from 'react-native-paper'
 import { useBoolean } from '@umijs/hooks'
 import useModel from 'flooks'
 import words from '../flooks/Words'

+ 4 - 2
components/SvgIcon.js

@@ -19,17 +19,19 @@ function Icon(props) {
         },
       ]
     : []
+  console.log(color)
   const pathComList = () => {
     return pathList.map((item, index) => {
       const pathProps = { ...item }
-      if (fillAll || !item.fillRule) {
+      if ((fillAll || !item.strokeWidth) && color) {
         pathProps.fill = color
       }
 
-      if (item.fillRule) {
+      if (item.strokeWidth && color) {
         pathProps.stroke = color
       }
       delete pathProps.viewBox
+      console.log(pathProps)
       return <path {...pathProps} key={index} />
     })
   }

+ 0 - 1
language/index.js

@@ -1,5 +1,4 @@
 // I18n.js
-import * as Localization from 'expo-localization'
 import i18n from 'i18n-js'
 import th from './th'
 import zh from './zh'

+ 6 - 2
navigation/BottomTabNavigator.jsx

@@ -39,7 +39,7 @@ export default function BottomTabNavigator() {
             </Text>
           ),
           tabBarIcon: ({ focused }) => (
-            <Icon type={focused ? 'primary' : 'info'} name="order" />
+            <Icon name={focused ? 'order1' : 'order2'} />
           ),
         }}
       />
@@ -53,7 +53,11 @@ export default function BottomTabNavigator() {
             </Text>
           ),
           tabBarIcon: ({ focused }) => (
-            <Icon type={focused ? 'primary' : 'info'} name="user" />
+            <Icon
+              type={focused ? 'primary' : 'info'}
+              fillAll={!!focused}
+              name="user"
+            />
           ),
         }}
       />

+ 49 - 4
screens/Home/HomeScreen.jsx

@@ -1,9 +1,16 @@
 import * as WebBrowser from 'expo-web-browser'
 import * as React from 'react'
-import { Platform, StyleSheet } from 'react-native'
+import { Platform, StyleSheet, View } from 'react-native'
 import { ScrollView } from 'react-native-gesture-handler'
-import { WhiteSpace, WingBlank } from '@ant-design/react-native'
-import { Paragraph, Menu, Divider, Provider, Text } from 'react-native-paper'
+import { WhiteSpace, WingBlank, Carousel, Grid } from '@ant-design/react-native'
+import {
+  Paragraph,
+  Menu,
+  Divider,
+  Provider,
+  Text,
+  Card,
+} from 'react-native-paper'
 import Button from '../../components/Button'
 import Header from '../../components/HomeHeader'
 import Icon from '../../components/SvgIcon'
@@ -16,8 +23,39 @@ export default function HomeScreen() {
         <Button block size="small" type="info" onPress={() => {}}>
           搜索
         </Button>
-        <Icon />
       </WingBlank>
+
+      <View style={styles.main}>
+        <Carousel style={styles.wrapper} selectedIndex={2} autoplay infinite>
+          <Card>
+            <Card.Cover
+              source={{ uri: 'https://picsum.photos/700' }}
+              resizeMode="center"
+              borderRadius={0}
+            />
+          </Card>
+          <Card>
+            <Card.Cover
+              source={{ uri: 'https://picsum.photos/700' }}
+              resizeMode="center"9
+              borderRadius={0}
+            />
+          </Card>
+          <Card>
+            <Card.Cover
+              source={{ uri: 'https://picsum.photos/700' }}
+              resizeMode="center"
+              borderRadius={0}
+            />
+          </Card>
+        </Carousel>
+
+        <Grid
+          data={data}
+          columnNum={3}
+          itemStyle={{ height: 150, backgroundColor: '#ffff00' }}
+        />
+      </View>
     </ScrollView>
   )
 }
@@ -37,4 +75,11 @@ const styles = StyleSheet.create({
     fontSize: 10,
     color: '#AAAAAA',
   },
+  main: {
+    flex: 1,
+    paddingTop: 10,
+  },
+  wrapper: {
+    height: 80,
+  },
 })