chore: update id order

This commit is contained in:
2026-03-28 17:00:00 +01:00
parent 5380abe8ed
commit 3bf3f5e605
48 changed files with 2347 additions and 3693 deletions
+1
View File
@@ -226,6 +226,7 @@ export interface OrderItem {
*/
export interface OrderDetail {
id: number;
client_order_number?: number;
username: string;
status: string;
delivery_address?: string;
@@ -327,7 +327,7 @@ export default function OrderDetailsScreen() {
>
<View style={styles.headerCard}>
<View style={styles.headerRow}>
<Text style={styles.title}>Commande #{order.id}</Text>
<Text style={styles.title}>Commande #{order.client_order_number ?? order.id}</Text>
<StatusBadge status={status} />
</View>
<Text style={styles.date}>
@@ -370,7 +370,7 @@ export default function OrderHistoryScreen() {
>
<View style={styles.orderHeader}>
<Text style={styles.orderIdText}>
Commande #{order.id}
Commande #{order.client_order_number ?? order.id}
</Text>
<StatusBadge status={order.status} />
</View>
@@ -406,7 +406,7 @@ export default function OrderTrackingScreen() {
>
<View style={styles.cardHeader}>
<Text style={styles.orderId}>
Commande #{order.id}
Commande #{order.client_order_number ?? order.id}
</Text>
<StatusBadge status={order.status} />
</View>
+114 -1
View File
@@ -6,6 +6,7 @@ import {
StyleSheet,
TouchableOpacity,
Alert,
Modal,
KeyboardAvoidingView,
Platform,
Linking,
@@ -45,6 +46,9 @@ export default function ProfileScreen() {
const [telegramEnabled, setTelegramEnabled] = useState(false);
const [telegramLoading, setTelegramLoading] = useState(false);
// Modal confirmation infos par défaut
const [showSaveModal, setShowSaveModal] = useState(false);
const loadData = useCallback(async () => {
setLoadingProfile(true);
const [savedAddress, savedPhone, savedSignal, profileRes, tgStatus] = await Promise.all([
@@ -85,6 +89,7 @@ export default function ProfileScreen() {
AsyncStorage.setItem(STORAGE_PHONE, defaultPhone.trim()),
AsyncStorage.setItem(STORAGE_SIGNAL, signalPseudo.trim()),
]);
setShowSaveModal(false);
Alert.alert("Enregistré", "Informations par défaut sauvegardées");
};
@@ -201,6 +206,74 @@ export default function ProfileScreen() {
},
saveBtnText: { color: "#fff", fontSize: fontSize.sm, fontWeight: fontWeight.semibold },
saveBtnTextSecondary: { color: colors.accent },
// Modal
modalOverlay: {
flex: 1,
backgroundColor: "rgba(0,0,0,0.6)",
justifyContent: "center",
alignItems: "center",
padding: spacing.l,
},
modalBox: {
backgroundColor: colors.bgCard,
borderRadius: borderRadius.md,
borderWidth: 1,
borderColor: colors.borderLight,
padding: spacing.xl,
width: "100%",
maxWidth: 360,
alignItems: "center",
},
modalIconWrap: {
width: 52,
height: 52,
borderRadius: 26,
backgroundColor: colors.accent + "22",
borderWidth: 1,
borderColor: colors.accent + "44",
justifyContent: "center",
alignItems: "center",
marginBottom: spacing.m,
},
modalTitle: {
color: colors.textPrimary,
fontSize: fontSize.md,
fontWeight: fontWeight.bold,
textAlign: "center",
marginBottom: spacing.s,
},
modalBody: {
color: colors.textMuted,
fontSize: fontSize.sm,
textAlign: "center",
lineHeight: 20,
marginBottom: spacing.l,
},
modalActions: {
flexDirection: "row",
gap: spacing.m,
width: "100%",
},
modalBtnCancel: {
flex: 1,
paddingVertical: spacing.m,
borderRadius: borderRadius.sm,
backgroundColor: "transparent",
borderWidth: 1,
borderColor: colors.borderLight,
alignItems: "center",
},
modalBtnConfirm: {
flex: 1,
paddingVertical: spacing.m,
borderRadius: borderRadius.sm,
backgroundColor: "transparent",
borderWidth: 1,
borderColor: colors.accent + "66",
alignItems: "center",
},
modalBtnCancelText: { color: colors.textMuted, fontSize: fontSize.sm, fontWeight: fontWeight.semibold },
modalBtnConfirmText: { color: colors.accent, fontSize: fontSize.sm, fontWeight: fontWeight.semibold },
}), [colors]);
if (loadingProfile) {
@@ -316,7 +389,7 @@ export default function ProfileScreen() {
</View>
<TouchableOpacity
style={[styles.saveBtn, styles.saveBtnSecondary]}
onPress={saveLocal}
onPress={() => setShowSaveModal(true)}
>
<Ionicons name="save-outline" size={16} color={colors.accent} />
<Text style={[styles.saveBtnText, styles.saveBtnTextSecondary]}>
@@ -365,6 +438,46 @@ export default function ProfileScreen() {
)}
</ScrollView>
<Modal
visible={showSaveModal}
transparent
animationType="fade"
onRequestClose={() => setShowSaveModal(false)}
>
<TouchableOpacity
style={styles.modalOverlay}
activeOpacity={1}
onPress={() => setShowSaveModal(false)}
>
<TouchableOpacity activeOpacity={1} onPress={() => {}}>
<View style={styles.modalBox}>
<View style={styles.modalIconWrap}>
<Ionicons name="save-outline" size={24} color={colors.accent} />
</View>
<Text style={styles.modalTitle}>Enregistrer les infos par défaut ?</Text>
<Text style={styles.modalBody}>
Adresse, téléphone de livraison et pseudo Signal seront sauvegardés et pré-remplis lors de vos prochaines commandes.
</Text>
<View style={styles.modalActions}>
<TouchableOpacity
style={styles.modalBtnCancel}
onPress={() => setShowSaveModal(false)}
>
<Text style={styles.modalBtnCancelText}>Annuler</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.modalBtnConfirm}
onPress={saveLocal}
>
<Text style={styles.modalBtnConfirmText}>Confirmer</Text>
</TouchableOpacity>
</View>
</View>
</TouchableOpacity>
</TouchableOpacity>
</Modal>
</KeyboardAvoidingView>
);
}