You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1174 lines
36 KiB

import React, { useEffect, useCallback, useState } from "react";
2 months ago
import {
View,
Text,
Image,
StyleSheet,
TouchableOpacity,
ScrollView,
Modal,
InteractionManager,
Alert,
TextInput,
2 months ago
} from "react-native";
import widthUtils from "../utils/widthUtils";
import fontSize from "../utils/fontsizeUtils";
import CloseIcon from "../components/CloseIcon";
import XIconBottom from "../components/XIconBottom";
import XIconTop from "../components/XIconTop";
2 months ago
import {
ProductDetailParams,
ProductGroupList,
SkuAttribute,
1 month ago
Sku,
2 months ago
} from "../services/api/productApi";
1 month ago
import { cartApi } from "../services/api/cart";
1 month ago
import { useNavigation } from "@react-navigation/native";
import { NativeStackNavigationProp } from "@react-navigation/native-stack";
import ImageView from "react-native-image-viewing";
import useProductCartStore from "../store/productCart";
2 months ago
interface ProductCardProps {
onClose: () => void;
product: ProductDetailParams;
groupList: ProductGroupList[];
}
const ProductCard: React.FC<ProductCardProps> = ({
onClose,
product: localProduct,
groupList: localGroupList,
}: {
onClose: () => void;
product: ProductDetailParams;
groupList: ProductGroupList[];
}) => {
1 month ago
const navigation = useNavigation<NativeStackNavigationProp<any>>();
const [deleteModalVisible, setDeleteModalVisible] = useState<boolean>(false);
const [images, setImages] = useState<string[]>([]);
const [currentImageIndex, setCurrentImageIndex] = useState(0);
const [imageViewerVisible, setImageViewerVisible] = useState(false);
1 month ago
const {
product,
groupList,
imgTitle,
price,
hasImg,
noImgList,
sizeTitle,
size,
flag,
totalPrice,
selectedSize,
setProduct,
setGroupList,
setImgTitle,
setPrice,
setHasImg,
setNoImgList,
setSizeTitle,
setSize,
setFlag,
setTotalPrice,
setSelectedSize,
processProductData,
handleSizeSelect,
handleNoImgSizeSelect,
handleColorSelect,
} = useProductCartStore();
1 month ago
useEffect(() => {
setProduct(localProduct);
setGroupList(localGroupList);
processProductData();
}, [localProduct, localGroupList]);
1 month ago
// 加入购物车
const addCartHandel = () => {
if (totalPrice === 0) {
Alert.alert("添加失败", "请选择商品");
return;
}
if(selectedSize < product.min_order_quantity) {
Alert.alert("添加失败", "小于最小购买数量");
return;
}
1 month ago
if (groupList.length > 1) {
const selectedSku =
hasImg?.attributes.filter((item) => (item.size ?? 0) > 0) || [];
const skus: { sku_id: number; quantity: number }[] = [];
selectedSku.forEach((item) => {
item.list.forEach((item) => {
if ((item.size ?? 0) > 0) {
skus.push({
sku_id: item.sku_id,
quantity: item.size as number,
});
}
});
});
const data = {
offer_id: product.offer_id,
skus,
};
cartApi(data).then((res) => {
console.log(res);
});
} else if (groupList.length === 1) {
const selectedSku =
noImgList.filter((item) => (item.size ?? 0) > 0) || [];
const skus: { sku_id: number; quantity: number }[] = [];
selectedSku.forEach((item) => {
skus.push({
sku_id: item.sku_id,
quantity: item.size as number,
});
});
const data = {
offer_id: product.offer_id,
skus,
};
cartApi(data).then((res) => {
console.log(res);
2 months ago
});
}
1 month ago
setDeleteModalVisible(true);
};
const cancelDelete = () => {
// 关闭确认对话框
setDeleteModalVisible(false);
onClose();
2 months ago
};
const handleNavigateToCart = useCallback(() => {
setDeleteModalVisible(false);
InteractionManager.runAfterInteractions(() => {
navigation.navigate("MainTabs", { screen: "Cart" });
});
}, [navigation]);
// 图片预览
const handleImagePress = (imageUrl: string) => {
setImages([imageUrl]);
setCurrentImageIndex(0);
setImageViewerVisible(true);
};
2 months ago
return (
<View style={styles.wrapper}>
<View style={styles.container}>
<View style={styles.productInfo}>
<View style={styles.productBigImgBox}>
<Image source={{ uri: imgTitle }} style={styles.productBigImg} />
<View style={styles.cornerView}>
<View style={styles.topRightIcon}>
<XIconTop size={6} />
2 months ago
</View>
<View style={styles.bottomLeftIcon}>
<XIconBottom size={6} />
2 months ago
</View>
</View>
</View>
<View style={styles.productInfoBox}>
<View style={styles.priceInfo}>
<View style={styles.priceInfoBox}>
<View style={styles.price}>
<Text style={styles.priceInfoText}>{price}</Text>
<Text style={styles.priceInfoTextCon}>FCFA</Text>
2 months ago
</View>
<View style={styles.priceInfoOffer}>
<Image
source={require("../../assets/img/折扣VIP1 (1).png")}
style={styles.priceInfoOfferImg}
/>
<View style={styles.discountTextContainer}>
<Text style={styles.discountText}>-5%</Text>
2 months ago
</View>
</View>
<View style={styles.priceInfoVip}>
<Image
source={require("../../assets/img/vip1.png")}
style={styles.priceInfoVipImg}
/>
2 months ago
</View>
</View>
<View style={styles.priceInfoClose}>
<TouchableOpacity onPress={() => onClose()}>
<CloseIcon size={fontSize(20)} />
</TouchableOpacity>
</View>
2 months ago
</View>
<ScrollView
horizontal
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
style={styles.priceInfoList}
>
{product &&
product.sale_info &&
product.sale_info.price_range_list &&
product.sale_info.price_range_list.length > 0
? product.sale_info.price_range_list.map((item, index) => {
return (
<View style={styles.priceList} key={index}>
<View style={styles.priceListBox}>
<Text style={styles.priceListBoxText}>
{item.price}
</Text>
<Text style={styles.priceListBoxTextCon}>FCFA</Text>
</View>
<View style={styles.priceListBoxPie}>
<Text style={styles.priceListBoxListText}>
&gt;= {item.min_quantity} <Text></Text>
</Text>
</View>
</View>
);
})
: null}
</ScrollView>
2 months ago
</View>
</View>
{/* 图片和文字 */}
{hasImg && groupList.length > 1 && hasImg.has_image && (
<View style={styles.productBox}>
{hasImg && (
<>
<View style={styles.productTit}>
<Text style={styles.productTitText}>
{hasImg.attribute_name} :{" "}
</Text>
<Text style={styles.productTitText}>{size}</Text>
</View>
1 month ago
<ScrollView
style={styles.productBoxImgList}
1 month ago
horizontal
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
1 month ago
>
{hasImg?.attributes?.map((item, index) => {
return (
1 month ago
<TouchableOpacity
style={[
styles.productBoxImgListBox,
item.has_color && styles.productBoxImgListBoxActive,
]}
key={index}
1 month ago
onPress={() =>
handleColorSelect(
item.value,
index,
item.sku_image_url
)
1 month ago
}
2 months ago
>
<Image
source={{ uri: item.sku_image_url }}
style={styles.productBoxImgListBoxImg}
/>
{item.size && (
<View style={styles.fixedCornerView}>
<Text style={styles.fixedCornerViewText}>
x{item.size}
1 month ago
</Text>
</View>
)}
1 month ago
</TouchableOpacity>
);
})}
1 month ago
</ScrollView>
</>
1 month ago
)}
<View style={styles.productTit}>
<Text style={styles.productTitText}>{sizeTitle}</Text>
</View>
4 weeks ago
<View style={{ flex: 1 }}>
<ScrollView
style={styles.sizePrice}
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
>
<View style={styles.sizePriceBox}>
{hasImg &&
hasImg.attributes
?.find((item) => item.has_color)
?.list.map((list, index1) => (
<View style={styles.sizePriceBoxItems} key={index1}>
<View style={styles.sizePriceBoxItem}>
<View style={styles.sizePriceBoxItemTextBox}>
{(list?.size ?? 0) > 0 && (
<Text style={styles.selectedNumText}>
x{list?.size}
</Text>
)}
<Text style={styles.priceText}>
{list.offer_price || price}
1 month ago
</Text>
4 weeks ago
<Text
style={styles.sizePriceBoxItemText}
numberOfLines={1}
ellipsizeMode="tail"
>
{list.attributes[0].value}
</Text>
</View>
<Text style={styles.amountText}>
{list?.amount_on_sale}
</Text>
4 weeks ago
</View>
<View style={styles.sizePriceBoxStepForward}>
<TouchableOpacity
style={styles.sizePriceBoxStepForwardButton}
onPress={() =>
handleSizeSelect(
list?.attributes[0]?.value,
"-",
index1,
list.amount_on_sale
)
}
2 months ago
>
4 weeks ago
<Text>-</Text>
</TouchableOpacity>
<TextInput
style={styles.sizePriceBoxStepForwardInput}
value={list.size?.toString() ?? "0"}
keyboardType="numeric"
onChangeText={(text) =>
handleSizeSelect(
list?.attributes[0]?.value,
text,
index1,
list.amount_on_sale
)
}
/>
<TouchableOpacity
style={styles.sizePriceBoxStepForwardButton}
onPress={() =>
handleSizeSelect(
list?.attributes[0]?.value,
"+",
index1,
list.amount_on_sale
)
}
>
<Text>+</Text>
</TouchableOpacity>
2 months ago
</View>
1 month ago
</View>
4 weeks ago
))}
</View>
</ScrollView>
</View>
</View>
)}
{/* 两个都是文字 */}
{hasImg && groupList.length > 1 && !hasImg.has_image && (
<View style={styles.productBox}>
<View style={styles.productTit}>
<Text style={styles.productTitText}>{hasImg.attribute_name}</Text>
</View>
1 month ago
{hasImg.attributes?.map((item, index) => {
return (
<TouchableOpacity
style={[
styles.noImgBoxs,
item.has_color && styles.productBoxImgListBoxActive,
]}
key={index}
onPress={() => {
handleColorSelect(item.value, index, item.sku_image_url);
}}
>
{(item?.size ?? 0) > 0 && (
<Text style={styles.selectedNumText}>x{item?.size}</Text>
)}
<Text style={styles.noImgBoxsText}>{item.value}</Text>
</TouchableOpacity>
);
})}
1 month ago
<View style={styles.productBox}>
<Text style={styles.productTitText}>{sizeTitle}</Text>
</View>
<ScrollView
4 weeks ago
style={[styles.sizePrice, { maxHeight: 200 }]}
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
>
<View style={styles.sizePriceBox}>
{hasImg &&
hasImg.attributes
?.find((item) => item.has_color)
?.list.map((list, index1) => (
<View style={styles.sizePriceBoxItems} key={index1}>
<View style={styles.sizePriceBoxItem}>
<View style={styles.sizePriceBoxItemTextBox}>
{(list?.size ?? 0) > 0 && (
<Text style={styles.selectedNumText}>
x{list?.size}
1 month ago
</Text>
)}
<Text style={styles.priceText}>
{list.offer_price || price}
</Text>
<Text
style={styles.sizePriceBoxItemText}
numberOfLines={1}
ellipsizeMode="tail"
>
{list.attributes[0].value}
</Text>
2 months ago
</View>
<Text style={styles.amountText}>
{list?.amount_on_sale}
</Text>
2 months ago
</View>
<View style={styles.sizePriceBoxStepForward}>
1 month ago
<TouchableOpacity
style={styles.sizePriceBoxStepForwardButton}
1 month ago
onPress={() =>
handleSizeSelect(
1 month ago
list?.attributes[0]?.value,
"-",
1 month ago
index1,
list.amount_on_sale
1 month ago
)
}
>
<Text>-</Text>
</TouchableOpacity>
<TextInput
style={styles.sizePriceBoxStepForwardInput}
value={list.size?.toString() ?? "0"}
keyboardType="numeric"
onChangeText={(text) =>
handleSizeSelect(
list?.attributes[0]?.value,
text,
index1,
list.amount_on_sale
)
}
/>
1 month ago
<TouchableOpacity
style={styles.sizePriceBoxStepForwardButton}
1 month ago
onPress={() =>
handleSizeSelect(
1 month ago
list?.attributes[0]?.value,
"+",
1 month ago
index1,
list.amount_on_sale
1 month ago
)
}
>
<Text>+</Text>
</TouchableOpacity>
</View>
</View>
))}
</View>
</ScrollView>
2 months ago
</View>
)}
{/* 只有一个文字 */}
{noImgList && groupList.length === 1 && !flag && (
<View style={styles.productBox}>
<View style={styles.productTit}>
<Text style={styles.productTitText}>{sizeTitle}</Text>
</View>
<ScrollView
4 weeks ago
style={[styles.sizePrice, { maxHeight: 200 }]}
showsVerticalScrollIndicator={false}
>
{noImgList &&
noImgList?.map((list, index1) => (
<View style={styles.sizePriceBoxItems} key={index1}>
<View style={styles.sizePriceBoxItem}>
<View style={styles.sizePriceBoxItemTextBox}>
{(list?.size ?? 0) > 0 && (
<Text style={styles.selectedNumText}>
x{list?.size}
</Text>
)}
<Text style={styles.priceText}>
{list.offer_price || price}
</Text>
<Text
style={styles.sizePriceBoxItemText}
numberOfLines={1}
ellipsizeMode="tail"
>
{list.attributes[0].value}
</Text>
</View>
<Text style={styles.amountText}>
{list?.amount_on_sale}
</Text>
</View>
<View style={styles.sizePriceBoxStepForward}>
<TouchableOpacity
style={styles.sizePriceBoxStepForwardButton}
onPress={() =>
handleNoImgSizeSelect(
list?.attributes[0]?.value,
"-",
index1,
list.amount_on_sale
)
}
>
<Text>-</Text>
</TouchableOpacity>
<TextInput
style={styles.sizePriceBoxStepForwardInput}
value={list.size?.toString() ?? "0"}
keyboardType="numeric"
onChangeText={(text) =>
handleNoImgSizeSelect(
list?.attributes[0]?.value,
text,
index1,
list.amount_on_sale
)
}
/>
<TouchableOpacity
style={styles.sizePriceBoxStepForwardButton}
onPress={() =>
handleNoImgSizeSelect(
list?.attributes[0]?.value,
"+",
index1,
list.amount_on_sale
)
}
>
<Text>+</Text>
</TouchableOpacity>
</View>
</View>
))}
</ScrollView>
</View>
)}
{/* 只有图片 */}
{noImgList && groupList.length === 1 && flag && (
<View style={styles.productBox}>
<View style={styles.productTit}>
<Text style={styles.productTitText}>{sizeTitle}</Text>
</View>
<ScrollView
4 weeks ago
style={[styles.sizePrice, { maxHeight: 200 }]}
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
>
{noImgList.map((list, index1) => (
<View style={styles.allImageBox} key={index1}>
<View style={styles.allImageBoxImg}>
<Image
source={{ uri: list.attributes[0].sku_image_url }}
style={styles.allImageBoxImgImg}
/>
</View>
<View style={styles.allImageBoxList}>
<View style={styles.allImageBoxListBox}>
<View
style={{ flexDirection: "row", alignItems: "center" }}
>
<Text
style={{
fontSize: fontSize(16),
fontWeight: "700",
fontFamily: "Segoe UI",
color: "red",
marginRight: 5,
}}
>
{list.offer_price || price}
</Text>
<Text
style={styles.allImageBoxListBoxText}
numberOfLines={1}
ellipsizeMode="tail"
>
{list.attributes[0].value}
</Text>
</View>
<Text style={styles.amountText}>
{list?.amount_on_sale}
</Text>
</View>
<View style={styles.allImageBoxListStop}>
<TouchableOpacity
style={styles.sizePriceBoxStepForwardButton}
onPress={() =>
handleNoImgSizeSelect(
list.attributes[0]?.value,
"-",
index1,
list.amount_on_sale
)
}
>
<Text>-</Text>
</TouchableOpacity>
<TextInput
style={styles.sizePriceBoxStepForwardInput}
keyboardType="numeric"
value={list.size?.toString() ?? "0"}
onChangeText={(text) =>
handleNoImgSizeSelect(
list.attributes[0]?.value,
text,
index1,
list.amount_on_sale
)
}
/>
<TouchableOpacity
style={styles.sizePriceBoxStepForwardButton}
onPress={() =>
handleNoImgSizeSelect(
list.attributes[0]?.value,
"+",
index1,
list.amount_on_sale
)
}
>
<Text>+</Text>
</TouchableOpacity>
</View>
</View>
</View>
))}
</ScrollView>
</View>
)}
2 months ago
</View>
<View style={styles.fixedBottomView}>
<View style={styles.fixedBottomViewBox}>
<View style={styles.fixedBottomViewBoxLeft}>
<Text style={styles.fixedBottomViewBoxLeftText}>:</Text>
<Text style={styles.fixedBottomViewBoxPriceText}>
{selectedSize}
1 month ago
</Text>
</View>
<View style={styles.fixedBottomViewBoxRight}>
<Text style={styles.fixedBottomViewBoxRightText}>:</Text>
<Text style={styles.fixedBottomViewBoxPriceText}>
{totalPrice.toFixed(2)} FCFA
1 month ago
</Text>
</View>
</View>
<TouchableOpacity
style={styles.fixedBottomViewButton}
onPress={addCartHandel}
>
<Text style={styles.fixedBottomViewButtonText}></Text>
</TouchableOpacity>
1 month ago
</View>
1 month ago
<Modal
visible={deleteModalVisible}
transparent
animationType="fade"
onRequestClose={cancelDelete}
>
<View style={styles.overlay}>
<View style={styles.popup}>
{/* <Image
source={require("../assets/image_5f59afb0.png")} // 替换成你实际的路径
style={styles.image}
/> */}
<Text style={styles.promptText}>Supprimer l'article ?</Text>
<View style={styles.buttonContainer}>
<TouchableOpacity
style={styles.cancelButton1}
onPress={cancelDelete}
>
<Text style={styles.cancelText}>Non</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.confirmButton}
onPress={handleNavigateToCart}
>
<Text style={styles.confirmText}>Voir le panier</Text>
</TouchableOpacity>
</View>
1 month ago
</View>
</View>
</Modal>
2 months ago
</View>
);
};
const styles = StyleSheet.create({
wrapper: {
flex: 1,
2 months ago
},
container: {
flex: 1,
padding: 19,
paddingBottom: widthUtils(118, 118).height,
2 months ago
},
productInfo: {
2 months ago
flexDirection: "row",
height: widthUtils(100, 100).height,
2 months ago
},
productBigImgBox: {
width: widthUtils(100, 100).width,
height: widthUtils(100, 81000).height,
borderRadius: 10,
2 months ago
},
productBigImg: {
2 months ago
width: "100%",
height: "100%",
borderRadius: 10,
2 months ago
},
productInfoBox: {
flex: 1,
paddingLeft: 10,
2 months ago
},
priceInfo: {
width: "100%",
height: "40%",
2 months ago
flexDirection: "row",
justifyContent: "space-between",
2 months ago
},
priceInfoBox: {
width: "90%",
height: "100%",
2 months ago
flexDirection: "row",
alignItems: "center",
gap: 10,
2 months ago
},
price: {
flexDirection: "row",
},
priceInfoText: {
2 months ago
fontWeight: "700",
fontSize: fontSize(30),
fontFamily: "Segoe UI",
color: "#ff5100",
},
priceListBoxText: {
fontWeight: "700",
fontSize: fontSize(20),
fontFamily: "Segoe UI",
2 months ago
},
priceListBoxTextCon: {
2 months ago
fontWeight: "700",
1 month ago
fontSize: fontSize(14),
2 months ago
fontFamily: "Segoe UI",
lineHeight: fontSize(20),
2 months ago
},
priceListBoxListText: {
2 months ago
fontFamily: "Segoe UI",
},
priceInfoTextCon: {
fontWeight: "700",
1 month ago
fontSize: fontSize(14),
2 months ago
fontFamily: "Segoe UI",
color: "#ff5100",
lineHeight: fontSize(30),
2 months ago
},
priceInfoOffer: {
width: widthUtils(28, 28).width,
height: widthUtils(28, 28).height,
position: "relative",
},
priceInfoOfferImg: {
2 months ago
width: "100%",
height: "100%",
2 months ago
},
discountTextContainer: {
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0,
justifyContent: "center",
2 months ago
alignItems: "center",
},
discountText: {
color: "#512003",
2 months ago
fontSize: fontSize(12),
fontWeight: "600",
fontStyle: "italic",
2 months ago
},
priceInfoVip: {
width: widthUtils(21, 63).width,
height: widthUtils(21, 63).height,
},
priceInfoVipImg: {
2 months ago
width: "100%",
height: "100%",
},
priceInfoClose: {
width: "10%",
alignItems: "flex-end",
2 months ago
},
priceInfoList: {
width: "100%",
padding: 5,
backgroundColor: "#f3f4f8",
borderRadius: 10,
height: "60%",
2 months ago
},
priceList: {
width: widthUtils(100, 100).width,
height: "100%",
borderRadius: 10,
marginRight: 5,
2 months ago
justifyContent: "flex-start",
alignItems: "flex-start",
paddingLeft: 10,
2 months ago
},
priceListBox: {
1 month ago
flexDirection: "row",
justifyContent: "center",
},
priceListBoxPie: {
1 month ago
alignItems: "flex-start",
2 months ago
},
productBox: {
marginTop: 10,
flex: 1,
4 weeks ago
display: 'flex',
flexDirection: 'column',
},
productTit: {
flexDirection: "row",
2 months ago
width: "100%",
},
productTitText: {
fontSize: fontSize(16),
fontWeight: "700",
2 months ago
fontFamily: "Segoe UI",
color: "#000",
2 months ago
},
productBoxImgList: {
width: "100%",
paddingTop: 10,
flexGrow: 0,
flexDirection: "row",
flexWrap: "wrap",
},
productBoxImgListBox: {
width: widthUtils(90, 90).width,
height: widthUtils(90, 90).height,
backgroundColor: "#f4f4f4",
borderRadius: 10,
marginRight: 10,
marginBottom: 10,
position: "relative",
2 months ago
},
productBoxImgListBoxActive: {
1 month ago
borderWidth: 1,
borderColor: "#ff5100",
2 months ago
},
noImgBoxsText: {
width: "100%",
2 months ago
},
productBoxImgListBoxImg: {
width: "100%",
height: "100%",
borderRadius: 10,
2 months ago
},
4 weeks ago
sizePrice: {
flex: 1,
width: '100%',
},
sizePriceBox: {
width: "100%",
4 weeks ago
paddingBottom: 10,
1 month ago
},
sizePriceBoxItem: {
width: "70%",
2 months ago
},
sizePriceBoxItemTextBox: {
2 months ago
flexDirection: "row",
1 month ago
alignItems: "center",
2 months ago
},
1 month ago
selectedNumText: {
width: widthUtils(16, 30).width,
height: widthUtils(16, 30).height,
1 month ago
backgroundColor: "#ff5217",
borderRadius: 5,
color: "white",
textAlign: "center",
1 month ago
fontSize: fontSize(12),
1 month ago
fontWeight: "600",
fontFamily: "Segoe UI",
marginRight: 5,
lineHeight: 18,
},
sizePriceBoxItems: {
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
marginBottom: 10,
width: "100%",
},
sizePriceBoxItemText: {
fontSize: fontSize(18),
color: "#000",
},
priceText: {
fontSize: fontSize(16),
fontWeight: "700",
fontFamily: "Segoe UI",
color: "red",
marginRight: 5,
},
1 month ago
amountText: {
1 month ago
fontSize: fontSize(16),
1 month ago
fontWeight: "600",
2 months ago
fontFamily: "Segoe UI",
1 month ago
color: "#bdbdbd",
2 months ago
},
sizePriceBoxStepForward: {
width: "30%",
2 months ago
flexDirection: "row",
alignItems: "center",
justifyContent: "flex-end",
2 months ago
},
sizePriceBoxStepForwardButton: {
width: widthUtils(40, 30).width,
height: widthUtils(40, 30).height,
backgroundColor: "#f3f4f8",
justifyContent: "center",
alignItems: "center",
},
sizePriceBoxStepForwardInput: {
width: widthUtils(40, 30).width,
height: widthUtils(40, 30).height,
backgroundColor: "#fff",
1 month ago
textAlign: "center",
fontSize: fontSize(14),
borderWidth: 1,
borderColor: "#f3f4f8",
padding: 0,
lineHeight: fontSize(14),
2 months ago
},
fixedBottomView: {
1 month ago
position: "absolute",
bottom: 0,
left: 0,
right: 0,
height: widthUtils(118, 118).height,
2 months ago
width: "100%",
1 month ago
borderTopWidth: 1,
borderTopColor: "#f3f4f8",
padding: 10,
zIndex: 1000,
backgroundColor: "white",
},
fixedBottomViewBox: {
width: "100%",
1 month ago
flexDirection: "row",
justifyContent: "space-between",
},
fixedBottomViewBoxLeft: {
width: "50%",
flexDirection: "row",
alignItems: "center",
},
fixedBottomViewBoxLeftText: {
fontSize: fontSize(16),
fontFamily: "Segoe UI",
color: "#000",
},
fixedBottomViewBoxPriceText: {
fontSize: fontSize(20),
fontFamily: "Segoe UI",
color: "#ff5217",
fontWeight: "700",
2 months ago
},
fixedBottomViewBoxRight: {
width: "50%",
flexDirection: "row",
alignItems: "center",
justifyContent: "flex-end",
},
fixedBottomViewBoxRightText: {
fontSize: fontSize(16),
fontFamily: "Segoe UI",
},
fixedBottomViewButton: {
marginTop: 10,
1 month ago
width: "100%",
height: widthUtils(50, 50).height,
1 month ago
backgroundColor: "#ff5217",
borderRadius: 10,
justifyContent: "center",
1 month ago
alignItems: "center",
},
fixedBottomViewButtonText: {
fontSize: fontSize(16),
fontFamily: "Segoe UI",
color: "#fff",
fontWeight: "700",
lineHeight: widthUtils(50, 50).height,
},
noImgBoxs: {
width: "100%",
marginTop: 10,
padding: 10,
borderRadius: 10,
backgroundColor: "#efefef",
flexDirection: "row",
},
allImage: {
flex: 1,
},
allImageBox: {
flexDirection: "row",
marginTop: 10,
alignItems: "center",
},
allImageBoxImg: {
width: 50,
height: 50,
borderRadius: 10,
},
allImageBoxImgImg: {
width: "100%",
height: "100%",
borderRadius: 10,
},
allImageBoxList: {
flex: 1,
paddingLeft: 10,
flexDirection: "row",
},
allImageBoxListBox: {
width: "60%",
2 months ago
justifyContent: "center",
},
allImageBoxListBoxText: {
fontSize: fontSize(16),
fontFamily: "Segoe UI",
color: "#000",
},
allImageBoxListStop: {
width: "40%",
flexDirection: "row",
alignItems: "center",
justifyContent: "flex-end",
},
cornerView: {
position: "absolute",
top: 0,
right: 0,
width: 22,
height: 22,
backgroundColor: "#787675",
},
topRightIcon: {
position: "absolute",
top: 3,
right: 3,
},
bottomLeftIcon: {
position: "absolute",
bottom: 3,
left: 3,
2 months ago
},
1 month ago
fixedCornerView: {
position: "absolute",
top: 0,
1 month ago
left: 0,
width: 30,
height: 16,
backgroundColor: "#ff5217",
borderRadius: 10,
justifyContent: "center",
zIndex: 1,
1 month ago
},
fixedCornerViewText: {
1 month ago
fontSize: fontSize(12),
fontFamily: "Segoe UI",
color: "#fff",
fontWeight: "700",
1 month ago
textAlign: "center",
lineHeight: 16,
1 month ago
},
overlay: {
flex: 1,
backgroundColor: "rgba(0,0,0,0.4)",
justifyContent: "center",
alignItems: "center",
},
popup: {
backgroundColor: "white",
borderRadius: 10,
paddingVertical: 27,
paddingHorizontal: 20,
alignItems: "center",
gap: 21,
},
image: {
width: widthUtils(80, 80).width,
height: widthUtils(80, 80).height,
1 month ago
borderRadius: 5,
resizeMode: "cover",
},
promptText: {
fontSize: fontSize(20),
fontWeight: "600",
color: "black",
fontFamily: "Segoe UI", // 注意要在项目中配置字体
},
buttonContainer: {
flexDirection: "row",
justifyContent: "center",
marginTop: 10,
},
cancelButton1: {
width: widthUtils(50, 160).width,
height: widthUtils(50, 160).height,
1 month ago
borderRadius: 25,
backgroundColor: "#f2f3f5",
justifyContent: "center",
alignItems: "center",
},
confirmButton: {
width: widthUtils(50, 160).width,
height: widthUtils(50, 160).height,
1 month ago
borderRadius: 25,
backgroundColor: "#002fa7",
justifyContent: "center",
alignItems: "center",
marginLeft: 20,
},
cancelText: {
fontSize: fontSize(16),
fontWeight: "500",
color: "#333333",
fontFamily: "Source Han Sans CN", // 注意要在项目中配置字体
},
confirmText: {
fontSize: fontSize(16),
fontWeight: "500",
color: "#ffffff",
fontFamily: "Source Han Sans CN", // 同上
},
2 months ago
});
export default ProductCard;