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 { PolicyFooter, Social, ShowroomList, FooterInfo } from '../components/footer/footerMain'; 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'; import { ArticleItem } from '../components/article/ArticleItem'; export default function BuildPc() { return ( Trang chủ Build PC ) } const BuildPcBox = () => { return ( Xây dựng máy tính Chọn linh kiện xây dựng cấu hình Cấu hình 1 Cấu hình 2 Cấu hình 3 Cấu hình 4 Cấu hình 5 Làm mới Chi phí dự tính 30.000.000 đ ) } const BuildPcListStore = () => { const [checked, setChecked] = React.useState('store1'); const listStore = [ { id: 1, name: '01: 131 Lê Thanh Nghị - Q. Hai Bà Trưng - Hà Nội' }, { id: 2, name: '02: 43 Thái Hà - Q. Đống Đa - Hà Nội' }, { id: 3, name: '03: A1-6 Lô 8A Lê Hồng Phong - Q. Ngô Quyền - Hải Phòng' }, { id: 4, name: '04: 79 Nguyễn Văn Huyên - Q. Cầu Giấy - Hà Nội' }, { id: 5, name: '05: 511 Quang Trung - Q. Hà Đông - Hà Nội' }, { id: 6, name: '06: 520 Cách Mạng Tháng 8 - Quận 3 - TP HCM' }, { id: 7, name: '07: 398 Nguyễn Văn Cừ - Q. Long Biên - Hà Nội' }, { id: 8, name: '08: 299 Minh Khai - Từ Sơn - Bắc Ninh' }, ] return ( setChecked('store0')} /> Tất cả kho { listStore.map(item => { const value = 'store' + item.id; return ( setChecked(value)} /> {item.name} ) }) } ) } const ListItemBuildPc = () => { const dataListItem = [ { id: 1, name: 'Bộ vi xử lý', }, { id: 2, name: 'Bo mạch chủ', }, { id: 3, name: 'RAM', }, { id: 4, name: 'HDD', }, { id: 5, name: 'SSD', }, { id: 6, name: 'VGA', }, { id: 7, name: 'Nguồn', }, { id: 8, name: 'Vỏ Case', }, { id: 9, name: 'Màn hình', }, { id: 10, name: 'Bàn phám, Chuột', }, { id: 11, name: 'Bàn phím', }, { id: 12, name: 'Chuột', }, { id: 13, name: 'Tai nghe', }, { id: 14, name: 'Loa', }, { id: 15, name: 'Ghế gamming', }, { id: 16, name: 'Quạt làm mát', }, { id: 17, name: 'Tản nhiệt nước All in One', }, { id: 18, name: 'Tản nhiệt nước custom', }, { id: 19, name: 'Tản nhiệt khí', }, { id: 20, name: 'Windows bản quyền', }, { id: 21, name: 'Phần mềm Antivirus', }, ]; const [modalVisible, setModalVisible] = useState(false); return ( { dataListItem.map((item, index) => { return ( {index + 1}. {item.name} setModalVisible(true)}> + ) }) } { setModalVisible(!modalVisible); }}> setModalVisible(!modalVisible)}> ) } 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 ProductBuildPC = () => { const productData = [ { id: 1, productName: 'Laptop LG Gram 14ZD90N-V.AX55A5 (i5 1035G7/8GB RAM/512GBSSD/14.0 inch FHD/FP/Xám Bạc) (model 2020)', productSKU: 'TESTSKU', productImage: { small: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', medium: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', large: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', original: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', }, price: 30000000, marketPrice: 50000000, quantity: 1, warrantry: '36 Tháng', }, { id: 2, productName: 'Laptop LG Gram 14ZD90N-V.AX55A5 (i5 1035G7/8GB RAM/512GBSSD/14.0 inch FHD/FP/Xám Bạc) (model 2020)', productSKU: 'TESTSKU', productImage: { small: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', medium: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', large: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', original: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', }, price: 25000000, marketPrice: 50000000, quantity: 0, warrantry: '36 Tháng', }, { id: 3, productName: 'Laptop LG Gram 14ZD90N-V.AX55A5 (i5 1035G7/8GB RAM/512GBSSD/14.0 inch FHD/FP/Xám Bạc) (model 2020)', productSKU: 'TESTSKU', productImage: { small: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', medium: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', large: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', original: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', }, price: 35000000, marketPrice: 50000000, quantity: 1, warrantry: '36 Tháng', }, { id: 4, productName: 'Laptop LG Gram 14ZD90N-V.AX55A5 (i5 1035G7/8GB RAM/512GBSSD/14.0 inch FHD/FP/Xám Bạc) (model 2020)', productSKU: 'TESTSKU', productImage: { small: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', medium: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', large: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', original: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', }, price: 40000000, marketPrice: 50000000, quantity: 1, warrantry: '36 Tháng', }, { id: 5, productName: 'Laptop LG Gram 14ZD90N-V.AX55A5 (i5 1035G7/8GB RAM/512GBSSD/14.0 inch FHD/FP/Xám Bạc) (model 2020)', productSKU: 'TESTSKU', productImage: { small: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', medium: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', large: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', original: 'https://hanoicomputercdn.com/media/product/120_52019_14zd90n_v_ax55a5.png', }, price: 30000000, marketPrice: 50000000, quantity: 1, warrantry: '36 Tháng', }, ] return ( { productData.map((item, index) => { if (index < 5) { return ( {item.productName} Mã SP: {item.productSKU} Bảo hành: {item.warrantry} Kho hàng: { item.quantity == 0 ? Liên hệ : Còn hàng } {formatCurrency(item.price)} đ { item.quantity == 0 ? : } ) } }) } ) } 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', }, brecrumb: { display: 'flex', width: winWidth, paddingLeft: 10, paddingRight: 10, flexDirection: 'row', height: 18, alignItems: 'center', marginTop: 10, marginBottom: 10, }, brecrumbText: { fontSize: 13, color: '#222', }, brecrumbTextLast: { fontSize: 13, color: '#b7b7b7', }, brecrumbIcon: { fontSize: 13, color: '#222', marginLeft: 6, marginRight: 6 }, boxBuildPc: { paddingHorizontal: 10, width: winWidth, marginBottom: 30, }, boxBuildPcTitle: { width: '100%', marginBottom: 20, fontSize: 22, fontWeight: 'bold', textTransform: 'uppercase', textAlign: 'center', color: '#ed1b24', }, boxBuildPcBanner: { marginBottom: 20, width: '100%', height: 72, position: 'relative', }, boxBuildPcBannerImg: { width: '100%', position: 'absolute', top: 0, left: 0, bottom: 0, right: 0, }, boxBuildPcNote: { marginBottom: 20, textAlign: 'center', color: '#2d3877', fontSize: 15, fontWeight: 'bold', }, listConfig: { flexDirection: 'row', marginBottom: 20, flexWrap: 'wrap', justifyContent: 'space-between', alignItems: 'center', paddingBottom: 20, borderBottomColor: '#e1e1e1', borderBottomWidth: 1, }, listConfigItem: { width: '48%', marginBottom: 10, flexDirection: 'row', height: 40, justifyContent: 'center', alignItems: 'center', backgroundColor: '#d9d9d9', borderRadius: 3, }, listConfigItemText: { color: '#333', textTransform: 'uppercase' }, listConfigItemActive: { backgroundColor: '#2d3877', }, listConfigItemTextActive: { color: '#fff', }, boxBuildPcReload: { width: 126, height: 40, flexDirection: 'row', justifyContent: 'center', alignItems: 'center', borderRadius: 3, backgroundColor: '#2d3877', marginBottom: 20, }, boxBuildPcReloadText: { color: '#fff', textTransform: 'uppercase', marginRight: 10, }, boxBuildPcReloadIcon: { color: '#fff', }, boxBuildPcTotalPrice: { textAlign: 'right' }, boxBuildPcTotalPriceNum: { fontWeight: 'bold', color: 'red' }, boxStore: { marginBottom: 20, paddingBottom: 20, borderBottomWidth: 1, borderBottomColor: '#e1e1e1' }, boxStoreItem: { marginBottom: 10, flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', }, boxStoreItemCheck: { width: 36, height: 36, borderRadius: 18, borderWidth: 1, borderColor: '#666', marginRight: 10, }, boxStoreItemText: { width: winWidthP10 - 46, }, itemBuildPCList: {}, itemBuildPC: { marginBottom: 10, paddingBottom: 10, flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', borderBottomWidth: 1, borderBottomColor: '#e1e1e1' }, itemBuildPCText: {}, itemBuildPCShowPop: { width: 50, height: 40, justifyContent: 'center', alignItems: 'center', borderRadius: 3, backgroundColor: '#243a76', }, itemBuildPCShowPopText: { fontWeight: 'bold', fontSize: 36, color: '#fff', lineHeight: 36, }, itemBuildPCPop: { backgroundColor: '#fff', flex: 1, padding: 10, position: 'relative', paddingTop: 50, }, itemBuildPCPopClose: { width: 30, height: 30, borderWidth: 1, justifyContent: 'center', flexDirection: 'row', alignItems: 'center', position: 'absolute', top: 15, right: 10, }, itemBuildPCPopCloseIcon: {}, boxPrductBuildPc: { width: winWidth, paddingHorizontal: 10, marginBottom: 20, }, boxPrductBuildPcList: {}, boxPrductBuildPcItem: { flexDirection: 'row', marginBottom: 15, alignItems: 'center', paddingBottom: 15, borderBottomWidth: 1, borderBottomColor: '#e1e1e1' }, boxPrductBuildPcImg: { width: 60, height: 60, position: 'relative', overflow: 'hidden', marginRight: 10, }, boxPrductBuildPcImgCt: { position: 'absolute', top: 0, left: 0, bottom: 0, right: 0, }, boxPrductBuildPcInfo: { width: winWidthP10 - 130, paddingRight: 10, }, boxPrductBuildPcName: { marginBottom: 10, }, boxPrductBuildPcOtherText: { marginBottom: 10, flexDirection: 'row', }, boxPrductBuildPcOtherTextSt: { fontSize: 12, width: 80, }, boxPrductBuildPcOtherTextNd: { fontSize: 12, }, boxPrductBuildPcPrice: { fontSize: 19, fontWeight: 'bold', color: '#f40606', marginBottom: 7, }, boxPrductBuildPcOldPrice: { color: '#888', textDecorationLine: 'line-through', }, boxPrductBuildPcQuantity: { width: 80, }, boxPrductBuildPcQuantityNo: { flexDirection: 'row', alignItems: 'center', paddingHorizontal: 10, height: 20, backgroundColor: '#eaeaea', borderRadius: 3, }, boxPrductBuildPcQuantityNoIcon: { marginRight: 5, }, boxPrductBuildPcQuantityNoText: {}, boxPrductBuildPcQuantityHas: { flexDirection: 'row', alignItems: 'center', paddingHorizontal: 10, height: 20, backgroundColor: '#278c56', borderRadius: 3, }, boxPrductBuildPcQuantityHasIcon: { marginRight: 5, color: '#fff', }, boxPrductBuildPcQuantityHasText: { color: '#fff' }, boxPrductBuildPcSelec: { }, boxPrductBuildPcSelecNo: { width: 50, height: 40, justifyContent: 'center', alignItems: 'center', borderRadius: 3, backgroundColor: '#ec1b23', }, boxPrductBuildPcSelecYes: { width: 50, height: 40, justifyContent: 'center', alignItems: 'center', borderRadius: 3, backgroundColor: '#243a76', }, boxPrductBuildPcSelecIcon: { fontWeight: 'bold', fontSize: 36, color: '#fff', lineHeight: 36, }, })