Commit 4314d546 by Giang Tran

edit menu

parent 8c551211
...@@ -897,7 +897,7 @@ ...@@ -897,7 +897,7 @@
CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements; CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 13; CURRENT_PROJECT_VERSION = 14;
DEVELOPMENT_TEAM = MXZ24GRH48; DEVELOPMENT_TEAM = MXZ24GRH48;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
...@@ -930,7 +930,7 @@ ...@@ -930,7 +930,7 @@
CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements; CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 13; CURRENT_PROJECT_VERSION = 14;
DEVELOPMENT_TEAM = MXZ24GRH48; DEVELOPMENT_TEAM = MXZ24GRH48;
INFOPLIST_FILE = Invest/Info.plist; INFOPLIST_FILE = Invest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
......
...@@ -31,12 +31,12 @@ const AccountVerificationView = (props) => { ...@@ -31,12 +31,12 @@ const AccountVerificationView = (props) => {
}}> }}>
<Tab.Screen <Tab.Screen
name="GeneralInfor" name="GeneralInfor"
component={props.user.status == 3 ? GeneralInfor : GeneralView} component={props.user.status == 2 ? GeneralInfor : GeneralView}
options={{tabBarLabel: 'Thông tin chung'}} options={{tabBarLabel: 'Thông tin chung'}}
/> />
<Tab.Screen <Tab.Screen
name="Profile" name="Profile"
component={props.user.status == 3 ? Profile : ProfileView} component={props.user.status == 2 ? Profile : ProfileView}
options={{tabBarLabel: 'Hồ sơ'}} options={{tabBarLabel: 'Hồ sơ'}}
/> />
</Tab.Navigator> </Tab.Navigator>
......
import React, {useState} from 'react'; import React, {useState, useEffect} from 'react';
import {View, Text, StyleSheet, Dimensions} from 'react-native'; import {
View,
Text,
StyleSheet,
Dimensions,
TouchableOpacity,
Platform,
Alert,
} from 'react-native';
import R from '../../../assets/R'; import R from '../../../assets/R';
import HeaderBack from '../../../components/Header/HeaderBack'; import HeaderBack from '../../../components/Header/HeaderBack';
import TextField from '../../../components/Input/TextField'; import TextField from '../../../components/Input/TextField';
import TextMulti from '../../../components/Input/TextMulti'; import TextMulti from '../../../components/Input/TextMulti';
import TextDisable from '../../../components/Input/TextDisable'; import TextDisable from '../../../components/Input/TextDisable';
import {getFontXD, HEIGHTXD, toPriceVnd} from '../../../Config/Functions'; import {connect} from 'react-redux';
import {
getFontXD,
HEIGHTXD,
toPriceVnd,
checkFormatArray,
} from '../../../Config/Functions';
import PickerItem from '../../../components/Picker/PickerItem'; import PickerItem from '../../../components/Picker/PickerItem';
import RadioForm, { import RadioForm from 'react-native-simple-radio-button';
RadioButton, import {widthDraw, getListWidthDraw} from '../../../apis/Functions/Widthdraw';
RadioButtonInput, import {useNavigation} from '@react-navigation/native';
RadioButtonLabel, import {showLoading, hideLoading} from '../../../actions/loadingAction';
} from 'react-native-simple-radio-button';
var radio_props = [ var radio_props = [
{label: 'Từ ví', value: 'wallet'}, {label: 'Từ ví', value: 'WALLET'},
{label: 'Từ tài khoản CQG', value: 'cqg'}, {label: 'Từ tài khoản CQG', value: 'INVESTMENT'},
]; ];
const {width} = Dimensions.get('window'); const {width} = Dimensions.get('window');
const dataType = [ const WalletWithdraw = (props) => {
{ const [data, setData] = useState([]);
value: '1', const [src, setSrc] = useState('WALLET');
name: 'Chứng minh nhân dân',
},
{
value: '2',
name: 'Hộ chiếu',
},
{
value: '3',
name: 'Căn cước công dân',
},
];
const WalletDeposit = (props) => {
const [account, setAccount] = useState();
const [type, setType] = useState(); const [type, setType] = useState();
const [amount, setAmount] = useState();
const [notes, setNotes] = useState('');
const navigate = useNavigation();
useEffect(() => {
getData();
}, []);
const getData = async () => {
const res = await getListWidthDraw({
platform: Platform.OS,
});
if (res.data.code == 200 && res.data.data) {
console.log(res.data.data);
const newList = res.data.data.map((e) => {
return {...e, value: e.id, name: e.method};
});
setData(newList);
} else {
alert('Không lấy được danh sách phương thức!');
}
};
const onPressWithdraw = async () => {
const titles = ['tài khoản hưởng thụ', 'số tiền'];
const index = checkFormatArray([type, amount]);
if (index === true) {
props.showLoading();
const res = await widthDraw({
src,
receiving_account: type.id,
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 ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'Rút tiền'} /> <HeaderBack title={'Rút tiền'} />
<View style={styles.container}> <View style={styles.container}>
<View style={styles.wrapTop}> {/* <View style={styles.wrapTop}>
<View style={styles.itemTop}> <View style={styles.itemTop}>
<Text style={styles.txtTitle}>Ví</Text> <Text style={styles.txtTitle}>Ví</Text>
<Text style={styles.txtMoney}>{toPriceVnd(1000000)}</Text> <Text style={styles.txtMoney}>{toPriceVnd(1000000)}</Text>
...@@ -52,7 +108,7 @@ const WalletDeposit = (props) => { ...@@ -52,7 +108,7 @@ const WalletDeposit = (props) => {
<Text style={styles.txtTitle}>CQG</Text> <Text style={styles.txtTitle}>CQG</Text>
<Text style={styles.txtMoney}>{toPriceVnd(1000000)}</Text> <Text style={styles.txtMoney}>{toPriceVnd(1000000)}</Text>
</View> </View>
</View> </View> */}
<View style={styles.wrapBody}> <View style={styles.wrapBody}>
<Text <Text
style={{ style={{
...@@ -69,7 +125,7 @@ const WalletDeposit = (props) => { ...@@ -69,7 +125,7 @@ const WalletDeposit = (props) => {
style={styles.row} style={styles.row}
initial={0} initial={0}
onPress={(value) => { onPress={(value) => {
setAccount({value: value}); setSrc(value);
}} }}
/> />
{/* </View> */} {/* </View> */}
...@@ -82,26 +138,23 @@ const WalletDeposit = (props) => { ...@@ -82,26 +138,23 @@ const WalletDeposit = (props) => {
</Text> </Text>
<PickerItem <PickerItem
width={width - 20} width={width - 20}
data={dataType} data={data}
onValueChange={(value, items) => { onValueChange={(value, items) => {
setType(items); setType(items);
}} }}
/> />
<TextField <TextField
onChangeText={(val) => consoele.log(val)} onChangeText={(val) => setAmount(val)}
title={'Số tiền'} title={'Số tiền'}
isNumber={true} isNumber={true}
/> />
<TextMulti <TextMulti onChangeText={(val) => setNotes(val)} title={'Ghi chú'} />
onChangeText={(val) => consoele.log(val)}
title={'Ghi chú'}
/>
</View> </View>
</View> </View>
<View style={styles.btnSend}> <TouchableOpacity onPress={onPressWithdraw} style={styles.btnSend}>
<Text style={styles.txtSend}>Rút tin</Text> <Text style={styles.txtSend}>Rút tin</Text>
</View> </TouchableOpacity>
</View> </View>
); );
}; };
...@@ -166,4 +219,12 @@ const styles = StyleSheet.create({ ...@@ -166,4 +219,12 @@ const styles = StyleSheet.create({
}, },
}); });
export default WalletDeposit; const mapStateToProps = (state) => {
return {
user: state.userReducer,
};
};
export default connect(mapStateToProps, {
showLoading,
hideLoading,
})(WalletWithdraw);
...@@ -18,6 +18,7 @@ const NewFeed = (props) => { ...@@ -18,6 +18,7 @@ const NewFeed = (props) => {
<View style={{flex: 1, backgroundColor: 'white'}}> <View style={{flex: 1, backgroundColor: 'white'}}>
<Tab.Navigator <Tab.Navigator
initialRouteName="GeneralInfor" initialRouteName="GeneralInfor"
swipeEnabled={false}
tabBarOptions={{ tabBarOptions={{
scrollEnabled: true, scrollEnabled: true,
inactiveTintColor: '#929292', inactiveTintColor: '#929292',
......
...@@ -6,3 +6,8 @@ export const getListWidthDraw = async (body) => ...@@ -6,3 +6,8 @@ export const getListWidthDraw = async (body) =>
GetData(url.urlGetListWithDraw, body) GetData(url.urlGetListWithDraw, body)
.then((res) => res) .then((res) => res)
.catch((err) => err); .catch((err) => err);
export const widthDraw = async (body) =>
PostData(url.urlWithdraw, body)
.then((res) => res)
.catch((err) => err);
...@@ -6,7 +6,6 @@ export default { ...@@ -6,7 +6,6 @@ export default {
urlGetOTP: root + 'api/auth/customer-get-otp', urlGetOTP: root + 'api/auth/customer-get-otp',
urlVerifyOTP: root + 'api/auth/customer-verify-otp', urlVerifyOTP: root + 'api/auth/customer-verify-otp',
urlForgotPassword: root + 'api/auth/customer-forgot-password', urlForgotPassword: root + 'api/auth/customer-forgot-password',
urlGetListWithDraw: root + 'api/v1/payments/get-list-withdraw-method',
urlVerifyAccount: root + 'api/v1/customers/verify-account', urlVerifyAccount: root + 'api/v1/customers/verify-account',
urlGetListNew: root + '/api/v1/news/posts', urlGetListNew: root + '/api/v1/news/posts',
...@@ -14,4 +13,8 @@ export default { ...@@ -14,4 +13,8 @@ export default {
urlGetListMedia: root + 'api/v1/news/videos', urlGetListMedia: root + 'api/v1/news/videos',
urlMediaDetail: root + 'api/v1/videos/detail', urlMediaDetail: root + 'api/v1/videos/detail',
urlGetListCalendar: root + 'api/v1/news/calendar', urlGetListCalendar: root + 'api/v1/news/calendar',
//Withdraw
urlGetListWithDraw: root + 'api/v1/payments/get-list-withdraw-method',
urlWithdraw: root + 'api/v1/customers/request-withdraw',
}; };
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