diff --git a/src/redux/actions/userProduct.js b/src/redux/actions/userProduct.js index be0aa82..c77f7f7 100644 --- a/src/redux/actions/userProduct.js +++ b/src/redux/actions/userProduct.js @@ -24,7 +24,6 @@ const userProduct = { (data = {}, data2 = {}, data3 = {}) => async (dispatch) => { await proxy.post("userProduct/add", data, { dispatch }); - await proxy.get("userFactor/info", data3, { dispatch }); }, del: (data = {}, data2 = {}) => diff --git a/src/redux/reducers/config.js b/src/redux/reducers/config.js index 02c42b5..3d3fc4e 100644 --- a/src/redux/reducers/config.js +++ b/src/redux/reducers/config.js @@ -16,7 +16,6 @@ export default function config(state = initialState, action) { error: null, }; case "config/availableForSell": - console.log(data); return { ...state, loading: false, diff --git a/src/screens/Address/index.js b/src/screens/Address/index.js index 25f6141..6e2e7e2 100644 --- a/src/screens/Address/index.js +++ b/src/screens/Address/index.js @@ -553,17 +553,30 @@ const Address = ({ {!profilePage ? ( <> - + setMapAddress(address)} /> deleteItem({ id: address?.id }), }) } - style={tw('h-full')} + style={tw("h-full")} > {addresses?.length ? ( - - لطفا آدرس مورد نظر را انتخاب کنید. - + + + لطفا آدرس مورد نظر را انتخاب کنید. + + + {addresses?.map((address, index) => ( + + ))} + + ) : null} - - {addresses?.map((address, index) => ( - - ))} - + navigation.push("CreateAddress")} @@ -224,7 +227,7 @@ const mapStateToProps = (state) => ({ const mapDispatchToProps = { update: userFactor.update, - deleteItem: userAddress.update + deleteItem: userAddress.update, }; export default connect(mapStateToProps, mapDispatchToProps)(Address); diff --git a/src/screens/DeliveryForm/TransportMethod/index.js b/src/screens/DeliveryForm/TransportMethod/index.js index 5cff3ee..efbb03f 100644 --- a/src/screens/DeliveryForm/TransportMethod/index.js +++ b/src/screens/DeliveryForm/TransportMethod/index.js @@ -139,7 +139,7 @@ const TransportMethod = ({ [factorInfo, loading] ); - return ( + return factorInfo?.transports?.length ? ( - ); + ) : null; }; const mapStateToProps = (state) => ({ diff --git a/src/screens/DeliveryForm/index.js b/src/screens/DeliveryForm/index.js index f47714b..b22de8a 100644 --- a/src/screens/DeliveryForm/index.js +++ b/src/screens/DeliveryForm/index.js @@ -6,11 +6,13 @@ import { StatusBar, Platform, Dimensions, + Text } from "react-native"; import React, { useEffect } from "react"; import { connect } from "react-redux"; import { userFactor, userAddress } from "../../redux/actions"; import { asyncAwesomeAlert } from "../../utils/AsyncWrappers"; +import separate from "../../utils/separate"; //components import Navbar from "../../components/Navbar"; @@ -23,9 +25,65 @@ import CustomPressable from "../../components/Pressable"; //style import tw from "tailwind-rn"; import Colors from "../../constants/Colors"; +import fontSize from "../../constants/fontSize"; const { height } = Dimensions.get("window"); +const PriceStatus = ({ name, value, type, theme }) => { + return ( + + + {name} + + + + {value} + + + تومان + + + + ); +}; + const DeliveryForm = ({ list, form, @@ -85,6 +143,83 @@ const DeliveryForm = ({ ) : null} + + + + + + + + جمع کل سبد خرید + + + + {separate(factorInfo?.payPrice)} + + + تومان + + + @@ -114,7 +249,6 @@ const styles = StyleSheet.create({ }, container: { paddingVertical: 5, - }, }); diff --git a/src/screens/ShoppingCart/index.js b/src/screens/ShoppingCart/index.js index f8db8c8..bec6546 100644 --- a/src/screens/ShoppingCart/index.js +++ b/src/screens/ShoppingCart/index.js @@ -114,6 +114,10 @@ function ShoppingCart({ ); }, [list]); + useEffect(() => { + getFactorInfo({ userId }); + }, [list]); + useEffect(() => { getList(); getFactorInfo({ userId }); @@ -174,6 +178,7 @@ function ShoppingCart({ type="normal" theme={theme} /> + - + - {isEmpty ? 0 : separate(factorInfo?.payPrice || "")} + {isEmpty ? 0 : separate(factorInfo?.payPrice - factorInfo?.transportPrice)}