Browse Source

修复IconComponent导入问题和其他更新

main
unknown 2 weeks ago
parent
commit
d58dd90f33
  1. 8
      app/constants/productStatus.ts
  2. 1
      app/locales/en/translation.json
  3. 1
      app/locales/fr/translation.json
  4. 29
      app/screens/CartScreen.tsx
  5. 333
      app/screens/HomeScreen.tsx
  6. 8
      app/screens/ProductCard.tsx
  7. 127
      app/screens/productStatus/OrderDatails.tsx
  8. 5
      app/services/api/cart.ts
  9. 10
      app/services/api/orders.ts
  10. 2
      app/services/api/productApi.ts
  11. 32
      app/store/burialPoint.ts
  12. 146
      app/store/orderList.ts
  13. 28
      app/utils/languageUtils.ts
  14. 197
      event.js
  15. 194
      event.json
  16. 16
      event_list.json
  17. 18
      event_page.json
  18. 18
      page.json

8
app/constants/productStatus.ts

@ -13,8 +13,8 @@ export const productStatus: ProductStatus[] = [
// { icon: DocumentClockIcon, text: '付运费', textKey: 'order.status.pay_shipping', status: 6 },
{ icon: DocumentClockIcon, text: '待发货', textKey: 'order.status.waiting_shipment', status: 1 },
{ icon: DocumentApprovedIcon, text: '运输中', textKey: 'order.status.in_transit', status: 2 },
{ icon: DocumentApprovedIcon, text: '代收货', textKey: 'order.status.waiting_receipt', status: 3 },
{ icon: PdfDocumentIcon, text: '已完成', textKey: 'order.status.completed', status: 4 },
{ icon: DocumentClockIcon, text: '已取消', textKey: 'order.status.cancelled', status: 5 },
{ icon: DocumentClockIcon, text: '已退款', textKey: 'order.status.refunded', status: 6 }
// { icon: DocumentApprovedIcon, text: '代收货', textKey: 'order.status.waiting_receipt', status: 3 },
{ icon: PdfDocumentIcon, text: '已完成', textKey: 'order.status.completed', status: 3 },
{ icon: DocumentClockIcon, text: '已过期', textKey: 'order.status.cancelled', status: 4 },
// { icon: DocumentClockIcon, text: '已退款', textKey: 'order.status.refunded', status: 6 }
]

1
app/locales/en/translation.json

@ -235,6 +235,7 @@
"order.error.payment_update": "Failed to update payment method",
"order.details": "Order Details",
"order.information": "Order Information",
"order.error.add_cart": "Failed to add to cart",
"order.id": "Order ID",
"order.create_time": "Order Time",
"order.shipping_type": "Shipping Method",

1
app/locales/fr/translation.json

@ -166,6 +166,7 @@
"order.error.payment_update": "Échec de la mise à jour du mode de paiement",
"order.details": "Détails de la commande",
"order.information": "Informations de commande",
"order.error.add_cart": "Échec de l'ajout au panier",
"order.id": "ID de commande",
"order.create_time": "Date de commande",
"order.shipping_type": "Méthode d'expédition",

29
app/screens/CartScreen.tsx

@ -822,16 +822,16 @@ export const CartScreen = () => {
</View>
</View>
{/* Actual price - right below discount price */}
<View style={styles.productInfoContainer4}>
<Text style={styles.productCodeLabel}>
{sku.price}
</Text>
<Text style={styles.productDetailsTextStyle}>
FCFA
</Text>
</View>
</View>
{/* Actual price - right below discount price */}
<View style={styles.productInfoContainer4}>
<Text style={styles.productCodeLabel}>
{sku.price}
</Text>
<Text style={styles.productDetailsTextStyle}>
{sku.currency}
</Text>
</View>
</View>
{/* 3. Quantity controls on the right */}
<View style={styles.orderQuantityContainer}>
@ -1250,14 +1250,14 @@ const styles = StyleSheet.create({
alignItems: "center",
},
productCodeLabel: {
fontSize: fontSize(20),
fontSize: fontSize(16),
lineHeight: 22,
fontFamily: "Segoe UI",
fontWeight: "700",
color: "#FF5100",
},
productDetailsTextStyle: {
fontSize: fontSize(11),
fontSize: fontSize(10),
fontFamily: "Segoe UI",
fontWeight: "700",
color: "#FF5100",
@ -1279,6 +1279,7 @@ const styles = StyleSheet.create({
fontFamily: "PingFang SC",
fontWeight: "600",
color: "#9a9a9a",
textDecorationLine: 'line-through',
},
vipContainer: {
position: 'relative',
@ -1587,13 +1588,13 @@ const styles = StyleSheet.create({
color: "black",
},
highlightedText1: {
fontSize: fontSize(24),
fontSize: fontSize(20),
fontFamily: "Segoe UI",
fontWeight: "700",
color: "black",
},
priceLabel: {
fontSize: fontSize(11),
fontSize: fontSize(10),
fontFamily: "Segoe UI",
fontWeight: "700",
color: "black",

333
app/screens/HomeScreen.tsx

@ -62,7 +62,6 @@ type SubcategoryItem = {
type CategoryContentType = {
[key: string]: SubcategoryItem[];
};
// 懒加载图片组件 - 改进版本
const LazyImage = React.memo(
({
@ -76,16 +75,13 @@ const LazyImage = React.memo(
}) => {
const [isLoaded, setIsLoaded] = useState(false);
const [hasError, setHasError] = useState(false);
const onLoad = useCallback(() => {
setIsLoaded(true);
}, []);
const onError = useCallback(() => {
setHasError(true);
setIsLoaded(true); // Also mark as loaded on error to remove placeholder
}, []);
return (
<View style={[style, { overflow: "hidden" }]}>
{/* Show placeholder while image is loading */}
@ -98,7 +94,6 @@ const LazyImage = React.memo(
]}
/>
)}
{/* Show error state if image failed to load */}
{hasError && (
<View
@ -116,7 +111,6 @@ const LazyImage = React.memo(
</Text>
</View>
)}
{/* Actual image */}
<Image
source={{ uri }}
@ -129,12 +123,10 @@ const LazyImage = React.memo(
);
}
);
// 产品骨架屏组件 - 用于加载状态
const ProductSkeleton = React.memo(() => {
// 创建动画值
const shimmerAnim = useRef(new Animated.Value(0)).current;
// 设置动画效果
useEffect(() => {
const shimmerAnimation = Animated.loop(
@ -144,20 +136,16 @@ const ProductSkeleton = React.memo(() => {
useNativeDriver: true,
})
);
shimmerAnimation.start();
return () => {
shimmerAnimation.stop();
};
}, []);
// 定义动画插值
const shimmerTranslate = shimmerAnim.interpolate({
inputRange: [0, 1],
outputRange: [-200, 200],
});
return (
<View style={styles.beautyProductCard1}>
<View style={styles.skeletonImage}>
@ -219,7 +207,6 @@ const ProductSkeleton = React.memo(() => {
</View>
);
});
// Define the styles type to fix TypeScript errors
type StylesType = {
safeArea: ViewStyle;
@ -273,6 +260,7 @@ type StylesType = {
productCardList: ViewStyle;
productCardGroup: ViewStyle;
beautyProductCard1: ViewStyle;
productCardGroup1: ViewStyle;
beautyCardContainer1: ViewStyle;
vipButtonContainer: ViewStyle;
vipButton: ViewStyle;
@ -308,7 +296,6 @@ type StylesType = {
imagePickerCancelButton: ViewStyle;
imagePickerCancelText: TextStyle;
};
export const HomeScreen = () => {
const [activeIndex, setActiveIndex] = useState(0);
const screenWidth = Dimensions.get("window").width;
@ -339,7 +326,6 @@ export const HomeScreen = () => {
const [galleryUsed, setGalleryUsed] = useState(false);
const [hotTerms, setHotTerms] = useState<string[]>([]);
const [isLoadingHotTerms, setIsLoadingHotTerms] = useState(false);
// 直接在组件中实现分页加载逻辑
const [products, setProducts] = useState<Product[]>([]);
const [loading, setLoading] = useState(true);
@ -537,7 +523,6 @@ export const HomeScreen = () => {
setRefreshing(false);
}
}, [hotTerms, getRandomKeyword, fetchInitialProducts]);
const handleProductPress = useCallback(
(item: Product) => {
InteractionManager.runAfterInteractions(() => {
@ -550,7 +535,6 @@ export const HomeScreen = () => {
},
[navigation]
);
const categories = [
"Tous",
"Bijoux",
@ -564,7 +548,6 @@ export const HomeScreen = () => {
"Hygiène et Soins pour le corps",
"Maquillage",
];
const defaultSubcategories: SubcategoryItem[] = [
{ id: 1, title: "Jewelry", icon: "diamond-outline" },
{ id: 2, title: "Earrings", icon: "ear-outline" },
@ -573,7 +556,6 @@ export const HomeScreen = () => {
{ id: 5, title: "Earrings", icon: "ear-outline" },
{ id: 6, title: "Bracelet", icon: "watch-outline" },
];
const categoryContent: CategoryContentType = {
Tous: [],
Bijoux: defaultSubcategories,
@ -587,31 +569,26 @@ export const HomeScreen = () => {
"Hygiène et Soins pour le corps": defaultSubcategories,
Maquillage: defaultSubcategories,
};
useEffect(() => {
if (!categoryContent[selectedHorizontalCategory]) {
setSelectedHorizontalCategory("Tous");
}
}, [selectedHorizontalCategory]);
const navigateToSearch = useCallback(() => {
InteractionManager.runAfterInteractions(() => {
navigation.navigate("Search");
});
}, [navigation]);
const navigateToShippingDetails = useCallback(() => {
InteractionManager.runAfterInteractions(() => {
navigation.navigate("ShippingDetailsSection");
});
}, [navigation]);
const navigateToInquiry = useCallback(() => {
InteractionManager.runAfterInteractions(() => {
navigation.navigate("InquiryScreen");
});
}, [navigation]);
const scrollToCategory = (category: string) => {
const categoryIndex = categories.findIndex((c) => c === category);
if (categoryIndex !== -1 && horizontalScrollRef.current) {
@ -626,7 +603,6 @@ export const HomeScreen = () => {
});
}
};
const renderProductItem = ({ item }: { item: Product }) => (
<TouchableOpacity
onPress={() => handleProductPress(item)}
@ -645,7 +621,6 @@ export const HomeScreen = () => {
<IconComponent name="image-outline" size={24} color="#999" />
</View>
)}
{userStore.user?.user_id && (
<View style={styles.vipButtonContainer}>
<TouchableOpacity style={styles.vipButton}>
@ -677,7 +652,6 @@ export const HomeScreen = () => {
</View>
</TouchableOpacity>
);
const renderSkeletonGrid = useCallback(() => {
const skeletonArray = Array(8).fill(null);
return (
@ -694,7 +668,6 @@ export const HomeScreen = () => {
</View>
);
}, []);
const cleanupImagePickerCache = async () => {
try {
if (Platform.OS === 'web') {
@ -712,7 +685,6 @@ export const HomeScreen = () => {
setGalleryUsed(false);
}
};
const handleChooseFromGallery = useCallback(async () => {
setShowImagePickerModal(false);
setTimeout(async () => {
@ -722,14 +694,12 @@ export const HomeScreen = () => {
console.log("相册权限被拒绝");
return;
}
const result = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.Images,
allowsEditing: true,
aspect: [4, 3],
quality: 1,
});
if (!result.canceled && result.assets && result.assets.length > 0) {
await cleanupImagePickerCache();
navigation.navigate("ImageSearchResultScreen", {
@ -743,7 +713,6 @@ export const HomeScreen = () => {
}
}, 500);
}, []);
const handleTakePhoto = useCallback(async () => {
setShowImagePickerModal(false);
setTimeout(async () => {
@ -753,14 +722,12 @@ export const HomeScreen = () => {
console.log("相机权限被拒绝");
return;
}
const result = await ImagePicker.launchCameraAsync({
mediaTypes: ImagePicker.MediaTypeOptions.Images,
allowsEditing: true,
aspect: [4, 3],
quality: 1,
});
if (!result.canceled && result.assets && result.assets.length > 0) {
await cleanupImagePickerCache();
navigation.navigate("ImageSearchResultScreen", {
@ -774,35 +741,38 @@ export const HomeScreen = () => {
}
}, 500);
}, []);
const resetAppState = useCallback(() => {
setGalleryUsed(false);
cleanupImagePickerCache();
Alert.alert("已重置", "现在您可以使用相机功能了");
}, []);
// 优化轮播图切换回调
const handleCarouselSnap = useCallback((index: number) => {
setActiveIndex(index);
}, []);
const renderItem = ({ item, index }: { item: Product; index: number }) => {
if (index >= products.length && index < products.length + loadingPlaceholders) {
return <ProductSkeleton />;
}
return renderProductItem({ item });
};
const renderHeader = () => (
const renderHeader = useCallback(() => (
<>
<View style={styles.swiperContainer}>
<Carousel
loop
key="carousel-header"
width={screenWidth}
data={data}
height={widthUtils(286, 286).height}
modeConfig={{
parallaxScrollingScale: 0.9,
parallaxScrollingOffset: 50,
parallaxScrollingScale: 0,
parallaxScrollingOffset: 0,
}}
onSnapToItem={handleCarouselSnap}
renderItem={({ item }) => (
<TouchableOpacity
onPress={() => navigation.navigate(item.add)}
activeOpacity={1}
key={item.imgUrl}
style={{
flex: 1,
@ -822,6 +792,17 @@ export const HomeScreen = () => {
</TouchableOpacity>
)}
/>
<View style={styles.indicatorContainer}>
{data.map((_, index) => (
<View
key={index}
style={[
styles.indicator,
index === activeIndex ? styles.activeIndicator : styles.inactiveIndicator,
]}
/>
))}
</View>
<View style={styles.searchOverlay}>
<TouchableOpacity
style={styles.searchBar}
@ -943,8 +924,7 @@ export const HomeScreen = () => {
</View>
) : null}
</>
);
), [activeIndex, selectedHorizontalCategory]);
return (
<SafeAreaView style={styles.safeArea}>
<StatusBar barStyle="dark-content" backgroundColor="#fff" />
@ -956,30 +936,8 @@ export const HomeScreen = () => {
{renderSkeletonGrid()}
</View>
) : (
<FlatList
ref={flatListRef}
data={[...products, ...Array(loadingPlaceholders).fill(null)]}
numColumns={2}
<ScrollView
showsVerticalScrollIndicator={false}
columnWrapperStyle={styles.productCardGroup}
renderItem={renderItem}
keyExtractor={(item, index) =>
(item?.offer_id ? `${item.offer_id}-${currentPage}-${index}` : `placeholder-${currentPage}-${index}`)
}
contentContainerStyle={{
paddingBottom: 15,
backgroundColor: "transparent",
}}
ListHeaderComponent={renderHeader}
onEndReached={handleLoadMore}
onEndReachedThreshold={3}
ListFooterComponent={() => (
!hasMore && !loadingPlaceholders ? (
<View style={{ padding: 10, alignItems: 'center' }}>
<Text></Text>
</View>
) : null
)}
refreshControl={
<RefreshControl
refreshing={refreshing}
@ -989,9 +947,237 @@ export const HomeScreen = () => {
progressBackgroundColor="transparent"
/>
}
/>
onScroll={({ nativeEvent }) => {
const { layoutMeasurement, contentOffset, contentSize } = nativeEvent;
const paddingToBottom = 20;
if (layoutMeasurement.height + contentOffset.y >= contentSize.height - paddingToBottom) {
handleLoadMore();
}
}}
scrollEventThrottle={400}
>
{/* 轮播图区域 */}
<View style={styles.swiperContainer}>
<Carousel
key="carousel-header"
width={screenWidth}
data={data}
height={widthUtils(286, 286).height}
modeConfig={{
parallaxScrollingScale: 0,
parallaxScrollingOffset: 0,
}}
onSnapToItem={handleCarouselSnap}
renderItem={({ item }) => (
<TouchableOpacity
onPress={() => navigation.navigate(item.add)}
activeOpacity={1}
key={item.imgUrl}
style={{
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#f2f2f2",
borderRadius: 0,
overflow: "hidden",
}}
>
<Image
source={item.imgUrl}
style={{ width: "100%", height: "100%" }}
resizeMode="cover"
defaultSource={require("../../assets/img/banner en (3).png")}
/>
</TouchableOpacity>
)}
/>
<View style={styles.indicatorContainer}>
{data.map((_, index) => (
<View
key={index}
style={[
styles.indicator,
index === activeIndex ? styles.activeIndicator : styles.inactiveIndicator,
]}
/>
))}
</View>
<View style={styles.searchOverlay}>
<TouchableOpacity
style={styles.searchBar}
activeOpacity={0.7}
onPress={navigateToSearch}
>
<IconComponent name="search-outline" size={20} color="#999" />
<Text style={styles.searchPlaceholder}>{t("homePage.searchPlaceholder")}</Text>
<TouchableOpacity
style={styles.cameraButton}
onPress={() => setShowImagePickerModal(true)}
>
<IconComponent name="camera-outline" size={24} color="#333" />
</TouchableOpacity>
</TouchableOpacity>
</View>
</View>
{/* Banner区域 */}
<View style={styles.bannerContainer}>
<View style={styles.leftContainer}>
<TouchableOpacity
style={styles.leftTopItem}
onPress={navigateToShippingDetails}
>
<Image
source={require("../../assets/img/a_计算运费.png")}
style={styles.bannerIcon}
/>
</TouchableOpacity>
<TouchableOpacity
style={styles.leftBottomItem}
onPress={() => navigation.navigate("TikTokScreen")}
>
<Image
source={require("../../assets/img/a_tiktok.png")}
style={styles.bannerIcon}
/>
</TouchableOpacity>
</View>
<TouchableOpacity
style={styles.rightContainer}
onPress={navigateToInquiry}
>
<Image
source={require("../../assets/img/a_VIP.png")}
style={styles.bigbannerIcon}
/>
</TouchableOpacity>
</View>
{/* 分类区域 */}
<View style={styles.category}>
<View style={styles.categoryScrollContainer}>
<ScrollView
bounces={false}
overScrollMode="never"
ref={horizontalScrollRef}
horizontal
showsHorizontalScrollIndicator={false}
style={styles.categoryScroll}
>
{categories.map((category, index) => (
<TouchableOpacity
key={index}
style={[
styles.categoryItem,
selectedHorizontalCategory === category && styles.categoryItemActive,
]}
onPress={() => setSelectedHorizontalCategory(category)}
>
<Text
style={[
styles.categoryText,
selectedHorizontalCategory === category && styles.categoryTextActive,
]}
>
{t(`homePage.${category.toLowerCase()}`)}
</Text>
</TouchableOpacity>
))}
</ScrollView>
<LinearGradient
colors={["rgba(255,255,255,0)", "rgba(255,255,255,1)"]}
start={{ x: 0, y: 0 }}
end={{ x: 1, y: 0 }}
style={styles.fadeGradient}
/>
</View>
<View style={styles.categoryArrowContainer}>
<TouchableOpacity onPress={() => setShowCategoryModal(true)}>
<DownArrowIcon size={fontSize(18)} color="#666" rotation={360} />
</TouchableOpacity>
</View>
</View>
{/* 子分类区域 */}
{selectedHorizontalCategory &&
categoryContent[selectedHorizontalCategory] &&
categoryContent[selectedHorizontalCategory].length > 0 ? (
<View style={styles.subcategoryContainer}>
<ScrollView
bounces={false}
overScrollMode="never"
horizontal
showsHorizontalScrollIndicator={false}
style={styles.subcategoryScroll}
contentContainerStyle={styles.subcategoryContent}
>
{categoryContent[selectedHorizontalCategory].map((item) => (
<TouchableOpacity
key={item.id}
style={styles.subcategoryItem}
onPress={() => {
// Handle subcategory selection
}}
>
<View style={styles.subcategoryImagePlaceholder}>
<IconComponent name={item.icon} size={24} color="#666" />
</View>
<Text style={styles.subcategoryText}>{item.title}</Text>
</TouchableOpacity>
))}
</ScrollView>
</View>
) : null}
{/* 产品网格 */}
<View style={styles.productContainer}>
<View style={styles.productCardList}>
{(() => {
const allItems = [...products, ...Array(loadingPlaceholders).fill(null)];
const rows = [];
for (let i = 0; i < allItems.length; i += 2) {
const leftItem = allItems[i];
const rightItem = allItems[i + 1];
rows.push(
<View key={`row-${i}`} style={styles.productCardGroup1}>
{/* 左侧商品 */}
{leftItem ? (
i >= products.length ? (
<ProductSkeleton />
) : (
renderProductItem({ item: leftItem })
)
) : null}
{/* 右侧商品 */}
{rightItem ? (
i + 1 >= products.length ? (
<ProductSkeleton />
) : (
renderProductItem({ item: rightItem })
)
) : (
<View style={{ width: "48%" }} />
)}
</View>
);
}
return rows;
})()}
</View>
{/* 底部提示 */}
{!hasMore && !loadingPlaceholders && (
<View style={{ padding: 10, alignItems: 'center' }}>
<Text></Text>
</View>
)}
</View>
</ScrollView>
)}
<Modal
visible={showCategoryModal}
animationType="slide"
@ -1047,7 +1233,6 @@ export const HomeScreen = () => {
</View>
</View>
</Modal>
<Modal
visible={showImagePickerModal}
animationType="slide"
@ -1085,9 +1270,7 @@ export const HomeScreen = () => {
<Text style={styles.imagePickerText}></Text>
</TouchableOpacity>
)}
<View style={styles.imagePickerDivider} />
<TouchableOpacity
style={styles.imagePickerOption}
onPress={handleChooseFromGallery}
@ -1095,9 +1278,7 @@ export const HomeScreen = () => {
<IconComponent name="images-outline" size={24} color="#333" />
<Text style={styles.imagePickerText}>{t("homePage.chooseFromGallery")}</Text>
</TouchableOpacity>
<View style={styles.imagePickerDivider} />
<TouchableOpacity
style={styles.imagePickerCancelButton}
onPress={() => setShowImagePickerModal(false)}
@ -1385,10 +1566,16 @@ const styles = StyleSheet.create<StylesType>({
paddingTop: 0,
},
productCardGroup: {
flexDirection: "row",
justifyContent: "space-between",
marginBottom: 15,
paddingHorizontal: 15,
},
productCardGroup1:{
flexDirection: "row",
justifyContent: "space-between",
marginBottom: 15,
},
beautyProductCard1: {
width: "48%",
},

8
app/screens/ProductCard.tsx

@ -146,7 +146,7 @@ const ProductCard: React.FC<ProductCardProps> = ({
category_id: product?.category_id || 0,
price: item.offer_price || price || 0,
all_price: totalPrice || 0,
currency: currency || "",
currency: product.currency || "",
sku_id: item?.sku_id || 0,
quantity: (item?.size as number) || 0,
product_name: product?.subject || "",
@ -190,7 +190,7 @@ const ProductCard: React.FC<ProductCardProps> = ({
category_id: product?.category_id || 0,
price: item.offer_price || price || 0,
all_price: totalPrice || 0,
currency: currency || "",
currency: product.currency || "",
sku_id: item?.sku_id || 0,
quantity: (item?.size as number) || 0,
product_name: product?.subject || "",
@ -277,7 +277,7 @@ const ProductCard: React.FC<ProductCardProps> = ({
</View>
<View style={styles.price}>
<Text style={styles.priceInfoText}>{price}</Text>
<Text style={styles.priceInfoTextCon}>{currency}</Text>
<Text style={styles.priceInfoTextCon}>{product.currency}</Text>
</View>
</View>
<View style={styles.priceInfoClose}>
@ -774,7 +774,7 @@ const ProductCard: React.FC<ProductCardProps> = ({
<View style={styles.fixedBottomViewBoxRight}>
<Text style={styles.fixedBottomViewBoxRightText}>:</Text>
<Text style={styles.fixedBottomViewBoxPriceText}>
{totalPrice.toFixed(2)} {currency}
{totalPrice.toFixed(2)} {product.currency}
</Text>
</View>
</View>

127
app/screens/productStatus/OrderDatails.tsx

@ -25,7 +25,11 @@ import fontSize from "../../utils/fontsizeUtils";
import { useNavigation } from "@react-navigation/native";
import { NativeStackNavigationProp } from "@react-navigation/native-stack";
import { useRoute, RouteProp } from "@react-navigation/native";
import { ordersApi, OrderDetailsType } from "../../services/api/orders";
import {
ordersApi,
OrderDetailsType,
OrderItemDetails,
} from "../../services/api/orders";
import { payApi, PaymentMethod } from "../../services/api/payApi";
import useUserStore from "../../store/user";
import OrderIcon from "../../components/OrderIcon";
@ -44,8 +48,8 @@ import CircleOutlineIcon from "../../components/CircleOutlineIcon";
import CheckIcon from "../../components/CheckIcon";
import payMap from "../../utils/payMap";
import PhoneNumberInputModal from "../../screens/BalanceScreen/PhoneNumberInputModal";
import { cartApi } from "../../services/api/cart";
import IconComponent from "../../components/IconComponent";
// 定义选项类型
interface PaymentOption {
id: string;
@ -189,8 +193,9 @@ export const OrderDetails = () => {
>();
const [orderDetails, setOrderDetails] = useState<OrderDetailsType>();
const [isLoading, setIsLoading] = useState(true);
const { deleteOrder, changeOrder, updateOrderShippingInfo } =
const { deleteOrder, changeOrder, updateOrderShippingInfo,cancelOrder,confirmOrder } =
useOrderListStore();
const [showPaymentModal, setShowPaymentModal] = useState(false);
const [selectedPayment, setSelectedPayment] = useState<string | null>(null);
const [currentTab, setCurrentTab] = useState("online");
@ -557,6 +562,45 @@ export const OrderDetails = () => {
}
};
// 添加购物车
const addToCart = async (items: OrderItemDetails[]) => {
const groupedData: {
[key: string]: {
offer_id: number;
skus: { quantity: number; sku_id: string }[];
};
} = {};
items.forEach((item) => {
const offerId = item.offer_id.toString();
if (!groupedData[offerId]) {
groupedData[offerId] = {
offer_id: item.offer_id,
skus: [],
};
}
groupedData[offerId].skus.push({
quantity: item.quantity,
sku_id: item.sku_id.toString(),
});
});
// 转换为数组格式
const result = Object.values(groupedData)[0];
try{
setIsLoading(true);
await cartApi(result);
setIsLoading(false);
Alert.alert(t("order.add_cart_success"));
} catch (error) {
setIsLoading(false);
Alert.alert(t("error"), t("order.error.add_cart"));
}
};
// 添加确定按钮禁用逻辑函数
const isConfirmButtonDisabled = () => {
// 如果没有选择支付方式,禁用按钮
@ -834,7 +878,10 @@ export const OrderDetails = () => {
<View style={styles.dottedLine}></View>
<View style={styles.orderStatusContentPreview}>
<TouchableOpacity style={styles.addCard}>
<TouchableOpacity
style={styles.addCard}
onPress={() => addToCart(orderDetails.items)}
>
<View style={styles.addCardBox}>
<CardIcon size={16} color="#0098ef" />
<Text style={styles.addCardText}>
@ -845,6 +892,7 @@ export const OrderDetails = () => {
</View>
</View>
</View>
{/* {route.params.status} */}
{/* 价格信息 */}
<View style={styles.orderStatus}>
<View style={styles.orderStatusContent}>
@ -895,11 +943,14 @@ export const OrderDetails = () => {
</View>
</ScrollView>
{/* 代付款 */}
{orderDetails.order_status === 0 && (
{route.params.status === 0 && (
<View style={styles.bottomButtons}>
<TouchableOpacity
style={styles.bottomButton1}
onPress={() => setShowCancelModal(true)}
onPress={() => {
cancelOrder(route.params.orderId);
navigation.goBack();
}}
>
<Text style={styles.bottomButtonText1}>
{t("order.cancel")}
@ -916,19 +967,19 @@ export const OrderDetails = () => {
</View>
)}
{/* 待发货 */}
{orderDetails.order_status === 1 && (
{route.params.status === 1 && (
<View style={styles.bottomButtons}>
<TouchableOpacity
style={styles.bottomButton1}
onPress={() => {
callPhone("15903995548");
callPhone(orderDetails.whatsapp_number);
}}
>
<Text style={styles.bottomButtonText1}>
{t("order.contact_shipping")}
</Text>
</TouchableOpacity>
<TouchableOpacity
{/* <TouchableOpacity
style={styles.bottomButton}
onPress={() => {
changeOrder(route.params.orderId, 2);
@ -938,11 +989,11 @@ export const OrderDetails = () => {
<Text style={styles.bottomButtonText}>
{t("order.cancel")}
</Text>
</TouchableOpacity>
</TouchableOpacity> */}
</View>
)}
{/* 代收货 */}
{orderDetails.order_status === 2 && (
{route.params.status === 2 && (
<View style={styles.bottomButtons}>
<TouchableOpacity
style={styles.bottomButton1}
@ -955,14 +1006,8 @@ export const OrderDetails = () => {
<TouchableOpacity
style={styles.bottomButton}
onPress={() => {
updateOrderShippingInfo(route.params.orderId, {
shipping_status: 0,
shipping_info: {
shipping_company: "string",
shipping_no: "string",
shipping_info: {},
},
});
confirmOrder(route.params.orderId);
navigation.goBack();
}}
>
@ -973,32 +1018,36 @@ export const OrderDetails = () => {
</View>
)}
{/* 已完成 */}
{orderDetails.order_status === 3 && (
<View style={styles.bottomButtons}>
<TouchableOpacity
style={styles.bottomButton1}
onPress={() => {
deleteOrder(route.params.orderId);
navigation.goBack();
}}
>
<Text style={styles.bottomButtonText1}>
{t("order.cancel")}
</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.bottomButton}>
<Text style={styles.bottomButtonText}>
{t("order.pay_now")}
</Text>
</TouchableOpacity>
{route.params.status === 3 && (
<View>
</View>
// <View style={styles.bottomButtons}>
// <TouchableOpacity
// style={styles.bottomButton1}
// onPress={() => {
// addToCart(orderDetails.items);
// // navigation.goBack();
// }}
// >
// <Text style={styles.bottomButtonText1}>
// {t("order.add_to_cart")}
// </Text>
// </TouchableOpacity>
// <TouchableOpacity style={styles.bottomButton}>
// <Text style={styles.bottomButtonText}>
// {t("order.reorder")}
// </Text>
// </TouchableOpacity>
// </View>
)}
{/* 已取消 */}
{orderDetails.order_status === 4 && (
{route.params.status === 4 && (
<View style={styles.bottomButtons}>
<TouchableOpacity
style={styles.bottomButton1}
onPress={() => {}}
onPress={() => {
addToCart(orderDetails.items);
}}
>
<Text style={styles.bottomButtonText1}>
{t("order.add_to_cart")}

5
app/services/api/cart.ts

@ -2,8 +2,8 @@ import apiService from './apiClient';
export interface AddToCartParams {
offer_id: number;
skus: {sku_id:number,quantity:number}[]
offer_id: number | string;
skus: {sku_id:number | string,quantity:number}[]
}
export interface GetCartListResponse {
@ -32,6 +32,7 @@ export interface CartSku {
selected: number,
currency:string,
sku_id: number,
original_min_price:number,
attributes:attributes[],
}
export interface GetCartList {

10
app/services/api/orders.ts

@ -284,7 +284,7 @@ interface SkuAttributesDetails {
sku_image: string;
}
interface OrderItemDetails {
export interface OrderItemDetails {
offer_id: number;
cart_item_id: number | null;
sku_id: number;
@ -310,6 +310,7 @@ export interface OrderDetailsType {
domestic_shipping_fee: number;
actual_amount: number;
currency:string,
whatsapp_number:string,
discount_amount: number;
shipping_fee: number;
address_id: number;
@ -483,5 +484,10 @@ export const ordersApi = {
// 取消订单
cancelOrder: (order_id: string) =>
apiService.post<OrderCancelResponse>(`/api/orders/${order_id}/cancel/`),
apiService.post<OrderDetailsType>(`/api/orders/${order_id}/cancel/`),
// 确定收货
confirmOrder: (order_id: string) =>
apiService.patch<OrderDetailsType>(`/api/orders/${order_id}/shipping/`,{
}),
};

2
app/services/api/productApi.ts

@ -56,6 +56,7 @@ export type Products = Product[]
"value_trans_en": string,
"sku_image_url": string,
'has_color'?: boolean,
currency:string
size?:number,
list:Sku[],
@ -85,6 +86,7 @@ export type Products = Product[]
export interface ProductDetailParams {
"offer_id": 0,
currency:string
"category_id": 0,
"price": number | string,
"subject": "string",

32
app/store/burialPoint.ts

@ -194,7 +194,7 @@ const useBurialPointStore = create<BurialPointState>((set, get) => ({
logLogin: (isSuccess = true, loginMethod = "phone") => {
const loginEvent: BurialEvent = {
event_name: "login",
page_name: null,
page_name: "login",
referre_page: null,
event_properties: [
{
@ -212,7 +212,7 @@ const useBurialPointStore = create<BurialPointState>((set, get) => ({
logRegister: (isSuccess = true, registerMethod = "phone") => {
const registerEvent: BurialEvent = {
event_name: "register",
page_name: null,
page_name: "register",
referre_page: null,
event_properties: [
{
@ -229,8 +229,8 @@ const useBurialPointStore = create<BurialPointState>((set, get) => ({
// 记录浏览商品事件埋点
logViewProduct: (productInfo: ProductProperty, fromPage = "home") => {
const viewProductEvent: BurialEvent = {
event_name: "product_view",
page_name: "ProductDetail",
event_name: "product",
page_name: "product",
referre_page: fromPage,
event_properties: [productInfo]
};
@ -258,8 +258,8 @@ const useBurialPointStore = create<BurialPointState>((set, get) => ({
// 记录填写地址信息事件埋点
logAddressInfo: (addressInfo: Omit<AddressProperty, "timestamp">, fromPage = "cart") => {
const addressEvent: BurialEvent = {
event_name: "fill_information",
page_name: "PreviewAddress",
event_name: "address",
page_name: "address",
referre_page: fromPage,
event_properties: [
{
@ -275,8 +275,8 @@ const useBurialPointStore = create<BurialPointState>((set, get) => ({
// 记录物流信息确认事件埋点
logShippingConfirm: (shippingInfo: Omit<ShippingProperty, "timestamp">, fromPage = "address") => {
const shippingEvent: BurialEvent = {
event_name: "shipping_confirm",
page_name: "ShippingFee",
event_name: "shipping",
page_name: "shipping",
referre_page: fromPage,
event_properties: [
{
@ -292,8 +292,8 @@ const useBurialPointStore = create<BurialPointState>((set, get) => ({
// 记录支付方式确认事件埋点
logPaymentConfirm: (paymentInfo: Omit<PaymentProperty, "timestamp">, fromPage = "shipping") => {
const paymentEvent: BurialEvent = {
event_name: "payment_confirm",
page_name: "PaymentMethod",
event_name: "payment",
page_name: "payment",
referre_page: fromPage,
event_properties: [
{
@ -309,8 +309,8 @@ const useBurialPointStore = create<BurialPointState>((set, get) => ({
// 记录预览订单事件埋点
logPreviewOrder: (fromPage = "pay_method") => {
const previewEvent: BurialEvent = {
event_name: "preview_order",
page_name: "PreviewOrder",
event_name: "order",
page_name: "order",
referre_page: fromPage,
event_properties: [
{
@ -325,8 +325,8 @@ const useBurialPointStore = create<BurialPointState>((set, get) => ({
// 记录支付结账事件埋点
logCheckout: (checkoutInfo: Omit<CheckoutProperty, "timestamp">, fromPage = "perview") => {
const checkoutEvent: BurialEvent = {
event_name: "check_out",
page_name: "pay",
event_name: "checkout",
page_name: "checkout",
referre_page: fromPage,
event_properties: [
{
@ -342,8 +342,8 @@ const useBurialPointStore = create<BurialPointState>((set, get) => ({
// 记录添加购物车事件埋点
logAddToCart: (cartInfo: Omit<CartProperty, "timestamp">, fromPage = "search") => {
const addToCartEvent: BurialEvent = {
event_name: "add_to_cart",
page_name: "add_to_cart",
event_name: "addToCart",
page_name: "addToCart",
referre_page: fromPage,
event_properties: [
{

146
app/store/orderList.ts

@ -1,65 +1,101 @@
import { create } from 'zustand';
import { ordersApi, PaginatedOrderResponse, PaginatedOrderRequest,UpdateOrderShippingInfo} from '../services/api/orders';
import { create } from "zustand";
import {
ordersApi,
PaginatedOrderResponse,
PaginatedOrderRequest,
UpdateOrderShippingInfo,
} from "../services/api/orders";
interface OrderListState {
orders: PaginatedOrderResponse,
getAllOrders: (data: PaginatedOrderRequest,page:number) => Promise<void>,
deleteOrder: (orderId: string) => Promise<void>,
changeOrder: (orderId: string,status:number) => Promise<void>,
updateOrderShippingInfo: (orderId: string,data:UpdateOrderShippingInfo) => Promise<void>,
orders: PaginatedOrderResponse;
getAllOrders: (data: PaginatedOrderRequest, page: number) => Promise<void>;
deleteOrder: (orderId: string) => Promise<void>;
changeOrder: (orderId: string, status: number) => Promise<void>;
updateOrderShippingInfo: (
orderId: string,
data: UpdateOrderShippingInfo
) => Promise<void>;
cancelOrder: (orderId: string) => Promise<void>;
confirmOrder: (orderId: string) => Promise<void>;
}
export const useOrderListStore = create<OrderListState>((set, get) => ({
orders: {
items: [],
total: 0,
page: 1,
page_size: 10,
},
orders: {
items: [],
total: 0,
page: 1,
page_size: 10,
},
getAllOrders: async (data: PaginatedOrderRequest,page:number) => {
const response = await ordersApi.getAllOrders(data);
set((state) => ({
orders: {
...response,
items: page === 1
? response.items
: [...state.orders.items, ...response.items],
}
}));
},
getAllOrders: async (data: PaginatedOrderRequest, page: number) => {
const response = await ordersApi.getAllOrders(data);
set((state) => ({
orders: {
...response,
items:
page === 1
? response.items
: [...state.orders.items, ...response.items],
},
}));
},
deleteOrder: async (orderId: string) => {
await ordersApi.deleteOrder(orderId);
set((state) => ({
orders: {
...state.orders,
items: state.orders.items.filter(item => item.order_id !== orderId),
total: state.orders.total - 1
}
}));
},
deleteOrder: async (orderId: string) => {
await ordersApi.deleteOrder(orderId);
set((state) => ({
orders: {
...state.orders,
items: state.orders.items.filter((item) => item.order_id !== orderId),
total: state.orders.total - 1,
},
}));
},
changeOrder: async (orderId: string,status:number) => {
await ordersApi.changeOrder(orderId,status);
set((state) => ({
orders: {
...state.orders,
items: state.orders.items.filter(item => item.order_id !== orderId),
total: state.orders.total - 1
}
}));
},
changeOrder: async (orderId: string, status: number) => {
await ordersApi.changeOrder(orderId, status);
set((state) => ({
orders: {
...state.orders,
items: state.orders.items.filter((item) => item.order_id !== orderId),
total: state.orders.total - 1,
},
}));
},
updateOrderShippingInfo: async (orderId: string,data:UpdateOrderShippingInfo) => {
await ordersApi.updateOrderShippingInfo(orderId,data);
set((state) => ({
orders: {
...state.orders,
items: state.orders.items.filter(item => item.order_id !== orderId),
total: state.orders.total - 1
}
}));
},
}));
updateOrderShippingInfo: async (
orderId: string,
data: UpdateOrderShippingInfo
) => {
await ordersApi.updateOrderShippingInfo(orderId, data);
set((state) => ({
orders: {
...state.orders,
items: state.orders.items.filter((item) => item.order_id !== orderId),
total: state.orders.total - 1,
},
}));
},
// 取消订单
cancelOrder: async (orderId: string) => {
set((state) => ({
orders: {
...state.orders,
items: state.orders.items.filter((item) => item.order_id !== orderId),
total: state.orders.total - 1,
},
}));
await ordersApi.cancelOrder(orderId);
},
// 确定收货
confirmOrder: async (orderId: string) => {
set((state) => ({
orders: {
...state.orders,
items: state.orders.items.filter((item) => item.order_id !== orderId),
total: state.orders.total - 1,
},
}));
await ordersApi.confirmOrder(orderId);
},
}));

28
app/utils/languageUtils.ts

@ -55,3 +55,31 @@ export const getSkuTransLanguage = <T extends Record<string, any>>(data: T): str
// 返回匹配的翻译值,如果没有匹配则返回法语
return (data[matchedField || 'value_trans'] as string) || '';
};
export const getOrderTransLanguage = <T extends Record<string, any>>(data: T): string => {
// 获取当前i18n语言
const currentLang = getCurrentLanguage();
// 特殊处理中文
if (currentLang === 'zh' && 'value' in data) {
return data.value as string;
}
// 获取所有subject_trans开头的字段
const translationFields = Object.keys(data).filter(key =>
key.startsWith('product_name')
);
// 查找匹配的字段
const matchedField = translationFields.find(field => {
// 从字段名中提取语言代码
const langCode = field.replace('product_name', '');
// 如果没有后缀,则为法语
return langCode === '' ? currentLang === 'fr' : langCode === currentLang;
});
// 返回匹配的翻译值,如果没有匹配则返回法语
return (data[matchedField || 'product_name'] as string) || '';
};

197
event.js

@ -0,0 +1,197 @@
const eventData = {
user_id: 11,
device_id: "ios",
version: "1747643239421-2wi8sr8yr",
session_id: "1747643239421-g28qurlzy",
event_list: [
{
event_name: "launch", // app启动
page_name: null,
event_properties: [
{
is_open: 1, // 1: 正常打开 0: app崩溃
timestamp: "2025-05-19 08:27:21",
},
],
},
{
event_name: "login", // 登录
page_name: "login", // 登录页面
event_properties: [
{
is_login: 1,
login_method: "phone", // facebook, google, phone, email, apple
user_name: "1234567890", // 用户名称
timestamp: "2025-05-19 08:27:21",
},
],
},
{
event_name: "register", // 注册
page_name: "register", // 注册页面
event_properties: [
{
is_register: 1,
user_name: "1234567890", // 用户名称
register_method: "phone", // facebook, google, phone, email, apple
timestamp: "2025-05-19 08:27:21",
},
],
},
{
event_name: "search", // 搜索
page_name: "search", // 搜索页面
event_properties: [
{
search_keyword: "1234567890", // 搜索关键词
timestamp: "2025-05-19 08:27:21",
},
],
},
{
event_name: "product", // 商品
page_name: "product", // 商品页面
event_properties: [
{
offer_id: 892906753556, // 商品ID
category_id: 1037036, // 商品分类ID
price: 2.17, // 商品价格
currency: "FCFA", // FCFA, USD, CDF,CFA,EUR,
timestamp: "2025-05-19 08:27:21",
product_name: "瑜伽服女夏天排汗瑜伽服大码胖速干衣跑步套装女晨跑运动套装女", // 商品名称
product_img:
"https://cbu01.alicdn.com/img/ibank/O1CN01KvfDVh1UL3CWndJ89_!!2219347832500-0-cib.jpg", // 商品图片
},
],
},
{
event_name: "category", // 分类
page_name: "category", // 分类页面
event_properties: [
{
category_id: "1234567890", // 分类ID
timestamp: "2025-05-19 08:27:21",
category_name: "食品酒水", // 分类名称
level: 1, // 分类级别
},
],
},
{
event_name: "productList", // 商品列表
page_name: "productList", // 商品列表页面
event_properties: [
{
category_id: "133", // 分类ID
category_name: "农业用品", // 分类名称
timestamp: "2025-05-19 08:27:21",
},
],
},
{
event_name: "addToCart", // 添加到购物车
page_name: "addToCart", // 添加到购物车页面
event_properties: [
{
offer_id: 892906753556, // 商品ID
category_id: 1037036, // 商品分类ID
price: 2.17, // 商品价格
quality: 1, // 商品数量
currency: "FCFA", // FCFA, USD, CDF,CFA,EUR,
timestamp: "2025-05-19 08:27:21",
product_name: "瑜伽服女夏天排汗瑜伽服大码胖速干衣跑步套装女晨跑运动套装女", // 商品名称
product_img:
"https://cbu01.alicdn.com/img/ibank/O1CN01KvfDVh1UL3CWndJ89_!!2219347832500-0-cib.jpg", // 商品图片
},
{
offer_id: 892906753557, // 商品ID
category_id: 1037036, // 商品分类ID
price: 2.17, // 商品价格
quality: 2, // 商品数量
currency: "FCFA", // FCFA, USD, CDF,CFA,EUR,
timestamp: "2025-05-19 08:27:21",
product_name: "瑜伽服女夏天排汗瑜伽服大码胖速干衣跑步套装女晨跑运动套装女", // 商品名称
product_img:
"https://cbu01.alicdn.com/img/ibank/O1CN01KvfDVh1UL3CWndJ89_!!2219347832500-0-cib.jpg",
},
],
},
{
event_name: "address", // 地址
page_name: "address", // 地址页面
event_properties: [
{
last_name: "san", // 姓
first_name: "zhang", // 名
country: "chinese", // 国家
phone: 10086, // 手机号
whatsapp: 10086, // whatsapp号
timestamp: "2025-05-12 00:00:30",
},
],
},
{
event_name: "shipping",
page_name: "shipping",
event_properties: [
{
shipping_method: 0, // 运输方式 // 0 船运 1 空运
shipping_price_outside: 40, // 国际运输价格
shipping_price_within: 20, // 国内运输价格
currency: "FCFA", // FCFA, USD, CDF,CFA,EUR,
forwarder_name: "达菲物流", // 货代中心 // 欧万物流 //303仓库
country_city: "Congo-Kinshasa", // 国家-城市
timestamp: "2025-05-12 00:00:30",
},
],
},
{
event_name: "payment", // 支付
page_name: "payment", // 支付页面
event_properties: [
{
pay_method: "palpay", //支付方式 // palpay, mobile_money, wave, bank_card balance
online: 1, //线上或线下 // 1 线上支付 0 线下支付
all_price: 519.8, // 总价格
currency: "FCFA", // FCFA, USD, CDF,CFA,EUR,
timestamp: "2025-05-19 08:27:21",
},
],
},
{
event_name: "order", // 订单
page_name: "order", // 订单页面
event_properties: [
{
order_id: "1234567890", // 订单ID
timestamp: "2025-05-19 08:27:21",
},
],
},
{
event_name: "checkout", // 结算
page_name: "checkout", // 结算页面
event_properties: [
{
is_suc: 1, // 是否成功 1 成功 0 失败
all_price: 519.8, // 总价格
currency: "FCFA", // FCFA, USD, CDF,CFA,EUR,
timestamp: "2025-05-12 00:00:30",
shipping_method: 0, // 0 船运 1 空运
shipping_price_outside: 40, // 国际运输价格
shipping_price_within: 20, // 国内运输价格
},
],
},
{
event_name: "purchase", // 购买
page_name: "purchase", // 购买页面
event_properties: [
{
order_id: "1234567890", // 订单ID
is_suc: 1, // 是否成功 1 成功
timestamp: "2025-05-19 08:27:21",
},
],
},
],
};

194
event.json

@ -0,0 +1,194 @@
{
"user_id": 11,
"device_id": "ios",
"version": "1747643239421-2wi8sr8yr",
"session_id": "1747643239421-g28qurlzy",
"event_list": [
{
"event_name": "app_launch",
"page_name": null,
"event_properties": [
{
"is_open": 1,
"timestamp": "2025-05-19 08:27:21"
}
]
},
{
"event_name": "login",
"page_name": "login",
"event_properties": [
{
"is_login": 1,
"login_method": "phone",
"user_name": "1234567890",
"timestamp": "2025-05-19 08:27:21"
}
]
},
{
"event_name": "register",
"page_name": "register",
"event_properties": [
{
"is_register": 1,
"user_name": "1234567890",
"register_method": "phone",
"timestamp": "2025-05-19 08:27:21"
}
]
},
{
"event_name": "search",
"page_name": "search",
"event_properties": [
{
"search_keyword": "1234567890",
"timestamp": "2025-05-19 08:27:21"
}
]
},
{
"event_name": "product",
"page_name": "product",
"event_properties": [
{
"offer_id": 892906753556,
"category_id": 1037036,
"price": 2.17,
"currency": "FCFA",
"timestamp": "2025-05-19 08:27:21",
"product_name": "瑜伽服女夏天排汗瑜伽服大码胖速干衣跑步套装女晨跑运动套装女",
"product_img": "https://cbu01.alicdn.com/img/ibank/O1CN01KvfDVh1UL3CWndJ89_!!2219347832500-0-cib.jpg"
}
]
},
{
"event_name": "category",
"page_name": "category",
"event_properties": [
{
"category_id": "1234567890",
"timestamp": "2025-05-19 08:27:21",
"category_name": "食品酒水",
"level": 1
}
]
},
{
"event_name": "productList",
"page_name": "productList",
"event_properties": [
{
"category_id": "133",
"category_name": "农业用品",
"timestamp": "2025-05-19 08:27:21"
}
]
},
{
"event_name": "addToCart",
"page_name": "addToCart",
"event_properties": [
{
"offer_id": 892906753556,
"category_id": 1037036,
"price": 2.17,
"quality": 1,
"currency": "FCFA",
"timestamp": "2025-05-19 08:27:21",
"product_name": "瑜伽服女夏天排汗瑜伽服大码胖速干衣跑步套装女晨跑运动套装女",
"product_img": "https://cbu01.alicdn.com/img/ibank/O1CN01KvfDVh1UL3CWndJ89_!!2219347832500-0-cib.jpg"
},
{
"offer_id": 892906753557,
"category_id": 1037036,
"price": 2.17,
"quality": 2,
"currency": "FCFA",
"timestamp": "2025-05-19 08:27:21",
"product_name": "瑜伽服女夏天排汗瑜伽服大码胖速干衣跑步套装女晨跑运动套装女",
"product_img": "https://cbu01.alicdn.com/img/ibank/O1CN01KvfDVh1UL3CWndJ89_!!2219347832500-0-cib.jpg"
}
]
},
{
"event_name": "address",
"page_name": "address",
"event_properties": [
{
"last_name": "san",
"first_name": "zhang",
"country": "chinese",
"phone_number": 10086,
"whatsApp_number": 10086,
"timestamp": "2025-05-12 00:00:30"
}
]
},
{
"event_name": "shipping",
"page_name": "shipping",
"event_properties": [
{
"shipping_method": 0,
"shipping_price_outside": 40,
"shipping_price_within": 20,
"currency": "fcfa",
"forwarder_name": "达菲物流",
"country_city": "Congo-Kinshasa",
"timestamp": "2025-05-12 00:00:30"
}
]
},
{
"event_name": "payment",
"page_name": "payment",
"event_properties": [
{
"pay_method": "palpay",
"offline_payment": 1,
"all_price": 519.8,
"currency": "fcfa",
"timestamp": "2025-05-19 08:27:21"
}
]
},
{
"event_name": "order",
"page_name": "order",
"event_properties": [
{
"order_id": "1234567890",
"timestamp": "2025-05-19 08:27:21"
}
]
},
{
"event_name": "checkout",
"page_name": "checkout",
"event_properties": [
{
"is_suc": 1,
"all_price": 519.8,
"currency": "fcfa",
"timestamp": "2025-05-12 00:00:30",
"shipping_method": 0,
"shipping_price_outside": 40,
"shipping_price_within": 20
}
]
},
{
"event_name": "purchase",
"page_name": "purchase",
"event_properties": [
{
"order_id": "1234567890",
"is_suc": 1,
"timestamp": "2025-05-19 08:27:21"
}
]
}
]
}

16
event_list.json

@ -0,0 +1,16 @@
{
"app启动":"launch",
"登录":"login",
"注册":"register",
"浏览商品":"product",
"浏览分类":"category",
"浏览商品list":"productList",
"搜索":"search",
"添加购物车":"addToCart",
"填写地址":"adress",
"物流方式":"shipping",
"支付方式":"payment",
"创建订单":"order",
"发起结账":"checkout",
"支付成功":"purchase"
}

18
event_page.json

@ -0,0 +1,18 @@
{
"启动app": null,
"登录": "login",
"注册": "register",
"主页": "home",
"搜索": "search",
"商品详情页": "product",
"浏览商品分类": "category",
"浏览商品list": "productList",
"购物车": "cart",
"填写地址": "address",
"物流方式": "shipping",
"支付方式": "payment",
"浏览订单": "order",
"结账": "checkout",
"支付成功": "purchase",
"支付失败": "paymentFailed"
}

18
page.json

@ -0,0 +1,18 @@
{
"启动app": null,
"登录": "login",
"注册": "register",
"主页": "home",
"搜索": "search",
"商品详情页": "product",
"浏览商品分类": "category",
"浏览商品list": "productList",
"购物车": "cart",
"填写地址": "address",
"物流方式": "shipping",
"支付方式": "payment",
"浏览订单": "order",
"结账": "checkout",
"支付成功": "purchase",
"支付失败": "paymentFailed"
}
Loading…
Cancel
Save