reza added some change

master
Reza_ashrafi 3 years ago
parent 1fbe8fae3e
commit 3310d24429
  1. 6
      app.json
  2. BIN
      assets/appLogo.png
  3. 2
      navigation/index.js
  4. 2
      src/components/CustomTextInput.js
  5. 1
      src/components/MapSelector.js
  6. 3
      src/components/MusicPlayer.js
  7. 11
      src/redux/proxy.js
  8. 2
      src/redux/reducers/activation.js
  9. 6
      src/redux/reducers/user.js
  10. 1
      src/redux/store.js
  11. 1
      src/screens/DeliveryForm/index.js
  12. 3
      src/screens/Login/index.js
  13. 12
      src/screens/Otp/index.js
  14. 266
      src/screens/Product/components/Book.js
  15. 8
      src/screens/Product/components/LinkBox.js
  16. 18
      src/screens/Product/components/Sample.js
  17. 205
      src/screens/Product/components/Video.js
  18. 30
      src/screens/Product/index.js
  19. 2
      src/screens/Profile/components/ProfileAddress/index.js
  20. 2
      src/screens/QRContent/Tab/index.js
  21. 2
      src/screens/QRContent/index.js

@ -1,11 +1,11 @@
{ {
"expo": { "expo": {
"name": "RnDanovinExpo", "name": "Danovin",
"slug": "RnDanovinExpo", "slug": "Danovin",
"version": "1.0.0", "version": "1.0.0",
"orientation": "portrait", "orientation": "portrait",
"userInterfaceStyle": "automatic", "userInterfaceStyle": "automatic",
"icon": "", "icon": "./assets/appLogo.png",
"scheme": "danovin", "scheme": "danovin",
"splash": { "splash": {
"image": "", "image": "",

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

@ -51,7 +51,7 @@ const BottomTabNavigator = () => {
React.useEffect(() => { React.useEffect(() => {
setTimeout(() => { setTimeout(() => {
setHeaderShown(false); setHeaderShown(false);
}, 500); }, 600);
}, []); }, []);
return ( return (
<Tab.Navigator <Tab.Navigator

@ -30,6 +30,7 @@ const FloatingLabelInput = ({
autoFocus, autoFocus,
regex, regex,
mobile, mobile,
keyboardType,
...props ...props
}) => { }) => {
const colorScheme = useColorScheme(); const colorScheme = useColorScheme();
@ -95,6 +96,7 @@ const FloatingLabelInput = ({
maxLength={maxLength} maxLength={maxLength}
value={value} value={value}
onBlur={() => (value ? {} : setIsFocused(() => false))} onBlur={() => (value ? {} : setIsFocused(() => false))}
keyboardType={keyboardType}
/> />
</View> </View>
); );

@ -6,7 +6,6 @@ const X_API_KEY = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjkyODE4ODI0N2FhM
export default function MapSelector() { export default function MapSelector() {
onRegionDidChange = (e) => { onRegionDidChange = (e) => {
console.log('onRegionDidChange', e.geometry.coordinates);
}; };
return ( return (
<View style={styles.container}> <View style={styles.container}>

@ -6,19 +6,16 @@ export default function VoicePlayer({fileIds}) {
const [sound, setSound] = React.useState(); const [sound, setSound] = React.useState();
async function playSound() { async function playSound() {
console.log('Loading Sound');
const { sound } = await Audio.Sound.createAsync( const { sound } = await Audio.Sound.createAsync(
{uri : `https://dnvn.ir/api/v1/file/${fileIds}`} {uri : `https://dnvn.ir/api/v1/file/${fileIds}`}
); );
setSound(sound); setSound(sound);
console.log('Playing Sound');
await sound.playAsync(); } await sound.playAsync(); }
React.useEffect(() => { React.useEffect(() => {
return sound return sound
? () => { ? () => {
console.log('Unloading Sound');
sound.unloadAsync(); } sound.unloadAsync(); }
: undefined; : undefined;
}, [sound]); }, [sound]);

@ -27,7 +27,6 @@ class Proxy {
data || params data || params
); );
} catch (error) { } catch (error) {
console.log("proxy get error! : ", error);
} }
}; };
@ -35,7 +34,6 @@ class Proxy {
try { try {
this.check(url, opt, () => Axios.post(url, params, opt), data || params); this.check(url, opt, () => Axios.post(url, params, opt), data || params);
} catch (error) { } catch (error) {
console.log("proxy post error! : ", error);
} }
}; };
@ -43,7 +41,6 @@ class Proxy {
try { try {
this.check(url, opt, () => Axios.put(url, params, opt), data || params); this.check(url, opt, () => Axios.put(url, params, opt), data || params);
} catch (error) { } catch (error) {
console.log("proxy put error! : ", error);
} }
}; };
@ -56,7 +53,6 @@ class Proxy {
data || params data || params
); );
} catch (error) { } catch (error) {
console.log("proxy delete error! : ", error);
} }
}; };
@ -72,7 +68,6 @@ class Proxy {
case 401: case 401:
if (this.refresh()) { if (this.refresh()) {
let response = fetch(); let response = fetch();
console.log('check 401', response )
dispatch({ type: url, data: response.data.data, params }); dispatch({ type: url, data: response.data.data, params });
return response.data.data; return response.data.data;
} }
@ -86,7 +81,6 @@ class Proxy {
} }
return false; return false;
} catch (error) { } catch (error) {
console.log("proxy check error! : ", error);
} }
}; };
@ -102,12 +96,10 @@ class Proxy {
); );
return login ? true : false; return login ? true : false;
} catch (error) { } catch (error) {
console.log("proxy refresh error! : ", error);
} }
}; };
login = (url, params, { dispatch }) => { login = (url, params, { dispatch }) => {
console.log('login called');
try { try {
this.post(url, params, { this.post(url, params, {
dispatch: (obj) => { dispatch: (obj) => {
@ -125,7 +117,6 @@ class Proxy {
}, },
}); });
} catch (error) { } catch (error) {
console.log("proxy login error! : ", error);
} }
}; };
@ -139,7 +130,6 @@ class Proxy {
}, },
}); });
} catch (error) { } catch (error) {
console.log("proxy logout error : ", error);
} }
}; };
status = async () => { status = async () => {
@ -154,7 +144,6 @@ class Proxy {
} }
return userData || null; return userData || null;
} catch (error) { } catch (error) {
console.log("proxy status error : ", error);
return nulll; return nulll;
} }
}; };

@ -17,14 +17,12 @@ export default function activation(state = initialState, action) {
asyncAwesomeAlert("نتیجه", data.message, { asyncAwesomeAlert("نتیجه", data.message, {
showCancelButton: false, showCancelButton: false,
}); });
console.log(data.message);
return { ...state, loading: false, error: null }; return { ...state, loading: false, error: null };
case "activation/delete": case "activation/delete":
return { ...state, loading: false, error: null }; return { ...state, loading: false, error: null };
case "loading": case "loading":
return { ...state, loading: true }; return { ...state, loading: true };
case "error": case "error":
console.log(data.message);
asyncAwesomeAlert("خطا", data.message, { asyncAwesomeAlert("خطا", data.message, {
showCancelButton: false, showCancelButton: false,
}); });

@ -1,5 +1,6 @@
import proxy from "../proxy"; import proxy from "../proxy";
import AsyncStorage from "@react-native-async-storage/async-storage"; import AsyncStorage from "@react-native-async-storage/async-storage";
import {asyncAwesomeAlert} from '../../utils/AsyncWrappers';
let initialState = { let initialState = {
status: null, status: null,
@ -41,7 +42,7 @@ const user = (state = initialState, action) => {
try { try {
AsyncStorage.setItem("userData", myData); AsyncStorage.setItem("userData", myData);
} catch (error) { } catch (error) {
console.log("user/getProfile", error); ("user/getProfile", error);
} }
return { return {
...state, ...state,
@ -61,6 +62,9 @@ const user = (state = initialState, action) => {
case "loading": case "loading":
return { ...state, loading: true }; return { ...state, loading: true };
case "error": case "error":
asyncAwesomeAlert("خظا", data.message, {
showCancelButton: false,
});
return { ...state, loading: false, error: data.message }; return { ...state, loading: false, error: data.message };
default: default:
return state; return state;

@ -62,7 +62,6 @@ try {
ReactNative.I18nManager.allowRTL(false); ReactNative.I18nManager.allowRTL(false);
// enableScreens(); // enableScreens();
} catch (e) { } catch (e) {
console.log(e);
} }

@ -37,7 +37,6 @@ const DeliveryForm = ({ list, form, getList, getFactorInfo, userId, payFactor, f
getList(); getList();
}, []); }, []);
console.log(userFactor);
return ( return (
<SafeAreaView <SafeAreaView
style={{ style={{

@ -57,7 +57,7 @@ function Login(props) {
behavior={ios ? "padding" : "height"} behavior={ios ? "padding" : "height"}
style={[ style={[
tw( tw(
`flex flex-col flex-1 justify-center items-center bg-white mx-auto px-4` `flex flex-col flex-1 justify-center items-center bg-white px-4`
), ),
]} ]}
> >
@ -118,6 +118,7 @@ function Login(props) {
maxLength={11} maxLength={11}
value={phone} value={phone}
onChange={onChangePhone} onChange={onChangePhone}
keyboardType="numeric"
autoFocus={true} autoFocus={true}
direction="ltr" direction="ltr"
regex={(text) => onInput.phonenumber(text)} regex={(text) => onInput.phonenumber(text)}

@ -123,6 +123,12 @@ function Otp(props) {
} }
}, [props.isLogin]); }, [props.isLogin]);
const goBack = () => {
timer = 60;
props.navigation.navigate("Login");
}
return ( return (
<View style={[tw("px-4 flex-1 justify-center items-center bg-white")]}> <View style={[tw("px-4 flex-1 justify-center items-center bg-white")]}>
<Image <Image
@ -171,6 +177,7 @@ function Otp(props) {
onChangeText={(text) => onChangeCode(text, "1")} onChangeText={(text) => onChangeCode(text, "1")}
regex={onInput.numberOnly} regex={onInput.numberOnly}
direction="ltr" direction="ltr"
keyboardType="numeric"
/> />
<TextInput <TextInput
style={[ style={[
@ -189,6 +196,7 @@ function Otp(props) {
onChangeText={(text) => onChangeCode(text, "2")} onChangeText={(text) => onChangeCode(text, "2")}
regex={onInput.numberOnly} regex={onInput.numberOnly}
direction="ltr" direction="ltr"
keyboardType="numeric"
/> />
<TextInput <TextInput
style={[ style={[
@ -207,6 +215,7 @@ function Otp(props) {
onChangeText={(text) => onChangeCode(text, "3")} onChangeText={(text) => onChangeCode(text, "3")}
regex={onInput.numberOnly} regex={onInput.numberOnly}
direction="ltr" direction="ltr"
keyboardType="numeric"
/> />
<TextInput <TextInput
style={[ style={[
@ -225,6 +234,7 @@ function Otp(props) {
onChangeText={(text) => onChangeCode(text, "4")} onChangeText={(text) => onChangeCode(text, "4")}
regex={onInput.numberOnly} regex={onInput.numberOnly}
direction="ltr" direction="ltr"
keyboardType="numeric"
/> />
</View> </View>
<TouchableOpacity <TouchableOpacity
@ -274,7 +284,7 @@ function Otp(props) {
style={{ style={{
marginTop: 20, marginTop: 20,
}} }}
onPress={() => props.navigation.navigate("Login")} onPress={() => goBack()}
> >
<Text <Text
style={{ style={{

@ -8,11 +8,14 @@ import {
Dimensions, Dimensions,
Appearance, Appearance,
Pressable, Pressable,
Platform,
} from "react-native"; } from "react-native";
import { useNavigation } from "@react-navigation/native"; import { useNavigation } from "@react-navigation/native";
import { product, userProduct } from "../../../redux/actions"; import { product, userProduct } from "../../../redux/actions";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Entypo } from "@expo/vector-icons"; import { Entypo } from "@expo/vector-icons";
import separate from "../../../utils/separate";
//components //components
import CustomPressable from "../../../components/Pressable"; import CustomPressable from "../../../components/Pressable";
import Description from "./Description"; import Description from "./Description";
@ -29,7 +32,8 @@ import tw from "tailwind-rn";
import fontSize from "../../../constants/fontSize"; import fontSize from "../../../constants/fontSize";
import Colors from "../../../constants/Colors"; import Colors from "../../../constants/Colors";
const { height } = Dimensions.get("window"); const { height, width } = Dimensions.get("window");
const ios = Platform.OS === "ios";
function Book({ book, grades, pushToCart, userId, loading, mobile }) { function Book({ book, grades, pushToCart, userId, loading, mobile }) {
const colorScheme = Appearance.getColorScheme(); const colorScheme = Appearance.getColorScheme();
@ -44,6 +48,7 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) {
setPageLoading(false); setPageLoading(false);
}, 500); }, 500);
}, [type]); }, [type]);
return ( return (
<ScrollView style={[tw("flex flex-col flex-1 relative")]}> <ScrollView style={[tw("flex flex-col flex-1 relative")]}>
{!mobile && <View style={tw("mt-5")}></View>} {!mobile && <View style={tw("mt-5")}></View>}
@ -64,18 +69,11 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) {
)} )}
{imageSlider && <ImageSlider />} {imageSlider && <ImageSlider />}
<View style={tw("flex flex-row-reverse")}> <View style={tw("flex flex-row-reverse")}>
<Pressable
style={[
tw("rounded-md"),
{ height: mobile ? 160 : 300, width: mobile ? 110 : 210 },
]}
// onPress={() => setImageSlider(true)}
>
<Image <Image
source={{ uri: `https://dnvn.ir/api/v1/file/${book.fileIds}` }} source={{ uri: `https://dnvn.ir/api/v1/file/${book?.fileIds}` }}
style={[tw("rounded-md h-full w-full")]} style={[tw("rounded-md"), { height : height / 4, width : height / 4 * 3 / 4}]}
/> />
</Pressable>
<View <View
style={[ style={[
@ -89,21 +87,22 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) {
<Text <Text
style={{ style={{
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontSize: mobile ? fontSize.xl : fontSize.xl3, fontSize: mobile ? fontSize.lg : fontSize.xl3,
marginBottom: 5, marginBottom: 5,
fontFamily: "demi", fontFamily: "demi",
textAlign: ios ? "right" : "auto",
}} }}
> >
{book.product[type].name} {book?.name}
</Text> </Text>
<Text <Text
style={{ style={{
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontSize: mobile ? fontSize.lg : fontSize.xl, fontSize: mobile ? fontSize.base : fontSize.xl,
fontFamily: "regular", fontFamily: "regular",
}} }}
> >
{"پایه" + " " + grades[book.gradeId]} {"پایه" + " " + grades[book?.gradeId]}
</Text> </Text>
</View> </View>
<Text <Text
@ -112,7 +111,7 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) {
{ color: "#323232", fontSize: fontSize.sm, fontFamily: "light" }, { color: "#323232", fontSize: fontSize.sm, fontFamily: "light" },
]} ]}
> >
{book.text} {book?.text}
</Text> </Text>
</View> </View>
</View> </View>
@ -129,7 +128,7 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) {
}} }}
> >
{" "} {" "}
{book.pagesNum + "\n" + "صفحه"} {book?.pagesNum + "\n" + "صفحه"}
</Text> </Text>
</View> </View>
<View <View
@ -189,88 +188,199 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) {
<View style={tw("flex justify-between")}></View> <View style={tw("flex justify-between")}></View>
</View> </View>
<View style={tw("flex flex-row-reverse justify-between flex-wrap py-3")}> <View style={tw("flex flex-row-reverse justify-between flex-wrap py-3")}>
<CustomPressable <Pressable
title={"نسخه فیزیکی"} style={[
onPress={() => setType(1)} tw("flex flex-row-reverse w-full justify-between px-2 py-3 mb-4"),
backgroundColor={ {
type === 0 ? "transparent" : Colors.theme1[colorScheme].greenCF borderWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF,
backgroundColor: Colors.theme1[colorScheme].greenFF + "0a",
},
]}
onPress={() =>
pushToCart({
productId: book?.product[1]?.id,
userId: userId,
count: 1,
})
} }
color={type === 0 ? Colors.theme1[colorScheme].greenCF : "white"} >
border={{ color: Colors.theme1[colorScheme].greenCF, width: 1 }} <Text
width={"49%"} style={{
/> fontFamily: "bold",
<CustomPressable fontSize: fontSize.sm,
onPress={() => setType(0)} color: Colors.theme1[colorScheme].green79,
title={"نسخه دیجیتال"} paddingVertical: 4,
backgroundColor={ }}
type === 1 ? "transparent" : Colors.theme1[colorScheme].greenCF >
خرید نسخه فیزیکی کتاب
</Text>
<View style={tw("flex flex-row-reverse")}>
<View style={tw("w-px h-full bg-green-500")}></View>
<Text
style={[
tw("py-1 pr-2"),
{
borderLeftWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF,
fontFamily: "bold",
color: Colors.theme1[colorScheme].green79,
fontSize: fontSize.sm,
},
]}
>
{separate(book?.product[1]?.price) + " " + "تومان"}
</Text>
</View>
</Pressable>
<Pressable
style={[
tw("flex flex-row-reverse justify-between px-2 py-3 mb-4"),
{
borderWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF,
backgroundColor: Colors.theme1[colorScheme].greenFF + "0a",
width: width - 32 - 8 - (fontSize.sm * 6 + 18),
},
]}
onPress={() =>
pushToCart({
productId: book?.product[0]?.id,
userId: userId,
count: 1,
})
} }
color={type === 1 ? Colors.theme1[colorScheme].greenCF : "white"} >
border={{ color: Colors.theme1[colorScheme].greenCF, width: 1 }} <Text
width={"49%"} style={{
/> fontFamily: "bold",
<CustomPressable fontSize: fontSize.sm,
title={`خرید با قیمت ${book.product[type].price} تومان`} color: Colors.theme1[colorScheme].green79,
backgroundColor={Colors.theme1[colorScheme].greenCF} paddingVertical: 4,
color={"white"} }}
border={{ color: "#196EC0", width: 0 }} >
width={"65%"} خرید نسخه دیجیتال کتاب
loading={loading} </Text>
<View style={tw("flex flex-row-reverse")}>
<View style={tw("w-px h-full bg-green-500")}></View>
<Text
style={[
tw("py-1 pr-2"),
{
borderLeftWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF,
fontFamily: "bold",
color: Colors.theme1[colorScheme].green79,
fontSize: fontSize.sm,
},
]}
>
{separate(book?.product[0]?.price) + " " + "تومان"}
</Text>
</View>
</Pressable>
<Pressable
style={[
tw("flex flex-row-reverse justify-center px-2 py-3 mb-4"),
{
borderWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF,
backgroundColor: Colors.theme1[colorScheme].greenFF + "0a",
width: fontSize.sm * 6 + 18,
},
]}
onPress={() => navigation.push("Sample", { id: book?.sampleFileId })}
>
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.sm,
color: Colors.theme1[colorScheme].green79,
paddingVertical: 4,
}}
>
مشاهده نمونه
</Text>
</Pressable>
<Pressable
style={[
tw("flex flex-row-reverse justify-between px-2 py-3 mb-4"),
{
borderWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF,
backgroundColor: Colors.theme1[colorScheme].greenFF + "0a",
width: width - 32 - 8 - (fontSize.sm * 6 + 18),
},
]}
onPress={() => onPress={() =>
pushToCart({ pushToCart({
productId: book?.product[type]?.id, productId: book?.product[2]?.id,
userId: userId, userId: userId,
count: 1, count: 1,
}) })
} }
/> >
<CustomPressable <Text
title={"مشاهده نمونه"} style={{
backgroundColor="transparent" fontFamily: "bold",
color={Colors.theme1[colorScheme].redFF1} fontSize: fontSize.sm,
border={{ color: Colors.theme1[colorScheme].redFF1, width: 1 }} color: Colors.theme1[colorScheme].green79,
width={"33%"} paddingVertical: 4,
onPress={() => navigation.push('Sample')} }}
/> >
<TouchableOpacity خرید دوره ویدئویی کتاب
</Text>
<View style={tw("flex flex-row-reverse")}>
<View style={tw("w-px h-full bg-green-500")}></View>
<Text
style={[
tw("py-1 pr-2"),
{
borderLeftWidth: 1,
borderColor: Colors.theme1[colorScheme].greenCF,
fontFamily: "bold",
color: Colors.theme1[colorScheme].green79,
fontSize: fontSize.sm,
},
]}
>
{separate(book?.product[2]?.price) + " " + "تومان"}
</Text>
</View>
</Pressable>
<Pressable
style={[ style={[
tw( tw("flex flex-row-reverse justify-center px-2 py-3 mb-4"),
"w-full rounded-md flex flex-row justify-center items-center py-3 mt-4"
),
{ {
backgroundColor: Colors.theme1[colorScheme].greenCF + "1a",
borderWidth: 1, borderWidth: 1,
borderColor: Colors.theme1[colorScheme].green79 + "33", borderColor: Colors.theme1[colorScheme].greenCF,
backgroundColor: Colors.theme1[colorScheme].greenFF + "0a",
width: fontSize.sm * 6 + 18,
}, },
]} ]}
onPress={() => navigation.navigate("Video", { id: book.id })} onPress={() => navigation.navigate("Video", { id: book?.id })}
> >
<Entypo
name="chevron-small-left"
size={20}
color={Colors.theme1[colorScheme].green79}
/>
<Text <Text
style={[ style={{
tw(""), fontFamily: "bold",
{ fontSize: fontSize.sm,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontSize: mobile ? fontSize.base : fontSize.lg, paddingVertical: 4,
fontFamily: "bold", }}
},
]}
> >
مشاهده دوره ویدئویی این محصول پیش نمایش
</Text> </Text>
</TouchableOpacity> </Pressable>
</View> </View>
{book.product[type].description && ( {book?.product[type]?.description && (
<Description description={book.description} /> <Description description={book?.description} />
)} )}
<LinkBox <LinkBox
title="مشخصات محصول" title="مشخصات محصول"
key={"0"} key={"0"}
component={<ProductSpecifications list={book.product[type].properties} />} component={
<ProductSpecifications list={book?.product[type]?.properties} />
}
height={height - height / 4} height={height - height / 4}
/> />
<LinkBox <LinkBox
@ -306,7 +416,7 @@ function Book({ book, grades, pushToCart, userId, loading, mobile }) {
)} )}
{/* <Rates rates={book.rates} /> */} {/* <Rates rates={book.rates} /> */}
<Comments comments={book.comments} /> <Comments comments={book?.comments} />
</ScrollView> </ScrollView>
); );
} }

@ -21,7 +21,7 @@ function Description({ title, component, height, mobile }) {
`flex flex-row-reverse justify-between items-center mt-3 rounded-md px-5 ${mobile ? "py-3" : "py-4"}` `flex flex-row-reverse justify-between items-center mt-3 rounded-md px-5 ${mobile ? "py-3" : "py-4"}`
), ),
{ {
backgroundColor: Colors.theme1[colorScheme].greenCF, backgroundColor: Colors.theme1[colorScheme].greenCF + '15',
// borderWidth : 1, // borderWidth : 1,
}, },
]} ]}
@ -29,8 +29,8 @@ function Description({ title, component, height, mobile }) {
<Text <Text
style={[ style={[
{ {
fontSize: mobile ? fontSize.tiny : fontSize.lg, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: "white", color: Colors.theme1[colorScheme].green79,
fontFamily: "demi", fontFamily: "demi",
}, },
tw(""), tw(""),
@ -38,7 +38,7 @@ function Description({ title, component, height, mobile }) {
> >
{title} {title}
</Text> </Text>
<Entypo name="chevron-small-left" size={20} color="white" /> <Entypo name="chevron-small-left" size={20} color={Colors.theme1[colorScheme].green79} />
</TouchableOpacity> </TouchableOpacity>
<RBSheet <RBSheet
ref={refRBSheet} ref={refRBSheet}

@ -2,7 +2,9 @@ import { WebView } from "react-native-webview";
import {SafeAreaView, Platform, StatusBar} from "react-native"; import {SafeAreaView, Platform, StatusBar} from "react-native";
import React from "react"; import React from "react";
const Sample = () => { import Navbar from "../../../components/Navbar";
const Sample = ({route}) => {
return ( return (
<SafeAreaView <SafeAreaView
style={{ style={{
@ -11,9 +13,21 @@ const Sample = () => {
flex : 1 flex : 1
}} }}
> >
<Navbar
// setBoxPosition={setBoxPosition}
headerOptions={{
logo: false,
menu: false,
hamburgerMenu: false,
title: "",
bookmark: false,
qr: false,
back: true,
}}
/>
<WebView <WebView
source={{ source={{
uri: "https://github.com/facebook/react-native", uri: `https://dnvn.ir/xpdf/${route.params.id}`,
}} }}
style={{ flex: 1 }} style={{ flex: 1 }}
></WebView> ></WebView>

@ -1,205 +0,0 @@
import {t} from 'i18next';
import React from 'react';
import {
View,
Text,
Image,
Dimensions,
ScrollView,
Pressable,
} from 'react-native';
import {Entypo} from '@expo/vector-icons';
import CustomPressable from '../../../components/Pressable';
import Description from './Description';
import LinkBox from './LinkBox';
import Comments from './Comments';
import Rates from './Rates';
import tw from 'tailwind-rn';
const width = Dimensions.get('window').width;
const height = Dimensions.get('window').height;
export default function Video({product}) {
return (
<ScrollView style={[tw('flex flex-col flex-1')]}>
<View style={tw('flex flex-col')}>
<View
style={[
tw(
'w-full flex flex-row flex-1 justify-between items-center relative overflow-hidden',
),
{height: height / 3.8},
]}>
{/* <View
style={[
tw('rounded-full bg-black bg-opacity-20 z-50'),
{width: 50, height: 50},
]}></View> */}
<Image
source={product.poster}
style={tw('w-full rounded-md h-full absolute left-0 top-0')}
/>
<Image
source={{uri: product.imageUrl}}
style={[
tw('rounded-md h-full rounded-md ml-2'),
{width: 70, height: 100},
]}
/>
</View>
<View
style={[
tw('flex flex-col flex-1 justify-between'),
{
paddingRight: 10,
},
]}>
<View style={tw('flex flex-col')}>
<Text
style={{
marginTop : 5,
color: '#05335F',
fontSize: width / 18,
marginBottom: 5,
fontFamily : 'bold'
}}>
{product.name}
</Text>
<Text style={{color: '#196EC0', fontSize: width / 37, marginBottom: 10, fontFamily : 'light'}}>
{product.grade}
</Text>
</View>
<Text
style={[
tw('text-right w-full'),
{color: '#323232', fontSize: width / 38, fontFamily : 'light'},
]}>
{product.text}
</Text>
</View>
</View>
<View
style={tw(
'flex flex-row-reverse items-center justify-around py-6',
)}>
<View>
<Text
style={{
color: '#196EC0',
textAlign: 'center',
fontSize: width / 37,
fontFamily: 'light'
}}>
{' '}
{473 + '\n' + 'صفحه'}
</Text>
</View>
<View
style={{backgroundColor: '#196EC055', height: 20, width: 2}}></View>
<View>
<Text
style={{
color: '#196EC0',
textAlign: 'center',
fontSize: width / 37,
fontFamily: 'light'
}}>
{' '}
{'فیزیکی- دیجیتالی - ویدئو' + '\n' + 'در دسترس'}
</Text>
</View>
<View
style={{backgroundColor: '#196EC055', height: 20, width: 2}}></View>
<View>
<Text
style={{
color: '#196EC0',
textAlign: 'center',
fontSize: width / 37,
fontFamily: 'light'
}}>
{' '}
{4.8 + '\n' + 'امتیاز'}
</Text>
</View>
</View>
<View style={'flex flex-col mt-3'}>
<Text
style={[
tw('w-full text-right font-medium'),
{color: '#196EC0', fontSize: width / 36, fontFamily: 'regular'},
]}>
نسخه محصول را انتخاب کنید
</Text>
<View style={tw('flex justify-between')}></View>
</View>
<View
style={tw(
'flex flex-row justify-between flex-wrap py-3',
)}>
<CustomPressable
title={'نسخه فیزیکی'}
backgroundColor="transparent"
color={'#196EC0'}
border={{color: '#196EC0', width: 1}}
width={'49%'}
/>
<CustomPressable
title={'نسخه دیجیتال'}
backgroundColor="transparent"
color={'#196EC0'}
border={{color: '#196EC0', width: 1}}
width={'49%'}
/>
<CustomPressable
title={'خرید با قیمت 245.000 تومان'}
backgroundColor="#196EC0"
color={'white'}
border={{color: '#196EC0', width: 0}}
width={'65%'}
/>
<CustomPressable
title={'مشاهده نمونه'}
backgroundColor="transparent"
color={'#196EC0'}
border={{color: '#196EC0', width: 1}}
width={'33%'}
/>
<Pressable
style={[
tw(
'w-full rounded-md flex flex-row justify-center items-center py-3.5',
),
{backgroundColor: '#196EC01a'},
]}>
<Entypo name="chevron-small-left" size={20} color="#196EC0" />
<Text
style={[tw(''), {color: '#275077', fontSize: width / 36, fontFamily : 'light'}]}>
مشاهده دوره ویدئویی این محصول
</Text>
</Pressable>
</View>
<Description description={product.description} />
<LinkBox title="مشخصات محصول" path="" />
<LinkBox title="نقد بررسی و توضیحات تکمیلی محصول" path="" />
<LinkBox title="پرسش و پاسخ" path="" />
<View
style={tw(
'flex flex-row-reverse justify-between items-center my-6',
)}>
<Text
style={[
{fontSize: width / 36, color: '#275077', fontFamily: 'regular'},
]}>
امتیازات و نظرات
</Text>
<Entypo name="chevron-small-left" size={20} color="#196EC0" />
</View>
<Rates rates={product.rates} />
<Comments comments={product.comments} />
</ScrollView>
);
}

@ -8,21 +8,15 @@ import {
StatusBar, StatusBar,
} from "react-native"; } from "react-native";
import Book from "./components/Book"; import Book from "./components/Book";
import Video from "./components/Video"; import { book } from "../../redux/actions";
import {book} from "../../redux/actions";
import { connect } from "react-redux"; import { connect } from "react-redux";
import Navbar from "../../components/Navbar"; import Navbar from "../../components/Navbar";
function Product({ function Product({ route, book, getBook, grades }) {
route,
book,
getBook,
grades,
}) {
useEffect(() => { useEffect(() => {
getBook({id : route.params.id}); getBook({ id: route.params.id, vod : true });
},[]); }, []);
return ( return (
<SafeAreaView <SafeAreaView
style={{ style={{
@ -46,11 +40,7 @@ function Product({
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
style={styles.container} style={styles.container}
> >
{book && (route.params.type === 'video' ? ( <Book book={book} grades={grades} />
<Video />
) : (
<Book book={book} grades={grades} />
))}
</ScrollView> </ScrollView>
</SafeAreaView> </SafeAreaView>
); );
@ -69,12 +59,12 @@ const styles = StyleSheet.create({
}); });
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
book : state.book.info, book: state.book.info,
grades : state.publicApi.grades grades: state.publicApi.grades,
}); });
const mapDispatchToProps = { const mapDispatchToProps = {
getBook : book.info getBook: book.info,
} };
export default connect(mapStateToProps, mapDispatchToProps)(Product); export default connect(mapStateToProps, mapDispatchToProps)(Product);

@ -249,7 +249,7 @@ const ProfileAddress = ({
borderWidth: 1.5, borderWidth: 1.5,
}, },
tw( tw(
`flex flex-row-reverse self-end justify-center py-3 rounded-md items-center mt-4 mx-auto w-full` `flex flex-row-reverse self-end justify-center py-3 rounded-md items-center mt-4 w-full`
), ),
]} ]}
onPress={() => navigation.push("CreateAddress")} onPress={() => navigation.push("CreateAddress")}

@ -14,7 +14,7 @@ const { width} = Dimensions.get("window");
export default function Tab({ data }) { export default function Tab({ data }) {
const [dataType, setDataType] = useState("all"); const [dataType, setDataType] = useState("all");
console.log(data);
return ( return (
<View <View
style={[ style={[

@ -21,7 +21,7 @@ function QRContent({ route, getQrData, data, grades }) {
useEffect(() => { useEffect(() => {
if (data) { if (data) {
// console.log(data.qr.content); // (data.qr.content);
} }
}, [data]); }, [data]);
return ( return (

Loading…
Cancel
Save