Commit 01bec1da by Giang Tran

update api depositwallet

parent 3a9cee9a
......@@ -8,6 +8,8 @@ import RootView from './src/RootView';
import createSagaMiddleware from 'redux-saga';
import rootSaga from './src/Saga/rootSaga';
let bootSplashLogo = require('./src/assets/images/iconSplash.png');
let fakeApiCallWithoutBadNetwork = (ms) =>
new Promise((resolve) => setTimeout(resolve, ms));
......
......@@ -5,6 +5,7 @@ import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.zoontek.rnbootsplash.RNBootSplashPackage;
import com.zoontek.rnbootsplash.RNBootSplashPackage;
import com.BV.LinearGradient.LinearGradientPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.oblador.vectoricons.VectorIconsPackage;
......
......@@ -3,6 +3,8 @@ include ':react-native-bootsplash'
project(':react-native-bootsplash').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-bootsplash/android')
include ':react-native-bootsplash'
project(':react-native-bootsplash').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-bootsplash/android')
include ':react-native-bootsplash'
project(':react-native-bootsplash').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-bootsplash/android')
include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
include ':react-native-vector-icons'
......
......@@ -8,7 +8,6 @@
/* Begin PBXBuildFile section */
00E356F31AD99517003FC87E /* InvestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* InvestTests.m */; };
13869AC326244FB000412A7A /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 13869AC226244FB000412A7A /* GoogleService-Info.plist */; };
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
......@@ -19,8 +18,8 @@
2DCD954D1E0B4F2C00145EB5 /* InvestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* InvestTests.m */; };
2FCC6749524E697FC9323F22 /* libPods-Invest-InvestTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ABCEBFE5646F1EF68E7C87AB /* libPods-Invest-InvestTests.a */; };
48E6A9A75AE9C55476F21D2D /* libPods-Invest-tvOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4ECD31835B4784D2DC719E76 /* libPods-Invest-tvOSTests.a */; };
52B7A0A425F722CF00CEDA09 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 52B7A0A325F722CF00CEDA09 /* GoogleService-Info.plist */; };
52B7A0A525F722CF00CEDA09 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 52B7A0A325F722CF00CEDA09 /* GoogleService-Info.plist */; };
52B7A0A425F722CF00CEDA09 /* (null) in Resources */ = {isa = PBXBuildFile; };
52F3AE2D26257DEC00F77114 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 52F3AE2C26257DEB00F77114 /* GoogleService-Info.plist */; };
52FB2B09262400D400DD7983 /* BootSplash.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 52FB2B08262400D400DD7983 /* BootSplash.storyboard */; };
52FB2B0A262400D400DD7983 /* BootSplash.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 52FB2B08262400D400DD7983 /* BootSplash.storyboard */; };
BEE4F63E354049C2D225330D /* libPods-Invest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F96EA7789D1E36A43479651 /* libPods-Invest.a */; };
......@@ -50,7 +49,6 @@
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* InvestTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InvestTests.m; sourceTree = "<group>"; };
12715EC58B6699B513B54F09 /* Pods-Invest.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Invest.debug.xcconfig"; path = "Target Support Files/Pods-Invest/Pods-Invest.debug.xcconfig"; sourceTree = "<group>"; };
13869AC226244FB000412A7A /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* Invest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Invest.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Invest/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Invest/AppDelegate.m; sourceTree = "<group>"; };
......@@ -63,6 +61,7 @@
2D02E4901E0B4A5D006451C7 /* Invest-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Invest-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
4ECD31835B4784D2DC719E76 /* libPods-Invest-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Invest-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
52E1A15225F1255E00EA970D /* Invest.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = Invest.entitlements; path = Invest/Invest.entitlements; sourceTree = "<group>"; };
52F3AE2C26257DEB00F77114 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
52FB2B08262400D400DD7983 /* BootSplash.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = BootSplash.storyboard; path = Invest/BootSplash.storyboard; sourceTree = "<group>"; };
5F96EA7789D1E36A43479651 /* libPods-Invest.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Invest.a"; sourceTree = BUILT_PRODUCTS_DIR; };
72B39130AB01DE9359CED049 /* Pods-Invest-InvestTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Invest-InvestTests.release.xcconfig"; path = "Target Support Files/Pods-Invest-InvestTests/Pods-Invest-InvestTests.release.xcconfig"; sourceTree = "<group>"; };
......@@ -208,7 +207,7 @@
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
13869AC226244FB000412A7A /* GoogleService-Info.plist */,
52F3AE2C26257DEB00F77114 /* GoogleService-Info.plist */,
13B07FAE1A68108700A75B9A /* Invest */,
832341AE1AAA6A7D00B99B32 /* Libraries */,
00E356EF1AD99517003FC87E /* InvestTests */,
......@@ -406,7 +405,8 @@
files = (
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
52B7A0A425F722CF00CEDA09 /* GoogleService-Info.plist in Resources */,
52F3AE2D26257DEC00F77114 /* GoogleService-Info.plist in Resources */,
52B7A0A425F722CF00CEDA09 /* (null) in Resources */,
52FB2B09262400D400DD7983 /* BootSplash.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
......
......@@ -17,7 +17,7 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView autoresizesSubviews="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" image="BootSplashLogo" translatesAutoresizingMaskIntoConstraints="NO" id="3lX-Ut-9ad">
<rect key="frame" x="77.5" y="296.5" width="220" height="74"/>
<rect key="frame" x="127.5" y="313" width="120" height="41"/>
<accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" image="YES" notEnabled="YES"/>
</accessibility>
......@@ -40,6 +40,6 @@
</scene>
</scenes>
<resources>
<image name="BootSplashLogo" width="220" height="74"/>
<image name="BootSplashLogo" width="120" height="41"/>
</resources>
</document>
......@@ -7,12 +7,10 @@ import Modal from 'react-native-modal';
import {SkypeIndicator} from 'react-native-indicators';
import {HEIGHT, HEIGHTXD} from './Config/Functions';
import R from './assets/R';
import FirebaseNotification from './helper/FirebaseNotification';
import messaging from '@react-native-firebase/messaging';
import {enableScreens} from 'react-native-screens';
import AsyncStorage from '@react-native-community/async-storage';
import KEY from './assets/AsynStorage';
import firebase from '@react-native-firebase/app';
enableScreens();
const RootView = (props) => {
......@@ -50,13 +48,8 @@ const RootView = (props) => {
}
};
onReceived = (notification) => {};
onOpened = (notification) => {
console.log(('notification', notification));
};
return (
<View style={{flex: 1}}>
{/*<FirebaseNotification onReceived={onReceived} onOpened={onOpened} />*/}
<Modal isVisible={props.loadingModal.isVisible}>
<SkypeIndicator color={'white'} />
</Modal>
......
import React from 'react';
import {View, Text, StyleSheet, Dimensions} from 'react-native';
import React, {useState} from 'react';
import {
View,
Text,
StyleSheet,
Dimensions,
TouchableOpacity,
Alert,
} from 'react-native';
import R from '../../../assets/R';
import HeaderBack from '../../../components/Header/HeaderBack';
import TextField from '../../../components/Input/TextField';
import TextMulti from '../../../components/Input/TextMulti';
import TextDisable from '../../../components/Input/TextDisable';
import {getFontXD, toPriceVnd} from '../../../Config/Functions';
import {useNavigation} from '@react-navigation/native';
import {
getFontXD,
toPriceVnd,
checkFormatArray,
} from '../../../Config/Functions';
import {connect} from 'react-redux';
import {showLoading, hideLoading} from '../../../actions/loadingAction';
import {walletDeposit} from '../../../apis/Functions/Deposit';
const {width} = Dimensions.get('window');
const WalletDeposit = (props) => {
const [amount, setAmount] = useState();
const [notes, setNotes] = useState();
const navigate = useNavigation();
const onClick = async () => {
const titles = ['số tiền', 'ghi chú'];
const index = checkFormatArray([amount, notes]);
if (index === true) {
props.showLoading();
const res = await walletDeposit({
amount,
platform: Platform.OS,
notes,
fee: 0,
});
props.hideLoading();
if (res.data.code == 200) {
setTimeout(() => {
Alert.alert('Thông báo!', res.data.message);
navigate.goBack();
}, 500);
} else {
setTimeout(() => {
Alert.alert('Thông báo!', res.data.message);
}, 500);
}
} else {
Alert.alert('Vui lòng điền ' + titles[index]);
}
};
return (
<View style={{flex: 1}}>
<HeaderBack title={'Nạp tiền đầu tư'} />
......@@ -37,17 +84,18 @@ const WalletDeposit = (props) => {
</View>
</View>
<View style={styles.wrapBody}>
<TextDisable value={'10010101'} title={'Số tài khoản CQG'} />
<TextField title={'Số tiền'} isNumber={true} />
<TextMulti
onChangeText={(val) => consoele.log(val)}
title={'Ghi chú'}
{/* <TextDisable value={'10010101'} title={'Số tài khoản CQG'} /> */}
<TextField
onChangeText={(val) => setAmount(val)}
title={'Số tiền'}
isNumber={true}
/>
<TextMulti onChangeText={(val) => setNotes(val)} title={'Ghi chú'} />
</View>
</View>
<View style={styles.btnSend}>
<TouchableOpacity onPress={onClick} style={styles.btnSend}>
<Text style={styles.txtSend}>Np tin</Text>
</View>
</TouchableOpacity>
</View>
);
};
......@@ -111,4 +159,6 @@ const mapStateToProps = (state) => {
user: state.userReducer,
};
};
export default connect(mapStateToProps, {})(WalletDeposit);
export default connect(mapStateToProps, {showLoading, hideLoading})(
WalletDeposit,
);
......@@ -2,28 +2,26 @@ import React from 'react';
import {View, Text} from 'react-native';
import {getFontXD} from '../../../Config/Functions';
import HeaderBack from '../../../components/Header/HeaderBack';
import {WebView} from 'react-native-webview';
import {connect} from 'react-redux';
const MyGroup = (props) => {
return (
<View style={{flex: 1}}>
<HeaderBack title={'Tiền thưởng đội nhóm'} />
<View
style={{
flex: 1,
paddingHorizontal: 20,
justifyContent: 'center',
alignItems: 'center',
}}>
<Text
style={{
fontSize: getFontXD(52),
fontWeight: 'bold',
textAlign: 'center',
}}>
Tính năng đang được phát trin, vui lòng quay li sau!
</Text>
</View>
<HeaderBack isWhite={true} title={'Đối tác của tôi'} />
<WebView
androidHardwareAccelerationDisabled={true}
source={{
uri:
'http://api.dcvinvest.com/webview/partners/show/' + props.user.uid,
}}
/>
</View>
);
};
export default MyGroup;
const mapStateToProps = (state) => {
return {
user: state.userReducer,
};
};
export default connect(mapStateToProps, {})(MyGroup);
......@@ -6,3 +6,8 @@ export const getListMethod = async (body) =>
GetData(url.urlGetListMethod, body)
.then((res) => res)
.catch((err) => err);
export const walletDeposit = async (body) =>
PostData(url.urlWalletDeposit, body)
.then((res) => res)
.catch((err) => err);
......@@ -29,4 +29,5 @@ export default {
urlGetListHistory: root + 'api/v1/customers/get-list-transaction-history',
urlGetListNotification: root + 'api/v1/customers/get-list-notification',
urlWalletDeposit: root + 'api/v1/customers/request-deposit',
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment