u
This commit is contained in:
1 parent
7a9a22e02e
commit
ba9ce9e81b
8 files changed
+377
-248
No files matched your search
@@ -86,7 +86,9 @@ export default function TabsLayout() {
|
||||
zIndex: 0,
|
||||
elevation: 24,
|
||||
shadowColor: '#000',
|
||||
shadowOffset: { width: 0, height: 100 },
|
||||
shadowOffset: { width: 0, height: 20 },
|
||||
borderTopWidth: 1,
|
||||
borderTopColor: '#f2f3f5',
|
||||
}}
|
||||
>
|
||||
<TouchableOpacity className="w-12 items-center justify-center">
|
||||
|
||||
@@ -1,85 +1,28 @@
|
||||
import SegmentedControl from '@react-native-segmented-control/segmented-control'
|
||||
import React, { useState } from 'react'
|
||||
import { ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native'
|
||||
import { ATab } from '@/components/common/ao'
|
||||
import { AButton, ADateMorePicker, ATab } from '@/components/common/ao'
|
||||
|
||||
export default function DemoDatePickerUI() {
|
||||
const [index, setIndex] = useState(0)
|
||||
const [show, setShow] = useState(false)
|
||||
|
||||
return (
|
||||
<View style={{ flex: 1, backgroundColor: '#f3f4f6', padding: 16 }}>
|
||||
{/* 快捷选项栏 */}
|
||||
<ScrollView horizontal showsHorizontalScrollIndicator={false} style={{ marginBottom: 12 }}>
|
||||
<ATab
|
||||
data={[
|
||||
{
|
||||
label: '不限',
|
||||
key: '不限',
|
||||
},
|
||||
{
|
||||
label: '今天',
|
||||
key: '今天',
|
||||
},
|
||||
{
|
||||
label: '本月',
|
||||
key: '本月',
|
||||
},
|
||||
{
|
||||
label: '本年',
|
||||
key: '本年',
|
||||
},
|
||||
|
||||
]}
|
||||
/>
|
||||
</ScrollView>
|
||||
|
||||
{/* SegmentedControl */}
|
||||
<SegmentedControl
|
||||
values={['时间', '日', '月', '年', '范围']}
|
||||
selectedIndex={index}
|
||||
onChange={event => setIndex(event.nativeEvent.selectedSegmentIndex)}
|
||||
style={styles.segmentedControl}
|
||||
sliderStyle={styles.sliderStyle}
|
||||
/>
|
||||
|
||||
{/* 日期选择器占位 */}
|
||||
<View style={styles.datePickerPlaceholder}>
|
||||
<Text style={{ color: '#888' }}>这里显示日期选择器</Text>
|
||||
</View>
|
||||
<View className="flex-1">
|
||||
<AButton
|
||||
onPress={() => {
|
||||
setShow(true)
|
||||
}}
|
||||
className="mt-20"
|
||||
>
|
||||
测试
|
||||
</AButton>
|
||||
<ADateMorePicker
|
||||
visible={show}
|
||||
onClose={() => {
|
||||
setShow(false)
|
||||
}}
|
||||
>
|
||||
</ADateMorePicker>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
quickOption: {
|
||||
paddingVertical: 6,
|
||||
paddingHorizontal: 12,
|
||||
backgroundColor: '#fff',
|
||||
borderRadius: 6,
|
||||
borderWidth: 1,
|
||||
borderColor: '#ccc',
|
||||
marginRight: 8,
|
||||
height: 32,
|
||||
},
|
||||
quickOptionText: {
|
||||
fontSize: 14,
|
||||
color: '#333',
|
||||
},
|
||||
segmentedControl: {
|
||||
borderRadius: 0,
|
||||
height: 36,
|
||||
backgroundColor: '#e5e7eb',
|
||||
marginBottom: 12,
|
||||
},
|
||||
sliderStyle: {
|
||||
borderRadius: 0,
|
||||
backgroundColor: '#2196f3',
|
||||
},
|
||||
datePickerPlaceholder: {
|
||||
height: 200,
|
||||
backgroundColor: '#fff',
|
||||
borderRadius: 6,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
},
|
||||
})
|
||||
@@ -209,7 +209,7 @@ export default function Money() {
|
||||
category: category.id,
|
||||
}))
|
||||
}}
|
||||
/>
|
||||
/>
|
||||
|
||||
<ADrawer
|
||||
visible={showActionsMenu}
|
||||
@@ -217,7 +217,7 @@ export default function Money() {
|
||||
setShowActionsMenu(false)
|
||||
}}
|
||||
menuPosition="right"
|
||||
height="60%"
|
||||
width="60%"
|
||||
showHeader={false}
|
||||
>
|
||||
<SafeAreaView className="flex-col px-3">
|
||||
|
||||
Reference in new issue
Block a user