Commit 631428b1 authored by 赵振东's avatar 赵振东

feat: 新增审核求购页面

parent 65d87d76
......@@ -39,6 +39,7 @@ const RootNavigationContainer: React.FC<Iprops> = props => {
headerTitleAlign: 'center',
}}
initialRouteName="Home"
// initialRouteName="CheckRequireOrder"
>
{SCREEN_NAMES.map(name => (
<RootStack.Screen
......
......@@ -12,14 +12,14 @@ export interface RequestFetchOptions {
body?: any;
isUpload?: boolean;
showError?: boolean;
timeout?: number,
timeout?: number;
}
const requestLanguageMaps = {
'zh-CN': 'zh',
'en-US': 'en',
'jp-JPN': 'jp',
}
};
const TIMEOUT = 30 * 1000;
......@@ -31,22 +31,30 @@ const defaultFetchOptions: RequestFetchOptions = {
isUpload: false,
};
export const requestFetch = <T>(url: string, options: RequestFetchOptions): Promise<T> => {
export const requestFetch = <T>(
url: string,
options: RequestFetchOptions,
): Promise<T> => {
let fetchUrl = url || '';
const fetchOptions: RequestFetchOptions = mergeConfig(defaultFetchOptions, options)
const fetchOptions: RequestFetchOptions = mergeConfig(
defaultFetchOptions,
options,
);
if (!fetchUrl) {
throw new Error('not url for fetch');
}
if (fetchOptions.method) {
fetchOptions.method = fetchOptions.method.toLocaleLowerCase() as methodTypes;
fetchOptions.method =
fetchOptions.method.toLocaleLowerCase() as methodTypes;
} else {
fetchOptions.method = 'get';
}
if (i18n.language) {
// @ts-ignore
fetchOptions.headers['Accept-Language'] = requestLanguageMaps[i18n.language]
fetchOptions.headers['Accept-Language'] =
requestLanguageMaps[i18n.language];
}
// 处理get请求
if (fetchOptions.params) {
......@@ -57,7 +65,9 @@ export const requestFetch = <T>(url: string, options: RequestFetchOptions): Prom
* 处理post请求
*/
if (fetchOptions.data) {
fetchOptions.body = fetchOptions.isUpload ? fetchOptions.data : JSON.stringify(fetchOptions.data)
fetchOptions.body = fetchOptions.isUpload
? fetchOptions.data
: JSON.stringify(fetchOptions.data);
}
/**
* timeout 设置timeout 请看这个issue
......@@ -65,27 +75,32 @@ export const requestFetch = <T>(url: string, options: RequestFetchOptions): Prom
* https://github.com/facebook/react-native/issues/2556
*/
return new Promise((resolve, reject) => {
fetch(fetchUrl, { timeout: TIMEOUT, ...fetchOptions as any }).then((responseStream: { status: number; json: () => Promise<any>; }) => {
/**
* 非200状态的http请求将会抛出警告
*/
if (responseStream.status === 200) {
responseStream.json().then((response) => {
resolve(response)
}).catch((err) => {
reject(err)
})
} else if (responseStream.status === 500) {
responseStream.json().then((err) => reject(err))
} else {
reject(new Error(`error status is ${responseStream.status}`))
}
}).catch((e: any) => {
// eslint-disable-next-line prefer-promise-reject-errors
reject({
status: 3000,
errorMsg: '网络超时',
fetch(fetchUrl, { timeout: TIMEOUT, ...(fetchOptions as any) })
.then((responseStream: { status: number; json: () => Promise<any> }) => {
/**
* 非200状态的http请求将会抛出警告
*/
if (responseStream.status === 200) {
responseStream
.json()
.then(response => {
resolve(response);
})
.catch(err => {
reject(err);
});
} else if (responseStream.status === 500) {
responseStream.json().then(err => reject(err));
} else {
reject(new Error(`error status is ${responseStream.status}`));
}
})
})
})
.catch((e: any) => {
// eslint-disable-next-line prefer-promise-reject-errors
reject({
status: 3000,
errorMsg: '网络超时',
});
});
});
};
import React, { useState } from 'react';
import { Image, Text, TouchableOpacity, View } from 'react-native';
import useAppStyle from '../../../../hooks/useAppStyle';
import styles from './styles';
import { useNavigation } from '@react-navigation/native';
import { SvgXml } from 'react-native-svg';
import Icons from 'react-native-vector-icons/AntDesign';
import BaoIcon from '../../../../../assets/images/home_image/Bao.png';
import XunIcon from '../../../../../assets/images/home_image/Xun.png';
import { CheckOrderInnerStatusEnum } from '../../constants';
const CheckOrderItem = props => {
const { data: item, haveFoot = true } = props;
const navigation = useNavigation();
const myStyle = useAppStyle(styles);
return (
<View style={myStyle.box}>
<View style={myStyle['box-top']}>
<Text style={myStyle['box-top-text']}>
求购需求单号:
{item.quoteNo}
</Text>
{item?.outerStatus ? (
<Text style={myStyle['box-top-text']}>
{CheckOrderInnerStatusEnum.getLabelByValue(item?.innerStatus)}
</Text>
) : null}
</View>
{/* -------------------------- */}
<View style={myStyle['box-bottome']}>
<View style={myStyle['box-bottome-container']}>
<View style={myStyle['box-article']}>
<View style={myStyle['box-line']}></View>
</View>
<View>
<View style={myStyle['box-bottome-title']}>
<Image style={myStyle['box-bottome-block']} source={BaoIcon} />
<Text style={myStyle['box-bottome-title-text']}>
{item?.name}
</Text>
</View>
<View style={myStyle['box-bottome-content']}>
<View style={myStyle['box-bottome-content-left']}>
<View style={myStyle['box-bottome-content-left-text']}>
<View style={{ marginRight: 4 }}>
<Text
style={myStyle['box-bottome-content-left-text-label']}
>
<Icons name="clockcircleo" size={14} color="#C0C4CC" />
{`\t${item?.quoteEndTime}`}
</Text>
</View>
</View>
<View style={myStyle['box-bottome-content-left-text']}>
<View style={{ marginRight: 4 }}>
<Text
style={myStyle['box-bottome-content-left-text-label']}
>
<Icons name="user" size={14} color="#C0C4CC" />
{`\t${item?.purchaseMemberName}`}
</Text>
</View>
{/* ---------------- */}
</View>
</View>
<View style={myStyle['box-bottome-content-right']}>
{/* source={{ uri: products.logo }} */}
{/* <Image
source={lingxi_icon}
style={myStyle['box-bottome-content-right-img']}
/> */}
</View>
</View>
{/* 这里~~~~~~· */}
<View style={myStyle['box-bottome-title']}>
<Image style={myStyle['box-bottome-block']} source={XunIcon} />
<Text style={myStyle['box-bottome-title-text']}>
{item?.name}
</Text>
</View>
</View>
</View>
{/* 这里~~~~~~· */}
{haveFoot ? (
<View style={myStyle['box-bottome-foot']}>
<TouchableOpacity
onPress={() => {
navigation.navigate('RequireCheckOrderDetail', {
id: item?.id,
});
}}
style={myStyle['box-bottome-content-button']}
>
<Text style={myStyle['box-bottome-content-button-text']}>
审批
</Text>
</TouchableOpacity>
</View>
) : null}
</View>
</View>
);
};
export default CheckOrderItem;
import { StyleSheet, Platform } from 'react-native';
import { ThemeStyle } from '../../../../constants/theme';
import themeLayout from '../../../../constants/theme/layout';
export default (theme: ThemeStyle) =>
StyleSheet.create({
container: {
flex: 1,
flexDirection: 'column',
},
header: {
width: '100%',
flexDirection: 'row',
backgroundColor: '#fff',
alignItems: 'center',
},
input: {
width: '100%',
flexDirection: 'row',
backgroundColor: '#fff',
alignItems: 'center',
position: 'relative',
},
IconView: {
position: 'relative',
width: '100%',
},
searchImg: {
width: 18,
height: 18,
backgroundColor: '#F6F8FA',
position: 'absolute',
left: 25,
top: 12,
zIndex: 10,
},
search: {
display: 'flex',
width: '60%',
// flexDirection:'row'
},
categoryContainer: {
paddingHorizontal: themeLayout['padding-l'],
alignItems: 'center',
flexDirection: 'row',
backgroundColor: '#fff',
},
categoryWrap: {
flex: 1,
overflow: 'hidden',
height: 36,
// justifyContent: 'center',
},
categoryBox: {
// width: '25%',
marginRight: 5,
flexDirection: 'row',
alignItems: 'center',
},
categoryItem: {
flexDirection: 'row',
paddingRight: 40,
height: '100%',
alignItems: 'center',
},
categoryText: {
// fontSize: 12,
textAlign: 'center',
color: theme.fonts.black2,
fontWeight: '400',
},
categoryText__active: {
color: '#00A98F',
fontWeight: Platform.OS === 'ios' ? '500' : '600',
},
categoryIcon__active: {
color: '#00A98F',
// fontWeight: Platform.OS === 'ios' ? '500' : '600',
},
commodityList: {
backgroundColor: '#F4F5F7',
paddingHorizontal: 8,
paddingVertical: 8,
flex: 1,
},
searchBox: {
// flex: 0.9,
width: '90%',
height: 40,
borderRadius: 18,
alignItems: 'center',
backgroundColor: '#F7F8FA',
paddingLeft: themeLayout['padding-xs'],
overflow: 'hidden',
},
box: {
flex: 1,
height: 180,
// backgroundColor: 'green',
backgroundColor: '#FFFFFF',
borderRadius: themeLayout['padding-xs'],
marginBottom: themeLayout['padding-xs'],
paddingHorizontal: themeLayout['padding-s'],
},
'box-top': {
height: 40,
justifyContent: 'space-between',
alignItems: 'center',
flexDirection: 'row',
},
'box-top-text': {
color: '#91959B',
fontWeight: '400',
},
'box-bottome': {
height: 140,
justifyContent: 'space-between',
alignItems: 'center',
// backgroundColor: 'pink',
},
'box-bottome-container': {
width: '100%',
height: 83,
// justifyContent: 'center',
alignItems: 'center',
paddingTop: 14,
flexDirection: 'row',
// backgroundColor: '#666666',
},
'box-article': {
width: 16,
height: '100%',
marginRight: 4,
alignItems: 'center',
},
'box-line': {
width: 1,
height: '100%',
backgroundColor: '#909399',
},
'box-bottome-title': {
width: '100%',
height: 20,
alignItems: 'center',
justifyContent: 'flex-start',
flexDirection: 'row',
position: 'relative',
left: -20,
},
'box-bottome-block': {
width: 16,
height: 16,
marginRight: 4,
},
'box-bottome-title-text': {
color: '#252D37',
fontWeight: Platform.OS === 'ios' ? '500' : '600',
},
'box-bottome-content': {
justifyContent: 'space-between',
alignItems: 'center',
flexDirection: 'row',
},
'box-bottome-content-left': {
justifyContent: 'center',
alignItems: 'center',
marginVertical: 13,
},
'box-bottome-content-left-text': {
width: '100%',
alignItems: 'center',
flexDirection: 'row',
// marginTop: 16,
},
'box-bottome-content-left-text-label': {
color: '#91959B',
},
'box-bottome-content-left-text-value': {
color: '#252D37',
marginLight: 4,
},
'box-bottome-content-right': {
justifyContent: 'center',
alignItems: 'center',
},
'box-bottome-content-right-img': {
height: 48,
width: 48,
},
'box-bottome-foot': {
height: 40,
width: '100%',
alignItems: 'center',
justifyContent: 'flex-end',
flexDirection: 'row',
// backgroundColor: 'blue',
},
'box-bottome-content-button': {
backgroundColor: '#EBF9F6',
borderRadius: 4,
height: 24,
width: 72,
justifyContent: 'center',
alignItems: 'center',
marginRight: 8,
},
'box-bottome-content-button-text': {
color: '#00A98F',
},
});
import React, { useState } from 'react';
import { View, Text, TouchableOpacity, ScrollView } from 'react-native';
import useAppStyle from '../../../hooks/useAppStyle';
import useAppStyle from '../../../../hooks/useAppStyle';
import styles from './styles';
interface FilterBarType {
......@@ -21,7 +21,7 @@ interface Prop {
/**
* 过滤项改变触发事件
*/
onChange: (item: barValueType['item']) => void;
onChange: (item: barValueType['item'], index: number) => void;
}
const FilterBar = (prop: Prop) => {
......@@ -34,7 +34,7 @@ const FilterBar = (prop: Prop) => {
index: number,
) => {
setBarIndex(index);
onChange(item);
onChange(item, index);
};
return (
......@@ -52,11 +52,12 @@ const FilterBar = (prop: Prop) => {
style={[
myStyle.categoryItem,
barIndex === index ? myStyle.categoryItem__active : {},
index === 0 ? { width: 50 } : {},
]}
onPress={() => {
handleBar(item, index);
}}
key={item.key}
key={item?.key || item?.label}
>
<Text
style={[
......
import { StyleSheet, Platform } from 'react-native';
import { ThemeStyle } from '../../../constants/theme';
import themeLayout from '../../../constants/theme/layout';
import { ThemeStyle } from '../../../../constants/theme';
import themeLayout from '../../../../constants/theme/layout';
export default (theme: ThemeStyle) =>
StyleSheet.create({
......
import { getEnumManager } from '../../../utils/getEnumManager';
export const CheckOrderInnerStatusOptions = [
{ label: '全部', value: '' },
{ label: '待提交审核', value: 1 },
{ label: '待审核一级', value: 2 },
{ label: '待审核二级', value: 3 },
{ label: '待提交报价单', value: 4 },
{ label: '已提交', value: 5 },
{ label: '审核不通过一级', value: 6 },
{ label: '审核不通过二级', value: 7 },
];
export const CheckOrderInnerStatusEnum = getEnumManager(
CheckOrderInnerStatusOptions,
);
......@@ -10,56 +10,161 @@ import {
FlatList,
} from 'react-native';
import useAppStyle from '../../hooks/useAppStyle';
// import styles from './styles';
import styles from './styles';
import useLocale from '../../hooks/useLocale';
import { useNavigation } from '@react-navigation/native';
import OrderNavBar from '../../components/OrderNavBar';
import FilterBar from './filterBar';
import FilterBar from './components/FilterBar';
import CheckOrderItem from './components/CheckOrderItem';
import {
postTransactionMobileQuoteAskPurchasePage,
PostTransactionMobileQuoteAskPurchasePageResponseDetail as DataType,
PostTransactionMobileQuoteAskPurchasePageRequest as ParamType,
} from '../../services/TransactionV2Api';
import Loading from '../../components/Loading';
import { checkMore } from '../../utils/orderUtils';
const CheckRequireOrder = () => {
const handleChange = () => {};
const myStyle = useAppStyle(styles);
const [orderList, setOrderList] = useState<DataType[]>([]);
const [searchcriteria, setSearchcriteria] = useState<ParamType>({
pageSize: 8,
});
const [innerValue, setInnerValue] = useState('');
const [loading, setLoading] = useState<boolean>(false);
const pageRef = useRef<number>(1);
const [hasMore, setHasMore] = useState<boolean>(true);
const fetchData = async () => {
setLoading(true);
const res = await postTransactionMobileQuoteAskPurchasePage(searchcriteria);
setLoading(false);
setHasMore(
checkMore(
pageRef.current,
8,
(res.data.data || []).length,
res.data.totalCount,
),
);
if (pageRef.current > 1) {
setOrderList(orderList.concat(res.data.data));
return;
}
setOrderList(res.data.data);
};
const handleScroll = () => {
if (loading) return;
pageRef.current += 1;
setSearchcriteria({
...searchcriteria,
current: pageRef.current,
});
};
const handleSearchSubmit = () => {};
useEffect(() => {
fetchData();
}, [searchcriteria]);
const handleFilterPress = () => {};
const renderCheckOrderList = ({
item,
index,
}: {
item: DataType;
index: number;
}) => {
return <CheckOrderItem data={item} />;
};
const filterBar = [
{
label: '待提交审核',
key: 'Default',
},
{
label: '待审核一级',
key: 'Delivery',
},
{
label: '待审核二级',
key: 'CutOff',
},
{
label: '待提交报价单',
key: 'CutOff',
},
];
const reArrangOrderList = (item: any, index: number) => {
// const sort = getSort(item, status);
console.log(item, 'itemitemitemitemitem');
pageRef.current = 1;
const innerStatus = index ? index : undefined;
setSearchcriteria({
...searchcriteria,
innerStatus,
current: pageRef.current,
});
};
const handleChange = text => {
setInnerValue(text);
};
const handleSearchSubmit = () => {
pageRef.current = 1;
setSearchcriteria({
...searchcriteria,
keywords: innerValue,
current: pageRef.current,
});
};
return (
<View>
<View style={myStyle.container}>
{/* 头区域 */}
{/* <ScrollView> */}
<OrderNavBar
placeholder={'需求单号/需求单摘要'}
placeholder={'报价单/求购会员'}
onChangeText={handleChange}
onSubmitEditing={handleSearchSubmit}
// onFilterPress={handleFilterPress}
/>
<FilterBar
onChange={function (
item: any,
statusObj: {} | { [key: string]: BAR_STATUS },
): void {
throw new Error('Function not implemented.');
}}
onChange={reArrangOrderList}
// eslint-disable-next-line @typescript-eslint/no-use-before-define
value={filterBar}
/>
{/* {renderCheckOrderList()} */}
{/* 内容区域 */}
<View style={myStyle.commodityList}>
<FlatList
data={orderList}
renderItem={renderCheckOrderList}
scrollEventThrottle={16}
horizontal={false}
showsVerticalScrollIndicator={false}
onEndReached={handleScroll}
onEndReachedThreshold={0.15}
style={{
flex: 1,
}}
ListFooterComponent={
<View>
<Loading loading={loading} noMore={!hasMore} />
</View>
}
/>
</View>
{/* </ScrollView> */}
</View>
);
};
/**
* 外部状态集合,1,"待发布",2,"待报价",3,"已结束",4,"已终止",5,"已作废" ,Integer
*/
// outerStatusList?: number[]
const filterBar = [
{
label: '全部',
key: 'all',
},
{
label: '待提交审核',
key: 'waitCheck',
},
{
label: '待审核一级',
key: 'check1',
},
{
label: '待审核二级',
key: 'check2',
},
{
label: '待提交报价单',
key: 'waiteSubmit',
},
];
export default CheckRequireOrder;
import { StyleSheet, Platform } from 'react-native';
import { ThemeStyle } from '../../constants/theme';
import themeLayout from '../../constants/theme/layout';
export default (theme: ThemeStyle) =>
StyleSheet.create({
container: {
flex: 1,
flexDirection: 'column',
},
header: {
width: '100%',
flexDirection: 'row',
backgroundColor: '#fff',
alignItems: 'center',
paddingBottom: 6,
},
input: {
width: '100%',
flexDirection: 'row',
backgroundColor: '#fff',
alignItems: 'center',
position: 'relative',
},
IconView: {
position: 'relative',
width: '100%',
},
searchImg: {
width: 18,
height: 18,
backgroundColor: '#F6F8FA',
position: 'absolute',
left: 25,
top: 12,
zIndex: 10,
},
search: {
display: 'flex',
width: '60%',
// flexDirection:'row'
},
categoryContainer: {
paddingHorizontal: themeLayout['padding-l'],
alignItems: 'center',
flexDirection: 'row',
backgroundColor: '#fff',
},
categoryWrap: {
flex: 1,
overflow: 'hidden',
height: 36,
// justifyContent: 'center',
},
categoryBox: {
// width: '25%',
marginRight: 5,
flexDirection: 'row',
alignItems: 'center',
},
categoryItem: {
flexDirection: 'row',
paddingRight: 40,
height: '100%',
alignItems: 'center',
},
categoryText: {
// fontSize: 12,
textAlign: 'center',
color: theme.fonts.black2,
fontWeight: '400',
},
categoryText__active: {
color: '#00A98F',
fontWeight: Platform.OS === 'ios' ? '500' : '600',
},
categoryIcon__active: {
color: '#00A98F',
// fontWeight: Platform.OS === 'ios' ? '500' : '600',
},
commodityList: {
backgroundColor: '#F4F5F7',
paddingHorizontal: 8,
paddingVertical: 8,
flex: 1,
},
searchBox: {
// flex: 0.9,
width: '90%',
height: 40,
borderRadius: 18,
alignItems: 'center',
backgroundColor: '#F7F8FA',
paddingLeft: themeLayout['padding-xs'],
overflow: 'hidden',
},
box: {
flex: 1,
height: 171,
backgroundColor: '#FFFFFF',
borderRadius: themeLayout['padding-xs'],
marginBottom: themeLayout['padding-xs'],
paddingHorizontal: themeLayout['padding-s'],
},
'box-top': {
height: 40,
justifyContent: 'space-between',
alignItems: 'center',
flexDirection: 'row',
},
'box-top-text': {
color: '#91959B',
fontWeight: '400',
},
'box-bottome': {
height: 131,
justifyContent: 'space-between',
alignItems: 'center',
},
'box-bottome-container': {
width: '100%',
height: 83,
justifyContent: 'center',
// alignItems: 'center',
},
'box-bottome-title': {
width: '100%',
height: 20,
// justifyContent: 'center',
alignItems: 'flex-start',
marginTop: 5,
marginBottom: 2,
},
'box-bottome-title-text': {
color: '#252D37',
fontWeight: Platform.OS === 'ios' ? '500' : '600',
},
'box-bottome-content': {
justifyContent: 'space-between',
alignItems: 'center',
flexDirection: 'row',
},
'box-bottome-content-left': {
justifyContent: 'center',
alignItems: 'center',
marginTop: 14,
},
'box-bottome-content-left-text': {
width: '100%',
alignItems: 'center',
flexDirection: 'row',
// marginTop: 16,
},
'box-bottome-content-left-text-label': {
color: '#91959B',
},
'box-bottome-content-left-text-value': {
color: '#252D37',
marginLight: 4,
},
'box-bottome-content-right': {
justifyContent: 'center',
alignItems: 'center',
},
'box-bottome-content-right-img': {
height: 48,
width: 48,
},
'box-bottome-foot': {
height: 48,
width: '100%',
alignItems: 'center',
justifyContent: 'flex-end',
flexDirection: 'row',
},
'box-bottome-content-button': {
backgroundColor: '#EBF9F6',
borderRadius: 4,
height: 24,
width: 72,
justifyContent: 'center',
alignItems: 'center',
marginRight: 8,
},
'box-bottome-content-button-text': {
color: '#00A98F',
},
});
......@@ -13,50 +13,50 @@ import useLocale from '../../../../../hooks/useLocale';
* 订单详情 物流查更多物流单号
*/
interface logistics {
company: string,
logisticNo: string
company: string;
logisticNo: string;
}
interface Iprops {
showTimeLayer: boolean,
fnClose: Function,
goDetail: Function,
logisticsList: logistics[] | undefined
showTimeLayer: boolean;
fnClose: Function;
goDetail: Function;
logisticsList: logistics[] | undefined;
}
const PreviewMore: React.FC<Iprops> = (props: Iprops) => {
const { fnClose, showTimeLayer, logisticsList = [],goDetail } = props;
const { t } = useLocale('order')
const { fnClose, showTimeLayer, logisticsList = [], goDetail } = props;
const { t } = useLocale('order');
const styles = useAppStyle(Cstyle);
const fnClosePopup = () => {
if (fnClose) {
fnClose();
}
}
};
// 按key进行归类
const groupBy = (objectArray: any[], property: string) => objectArray.reduce((acc, obj) => {
obj.logisticCompanyVO?.length>0&&obj.logisticCompanyVO.forEach(item=>{
const key =item.company
if (!acc[key]) {
acc[key] = []
}
acc[key].push(obj)
})
return acc
}, {})
const groupBy = (objectArray: any[], property: string) =>
objectArray.reduce((acc, obj) => {
obj.logisticCompanyVO?.length > 0 &&
obj.logisticCompanyVO.forEach(item => {
const key = item.company;
if (!acc[key]) {
acc[key] = [];
}
acc[key].push(obj);
});
return acc;
}, {});
const navigation = useNavigation();
const goJump = (url: String, infos?: {}) => {
if (url) {
navigation.navigate(`${url}`, infos);
}
}
};
const handleCopy = (text: string) => {
if (!text) {
......@@ -67,7 +67,7 @@ const PreviewMore: React.FC<Iprops> = (props: Iprops) => {
Toast.show(t('order.tip.successCopy'));
};
const logisticsData = groupBy(logisticsList, 'company')
const logisticsData = groupBy(logisticsList, 'company');
// console.log(logisticsData, logisticsList, 'logisticsData')
......@@ -79,33 +79,61 @@ const PreviewMore: React.FC<Iprops> = (props: Iprops) => {
>
<View style={styles.warp}>
{
// logisticsData.length ?
Object.keys(logisticsData).map((item, index) => (
item!='undefined'&& <View key={`${index}_logistics`} style={styles.logisticBox}>
<View style={styles.title}><Text>{item}</Text></View>
{
logisticsData[item].map((_item: any, _index: any) => (
<View key={`${_index}_logistics_line`} style={styles.logisticsNoLine}>
<View style={styles.left}>
<Text style={styles.logisticsNo}>{_item.logisticCompanyVO[0]?.logisticsNo}</Text>
<SvgXml onPress={() => handleCopy(_item.logisticCompanyVO[0]?.logisticsNo)} xml={CopyIocn} width={15} height={15} />
</View>
<View onPress={() => goDetail({logisticsNo:_item.logisticCompanyVO[0]?.logisticsNo,expressCode:_item.logisticCompanyVO[0]?.logisticsCode,company:_item.logisticCompanyVO[0]?.company,senderPhone:_item.senderPhone,receiverPhone:_item.receiverPhone})}>
<Text style={styles.logistics}>{t('order.previewMore.logistics')}</Text>
<SvgXml xml={Iocn} width={15} height={15} />
// logisticsData.length ?
Object.keys(logisticsData).map(
(item, index) =>
item != 'undefined' && (
<View key={`${index}_logistics`} style={styles.logisticBox}>
<View style={styles.title}>
<Text>{item}</Text>
</View>
{logisticsData[item].map((_item: any, _index: any) => (
<View
key={`${_index}_logistics_line`}
style={styles.logisticsNoLine}
>
<View style={styles.left}>
<Text style={styles.logisticsNo}>
{_item.logisticCompanyVO[0]?.logisticsNo}
</Text>
<SvgXml
onPress={() =>
handleCopy(_item.logisticCompanyVO[0]?.logisticsNo)
}
xml={CopyIocn}
width={15}
height={15}
/>
</View>
<View
onPress={() =>
goDetail({
logisticsNo:
_item.logisticCompanyVO[0]?.logisticsNo,
expressCode:
_item.logisticCompanyVO[0]?.logisticsCode,
company: _item.logisticCompanyVO[0]?.company,
senderPhone: _item.senderPhone,
receiverPhone: _item.receiverPhone,
})
}
>
<Text style={styles.logistics}>
{t('order.previewMore.logistics')}
</Text>
<SvgXml xml={Iocn} width={15} height={15} />
</View>
</View>
))}
</View>
</View>
))
}
</View>
))
// : null
}
),
)
// : null
}
<View />
</View>
</Popup>
)
}
);
};
export default PreviewMore
export default PreviewMore;
......@@ -36,9 +36,7 @@ const RequirePriceOrder = props => {
useEffect(() => {
getProductList()
.then(res => {
// setProductList(_normalizeList(res));
setProductList(res);
console.log(res, 'resresresresres');
})
.catch(() => {});
}, []);
......
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