import 'react-native-gesture-handler'; import * as React from 'react'; import { useState } from 'react'; import { Alert, Button, Image, StyleSheet, Dimensions, SafeAreaView, ScrollView, TouchableOpacity, Modal, Pressable, Share } from 'react-native'; import Constants from 'expo-constants'; import { Ionicons, FontAwesome } from '@expo/vector-icons'; import { LinearGradient } from 'expo-linear-gradient'; import { useNavigation } from '@react-navigation/native'; import EditScreenInfo from '../components/EditScreenInfo'; import { Text, View, } from '../components/Themed'; import useColorScheme from '../hooks/useColorScheme'; import { TextInput } from 'react-native-gesture-handler'; import { RadioButton, Checkbox } from 'react-native-paper'; import { Picker } from '@react-native-picker/picker'; export default function AccountProductBought() { return ( ) } function formatCurrency(price: string | number) { let priceConvert = parseFloat(`${price}`).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1.").toString(); let len = priceConvert.length; return priceConvert.substring(0, len - 3); } const HeaderAccountOrderList = () => { const navigation = useNavigation(); return ( navigation.goBack()} style={styles.headerAOLBack}> Sản phẩm bạn đã mua ) } const ShowProductItemBought = (props: { id: number, productName: string, productSKU: string, summary: string, productImage: { small: string, medium: string, large: string, original: string }, price: number, marketPrice: number, quantity: number }) => { const { id, productName, productSKU, summary, productImage, price, marketPrice, quantity } = props; const discount = Math.ceil(100 - (price / marketPrice * 100)); return ( {productName} {formatCurrency(price)} đ Viết nhận xét ); } const productData = [ { id: 1, productName: 'Máy làm mát Nagakawa NFC452 (110W) - Hàng chính hãng', productSKU: 'TESTSKU', productImage: { small: 'https://shop.nagakawa.com.vn/media/product/137_nfc452.jpg', medium: 'https://shop.nagakawa.com.vn/media/product/137_nfc452.jpg', large: 'https://shop.nagakawa.com.vn/media/product/137_nfc452.jpg', original: 'https://shop.nagakawa.com.vn/media/product/137_nfc452.jpg', }, price: 30000000, marketPrice: 50000000, quantity: 1, summary: 'CPU: Intel Core i5 1035G1\nRAM: 8GB\nỔ cứng: 256GB SSD\nMàn hình: 15.6 inch FHD\nHĐH: Win 10\nMàu: Đen' }, { id: 2, productName: 'Máy làm mát Nagakawa NFC452 (110W) - Hàng chính hãng', productSKU: 'TESTSKU', productImage: { small: 'https://shop.nagakawa.com.vn/media/product/137_nfc452.jpg', medium: 'https://shop.nagakawa.com.vn/media/product/137_nfc452.jpg', large: 'https://shop.nagakawa.com.vn/media/product/137_nfc452.jpg', original: 'https://shop.nagakawa.com.vn/media/product/137_nfc452.jpg', }, price: 25000000, marketPrice: 50000000, quantity: 0, summary: 'CPU: Intel Core i5 1035G1\nRAM: 8GB\nỔ cứng: 256GB SSD\nMàn hình: 15.6 inch FHD\nHĐH: Win 10\nMàu: Đen' }, ] const ProductBought = () => { return ( { productData.map(item => ) } ) } const winWidth = Dimensions.get('window').width; //full width const winHeight = Dimensions.get('window').height; //full height const winWidthP10 = winWidth - 20; const halfWinWidth = winWidth / 2; const ratio = winWidthP10 / 850; //541 is actual image width const styles = StyleSheet.create({ container: { flex: 1, alignItems: 'center', justifyContent: 'center', backgroundColor: '#fff', }, headerAOL: { width: winWidth, padding: 10, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', }, headerAOLBack: { width: 40, height: 40, flexDirection: 'row', alignItems: 'center', }, headerAOLBackIcon: { fontSize: 24, }, headerAOLSearch: { width: 40, height: 40, flexDirection: 'row', alignItems: 'center', }, headerAOLSearchIcon: { fontSize: 24, }, headerAOLTitle: { width: winWidth - 60, textAlign: 'center', fontWeight: '700', }, headerAOLChat: { width: 40, height: 40, flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-end', }, headerAOLChatIcon: { fontSize: 24, }, GreenColor: { color: '#008445', }, OrangeColor: { color: '#FE9923', }, RedColor: { color: '#D8262F', }, boxAccOrDt: { width: winWidth, padding: 10, }, boxProductSave: { backgroundColor: '#f2f2f2' }, listProductSave: { backgroundColor: '#f2f2f2' }, itemProduct: { padding: 10, marginBottom: 10, }, itemProducCt: { width: '100%', flexDirection: 'row', marginBottom: 10, }, pBloxImgProduct: { position: 'relative', width: 96, height: 96, marginRight: 10, }, pBloxImgProductBao: { position: 'relative', paddingTop: '100%', overflow: 'hidden', display: 'flex', alignItems: 'center', justifyContent: 'center', flexDirection: 'row', }, pImgProduct: { position: 'absolute', top: 0, left: '5%', right: 0, bottom: 0, maxHeight: 500, width: '90%', }, pBloxImgProductInfo: { width: winWidth - 136, }, pNameProduct: { fontSize: 16, color: '#111', marginBottom: 10, fontWeight: '700', textTransform: 'uppercase' }, priceProduct: { fontSize: 18, fontWeight: 'bold', color: '#f10000', marginBottom: 5, }, proReview: { width: '100%', height: 40, backgroundColor: '#D8262F', borderRadius: 5, flexDirection: 'row', justifyContent: 'center', alignItems: 'center', }, proReviewText: { textTransform: 'uppercase', fontWeight: '700', color: '#fff' }, })