Commit 4314d546 by Giang Tran

edit menu

parent 8c551211
......@@ -897,7 +897,7 @@
CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 13;
CURRENT_PROJECT_VERSION = 14;
DEVELOPMENT_TEAM = MXZ24GRH48;
ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
......@@ -930,7 +930,7 @@
CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 13;
CURRENT_PROJECT_VERSION = 14;
DEVELOPMENT_TEAM = MXZ24GRH48;
INFOPLIST_FILE = Invest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
......
......@@ -31,12 +31,12 @@ const AccountVerificationView = (props) => {
}}>
<Tab.Screen
name="GeneralInfor"
component={props.user.status == 3 ? GeneralInfor : GeneralView}
component={props.user.status == 2 ? GeneralInfor : GeneralView}
options={{tabBarLabel: 'Thông tin chung'}}
/>
<Tab.Screen
name="Profile"
component={props.user.status == 3 ? Profile : ProfileView}
component={props.user.status == 2 ? Profile : ProfileView}
options={{tabBarLabel: 'Hồ sơ'}}
/>
</Tab.Navigator>
......
import React, {useState} from 'react';
import {View, Text, StyleSheet, Dimensions} from 'react-native';
import React, {useState, useEffect} from 'react';
import {
View,
Text,
StyleSheet,
Dimensions,
TouchableOpacity,
Platform,
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, 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 RadioForm, {
RadioButton,
RadioButtonInput,
RadioButtonLabel,
} from 'react-native-simple-radio-button';
import RadioForm from 'react-native-simple-radio-button';
import {widthDraw, getListWidthDraw} from '../../../apis/Functions/Widthdraw';
import {useNavigation} from '@react-navigation/native';
import {showLoading, hideLoading} from '../../../actions/loadingAction';
var radio_props = [
{label: 'Từ ví', value: 'wallet'},
{label: 'Từ tài khoản CQG', value: 'cqg'},
{label: 'Từ ví', value: 'WALLET'},
{label: 'Từ tài khoản CQG', value: 'INVESTMENT'},
];
const {width} = Dimensions.get('window');
const dataType = [
{
value: '1',
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 WalletWithdraw = (props) => {
const [data, setData] = useState([]);
const [src, setSrc] = useState('WALLET');
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 (
<View style={{flex: 1}}>
<HeaderBack title={'Rút tiền'} />
<View style={styles.container}>
<View style={styles.wrapTop}>
{/* <View style={styles.wrapTop}>
<View style={styles.itemTop}>
<Text style={styles.txtTitle}>Ví</Text>
<Text style={styles.txtMoney}>{toPriceVnd(1000000)}</Text>
......@@ -52,7 +108,7 @@ const WalletDeposit = (props) => {
<Text style={styles.txtTitle}>CQG</Text>
<Text style={styles.txtMoney}>{toPriceVnd(1000000)}</Text>
</View>
</View>
</View> */}
<View style={styles.wrapBody}>
<Text
style={{
......@@ -69,7 +125,7 @@ const WalletDeposit = (props) => {
style={styles.row}
initial={0}
onPress={(value) => {
setAccount({value: value});
setSrc(value);
}}
/>
{/* </View> */}
......@@ -82,26 +138,23 @@ const WalletDeposit = (props) => {
</Text>
<PickerItem
width={width - 20}
data={dataType}
data={data}
onValueChange={(value, items) => {
setType(items);
}}
/>
<TextField
onChangeText={(val) => consoele.log(val)}
onChangeText={(val) => setAmount(val)}
title={'Số tiền'}
isNumber={true}
/>
<TextMulti
onChangeText={(val) => consoele.log(val)}
title={'Ghi chú'}
/>
<TextMulti onChangeText={(val) => setNotes(val)} title={'Ghi chú'} />
</View>
</View>
<View style={styles.btnSend}>
<TouchableOpacity onPress={onPressWithdraw} style={styles.btnSend}>
<Text style={styles.txtSend}>Rút tin</Text>
</View>
</TouchableOpacity>
</View>
);
};
......@@ -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) => {
<View style={{flex: 1, backgroundColor: 'white'}}>
<Tab.Navigator
initialRouteName="GeneralInfor"
swipeEnabled={false}
tabBarOptions={{
scrollEnabled: true,
inactiveTintColor: '#929292',
......
......@@ -6,3 +6,8 @@ export const getListWidthDraw = async (body) =>
GetData(url.urlGetListWithDraw, body)
.then((res) => res)
.catch((err) => err);
export const widthDraw = async (body) =>
PostData(url.urlWithdraw, body)
.then((res) => res)
.catch((err) => err);
......@@ -6,7 +6,6 @@ export default {
urlGetOTP: root + 'api/auth/customer-get-otp',
urlVerifyOTP: root + 'api/auth/customer-verify-otp',
urlForgotPassword: root + 'api/auth/customer-forgot-password',
urlGetListWithDraw: root + 'api/v1/payments/get-list-withdraw-method',
urlVerifyAccount: root + 'api/v1/customers/verify-account',
urlGetListNew: root + '/api/v1/news/posts',
......@@ -14,4 +13,8 @@ export default {
urlGetListMedia: root + 'api/v1/news/videos',
urlMediaDetail: root + 'api/v1/videos/detail',
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