|
@@ -1,3 +1,4 @@
|
|
|
|
|
+import { pressableStyle } from 'nativewind';
|
|
|
import { StatusBadge } from '@/components/ui/status-badge';
|
|
import { StatusBadge } from '@/components/ui/status-badge';
|
|
|
import type { ListResponse } from '@/utils/api';
|
|
import type { ListResponse } from '@/utils/api';
|
|
|
import api from '@/utils/api';
|
|
import api from '@/utils/api';
|
|
@@ -6,7 +7,7 @@ import { ActivityIndicator, Toast } from '@ant-design/react-native';
|
|
|
import { Ionicons } from '@expo/vector-icons';
|
|
import { Ionicons } from '@expo/vector-icons';
|
|
|
import clsx from 'clsx';
|
|
import clsx from 'clsx';
|
|
|
import { BlurView } from 'expo-blur';
|
|
import { BlurView } from 'expo-blur';
|
|
|
-import { Stack } from 'expo-router';
|
|
|
|
|
|
|
+import { Link, Stack } from 'expo-router';
|
|
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
|
import { Pressable, Text, TextInput, View } from 'react-native';
|
|
import { Pressable, Text, TextInput, View } from 'react-native';
|
|
|
import Animated, { Extrapolation, interpolate, useAnimatedScrollHandler, useAnimatedStyle, useSharedValue } from 'react-native-reanimated';
|
|
import Animated, { Extrapolation, interpolate, useAnimatedScrollHandler, useAnimatedStyle, useSharedValue } from 'react-native-reanimated';
|
|
@@ -40,10 +41,10 @@ function CustomerCard({ item }: { item: Customer }) {
|
|
|
return (
|
|
return (
|
|
|
<Pressable
|
|
<Pressable
|
|
|
className="rounded-2xl border border-outline-variant bg-surface-container-lowest px-4 py-4"
|
|
className="rounded-2xl border border-outline-variant bg-surface-container-lowest px-4 py-4"
|
|
|
- style={({ pressed }) => ({
|
|
|
|
|
|
|
+ style={pressableStyle(({ pressed }) => ({
|
|
|
opacity: pressed ? 0.93 : 1,
|
|
opacity: pressed ? 0.93 : 1,
|
|
|
transform: [{ scale: pressed ? 0.995 : 1 }],
|
|
transform: [{ scale: pressed ? 0.995 : 1 }],
|
|
|
- })}
|
|
|
|
|
|
|
+ }))}
|
|
|
>
|
|
>
|
|
|
<View className="mb-3 flex-row items-start justify-between gap-3">
|
|
<View className="mb-3 flex-row items-start justify-between gap-3">
|
|
|
<View className="flex-1 flex-row items-center gap-3">
|
|
<View className="flex-1 flex-row items-center gap-3">
|
|
@@ -76,14 +77,12 @@ function CustomerCard({ item }: { item: Customer }) {
|
|
|
|
|
|
|
|
<View className="flex-row gap-3">
|
|
<View className="flex-row gap-3">
|
|
|
<Pressable
|
|
<Pressable
|
|
|
- className="flex-1 items-center rounded-xl bg-primary-container py-2.5"
|
|
|
|
|
- style={({ pressed }) => ({ opacity: pressed ? 0.88 : 1 })}
|
|
|
|
|
|
|
+ className="flex-1 items-center rounded-xl bg-primary-container py-2.5 active:opacity-88"
|
|
|
>
|
|
>
|
|
|
<Text className="text-sm font-bold text-on-primary">{item.loan_status}</Text>
|
|
<Text className="text-sm font-bold text-on-primary">{item.loan_status}</Text>
|
|
|
</Pressable>
|
|
</Pressable>
|
|
|
<Pressable
|
|
<Pressable
|
|
|
- className="flex-1 items-center rounded-xl bg-surface-container-high py-2.5"
|
|
|
|
|
- style={({ pressed }) => ({ opacity: pressed ? 0.88 : 1 })}
|
|
|
|
|
|
|
+ className="flex-1 items-center rounded-xl bg-surface-container-high py-2.5 active:opacity-88"
|
|
|
>
|
|
>
|
|
|
<Text className="text-sm font-semibold text-on-surface">编辑资料</Text>
|
|
<Text className="text-sm font-semibold text-on-surface">编辑资料</Text>
|
|
|
</Pressable>
|
|
</Pressable>
|
|
@@ -231,10 +230,9 @@ export default function CustomerScreens() {
|
|
|
<Pressable
|
|
<Pressable
|
|
|
key={key}
|
|
key={key}
|
|
|
onPress={() => handleSelectStatus(key as CustomerLoanStatus)}
|
|
onPress={() => handleSelectStatus(key as CustomerLoanStatus)}
|
|
|
- className={clsx('rounded-md px-1 border border-transparent', {
|
|
|
|
|
|
|
+ className={clsx('rounded-md px-1 border border-transparent active:opacity-84', {
|
|
|
'border-primary-container': active,
|
|
'border-primary-container': active,
|
|
|
})}
|
|
})}
|
|
|
- style={({ pressed }) => ({ opacity: pressed ? 0.84 : 1 })}
|
|
|
|
|
>
|
|
>
|
|
|
<Text
|
|
<Text
|
|
|
className={clsx('text-sm font-bold text-on-surface-variant', {
|
|
className={clsx('text-sm font-bold text-on-surface-variant', {
|
|
@@ -307,17 +305,17 @@ export default function CustomerScreens() {
|
|
|
</Animated.View>
|
|
</Animated.View>
|
|
|
),
|
|
),
|
|
|
}} />
|
|
}} />
|
|
|
- <View style={{bottom: insets.bottom + 44}} className="absolute pb-2 right-5">
|
|
|
|
|
|
|
+ <Link asChild href="/customer/add" style={{bottom: insets.bottom + 44 + 12}} className="absolute pb-2 right-5">
|
|
|
<Pressable
|
|
<Pressable
|
|
|
className="h-14 w-14 items-center justify-center rounded-full bg-primary-container"
|
|
className="h-14 w-14 items-center justify-center rounded-full bg-primary-container"
|
|
|
- style={({ pressed }) => ({
|
|
|
|
|
|
|
+ style={pressableStyle(({ pressed }) => ({
|
|
|
opacity: pressed ? 0.88 : 1,
|
|
opacity: pressed ? 0.88 : 1,
|
|
|
transform: [{ scale: pressed ? 0.94 : 1 }],
|
|
transform: [{ scale: pressed ? 0.94 : 1 }],
|
|
|
- })}
|
|
|
|
|
|
|
+ }))}
|
|
|
>
|
|
>
|
|
|
<Ionicons name="person-add" size={22} color="#ffffff" />
|
|
<Ionicons name="person-add" size={22} color="#ffffff" />
|
|
|
</Pressable>
|
|
</Pressable>
|
|
|
- </View>
|
|
|
|
|
|
|
+ </Link>
|
|
|
</>
|
|
</>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|