|
@@ -1,9 +1,3 @@
|
|
|
-import type { Customer as CustomerType } from '@/app/(tabs)/customer';
|
|
|
|
|
-import { SectionHeader } from '@/components/ui/section-header';
|
|
|
|
|
-import { Colors } from '@/constants/theme';
|
|
|
|
|
-import type { ListResponse } from '@/utils/api';
|
|
|
|
|
-import api from '@/utils/api';
|
|
|
|
|
-import { useSWC } from '@/utils/cache';
|
|
|
|
|
import { ActivityIndicator, Modal } from '@ant-design/react-native';
|
|
import { ActivityIndicator, Modal } from '@ant-design/react-native';
|
|
|
import { Ionicons } from '@expo/vector-icons';
|
|
import { Ionicons } from '@expo/vector-icons';
|
|
|
import { BlurView } from 'expo-blur';
|
|
import { BlurView } from 'expo-blur';
|
|
@@ -12,7 +6,13 @@ import React, { useCallback, useState } from 'react';
|
|
|
import { Pressable, Text, View } from 'react-native';
|
|
import { Pressable, Text, 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';
|
|
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
|
|
|
+import { SectionHeader } from '@/components/ui/section-header';
|
|
|
|
|
+import { Colors } from '@/constants/theme';
|
|
|
|
|
+import api from '@/utils/api';
|
|
|
|
|
+import { useSWC } from '@/utils/cache';
|
|
|
import { UploadComponent } from '../../components/upload';
|
|
import { UploadComponent } from '../../components/upload';
|
|
|
|
|
+import type { Customer as CustomerType } from '@/app/(tabs)/customer';
|
|
|
|
|
+import type { ListResponse } from '@/utils/api';
|
|
|
|
|
|
|
|
type AnalysisRecord = {
|
|
type AnalysisRecord = {
|
|
|
id: string;
|
|
id: string;
|
|
@@ -24,7 +24,7 @@ type AnalysisRecord = {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
export default function AnalyticsScreen() {
|
|
export default function AnalyticsScreen() {
|
|
|
- const { data: list, loading, error, load, refresh } = useSWC<ListResponse<AnalysisRecord>>("credit_index_list", async () => {
|
|
|
|
|
|
|
+ const { data: list, loading, load } = useSWC<ListResponse<AnalysisRecord>>("credit_index_list", async () => {
|
|
|
return api.post("credit/list", { size: 10 });
|
|
return api.post("credit/list", { size: 10 });
|
|
|
}, {
|
|
}, {
|
|
|
cacheOnly: true,
|
|
cacheOnly: true,
|
|
@@ -56,9 +56,9 @@ export default function AnalyticsScreen() {
|
|
|
navigation.navigate('customer/select', {
|
|
navigation.navigate('customer/select', {
|
|
|
current: selectedCustomer?.id,
|
|
current: selectedCustomer?.id,
|
|
|
onSelect: async (c: CustomerType| undefined) => {
|
|
onSelect: async (c: CustomerType| undefined) => {
|
|
|
- if (c?.loan_status != 'idle' && c?.loan_status != 'unmatch') {
|
|
|
|
|
|
|
+ if (c?.loan_status !== 'idle' && c?.loan_status !== 'unmatch') {
|
|
|
const res = await new Promise<boolean | void>((resolve)=>{
|
|
const res = await new Promise<boolean | void>((resolve)=>{
|
|
|
- Modal.alert("注意", `用户${c!.name} ${c!.loan_status == 'pending' ? '正在等待分析征信': '已有分析报告'}, 是否要再提交一份?`, [{
|
|
|
|
|
|
|
+ Modal.alert("注意", `用户${c!.name} ${c!.loan_status === 'pending' ? '正在等待分析征信': '已有分析报告'}, 是否要再提交一份?`, [{
|
|
|
text: '取消',
|
|
text: '取消',
|
|
|
style: {color: Colors.secondary.DEFAULT},
|
|
style: {color: Colors.secondary.DEFAULT},
|
|
|
onPress: ()=>resolve(false)
|
|
onPress: ()=>resolve(false)
|
|
@@ -79,7 +79,7 @@ export default function AnalyticsScreen() {
|
|
|
}, [selectedCustomer, setSelectedCustommer]);
|
|
}, [selectedCustomer, setSelectedCustommer]);
|
|
|
|
|
|
|
|
const onUploadComplete = useCallback((s?: 'cancel' | 'break') => {
|
|
const onUploadComplete = useCallback((s?: 'cancel' | 'break') => {
|
|
|
- if (s == 'break') {
|
|
|
|
|
|
|
+ if (s === 'break') {
|
|
|
handleSelectCustomer();
|
|
handleSelectCustomer();
|
|
|
}
|
|
}
|
|
|
}, [handleSelectCustomer]);
|
|
}, [handleSelectCustomer]);
|
|
@@ -118,14 +118,14 @@ export default function AnalyticsScreen() {
|
|
|
className="flex-row items-center rounded-2xl bg-surface-container-low px-4 py-3.5 active:opacity-90"
|
|
className="flex-row items-center rounded-2xl bg-surface-container-low px-4 py-3.5 active:opacity-90"
|
|
|
onPress={handleSelectCustomer}
|
|
onPress={handleSelectCustomer}
|
|
|
>
|
|
>
|
|
|
- <Ionicons name="person-outline" size={18} color="#737686" />
|
|
|
|
|
|
|
+ <Ionicons name="person-outline" size={18} color="#94a3b8" />
|
|
|
<Text className="ml-3 flex-1 text-base font-medium text-on-surface">
|
|
<Text className="ml-3 flex-1 text-base font-medium text-on-surface">
|
|
|
{selectedCustomer ? `${selectedCustomer.name}(${selectedCustomer.mobile})` : '无'}
|
|
{selectedCustomer ? `${selectedCustomer.name}(${selectedCustomer.mobile})` : '无'}
|
|
|
</Text>
|
|
</Text>
|
|
|
{selectedCustomer&&<Pressable className='mx-2' hitSlop={8} onPress={()=>setSelectedCustommer(undefined)}>
|
|
{selectedCustomer&&<Pressable className='mx-2' hitSlop={8} onPress={()=>setSelectedCustommer(undefined)}>
|
|
|
- <Ionicons name="close-circle" size={20} color="#c3c6d7" />
|
|
|
|
|
|
|
+ <Ionicons name="close-circle" size={20} color="#94a3b8" />
|
|
|
</Pressable>}
|
|
</Pressable>}
|
|
|
- <Ionicons name="chevron-down" size={18} color="#c3c6d7" />
|
|
|
|
|
|
|
+ <Ionicons name="chevron-down" size={18} color="#94a3b8" />
|
|
|
</Pressable>
|
|
</Pressable>
|
|
|
</View>
|
|
</View>
|
|
|
|
|
|
|
@@ -139,7 +139,7 @@ export default function AnalyticsScreen() {
|
|
|
{list?.list?.map((record) => (
|
|
{list?.list?.map((record) => (
|
|
|
<Pressable
|
|
<Pressable
|
|
|
key={record.id}
|
|
key={record.id}
|
|
|
- className="flex-row items-center rounded-2xl border border-outline-variant bg-surface-container-lowest px-4 py-3.5 active:opacity-93"
|
|
|
|
|
|
|
+ className="flex-row items-center rounded-2xl border border-outline-variant bg-surface-container-lowest px-4 py-3.5 active:opacity-90 active:scale-[0.99]"
|
|
|
>
|
|
>
|
|
|
<View
|
|
<View
|
|
|
className={`mr-3 h-11 w-11 items-center justify-center rounded-full ${record.status === 'completed'
|
|
className={`mr-3 h-11 w-11 items-center justify-center rounded-full ${record.status === 'completed'
|
|
@@ -160,10 +160,10 @@ export default function AnalyticsScreen() {
|
|
|
size={20}
|
|
size={20}
|
|
|
color={
|
|
color={
|
|
|
record.status === 'completed'
|
|
record.status === 'completed'
|
|
|
- ? '#16a34a'
|
|
|
|
|
|
|
+ ? Colors.success.DEFAULT
|
|
|
: record.status === 'pending'
|
|
: record.status === 'pending'
|
|
|
- ? '#2563eb'
|
|
|
|
|
- : '#ba1a1a'
|
|
|
|
|
|
|
+ ? Colors.tint
|
|
|
|
|
+ : Colors.error.DEFAULT
|
|
|
}
|
|
}
|
|
|
/>
|
|
/>
|
|
|
</View>
|
|
</View>
|
|
@@ -175,7 +175,7 @@ export default function AnalyticsScreen() {
|
|
|
</Text>
|
|
</Text>
|
|
|
<Text className="text-xs text-on-surface-variant">{record.createtime}</Text>
|
|
<Text className="text-xs text-on-surface-variant">{record.createtime}</Text>
|
|
|
</View>
|
|
</View>
|
|
|
- {(record.status === 'pending' || record.status == 'failed') && (
|
|
|
|
|
|
|
+ {(record.status === 'pending' || record.status === 'failed') && (
|
|
|
<View>
|
|
<View>
|
|
|
<View className="mb-2 flex-row items-center justify-between">
|
|
<View className="mb-2 flex-row items-center justify-between">
|
|
|
<Text className="text-sm text-on-surface-variant">...</Text>
|
|
<Text className="text-sm text-on-surface-variant">...</Text>
|
|
@@ -207,7 +207,7 @@ export default function AnalyticsScreen() {
|
|
|
|
|
|
|
|
</View>
|
|
</View>
|
|
|
|
|
|
|
|
- <Ionicons name="chevron-forward" size={18} color="#c3c6d7" />
|
|
|
|
|
|
|
+ <Ionicons name="chevron-forward" size={18} color="#94a3b8" />
|
|
|
</Pressable>
|
|
</Pressable>
|
|
|
))}
|
|
))}
|
|
|
</View>
|
|
</View>
|