commit
This commit is contained in:
+1
-1
@@ -26,7 +26,7 @@ export const apiCall = async <R, D = {}>(
|
|||||||
return response.data;
|
return response.data;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
const errorMessage = error?.response?.data?.error;
|
const errorMessage = error?.response?.data?.error;
|
||||||
// console.log(error?.response?.data.error, '---------------------------api error message');
|
|
||||||
|
|
||||||
if (error?.response?.statusCode === 401) {
|
if (error?.response?.statusCode === 401) {
|
||||||
store.dispatch(setToken({}));
|
store.dispatch(setToken({}));
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ const LiveAuction = () => {
|
|||||||
try {
|
try {
|
||||||
setAllBoolean(prev => ({ ...prev, isLoading: true }))
|
setAllBoolean(prev => ({ ...prev, isLoading: true }))
|
||||||
const res = await apiCall<any>('get', `${GET_MY_AUCTION}`,);
|
const res = await apiCall<any>('get', `${GET_MY_AUCTION}`,);
|
||||||
|
|
||||||
if (res?.statusCode === 200) {
|
if (res?.statusCode === 200) {
|
||||||
const purchasedIds = new Set(res.data.map((item: any) => item.auctionId));
|
const purchasedIds = new Set(res.data.map((item: any) => item.auctionId));
|
||||||
const filteredLive = data?.result.map((item: any) => ({ ...item, active: !purchasedIds.has(item.auctionId) }));
|
const filteredLive = data?.result.map((item: any) => ({ ...item, active: !purchasedIds.has(item.auctionId) }));
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import moment from 'moment';
|
|||||||
interface Props { visible: boolean; onClose: () => void; data?: any }
|
interface Props { visible: boolean; onClose: () => void; data?: any }
|
||||||
|
|
||||||
const AuctionFullDetail: React.FC<Props> = ({ visible, onClose, data }) => {
|
const AuctionFullDetail: React.FC<Props> = ({ visible, onClose, data }) => {
|
||||||
|
|
||||||
const inset = useSafeAreaInsets()
|
const inset = useSafeAreaInsets()
|
||||||
const { data: auctionData, isLoading } = useGetAuciton({ auctionId: data?.auctionId })
|
const { data: auctionData, isLoading } = useGetAuciton({ auctionId: data?.auctionId })
|
||||||
const [aucitonDetail, setAuciotnDetail] = useState<any>(auctionData)
|
const [aucitonDetail, setAuciotnDetail] = useState<any>(auctionData)
|
||||||
@@ -52,10 +53,10 @@ const AuctionFullDetail: React.FC<Props> = ({ visible, onClose, data }) => {
|
|||||||
|
|
||||||
const path = `${dirs.DownloadDir}/${fileName}.pdf`;
|
const path = `${dirs.DownloadDir}/${fileName}.pdf`;
|
||||||
|
|
||||||
// console.log('Saving to:', path);
|
|
||||||
|
|
||||||
const downloadUrl = `${AUCTION_DOCUMENT_DOWNLOAD}?documentId=${id}&isAmendment=false`;
|
const downloadUrl = `${AUCTION_DOCUMENT_DOWNLOAD}?documentId=${id}&isAmendment=false`;
|
||||||
// console.log('Download URL:', downloadUrl);
|
|
||||||
|
|
||||||
const response = await ReactNativeBlobUtil.config({
|
const response = await ReactNativeBlobUtil.config({
|
||||||
fileCache: false,
|
fileCache: false,
|
||||||
@@ -163,7 +164,7 @@ const AuctionFullDetail: React.FC<Props> = ({ visible, onClose, data }) => {
|
|||||||
<View style={[styles.iconCircle, { backgroundColor: '#fee2e2' }]}><Clock size={16} color="#ef4444" /></View>
|
<View style={[styles.iconCircle, { backgroundColor: '#fee2e2' }]}><Clock size={16} color="#ef4444" /></View>
|
||||||
<View>
|
<View>
|
||||||
<Text style={styles.label}>Purchase Deadline (End)</Text>
|
<Text style={styles.label}>Purchase Deadline (End)</Text>
|
||||||
<Text style={styles.value}>{formatDate(data?.purchaseEnd)}</Text>
|
<Text style={styles.value}>{formatDate(data?.keyDates?.auctionPurchase?.startDateTime)}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -41,10 +41,10 @@ const AuctionItemDetail: React.FC<Props> = ({ visible, onClose, data }) => {
|
|||||||
|
|
||||||
const path = `${dirs.DownloadDir}/${fileName}.pdf`;
|
const path = `${dirs.DownloadDir}/${fileName}.pdf`;
|
||||||
|
|
||||||
// console.log('Saving to:', path);
|
|
||||||
|
|
||||||
const downloadUrl = `${AUCTION_ITEM_DOCUMENT_DOWNLOAD}?auctionItemId=${id}`;
|
const downloadUrl = `${AUCTION_ITEM_DOCUMENT_DOWNLOAD}?auctionItemId=${id}`;
|
||||||
// console.log('Download URL:', downloadUrl);
|
|
||||||
|
|
||||||
const response = await ReactNativeBlobUtil.config({
|
const response = await ReactNativeBlobUtil.config({
|
||||||
fileCache: false,
|
fileCache: false,
|
||||||
|
|||||||
@@ -142,7 +142,9 @@ const PurchaseAuctionList = () => {
|
|||||||
);
|
);
|
||||||
purchaseListMutation({ auctionNumbers, contractorId: LoginUser.contractorId }, {
|
purchaseListMutation({ auctionNumbers, contractorId: LoginUser.contractorId }, {
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
|
console.log("purchaseListMutation",res)
|
||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
|
|
||||||
setList(res.data)
|
setList(res.data)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { View, Text, StyleSheet, ScrollView, TouchableOpacity } from 'react-native';
|
import { View, Text, StyleSheet, ScrollView, TouchableOpacity } from 'react-native';
|
||||||
import Animated, { FadeIn, FadeOut, Layout, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
import Animated, { FadeIn, FadeOut, Layout, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
||||||
import { ChevronDown, Trash2, Info } from 'lucide-react-native';
|
import { ChevronDown, Trash2, Info } from 'lucide-react-native';
|
||||||
@@ -17,6 +17,13 @@ const PurchaseList = () => {
|
|||||||
const toggleExpand = (index: number) => {
|
const toggleExpand = (index: number) => {
|
||||||
setExpandedIndex(prev => (prev === index ? null : index));
|
setExpandedIndex(prev => (prev === index ? null : index));
|
||||||
};
|
};
|
||||||
|
useEffect(() => {
|
||||||
|
if (!SelectedPurchaseList || SelectedPurchaseList.length < 1) {
|
||||||
|
Navigation.goBack();
|
||||||
|
}
|
||||||
|
}, [SelectedPurchaseList]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.screen}>
|
<View style={styles.screen}>
|
||||||
|
|||||||
+29
-13
@@ -4,7 +4,7 @@ import Animated, { useSharedValue, useAnimatedStyle, withDelay, withTiming } fro
|
|||||||
import { Layers, Clock, ShoppingCart, X, FileText } from 'lucide-react-native';
|
import { Layers, Clock, ShoppingCart, X, FileText } from 'lucide-react-native';
|
||||||
import { Header } from '../../Component/Index';
|
import { Header } from '../../Component/Index';
|
||||||
import colors from '../../Constant/Color';
|
import colors from '../../Constant/Color';
|
||||||
import { useDashboard, useESetuAdharVarification } from '../../Services/BBPS/Hooks';
|
import { useDashboard, useESetuAdharVarification, useTenderDashboard } from '../../Services/BBPS/Hooks';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import ConfirmDialog from '../../Constant/Dialog/ConfirmDialog';
|
import ConfirmDialog from '../../Constant/Dialog/ConfirmDialog';
|
||||||
import { generateTransactionId } from '../../Helper/uniqueId';
|
import { generateTransactionId } from '../../Helper/uniqueId';
|
||||||
@@ -62,12 +62,15 @@ const StatCard = ({ item, index, isLoading }: any) => {
|
|||||||
|
|
||||||
const Home = () => {
|
const Home = () => {
|
||||||
const { data, isLoading } = useDashboard();
|
const { data, isLoading } = useDashboard();
|
||||||
|
const { data: tenderData, isLoading: tenderLoading } = useTenderDashboard();
|
||||||
|
|
||||||
const Navigation: any = useNavigation();
|
const Navigation: any = useNavigation();
|
||||||
const user = useSelector((state: any) => state.token?.token);
|
const user = useSelector((state: any) => state.token?.token);
|
||||||
const { mutateAsync: eSetuAdharVarification, isPending } = useESetuAdharVarification();
|
const { mutateAsync: eSetuAdharVarification, isPending } = useESetuAdharVarification();
|
||||||
const dashboard = data?.data || {};
|
const dashboard = data?.data || {};
|
||||||
const [showDialog, setShowDialog] = useState<boolean>(false);
|
const [showDialog, setShowDialog] = useState<boolean>(false);
|
||||||
const [isNavigating, setIsNavigating] = useState<boolean>(false);
|
const [isNavigating, setIsNavigating] = useState<boolean>(false);
|
||||||
|
const [DASHBOARD_CARDS,setDASHBOARD_CARDS]=useState<any>([])
|
||||||
useFocusEffect(() => {
|
useFocusEffect(() => {
|
||||||
setIsNavigating(false)
|
setIsNavigating(false)
|
||||||
})
|
})
|
||||||
@@ -106,64 +109,75 @@ const Home = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const DASHBOARD_CARDS = [
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if (user?.userType === "auction") {
|
||||||
|
setDASHBOARD_CARDS([
|
||||||
{
|
{
|
||||||
title: 'Total Auctions',
|
title: 'Total Auctions',
|
||||||
value: dashboard.myAuctionCount ?? 0,
|
value: dashboard?.myAuctionCount ?? 0,
|
||||||
desc: 'Auctions purchased by you',
|
desc: 'Auctions purchased by you',
|
||||||
icon: Layers,
|
icon: Layers,
|
||||||
color: '#2563EB',
|
color: '#2563EB',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Live Auctions',
|
title: 'Live Auctions',
|
||||||
value: dashboard.liveAuctionCount ?? 0,
|
value: dashboard?.liveAuctionCount ?? 0,
|
||||||
desc: 'Currently live',
|
desc: 'Currently live',
|
||||||
icon: Clock,
|
icon: Clock,
|
||||||
color: '#0284C7',
|
color: '#0284C7',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Participated Auctions',
|
title: 'Participated Auctions',
|
||||||
value: dashboard.currentBiddingCount ?? 0,
|
value: dashboard?.currentBiddingCount ?? 0,
|
||||||
desc: 'Participated in auction',
|
desc: 'Participated in auction',
|
||||||
icon: ShoppingCart,
|
icon: ShoppingCart,
|
||||||
color: '#7C3AED',
|
color: '#7C3AED',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Cancelled Auctions',
|
title: 'Cancelled Auctions',
|
||||||
value: dashboard.cancelledAuctionCount ?? 0,
|
value: dashboard?.cancelledAuctionCount ?? 0,
|
||||||
desc: 'Cancelled by department',
|
desc: 'Cancelled by department',
|
||||||
icon: X,
|
icon: X,
|
||||||
color: '#DC2626',
|
color: '#DC2626',
|
||||||
},
|
},
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
setDASHBOARD_CARDS([
|
||||||
{
|
{
|
||||||
title: 'Total Tenders',
|
title: 'Total Tenders',
|
||||||
value: 0,
|
value: tenderData?.data?.[0]?.totalTender ?? 0,
|
||||||
desc: 'Tenders assigned',
|
desc: 'Tenders assigned',
|
||||||
icon: FileText,
|
icon: FileText,
|
||||||
color: '#16A34A',
|
color: '#16A34A',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Live Tenders',
|
title: 'Live Tenders',
|
||||||
value: 0,
|
value: tenderData?.data?.[0]?.liveTender ?? 0,
|
||||||
desc: 'Currently live',
|
desc: 'Currently live',
|
||||||
icon: Clock,
|
icon: Clock,
|
||||||
color: '#059669',
|
color: '#059669',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Participated Tenders',
|
title: 'Participated Tenders',
|
||||||
value: 0,
|
value: tenderData?.data?.[0]?.totalParticipate ?? 0,
|
||||||
desc: 'Participated in tender',
|
desc: 'Participated in tender',
|
||||||
icon: ShoppingCart,
|
icon: ShoppingCart,
|
||||||
color: '#0EA5E9',
|
color: '#0EA5E9',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Cancelled Tenders',
|
title: 'Cancelled Tenders',
|
||||||
value: 0,
|
value: tenderData?.data?.[0]?.cancelledTender ?? 0,
|
||||||
desc: 'Cancelled by authority',
|
desc: 'Cancelled by authority',
|
||||||
icon: X,
|
icon: X,
|
||||||
color: '#EF4444',
|
color: '#EF4444',
|
||||||
},
|
},
|
||||||
];
|
]);
|
||||||
|
}
|
||||||
|
},[tenderData,dashboard])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.screen}>
|
<View style={styles.screen}>
|
||||||
@@ -193,13 +207,15 @@ const Home = () => {
|
|||||||
numColumns={2}
|
numColumns={2}
|
||||||
columnWrapperStyle={styles.row}
|
columnWrapperStyle={styles.row}
|
||||||
contentContainerStyle={styles.list}
|
contentContainerStyle={styles.list}
|
||||||
renderItem={({ item, index }) => (
|
renderItem={({ item, index }) => {
|
||||||
|
return (
|
||||||
<StatCard
|
<StatCard
|
||||||
item={item}
|
item={item}
|
||||||
index={index}
|
index={index}
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
/>
|
/>
|
||||||
)}
|
)
|
||||||
|
}}
|
||||||
showsVerticalScrollIndicator={false}
|
showsVerticalScrollIndicator={false}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ import {
|
|||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { useNavigation } from '@react-navigation/native';
|
import { useNavigation } from '@react-navigation/native';
|
||||||
import colors from '../../Constant/Color';
|
import colors from '../../Constant/Color';
|
||||||
|
import { showToast } from '../../Constant/ShowDailog';
|
||||||
|
import NavigationString from '../../Constant/NavigationString';
|
||||||
|
|
||||||
interface ForgotModalProps {
|
interface ForgotModalProps {
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
@@ -28,7 +30,7 @@ const ForgotModal: React.FC<ForgotModalProps> = ({
|
|||||||
visible,
|
visible,
|
||||||
onClose
|
onClose
|
||||||
}) => {
|
}) => {
|
||||||
const navigation = useNavigation() as Navigation;
|
const Navigation = useNavigation<any>();
|
||||||
const [email, setEmail] = useState<string>('');
|
const [email, setEmail] = useState<string>('');
|
||||||
const [loading, setLoading] = useState<boolean>(false);
|
const [loading, setLoading] = useState<boolean>(false);
|
||||||
const [error, setError] = useState<string>('');
|
const [error, setError] = useState<string>('');
|
||||||
@@ -67,20 +69,10 @@ const ForgotModal: React.FC<ForgotModalProps> = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
Alert.alert(
|
showToast('OTP has been sent to your email address. Please check your inbox.')
|
||||||
'Success',
|
|
||||||
'OTP has been sent to your email address. Please check your inbox.',
|
|
||||||
[
|
|
||||||
{
|
|
||||||
text: 'OK',
|
|
||||||
onPress: () => {
|
|
||||||
onClose();
|
onClose();
|
||||||
navigation.navigate('ResetPassword', { email });
|
Navigation.navigate(NavigationString.ResetPassword, { email });
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
);
|
|
||||||
setEmail('');
|
|
||||||
} else {
|
} else {
|
||||||
const errorData = await response.text();
|
const errorData = await response.text();
|
||||||
console.error('API Error:', errorData);
|
console.error('API Error:', errorData);
|
||||||
|
|||||||
@@ -123,11 +123,13 @@ const Login = () => {
|
|||||||
Dispatch(setToken({ ...res.data, token: res.token, userType: activeType }));
|
Dispatch(setToken({ ...res.data, token: res.token, userType: activeType }));
|
||||||
handleGetData();
|
handleGetData();
|
||||||
} else {
|
} else {
|
||||||
|
setLoginLoading(false);
|
||||||
showErrorAlert(res.message)
|
showErrorAlert(res.message)
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
onError: err => {
|
onError: err => {
|
||||||
|
setLoginLoading(false);
|
||||||
showErrorAlert(err.message);
|
showErrorAlert(err.message);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -16,8 +16,10 @@ import {
|
|||||||
TextInputKeyPressEventData,
|
TextInputKeyPressEventData,
|
||||||
ToastAndroid,
|
ToastAndroid,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
|
import { Eye, EyeOff } from 'lucide-react-native';
|
||||||
import { BASE_URL } from '../../Services/BBPS/ApiUrls';
|
import { BASE_URL } from '../../Services/BBPS/ApiUrls';
|
||||||
import colors from '../../Constant/Color';
|
import colors from '../../Constant/Color';
|
||||||
|
|
||||||
interface ResetPasswordProps {
|
interface ResetPasswordProps {
|
||||||
route?: any;
|
route?: any;
|
||||||
navigation?: any;
|
navigation?: any;
|
||||||
@@ -45,12 +47,10 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
const confirmPasswordRef = useRef<TextInput>(null);
|
const confirmPasswordRef = useRef<TextInput>(null);
|
||||||
const resendTimerRef = useRef<NodeJS.Timeout | null>(null);
|
const resendTimerRef = useRef<NodeJS.Timeout | null>(null);
|
||||||
|
|
||||||
// Initialize resend cooldown from storage or set to 0
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
checkResendCooldown();
|
checkResendCooldown();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Clean up timer on unmount
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return () => {
|
return () => {
|
||||||
if (resendTimerRef.current) {
|
if (resendTimerRef.current) {
|
||||||
@@ -59,7 +59,6 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Update timer every second
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (resendCooldown > 0) {
|
if (resendCooldown > 0) {
|
||||||
resendTimerRef.current = setInterval(() => {
|
resendTimerRef.current = setInterval(() => {
|
||||||
@@ -98,13 +97,12 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const startResendCooldown = async () => {
|
const startResendCooldown = async () => {
|
||||||
const cooldownTime = 300; // 5 minutes in seconds
|
const cooldownTime = 300;
|
||||||
setResendCooldown(cooldownTime);
|
setResendCooldown(cooldownTime);
|
||||||
await AsyncStorage.setItem('otpResendTime', Date.now().toString());
|
await AsyncStorage.setItem('otpResendTime', Date.now().toString());
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Auto-submit OTP when all fields are filled
|
|
||||||
const fullOtp = otp.join('');
|
const fullOtp = otp.join('');
|
||||||
if (fullOtp.length === 6 && !isOtpVerified) {
|
if (fullOtp.length === 6 && !isOtpVerified) {
|
||||||
handleSubmitOtp();
|
handleSubmitOtp();
|
||||||
@@ -112,14 +110,13 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
}, [otp]);
|
}, [otp]);
|
||||||
|
|
||||||
const handleOtpChange = (value: string, index: number) => {
|
const handleOtpChange = (value: string, index: number) => {
|
||||||
if (!/^\d*$/.test(value)) return; // Only allow numbers
|
if (!/^\d*$/.test(value)) return;
|
||||||
|
|
||||||
const newOtp = [...otp];
|
const newOtp = [...otp];
|
||||||
newOtp[index] = value;
|
newOtp[index] = value;
|
||||||
setOtp(newOtp);
|
setOtp(newOtp);
|
||||||
setOtpError('');
|
setOtpError('');
|
||||||
|
|
||||||
// Auto-focus to next input
|
|
||||||
if (value && index < 5) {
|
if (value && index < 5) {
|
||||||
otpInputs.current[index + 1]?.focus();
|
otpInputs.current[index + 1]?.focus();
|
||||||
}
|
}
|
||||||
@@ -127,7 +124,6 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
|
|
||||||
const handleOtpKeyPress = (e: NativeSyntheticEvent<TextInputKeyPressEventData>, index: number) => {
|
const handleOtpKeyPress = (e: NativeSyntheticEvent<TextInputKeyPressEventData>, index: number) => {
|
||||||
if (e.nativeEvent.key === 'Backspace' && !otp[index] && index > 0) {
|
if (e.nativeEvent.key === 'Backspace' && !otp[index] && index > 0) {
|
||||||
// Move focus to previous input on backspace
|
|
||||||
otpInputs.current[index - 1]?.focus();
|
otpInputs.current[index - 1]?.focus();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -149,7 +145,6 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
setOtpError('');
|
setOtpError('');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Make the API request to verify OTP
|
|
||||||
const res = await axios.post(
|
const res = await axios.post(
|
||||||
`${BASE_URL}eproc/verify-otp?email=${encodeURIComponent(email)}&otp=${fullOtp}`,
|
`${BASE_URL}eproc/verify-otp?email=${encodeURIComponent(email)}&otp=${fullOtp}`,
|
||||||
null,
|
null,
|
||||||
@@ -167,7 +162,6 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
ToastAndroid.show('OTP verified successfully!', ToastAndroid.SHORT);
|
ToastAndroid.show('OTP verified successfully!', ToastAndroid.SHORT);
|
||||||
setIsOtpVerified(true);
|
setIsOtpVerified(true);
|
||||||
|
|
||||||
// Focus on password field after successful OTP verification
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
newPasswordRef.current?.focus();
|
newPasswordRef.current?.focus();
|
||||||
}, 100);
|
}, 100);
|
||||||
@@ -193,19 +187,16 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
const validateForm = (): boolean => {
|
const validateForm = (): boolean => {
|
||||||
let isValid = true;
|
let isValid = true;
|
||||||
|
|
||||||
// Validate OTP
|
|
||||||
if (!isOtpVerified) {
|
if (!isOtpVerified) {
|
||||||
setOtpError('Please verify OTP first');
|
setOtpError('Please verify OTP first');
|
||||||
isValid = false;
|
isValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate password
|
|
||||||
if (newPassword.length < 8) {
|
if (newPassword.length < 8) {
|
||||||
setPasswordError('Password must be at least 8 characters long');
|
setPasswordError('Password must be at least 8 characters long');
|
||||||
isValid = false;
|
isValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate confirm password
|
|
||||||
if (newPassword !== confirmPassword) {
|
if (newPassword !== confirmPassword) {
|
||||||
setConfirmPasswordError('Passwords do not match');
|
setConfirmPasswordError('Passwords do not match');
|
||||||
isValid = false;
|
isValid = false;
|
||||||
@@ -225,7 +216,6 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Make API call to reset password according to curl
|
|
||||||
const res = await axios.post(
|
const res = await axios.post(
|
||||||
`${BASE_URL}eproc/reset-password?email=${encodeURIComponent(email)}&otp=${otp.join('')}&newPassword=${encodeURIComponent(newPassword)}&confirmPassword=${encodeURIComponent(confirmPassword)}`,
|
`${BASE_URL}eproc/reset-password?email=${encodeURIComponent(email)}&otp=${otp.join('')}&newPassword=${encodeURIComponent(newPassword)}&confirmPassword=${encodeURIComponent(confirmPassword)}`,
|
||||||
null,
|
null,
|
||||||
@@ -245,7 +235,6 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
'Your password has been reset successfully.',
|
'Your password has been reset successfully.',
|
||||||
[{
|
[{
|
||||||
text: 'OK', onPress: () => {
|
text: 'OK', onPress: () => {
|
||||||
// Navigate to login screen
|
|
||||||
navigation.navigate('Login');
|
navigation.navigate('Login');
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
@@ -273,9 +262,8 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
setResendLoading(true);
|
setResendLoading(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Make API call to resend OTP
|
|
||||||
const res = await axios.post(
|
const res = await axios.post(
|
||||||
`${BASE_URL}eproc/send-otp-forgot-password?email=${encodeURIComponent(email)}`,
|
`https://procurelinc.in/EProcurementSB/eproc/send-otp-forgot-password?email=${encodeURIComponent(email)}`,
|
||||||
null,
|
null,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
@@ -285,12 +273,11 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (res.data?.statusCode === 200) {
|
if (res.data?.statusCode === 200) {
|
||||||
|
console.log("ress",res)
|
||||||
ToastAndroid.show('OTP sent successfully', ToastAndroid.SHORT);
|
ToastAndroid.show('OTP sent successfully', ToastAndroid.SHORT);
|
||||||
// Clear OTP fields
|
|
||||||
setOtp(['', '', '', '', '', '']);
|
setOtp(['', '', '', '', '', '']);
|
||||||
setIsOtpVerified(false);
|
setIsOtpVerified(false);
|
||||||
setOtpError('');
|
setOtpError('');
|
||||||
// Start the cooldown timer
|
|
||||||
startResendCooldown();
|
startResendCooldown();
|
||||||
} else {
|
} else {
|
||||||
throw new Error(res.data?.message || 'Failed to resend OTP');
|
throw new Error(res.data?.message || 'Failed to resend OTP');
|
||||||
@@ -325,7 +312,6 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
Enter the OTP sent to {email} and your new password
|
Enter the OTP sent to {email} and your new password
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
{/* OTP Input Section */}
|
|
||||||
<View style={styles.otpSection}>
|
<View style={styles.otpSection}>
|
||||||
<Text style={styles.sectionLabel}>OTP Code</Text>
|
<Text style={styles.sectionLabel}>OTP Code</Text>
|
||||||
<View style={styles.otpContainer}>
|
<View style={styles.otpContainer}>
|
||||||
@@ -363,10 +349,8 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
)}
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{/* Password Input Section - Only enabled after OTP verification */}
|
|
||||||
<View style={styles.passwordSection}>
|
<View style={styles.passwordSection}>
|
||||||
<Text style={styles.sectionLabel}>New Password</Text>
|
<Text style={styles.sectionLabel}>New Password</Text>
|
||||||
<View style={styles.passwordInputContainer}>
|
<View style={styles.passwordInputContainer}>
|
||||||
@@ -374,7 +358,7 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
ref={newPasswordRef}
|
ref={newPasswordRef}
|
||||||
style={[styles.input, passwordError ? styles.inputError : null, !isOtpVerified && styles.disabledInput]}
|
style={[styles.input, passwordError ? styles.inputError : null, !isOtpVerified && styles.disabledInput]}
|
||||||
placeholder="Enter new password"
|
placeholder="Enter new password"
|
||||||
placeholderTextColor={!isOtpVerified ? '#4f058bff' : '#000'}
|
placeholderTextColor={!isOtpVerified ? colors.lightText : colors.black}
|
||||||
value={newPassword}
|
value={newPassword}
|
||||||
onChangeText={(text) => {
|
onChangeText={(text) => {
|
||||||
setNewPassword(text);
|
setNewPassword(text);
|
||||||
@@ -390,9 +374,11 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
style={styles.eyeIcon}
|
style={styles.eyeIcon}
|
||||||
onPress={() => setNewPasswordVisible(!newPasswordVisible)}
|
onPress={() => setNewPasswordVisible(!newPasswordVisible)}
|
||||||
>
|
>
|
||||||
<Text style={styles.eyeIconText}>
|
{newPasswordVisible ? (
|
||||||
{newPasswordVisible ? '🙈' : '👁️'}
|
<EyeOff size={20} color={colors.primary} />
|
||||||
</Text>
|
) : (
|
||||||
|
<Eye size={20} color={colors.primary} />
|
||||||
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
@@ -404,7 +390,7 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
ref={confirmPasswordRef}
|
ref={confirmPasswordRef}
|
||||||
style={[styles.input, confirmPasswordError ? styles.inputError : null, !isOtpVerified && styles.disabledInput]}
|
style={[styles.input, confirmPasswordError ? styles.inputError : null, !isOtpVerified && styles.disabledInput]}
|
||||||
placeholder="Confirm new password"
|
placeholder="Confirm new password"
|
||||||
placeholderTextColor={!isOtpVerified ? '#4f058bff' : '#000'}
|
placeholderTextColor={!isOtpVerified ? colors.lightText : colors.black}
|
||||||
value={confirmPassword}
|
value={confirmPassword}
|
||||||
onChangeText={(text) => {
|
onChangeText={(text) => {
|
||||||
setConfirmPassword(text);
|
setConfirmPassword(text);
|
||||||
@@ -420,9 +406,11 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
style={styles.eyeIcon}
|
style={styles.eyeIcon}
|
||||||
onPress={() => setConfirmPasswordVisible(!confirmPasswordVisible)}
|
onPress={() => setConfirmPasswordVisible(!confirmPasswordVisible)}
|
||||||
>
|
>
|
||||||
<Text style={styles.eyeIconText}>
|
{confirmPasswordVisible ? (
|
||||||
{confirmPasswordVisible ? '🙈' : '👁️'}
|
<EyeOff size={20} color={colors.primary} />
|
||||||
</Text>
|
) : (
|
||||||
|
<Eye size={20} color={colors.primary} />
|
||||||
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
@@ -445,7 +433,7 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
)}
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
<TouchableOpacity
|
{!isOtpVerified&&<TouchableOpacity
|
||||||
style={[styles.resendButton, resendCooldown > 0 && styles.disabledResendButton]}
|
style={[styles.resendButton, resendCooldown > 0 && styles.disabledResendButton]}
|
||||||
onPress={handleResendOtp}
|
onPress={handleResendOtp}
|
||||||
disabled={resendLoading || resendCooldown > 0}
|
disabled={resendLoading || resendCooldown > 0}
|
||||||
@@ -459,7 +447,7 @@ const ResetPassword: React.FC<ResetPasswordProps> = ({ route, navigation }) => {
|
|||||||
) : (
|
) : (
|
||||||
<Text style={styles.resendButtonText}>Resend OTP</Text>
|
<Text style={styles.resendButtonText}>Resend OTP</Text>
|
||||||
)}
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</KeyboardAvoidingView>
|
</KeyboardAvoidingView>
|
||||||
);
|
);
|
||||||
@@ -550,12 +538,9 @@ const styles = StyleSheet.create({
|
|||||||
eyeIcon: {
|
eyeIcon: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
right: 15,
|
right: 15,
|
||||||
top: 13,
|
top: 15,
|
||||||
zIndex: 1,
|
zIndex: 1,
|
||||||
},
|
},
|
||||||
eyeIconText: {
|
|
||||||
fontSize: 20,
|
|
||||||
},
|
|
||||||
errorText: {
|
errorText: {
|
||||||
color: '#ff3b30',
|
color: '#ff3b30',
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import {
|
|||||||
} from 'lucide-react-native';
|
} from 'lucide-react-native';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
|
import { showSuccessAlert, showToast } from '../../Constant/ShowDailog';
|
||||||
|
|
||||||
const InfoRow = ({ label, value }: any) => (
|
const InfoRow = ({ label, value }: any) => (
|
||||||
<View style={styles.row}>
|
<View style={styles.row}>
|
||||||
@@ -78,7 +79,7 @@ const LiveTenderDetail = () => {
|
|||||||
Accept: 'application/pdf',
|
Accept: 'application/pdf',
|
||||||
});
|
});
|
||||||
const stat = await ReactNativeBlobUtil.fs.stat(path);
|
const stat = await ReactNativeBlobUtil.fs.stat(path);
|
||||||
Alert.alert('Download complete', `File saved to: ${path}`);
|
showToast('Download complete');
|
||||||
setDownloadingId(null);
|
setDownloadingId(null);
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
setDownloadingId(null);
|
setDownloadingId(null);
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ const ProceedToBidDetail = () => {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{/* Feature Flags */}
|
{/* Feature Flags
|
||||||
<View style={styles.section}>
|
<View style={styles.section}>
|
||||||
<Text style={styles.sectionTitle}>Available Features</Text>
|
<Text style={styles.sectionTitle}>Available Features</Text>
|
||||||
<View style={styles.chipsContainer}>
|
<View style={styles.chipsContainer}>
|
||||||
@@ -228,7 +228,7 @@ const ProceedToBidDetail = () => {
|
|||||||
<FeatureChip label="QCBS" enabled={tenderData?.showQCBS} />
|
<FeatureChip label="QCBS" enabled={tenderData?.showQCBS} />
|
||||||
<FeatureChip label="LCS" enabled={tenderData?.showLCS} />
|
<FeatureChip label="LCS" enabled={tenderData?.showLCS} />
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View> */}
|
||||||
|
|
||||||
{/* Final Status */}
|
{/* Final Status */}
|
||||||
<View style={styles.finalStatusCard}>
|
<View style={styles.finalStatusCard}>
|
||||||
@@ -266,9 +266,7 @@ const ProceedToBidDetail = () => {
|
|||||||
|
|
||||||
) :
|
) :
|
||||||
// <Text style={styles.footerText}>One time bidding is completed</Text>
|
// <Text style={styles.footerText}>One time bidding is completed</Text>
|
||||||
<TouchableOpacity onPress={() => navigation.navigate('ViewTenderDetail', tenderData)} style={[styles.actionButton, { borderColor: colors.primary, borderWidth: 1 }]}>
|
null
|
||||||
<Text>View Tender Bid Detail</Text>
|
|
||||||
</TouchableOpacity>
|
|
||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const PurchaseTenderTile = ({ item, onPressDetails }: any) => {
|
|||||||
const scale = useSharedValue(1);
|
const scale = useSharedValue(1);
|
||||||
const elevation = useSharedValue(8);
|
const elevation = useSharedValue(8);
|
||||||
const navigation = useNavigation<any>();
|
const navigation = useNavigation<any>();
|
||||||
|
console.log("obj000ect",item)
|
||||||
const animatedStyle = useAnimatedStyle(() => ({
|
const animatedStyle = useAnimatedStyle(() => ({
|
||||||
transform: [{ scale: scale.value }],
|
transform: [{ scale: scale.value }],
|
||||||
elevation: elevation.value,
|
elevation: elevation.value,
|
||||||
|
|||||||
@@ -32,17 +32,19 @@ import ReactNativeBlobUtil from 'react-native-blob-util';
|
|||||||
import { GET_DOCID } from '../../Services/BBPS/ApiUrls'
|
import { GET_DOCID } from '../../Services/BBPS/ApiUrls'
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
import EnvelopeCExcelPreview from './Component/EnvelopeCExcelPreview'
|
import EnvelopeCExcelPreview from './Component/EnvelopeCExcelPreview'
|
||||||
|
import { showSuccessAlert } from '../../Constant/ShowDailog'
|
||||||
|
|
||||||
const ViewTenderDetail = () => {
|
const ViewTenderDetail = () => {
|
||||||
const route: any = useRoute()
|
const route = useRoute<any>()
|
||||||
|
console.log("jjo",route?.params?.tenderId)
|
||||||
const { data: tenderResponse }: any = useFetchLiveTenderById(route?.params?.tenderId);
|
const { data: tenderResponse }: any = useFetchLiveTenderById(route?.params?.tenderId);
|
||||||
const tender = tenderResponse?.data;
|
const tender = tenderResponse?.data || {};
|
||||||
|
|
||||||
console.log("tender data : ", tender)
|
console.log("tender data : ", tender)
|
||||||
const { data } = useFetchTenderBidDetailById(route?.params?.tenderId)
|
const { data } = useFetchTenderBidDetailById(route?.params?.tenderId)
|
||||||
const Token = useSelector((state: any) => state.token.token)
|
const Token = useSelector((state: any) => state.token.token)
|
||||||
|
|
||||||
console.log("dasdddddddddddddddddddd : ", data)
|
// console.log("dasdddddddddddddddddddd:", data)
|
||||||
const formatDate = (dateArray: any) => {
|
const formatDate = (dateArray: any) => {
|
||||||
if (!dateArray) return "N/A";
|
if (!dateArray) return "N/A";
|
||||||
const [year, month, day, hour, minute] = dateArray;
|
const [year, month, day, hour, minute] = dateArray;
|
||||||
@@ -95,7 +97,7 @@ const ViewTenderDetail = () => {
|
|||||||
const stat = await ReactNativeBlobUtil.fs.stat(path);
|
const stat = await ReactNativeBlobUtil.fs.stat(path);
|
||||||
console.log('File size:', stat.size);
|
console.log('File size:', stat.size);
|
||||||
console.log("start : ", stat)
|
console.log("start : ", stat)
|
||||||
Alert.alert('Download complete', `File saved to: ${path}`);
|
showSuccessAlert(`Download complete `);
|
||||||
console.log("file response : ", response)
|
console.log("file response : ", response)
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
Alert.alert('Error', error?.message || 'Something went wrong while downloading.');
|
Alert.alert('Error', error?.message || 'Something went wrong while downloading.');
|
||||||
@@ -111,7 +113,7 @@ const ViewTenderDetail = () => {
|
|||||||
<Mail size={24} color={colors.primary} />
|
<Mail size={24} color={colors.primary} />
|
||||||
<Text style={styles.sectionTitle}>{title}</Text>
|
<Text style={styles.sectionTitle}>{title}</Text>
|
||||||
</View>
|
</View>
|
||||||
{data.map((item: any, index: number) => (
|
{data&& data.map((item: any, index: number) => (
|
||||||
<View key={index} style={styles.envelopeItem}>
|
<View key={index} style={styles.envelopeItem}>
|
||||||
<View style={styles.envelopeHeader}>
|
<View style={styles.envelopeHeader}>
|
||||||
<Text style={styles.labelName}>
|
<Text style={styles.labelName}>
|
||||||
@@ -278,7 +280,7 @@ const ViewTenderDetail = () => {
|
|||||||
</Text>
|
</Text>
|
||||||
{/* <Text style={styles.documentMeta}>Department User ID: {item.deptUserId}</Text> */}
|
{/* <Text style={styles.documentMeta}>Department User ID: {item.deptUserId}</Text> */}
|
||||||
</View>
|
</View>
|
||||||
{item.documentFileName && (
|
{item?.documentFileName && (
|
||||||
<TouchableOpacity style={styles.downloadButton}>
|
<TouchableOpacity style={styles.downloadButton}>
|
||||||
{/* <Download size={24} color={colors.primary} /> */}
|
{/* <Download size={24} color={colors.primary} /> */}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ interface InfoRowProps {
|
|||||||
const TenderBidding = () => {
|
const TenderBidding = () => {
|
||||||
const route = useRoute<any>();
|
const route = useRoute<any>();
|
||||||
const navigation = useNavigation();
|
const navigation = useNavigation();
|
||||||
console.log("-=-=-=-=-=",route)
|
|
||||||
|
|
||||||
console.log("ROUTE DATA",route)
|
|
||||||
|
|
||||||
|
|
||||||
const tenderId = useState<any>(route.params?.tenderId || null);
|
const tenderId = useState<any>(route.params?.tenderId || null);
|
||||||
|
|
||||||
@@ -51,11 +51,10 @@ const TenderBidding = () => {
|
|||||||
|
|
||||||
|
|
||||||
const bidData= tenderResponse?.data;
|
const bidData= tenderResponse?.data;
|
||||||
console.log(" --------------1",bidData)
|
|
||||||
const { data:tender, refetch } = useProceedToBid(route.params?.tenderId);
|
const { data:tender, refetch } = useProceedToBid(route.params?.tenderId);
|
||||||
const tenderData= tender?.data
|
const tenderData= tender?.data
|
||||||
|
|
||||||
console.log(" --------------2",tenderData)
|
|
||||||
const [activeEnvelope, setActiveEnvelope] = useState<EnvelopeType>('A');
|
const [activeEnvelope, setActiveEnvelope] = useState<EnvelopeType>('A');
|
||||||
const [envelopForm, setEnvelopForm] = useState<EnvelopeFormState>({
|
const [envelopForm, setEnvelopForm] = useState<EnvelopeFormState>({
|
||||||
A: {},
|
A: {},
|
||||||
@@ -331,7 +330,7 @@ const TenderBidding = () => {
|
|||||||
|
|
||||||
|
|
||||||
const handleSubmitEnvelopeA = async () => {
|
const handleSubmitEnvelopeA = async () => {
|
||||||
console.log("hitting here ",envelopForm?.[activeEnvelope])
|
|
||||||
if (!validateEnvelope()) {
|
if (!validateEnvelope()) {
|
||||||
Alert.alert('Validation Error', 'Please fill all mandatory fields');
|
Alert.alert('Validation Error', 'Please fill all mandatory fields');
|
||||||
return;
|
return;
|
||||||
@@ -339,7 +338,7 @@ const TenderBidding = () => {
|
|||||||
const payload = buildEnvelopePayload();
|
const payload = buildEnvelopePayload();
|
||||||
|
|
||||||
if (envelopForm?.[activeEnvelope]?.[3]) {
|
if (envelopForm?.[activeEnvelope]?.[3]) {
|
||||||
console.log("----",)
|
|
||||||
const result = await handleSubmitEnvelopeFile(SUBMIT_ENVELOPE_FILE_A)
|
const result = await handleSubmitEnvelopeFile(SUBMIT_ENVELOPE_FILE_A)
|
||||||
|
|
||||||
if (result && result?.statusCode === 200) {
|
if (result && result?.statusCode === 200) {
|
||||||
@@ -441,7 +440,7 @@ const TenderBidding = () => {
|
|||||||
// console.log( `bold ${tenderData?.[`tenderEnvelope${activeEnvelope}List`]}`,tenderData?.[`tenderEnvelope${activeEnvelope}List`])
|
// console.log( `bold ${tenderData?.[`tenderEnvelope${activeEnvelope}List`]}`,tenderData?.[`tenderEnvelope${activeEnvelope}List`])
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<InsideHeader title="Tender Bidding Start" showArrow />
|
<InsideHeader title="Tender Bidding" showArrow />
|
||||||
<ScrollView contentContainerStyle={styles.scrollContainer}>
|
<ScrollView contentContainerStyle={styles.scrollContainer}>
|
||||||
{/* Tender Info */}
|
{/* Tender Info */}
|
||||||
<View style={styles.card}>
|
<View style={styles.card}>
|
||||||
@@ -552,30 +551,30 @@ const TenderBidding = () => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<View style={styles.footer}>
|
<View style={styles.footer}>
|
||||||
{hasEnvelopes() && activeEnvelope !== 'C' ? (
|
{hasEnvelopes() && activeEnvelope !== 'C' &&
|
||||||
|
!(activeEnvelope === 'A' && bidData.envelopeASubmittStatus) &&
|
||||||
|
!(activeEnvelope === 'B' && bidData.envelopeBSubmittStatus) ? (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={styles.primaryButton}
|
style={styles.primaryButton}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
|
if (!check) {
|
||||||
|
Alert.alert('Info', 'check first terms & condition');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (activeEnvelope === 'A') {
|
if (activeEnvelope === 'A') {
|
||||||
if (!check) {
|
|
||||||
Alert.alert('Info', 'check first terms & condition');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
handleSubmitEnvelopeA();
|
handleSubmitEnvelopeA();
|
||||||
} else if (activeEnvelope === 'B') {
|
} else if (activeEnvelope === 'B') {
|
||||||
if (!check) {
|
|
||||||
Alert.alert('Info', 'check first terms & condition');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
handleSubmitEnvelopeB();
|
handleSubmitEnvelopeB();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
>
|
>
|
||||||
<Text style={styles.primaryButtonText}>
|
<Text style={styles.primaryButtonText}>
|
||||||
{loading ? <ActivityIndicator size={'small'} color={'#fff'} /> : `Submit Bid (${activeEnvelope})`}
|
{loading ? (
|
||||||
|
<ActivityIndicator size={'small'} color={'#fff'} />
|
||||||
|
) : (
|
||||||
|
`Submit Bid (${activeEnvelope})`
|
||||||
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
) : (
|
) : (
|
||||||
@@ -588,6 +587,7 @@ const TenderBidding = () => {
|
|||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ const ITEM_DOCUMENT_DOWNLOAD = `${BASE_URL_Auction}api/auction/home/downloadDocu
|
|||||||
|
|
||||||
// Rohit
|
// Rohit
|
||||||
const DASHBOARD_COUNT = `${BASE_URL_Auction}api/auction/home/dashboard/counts`
|
const DASHBOARD_COUNT = `${BASE_URL_Auction}api/auction/home/dashboard/counts`
|
||||||
|
const TENDER_DASHBOARD = `${BASE_URL}contractor/getAllContractorDashboradDetails`
|
||||||
const AUCTION_ONE_TIME_BID = `${BASE_URL_Auction}api/bidding/getBidForAuction`
|
const AUCTION_ONE_TIME_BID = `${BASE_URL_Auction}api/bidding/getBidForAuction`
|
||||||
const AUCITON_SINGLE_EMD = `${BASE_URL_Auction}api/auction/addEMDDocumentsAuctionWise`
|
const AUCITON_SINGLE_EMD = `${BASE_URL_Auction}api/auction/addEMDDocumentsAuctionWise`
|
||||||
const PURCHASE_AUCTION_LIST = `${BASE_URL_Auction}api/auction/proceedToPurchase`
|
const PURCHASE_AUCTION_LIST = `${BASE_URL_Auction}api/auction/proceedToPurchase`
|
||||||
@@ -165,6 +166,7 @@ export {
|
|||||||
GET_TENDER_BY_ID,
|
GET_TENDER_BY_ID,
|
||||||
GET_CONTRACTOR_PROFILE,
|
GET_CONTRACTOR_PROFILE,
|
||||||
ESETU_VARIFICATION,
|
ESETU_VARIFICATION,
|
||||||
TENDER_BID_DETAIL
|
TENDER_BID_DETAIL,
|
||||||
|
TENDER_DASHBOARD
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useInfiniteQuery, useMutation, useQuery } from '@tanstack/react-query';
|
import { useInfiniteQuery, useMutation, useQuery } from '@tanstack/react-query';
|
||||||
import { contractorStageThreeSubmit, contractorStageTwoSubmit, fetchAuctionItem, fetchCityDropdown, fetchDashboard, fetchEmdCheck, fetchLiveAuction, fetchLiveTender, fetchMasterData, fetchPurchaseAuction, fetchPurchaseAuctionList, fetchPurchaseTender, fetchTenderById, getAuction, getDesignation, getRagistrationState, offlineAuctionPurchase, offlineTenderPurchase, partnerShipSubmit, proceedToBid, registerContractor, sendAadhaarOtp, submitEnvelopeA, submitEnvelopeB, uploadEnvelopeFile, userAuctionLogin, userLogin, verifyAadhaarOtp, verifyGstNumber, verifyPanHandler, viewAuctionDocumentDownload, viewAuctionDocuments, viewAuctionItemDocuments, fetchPurchaseAuctionPage, tenderDetails, fetchLiveTenderById, fetchContractorProfile, updateUserProfile, eSetuAdharVarification, fetchTenderBidDetailById } from './apis';
|
import { contractorStageThreeSubmit, contractorStageTwoSubmit, fetchAuctionItem, fetchCityDropdown, fetchDashboard, fetchEmdCheck, fetchLiveAuction, fetchLiveTender, fetchMasterData, fetchPurchaseAuction, fetchPurchaseAuctionList, fetchPurchaseTender, fetchTenderById, getAuction, getDesignation, getRagistrationState, offlineAuctionPurchase, offlineTenderPurchase, partnerShipSubmit, proceedToBid, registerContractor, sendAadhaarOtp, submitEnvelopeA, submitEnvelopeB, uploadEnvelopeFile, userAuctionLogin, userLogin, verifyAadhaarOtp, verifyGstNumber, verifyPanHandler, viewAuctionDocumentDownload, viewAuctionDocuments, viewAuctionItemDocuments, fetchPurchaseAuctionPage, tenderDetails, fetchLiveTenderById, fetchContractorProfile, updateUserProfile, eSetuAdharVarification, fetchTenderBidDetailById, fetchTenderDashboard } from './apis';
|
||||||
|
|
||||||
// User
|
// User
|
||||||
|
|
||||||
@@ -21,7 +21,12 @@ export const useDashboard = () => {
|
|||||||
queryFn: () => fetchDashboard()
|
queryFn: () => fetchDashboard()
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
export const useTenderDashboard = () => {
|
||||||
|
return useQuery({
|
||||||
|
queryKey: ['fetchTenderDashboard'],
|
||||||
|
queryFn: () => fetchTenderDashboard()
|
||||||
|
});
|
||||||
|
};
|
||||||
// Auction & Tender
|
// Auction & Tender
|
||||||
|
|
||||||
export const useFetchPurchaseTender = () => {
|
export const useFetchPurchaseTender = () => {
|
||||||
|
|||||||
+18
-11
@@ -1,6 +1,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { AUCTION_DOCUMENT_DOWNLOAD, DASHBOARD_COUNT, EMD_CHECK, FORARD_AUCTION_ITEM, GET_AUCTION_DETAILS, GET_MY_AUCTION, GET_MY_TENDER, GET_TENDER_DETAILS, LIVE_AUCTION, LIVE_TENDER, LOG_IN_URL, PROCEED_PURCHASE_AUCTION, PROCEED_TO_BID, PURCHASE_TENDER_OFFLINE, TENDER_LOGIN, PURCHASE_AUCTION_LIST, PURCHASE_OFFLINE_AUCTION, REVERSE_AUCTION_ITEM, VIEW_AUCTION_DOCUMENTS, VIEW_AUCTION_ITEM_DETAIL, STAGETHREE, REJ_STAGE_TWO, GETCONTRACTORBYSTATE, GET_MASTER_DATA, ALL_DESIGNATION, GET_REGISTRATION_STATE, PARTNER_API_ENDPOINT, SAVE_CONTRACTOR_STAGE1, VERIFY_GST, VERIFY_ADHAR, SEND_ADHAROTP, SUBMIT_ENVELOPE_FILE_B, SUBMIT_ENVELOPE_FILE_A, SUBMIT_ENVELOPE_A, SUBMIT_ENVELOPE_B, VERIFY_ORGPAN, PURCHASE_AUCTION_PAGE, GET_TENDER_BY_ID, GET_CONTRACTOR_PROFILE, CONTRACTOR_PROFILE_UPDATE,
|
import { AUCTION_DOCUMENT_DOWNLOAD, DASHBOARD_COUNT, EMD_CHECK, FORARD_AUCTION_ITEM, GET_AUCTION_DETAILS, GET_MY_AUCTION, GET_MY_TENDER, GET_TENDER_DETAILS, LIVE_AUCTION, LIVE_TENDER, LOG_IN_URL, PROCEED_PURCHASE_AUCTION, PROCEED_TO_BID, PURCHASE_TENDER_OFFLINE, TENDER_LOGIN, PURCHASE_AUCTION_LIST, PURCHASE_OFFLINE_AUCTION, REVERSE_AUCTION_ITEM, VIEW_AUCTION_DOCUMENTS, VIEW_AUCTION_ITEM_DETAIL, STAGETHREE, REJ_STAGE_TWO, GETCONTRACTORBYSTATE, GET_MASTER_DATA, ALL_DESIGNATION, GET_REGISTRATION_STATE, PARTNER_API_ENDPOINT, SAVE_CONTRACTOR_STAGE1, VERIFY_GST, VERIFY_ADHAR, SEND_ADHAROTP, SUBMIT_ENVELOPE_FILE_B, SUBMIT_ENVELOPE_FILE_A, SUBMIT_ENVELOPE_A, SUBMIT_ENVELOPE_B, VERIFY_ORGPAN, PURCHASE_AUCTION_PAGE, GET_TENDER_BY_ID, GET_CONTRACTOR_PROFILE, CONTRACTOR_PROFILE_UPDATE,
|
||||||
ESETU_VARIFICATION, TENDER_BID_DETAIL } from "./ApiUrls";
|
ESETU_VARIFICATION, TENDER_BID_DETAIL,
|
||||||
|
TENDER_DASHBOARD} from "./ApiUrls";
|
||||||
import { apiCall } from "../../Axios/Axios";
|
import { apiCall } from "../../Axios/Axios";
|
||||||
|
|
||||||
// User
|
// User
|
||||||
@@ -47,12 +48,17 @@ export const fetchDashboard = async (): Promise<any> => {
|
|||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const fetchTenderDashboard = async (): Promise<any> => {
|
||||||
|
const data = await apiCall<any>('get', `${TENDER_DASHBOARD}`);
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
|
||||||
export const fetchPurchaseAuction = async (): Promise<any> => {
|
export const fetchPurchaseAuction = async (): Promise<any> => {
|
||||||
const data = await apiCall<any>('get', `${GET_MY_AUCTION}`);
|
const data = await apiCall<any>('get', `${GET_MY_AUCTION}`);
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
export const fetchPurchaseAuctionPage = async (payload: any): Promise<any> => {
|
export const fetchPurchaseAuctionPage = async (payload: any): Promise<any> => {
|
||||||
console.log(payload,'[[[[[[[[[[[[[[[[[[[[[[[[');
|
|
||||||
|
|
||||||
const data = await apiCall<any>('get', `${PURCHASE_AUCTION_PAGE}`, {}, payload);
|
const data = await apiCall<any>('get', `${PURCHASE_AUCTION_PAGE}`, {}, payload);
|
||||||
return data
|
return data
|
||||||
@@ -157,7 +163,7 @@ export const proceedToBid = async (tenderId: string): Promise<any> => {
|
|||||||
'get',
|
'get',
|
||||||
`${PROCEED_TO_BID}${tenderId}`
|
`${PROCEED_TO_BID}${tenderId}`
|
||||||
);
|
);
|
||||||
console.log("-=-=-=-=-89",data)
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,7 +245,7 @@ export const fetchCityDropdown = async (stateId: number): Promise<any> => {
|
|||||||
'get',
|
'get',
|
||||||
`${GETCONTRACTORBYSTATE}?stateId=${stateId}`,
|
`${GETCONTRACTORBYSTATE}?stateId=${stateId}`,
|
||||||
);
|
);
|
||||||
console.log("--",res)
|
|
||||||
if (res.statusCode !== 200 || !res.data) {
|
if (res.statusCode !== 200 || !res.data) {
|
||||||
throw new Error('Failed load cities');
|
throw new Error('Failed load cities');
|
||||||
}
|
}
|
||||||
@@ -273,14 +279,13 @@ export const getRagistrationState = async (): Promise<any> => {
|
|||||||
|
|
||||||
|
|
||||||
export const eSetuAdharVarification = async (payLoad:any ): Promise<any> => {
|
export const eSetuAdharVarification = async (payLoad:any ): Promise<any> => {
|
||||||
console.log("klkllklklklk",payLoad)
|
|
||||||
const data = await apiCall<any>(
|
const data = await apiCall<any>(
|
||||||
'post',
|
'post',
|
||||||
`${ESETU_VARIFICATION}`,
|
`${ESETU_VARIFICATION}`,
|
||||||
payLoad,
|
payLoad,
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log("ghghghghghhgg",data)
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -295,9 +300,11 @@ export const partnerShipSubmit = (
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const registerContractor = async (payload: any): Promise<any> => {
|
export const registerContractor = async (payload: any): Promise<any> => {
|
||||||
console.log("registerContractor payload : ", payload)
|
|
||||||
try {
|
try {
|
||||||
|
console.log("ragitration PayLoad " ,payload)
|
||||||
const response = await axios.post(SAVE_CONTRACTOR_STAGE1, { ...payload, device: "mobileApp" });
|
const response = await axios.post(SAVE_CONTRACTOR_STAGE1, { ...payload, device: "mobileApp" });
|
||||||
|
console.log("ragitration response " ,response)
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
throw error.response?.data || error.message;
|
throw error.response?.data || error.message;
|
||||||
@@ -349,15 +356,15 @@ export const verifyGstNumber = (
|
|||||||
|
|
||||||
|
|
||||||
export const submitEnvelopeA = async (payload: any) => {
|
export const submitEnvelopeA = async (payload: any) => {
|
||||||
console.log('SUBMIT ENVELOPE A API CALLED', payload)
|
|
||||||
const { data } = await apiCall<any>('post', SUBMIT_ENVELOPE_A, payload)
|
const { data } = await apiCall<any>('post', SUBMIT_ENVELOPE_A, payload)
|
||||||
console.log("data : ", data)
|
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
export const submitEnvelopeB = async (payload: any) => {
|
export const submitEnvelopeB = async (payload: any) => {
|
||||||
console.log('SUBMIT ENVELOPE B API CALLED', payload)
|
|
||||||
const { data } = await apiCall<any>('post', SUBMIT_ENVELOPE_B, payload)
|
const { data } = await apiCall<any>('post', SUBMIT_ENVELOPE_B, payload)
|
||||||
console.log("data : ", data)
|
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user