Commit 036ea058 authored by chen's avatar chen

fix: 修复bug

parent 9a42d762
import React, { useRef, useState } from 'react';
import {
View,
Text,
TouchableOpacity,
ScrollView,
Platform,
} from 'react-native';
import useAppStyle from '../../hooks/useAppStyle';
import styles from './styles';
export interface FilterBarType {
/** 标题 */
label: string,
/** key 值 */
key: string,
/** 筛选值 */
dataType: number,
/** 角标数组 */
nums: number
/** 图标 */
icon?: boolean;
}
type barValueType = {
item: FilterBarType;
};
interface Prop {
/**
* 值
*/
value: FilterBarType[];
/**
* 过滤项改变触发事件
*/
onChange: (item: barValueType['item'], index: number) => void;
}
const FilterBar = (props: Prop) => {
const { value: filterBar, onChange } = props;
const myStyle = useAppStyle(styles);
const [barIndex, setBarIndex] = useState<number>(0);
const handleBar = (
item: FilterBarType,
index: number,
) => {
setBarIndex(index);
onChange(item, index);
};
return (
<View style={myStyle.categoryContainer}>
<ScrollView
horizontal
showsHorizontalScrollIndicator={false}
style={myStyle.categoryWrap}
>
<View style={myStyle.categoryBox}>
{filterBar.map((item, index) => {
return (
<TouchableOpacity
activeOpacity={0.8}
style={[
myStyle.categoryItem,
barIndex === index ? myStyle.categoryItem__active : {},
index === 0 ? { width: 50 } : {},
]}
onPress={() => {
handleBar(item, index);
}}
key={item?.key || item?.label}
>
<Text
style={[
myStyle.categoryText,
barIndex === index ? myStyle.categoryText__active : {},
]}
>
{item.label}
</Text>
{item?.nums ? (
<View
style={[
myStyle['category_dot'],
item?.nums > 10 ? { width: 20 } : null,
]}
>
<View
style={[
myStyle['category_dot_text'],
item?.nums > 10 ? { width: 19 } : null,
]}
>
<Text
style={{
fontWeight: 'bold',
fontFamily: '',
color: '#FFFFFF',
fontSize: 10,
}}
>
{item?.nums}
</Text>
</View>
</View>
) : null}
</TouchableOpacity>
);
})}
</View>
</ScrollView>
</View>
);
};
FilterBar.defaultProps = {
filterBar: [],
};
export default FilterBar;
import { StyleSheet, Platform } from 'react-native';
import { ThemeStyle } from '../../../../constants/theme';
import themeLayout from '../../../../constants/theme/layout';
export default (theme: ThemeStyle) =>
StyleSheet.create({
categoryContainer: {
// paddingHorizontal: themeLayout['padding-l'],
alignItems: 'center',
flexDirection: 'row',
backgroundColor: '#fff',
},
categoryWrap: {
flex: 1,
overflow: 'hidden',
height: 36,
},
categoryBox: {
flexDirection: 'row',
alignItems: 'center',
},
categoryItem: {
flexDirection: 'row',
height: '100%',
alignItems: 'center',
width: 100,
justifyContent: 'center',
},
categoryItem__active: {
borderBottomColor: theme.colors.primary,
borderBottomWidth: 2,
},
categoryText: {
textAlign: 'center',
color: theme.fonts.black2,
fontWeight: '400',
fontFamily: '',
},
categoryText__active: {
fontWeight: 'bold',
fontFamily: '',
},
categoryIcon__active: {
color: '#00A98F',
},
category_dot: {
width: 14,
height: 14,
borderRadius: 14,
backgroundColor: '#EF3346',
justifyContent: 'center',
alignItems: 'center',
position: 'relative',
left: -6,
top: -6,
},
category_dot_text: { position: 'absolute', left: 4 },
});
......@@ -90,10 +90,9 @@ export default {
'In order to confirm your identity, you need to verify your phone number',
'formInfo.confirm.email':
'In order to confirm your identity, you need to verify your email',
'formInfo.confirm.phoneSend':
'The verification code has been sent to your phone',
'formInfo.confirm.emailSend':
'The verification code has been sent to your email',
'formInfo.confirm.phoneSend': 'The verification code will be sent to your phone',
'formInfo.confirm.emailSend': 'The verification code will be sent to your mailbox',
'formInfo.info.accont': 'Account Security',
'formInfo.info.address': 'Receiving address',
......@@ -148,4 +147,6 @@ export default {
'formInfo.Login.inputPassword': 'Please enter the password',
'formInfo.Login.inputPhone': 'Please enter user name/phone number/email',
'formInfo.Login.login': 'Login',
'formInfo.Login.xieyi': 'agree on',
'order.requireOrder.feedbackInformation': 'feedback information',
};
......@@ -78,8 +78,8 @@ export default {
'formInfo.confirm.phone': '为了确认您的身份,需要验证手机号',
'formInfo.confirm.email': '为了确认您的身份,需要验证邮箱',
'formInfo.confirm.phoneSend': '验证码发送至您的手机',
'formInfo.confirm.emailSend': '验证码发送至您的邮箱',
'formInfo.confirm.phoneSend': '验证码发送至您的手机',
'formInfo.confirm.emailSend': '验证码发送至您的邮箱',
'formInfo.info.accont': '账户安全',
'formInfo.info.address': '收货地址',
......@@ -113,4 +113,6 @@ export default {
'formInfo.address.backInfo': '商品寄回信息',
'formInfo.name.pel': '请输入名字',
'formInfo.Login.xieyi': '协议',
}
......@@ -79,8 +79,8 @@ export default {
'formInfo.confirm.phone': '为了确认您的身份,需要验证手机号',
'formInfo.confirm.email': '为了确认您的身份,需要验证邮箱',
'formInfo.confirm.phoneSend': '验证码发送至您的手机',
'formInfo.confirm.emailSend': '验证码发送至您的邮箱',
'formInfo.confirm.phoneSend': '验证码发送至您的手机',
'formInfo.confirm.emailSend': '验证码发送至您的邮箱',
'formInfo.info.accont': '账户安全',
'formInfo.info.address': '收货地址',
......@@ -133,4 +133,6 @@ export default {
'formInfo.Login.inputPassword': '请输入密码',
'formInfo.Login.inputPhone': '请输入用户名/手机号/邮箱',
'formInfo.Login.login': '登录',
'formInfo.Login.xieyi': '协议',
};
......@@ -401,4 +401,5 @@ export default {
'order.requireOrder.hasSubmit': '已提交',
'order.requireOrder.quotationNo': ' 报价单号:',
'order.requireOrder.requestNo': '求购需求单号:',
'order.requireOrder.feedbackInformation': '反馈信息',
};
......@@ -31,10 +31,6 @@ const AccountInfo: React.FC<any> = ({ navigation }) => {
};
const jumpToCode = () => {
console.log(
currentAI[1].value,
'currentAI[1].valuecurrentAI[1].valuecurrentAI[1].value',
);
navigation.navigate('InputCaptureCode', {
type: 'password',
verify: { name: 'email', value: currentAI[1].value },
......
......@@ -142,12 +142,14 @@ const InquiryOrderDetail: FcRoute<'InquiryOrderDetail', Param> = props => {
return (
<View style={myStyle['Mcell-content']}>
<Text style={myStyle['Mcell-text']}>{title}</Text>
<Text style={{ color: '#252D37' }}>
{item.formatNum
? formatNum(Goods?.[value], 6)
: Goods?.[value]}
</Text>
<View style={myStyle['Mcell-item']}>
<Text style={myStyle['Mcell-text']}>{title}</Text>
<Text style={{ color: '#252D37' }}>
{item.formatNum
? formatNum(Goods?.[value], 6)
: Goods?.[value]}
</Text>
</View>
</View>
);
}}
......
......@@ -166,11 +166,16 @@ export default (theme: ThemeStyle) =>
color: '#252D37',
},
'Mcell-content': {
width: '48%'
},
'Mcell-item': {
flexDirection: 'row',
// justifyContent: 'space-between',
width: '48%',
display: 'flex',
width: '48%'
},
'Mcell-text': {
marginRight: 5,
},
});
......@@ -24,26 +24,39 @@ export const CheckOrderInnerStatusOptions = [
},
];
/**
* 审核报价单 tabs
*/
export const filterBar = [
{
label: i18n.t('order:order:order.inquiry.index.orderStatus', '全部'),
key: 'all',
dataType: 1,
nums: 0
},
{
label: i18n.t('order:order.tabs.audit', '待提交审核'),
key: 'waitCheck',
dataType: 2,
nums: 0
},
{
label: i18n.t('order:order.tabs.audit1.1', '待审核一级'),
key: 'check1',
dataType: 3,
nums: 0
},
{
label: i18n.t('order:order.tabs.audit2.2', '待审核二级'),
key: 'check2',
dataType: 4,
nums: 0
},
{
label: i18n.t('order:order.inquiry.index.tab.onSubmit', '待提交报价单'),
key: 'waiteSubmit',
dataType: 5,
nums: 0
},
];
......
import React, { useRef, useEffect, useState } from 'react';
import {
View,
Text,
TextInput,
Image,
StatusBar,
TouchableOpacity,
ScrollView,
FlatList,
} from 'react-native';
import useAppStyle from '../../hooks/useAppStyle';
import styles from './styles';
import useLocale from '../../hooks/useLocale';
import { useNavigation } from '@react-navigation/native';
import OrderNavBar from '../../components/OrderNavBar';
import {
......@@ -24,43 +17,55 @@ import {
} from '../../services/TransactionV2Api';
import Loading from '../../components/Loading';
import { checkMore } from '../../utils/orderUtils';
import FilterBar from '../CheckRequireOrder/components/FilterBar';
import CheckOrderItem from './components/CheckOrderItem';
import { filterBar } from './constants';
import FilterBar, { FilterBarType } from '../../components/FilterBar';
const CheckQuotationOrder = () => {
const myStyle = useAppStyle(styles);
const { t } = useLocale('order');
const [orderList, setOrderList] = useState<DataType[]>([]);
const [orderNum, setOrderNum] = useState<NumType | {}>({});
const [searchcriteria, setSearchcriteria] = useState<ParamType>({
const [searchcriteria, setSearchcriteria] = useState<any>({
pageSize: 8,
current: 1
});
const [innerValue, setInnerValue] = useState('');
const [loading, setLoading] = useState<boolean>(false);
const pageRef = useRef<number>(1);
const [hasMore, setHasMore] = useState<boolean>(true);
const [tabs, setTabs] = useState<FilterBarType[]>(filterBar);
// 获取tabs 角标数量
useEffect(() => {
getTransactionMobileProductQuotationListTotalStatistics().then(res => {
if (res.code === 1000) {
// 按filterTab来
const data = res.data
const list = [...filterBar];
list[1].nums = data.submitReviewCount;
list[2].nums = data.firstReviewCount;
list[3].nums = data.secondReviewCount;
list[4].nums = data.submitCount;
setTabs(list)
}
});
}, [])
// 获取订单列表
const fetchData = async () => {
setLoading(true);
if ( pageRef.current <= 1) { setOrderList([]) };
const res = await getTransactionMobileProductQuotationList(searchcriteria);
setLoading(false);
const data: any = res?.data?.data;
setHasMore(
checkMore(
pageRef.current,
8,
(res.data.data || []).length,
res.data.totalCount,
),
checkMore(pageRef.current, searchcriteria.pageSize, (data || []).length, res.data.totalCount)
);
if (pageRef.current > 1) {
setOrderList(orderList.concat(res.data.data));
setOrderList(orderList.concat(data));
return;
}
setOrderList(res.data.data);
const res2 = await getTransactionMobileProductQuotationListTotalStatistics();
setOrderNum(res2.data);
setOrderList(data);
};
const handleScroll = () => {
......@@ -68,7 +73,7 @@ const CheckQuotationOrder = () => {
pageRef.current += 1;
setSearchcriteria({
...searchcriteria,
current: pageRef.current,
current: `${pageRef.current}`,
});
};
......@@ -87,17 +92,16 @@ const CheckQuotationOrder = () => {
};
const reArrangOrderList = (item: any, index: number) => {
// const sort = getSort(item, status);
pageRef.current = 1;
const interiorState = index ? index : undefined;
const interiorState: any = item.dataType;
setSearchcriteria({
...searchcriteria,
interiorState,
current: pageRef.current,
dataType: interiorState,
current: `${pageRef.current}`,
});
};
const handleChange = text => {
const handleChange = (text: string) => {
setInnerValue(text);
};
......@@ -106,7 +110,7 @@ const CheckQuotationOrder = () => {
setSearchcriteria({
...searchcriteria,
keyword: innerValue,
current: pageRef.current,
current: `${pageRef.current}`,
});
};
return (
......@@ -116,15 +120,11 @@ const CheckQuotationOrder = () => {
placeholder={t('order.requireOrder.placeholder.1', '报价单/求购会员')}
onChangeText={handleChange}
onSubmitEditing={handleSearchSubmit}
// onFilterPress={handleFilterPress}
/>
<FilterBar
onChange={reArrangOrderList}
// eslint-disable-next-line @typescript-eslint/no-use-before-define
value={filterBar}
numValue={orderNum}
value={tabs}
/>
{/* {renderCheckOrderList()} */}
{/* 内容区域 */}
<View style={myStyle.commodityList}>
<FlatList
......
......@@ -68,7 +68,7 @@ const CheckOrderItem = props => {
>
<View style={myStyle['box-top']}>
<Text style={myStyle['box-top-text']}>
{t('order.requireOrder.requestNo', '求购需求单号:')}
{t('order.inquiry.details.baseInfo.no', '报价单号')}
{item.quoteNo}
</Text>
{item?.outerStatus ? (
......
......@@ -10,9 +10,16 @@ import useAppStyle from '../../../../hooks/useAppStyle';
import { GetTransactionMobileQuoteAskPurchaseTotalStatisticsResponse } from '../../../../services/TransactionV2Api';
import styles from './styles';
interface FilterBarType {
label: string;
key?: string;
interface FilterBarType {
/** 标题 */
label: string,
/** key 值 */
key: string,
/** 筛选值 */
dataType: number,
/** 角标数组 */
nums: number
/** 图标 */
icon?: boolean;
}
......@@ -35,8 +42,8 @@ interface Prop {
onChange: (item: barValueType['item'], index: number) => void;
}
const FilterBar = (prop: Prop) => {
const { value: filterBar, onChange, numValue } = prop;
const FilterBar = (props: Prop) => {
const { value: filterBar, onChange } = props;
const myStyle = useAppStyle(styles);
const [barIndex, setBarIndex] = useState<number>(0);
......@@ -78,17 +85,17 @@ const FilterBar = (prop: Prop) => {
>
{item.label}
</Text>
{index === 2 && numValue?.firstReviewCount ? (
{item?.nums ? (
<View
style={[
myStyle['category_dot'],
numValue?.firstReviewCount > 10 ? { width: 20 } : null,
item?.nums > 10 ? { width: 20 } : null,
]}
>
<View
style={[
myStyle['category_dot_text'],
numValue?.firstReviewCount > 10 ? { width: 19 } : null,
item?.nums > 10 ? { width: 19 } : null,
]}
>
<Text
......@@ -99,34 +106,7 @@ const FilterBar = (prop: Prop) => {
fontSize: 10,
}}
>
{numValue?.firstReviewCount}
</Text>
</View>
</View>
) : null}
{index === 3 && numValue?.secondReviewCount ? (
<View
style={[
myStyle['category_dot'],
numValue?.secondReviewCount > 10 ? { width: 20 } : null,
]}
>
<View
style={[
myStyle['category_dot_text'],
numValue?.secondReviewCount > 10 ? { width: 19 } : null,
]}
>
<Text
style={{
fontWeight: 'bold',
fontFamily: '',
color: '#FFFFFF',
fontSize: 10,
}}
>
{numValue?.secondReviewCount}
{item?.nums}
</Text>
</View>
</View>
......
......@@ -14,7 +14,6 @@ import styles from './styles';
import useLocale from '../../hooks/useLocale';
import { useNavigation } from '@react-navigation/native';
import OrderNavBar from '../../components/OrderNavBar';
import FilterBar from './components/FilterBar';
import CheckOrderItem from './components/CheckOrderItem';
import {
postTransactionMobileQuoteAskPurchasePage,
......@@ -26,6 +25,7 @@ import {
import Loading from '../../components/Loading';
import { checkMore } from '../../utils/orderUtils';
import { filterBar } from '../CheckQuotationOrder/constants';
import FilterBar, { FilterBarType } from '../../components/FilterBar';
const CheckRequireOrder = () => {
const myStyle = useAppStyle(styles);
......@@ -39,6 +39,24 @@ const CheckRequireOrder = () => {
const [loading, setLoading] = useState<boolean>(false);
const pageRef = useRef<number>(1);
const [hasMore, setHasMore] = useState<boolean>(true);
const [tabs, setTabs] = useState<FilterBarType[]>(filterBar);
// 获取tabs 角标数量
useEffect(() => {
getTransactionMobileQuoteAskPurchaseTotalStatistics().then(res => {
if (res.code === 1000) {
// 按filterTab来
const data = res.data
const list = [...filterBar];
list[1].nums = data.submitReviewCount;
list[2].nums = data.firstReviewCount;
list[3].nums = data.secondReviewCount;
list[4].nums = data.submitCount;
setTabs(list)
}
});
}, [])
const fetchData = async () => {
setLoading(true);
......@@ -58,8 +76,6 @@ const CheckRequireOrder = () => {
}
setOrderList(res.data.data);
const res2 = await getTransactionMobileQuoteAskPurchaseTotalStatistics();
setOrderNum(res2.data);
};
const handleScroll = () => {
......@@ -96,7 +112,7 @@ const CheckRequireOrder = () => {
});
};
const handleChange = text => {
const handleChange = (text: string) => {
setInnerValue(text);
};
......@@ -108,6 +124,8 @@ const CheckRequireOrder = () => {
current: pageRef.current,
});
};
return (
<View style={myStyle.container}>
{/* 头区域 */}
......@@ -120,8 +138,7 @@ const CheckRequireOrder = () => {
<FilterBar
onChange={reArrangOrderList}
// eslint-disable-next-line @typescript-eslint/no-use-before-define
value={filterBar}
numValue={orderNum}
value={tabs}
/>
{/* {renderCheckOrderList()} */}
{/* 内容区域 */}
......
......@@ -127,7 +127,7 @@ const CheckOrderItem = (props: any) => {
<Text
style={myStyle['box-bottome-content-left-text-label']}
>
{`\t${item?.memberName}`}
{`\t${item?.offerMemberName}`}
</Text>
</View>
</View>
......@@ -143,7 +143,7 @@ const CheckOrderItem = (props: any) => {
<View style={myStyle['box-bottome-title']}>
<Image style={myStyle['box-bottome-block']} source={XunIcon} />
<Text style={myStyle['box-bottome-title-text']}>
{item?.details}
{item?.inquiryDetails}
</Text>
</View>
</View>
......
......@@ -50,11 +50,14 @@ const InputCaptureCode = (props: Iprops) => {
route: {
params: {
type,
verify: { name, value },
verify: { name },
},
},
navigation,
} = props;
const [value, setValue] = useState<string>(mail)
const styles = useAppStyle(Cstyle);
const renderHeader = () => {
......@@ -105,7 +108,7 @@ const InputCaptureCode = (props: Iprops) => {
}
});
};
console.log(name !== 'paycode', "name !== 'paycode'name !== 'paycode'");
const CodeDom = () => {
return (
<Capture
......@@ -196,6 +199,7 @@ const InputCaptureCode = (props: Iprops) => {
}
};
console.log('name===========', name)
return (
<View style={styles.page}>
<NavBar title={t('formInfo.show.editPassword', '修改密码')} />
......
......@@ -6,6 +6,9 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { RootStackScreenProps } from '../../../routers/types';
import { getManageContentNoticeGet } from '../../../services/ManageV2Api';
import type { GetManageContentNoticeGetResponse } from '../../../services/ManageV2Api';
import NavBar from '../../../components/NavBar';
import useLocale from '../../../hooks/useLocale';
type LoginAgreementScreenNavigationProp =
RootStackScreenProps<'LoginAgreement'>;
......@@ -21,10 +24,9 @@ const LoginAgreement: React.FC<LoginAgreementScreenNavigationProp> = ({
const {
params: { id },
} = route;
const [columnTypeList, setcolumnTypeList] =
useState<GetManageContentNoticeGetResponse | null>(null);
const [columnTypeList, setcolumnTypeList] = useState<GetManageContentNoticeGetResponse | null>(null);
const safeInset = useSafeAreaInsets();
const { t } = useLocale('formInfo');
const findAllByColumnType = async () => {
const res = await getManageContentNoticeGet({ id: `${id}` });
......@@ -40,6 +42,7 @@ const LoginAgreement: React.FC<LoginAgreementScreenNavigationProp> = ({
return (
<View style={{ flex: 1, paddingBottom: safeInset.bottom }}>
<NavBar title={t('formInfo.Login.xieyi', '协议')} />
<WebView source={{ html: columnTypeList?.content || '' }} />
</View>
);
......
......@@ -21,6 +21,7 @@ export default (theme: ThemeStyle) =>
logo: {
width: 97,
height: 68,
resizeMode: 'contain'
},
logoTitle: {
fontSize: 24,
......
import React from 'react';
import React, { useState } from 'react';
import { View, Text, TouchableOpacity } from 'react-native';
import { RequireOrderStatusEnum } from '../../constants';
import { useNavigation } from '@react-navigation/native';
......@@ -6,7 +6,7 @@ import useAppStyle from '../../../../hooks/useAppStyle';
import styles from './styles';
const CommodityItem = props => {
const { data: item, haveFoot = true } = props;
const { data: item, haveFoot = true, onViewInfo } = props;
const myStyle = useAppStyle(styles);
const navigation = useNavigation();
......@@ -62,28 +62,40 @@ const CommodityItem = props => {
</View>
{haveFoot ? (
<View style={myStyle['box-bottome-foot']}>
{item?.status === 3 ? (
<>
<TouchableOpacity
onPress={() => {
onViewInfo(1, item?.id)
}}
style={myStyle['box-bottome-content-button']}
>
<Text style={myStyle['box-bottome-content-button-text']}>
查看报价
</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
onViewInfo(2, item?.id)
}}
style={myStyle['box-bottome-content-button']}
>
<Text style={myStyle['box-bottome-content-button-text']}>
查看反馈
</Text>
</TouchableOpacity>
</>
) : null}
<TouchableOpacity
onPress={() => {
navigation.navigate('RequireOrderDetail', { id: item?.id });
}}
style={myStyle['box-bottome-content-button']}
style={{...myStyle['box-bottome-content-button'], backgroundColor: '#EBF9F6',}}
>
<Text style={myStyle['box-bottome-content-button-text']}>
<Text style={{...myStyle['box-bottome-content-button-text'], color: '#00A98F'}}>
查看单据
</Text>
</TouchableOpacity>
{item?.whetherQuoted ? (
<TouchableOpacity
onPress={() => {
navigation.navigate('RequirePriceOrder', { id: item?.id });
}}
style={myStyle['box-bottome-content-button']}
>
<Text style={myStyle['box-bottome-content-button-text']}>
查看报价
</Text>
</TouchableOpacity>
) : null}
</View>
) : null}
</View>
......
......@@ -178,7 +178,7 @@ export default (theme: ThemeStyle) =>
flexDirection: 'row',
},
'box-bottome-content-button': {
backgroundColor: '#EBF9F6',
backgroundColor: '#F5F6F7',
borderRadius: 4,
height: 24,
width: 72,
......@@ -187,6 +187,6 @@ export default (theme: ThemeStyle) =>
marginRight: 8,
},
'box-bottome-content-button-text': {
color: '#00A98F',
color: '#252D37',
},
});
......@@ -5,6 +5,7 @@ import {
StatusBar,
TouchableOpacity,
FlatList,
Image,
} from 'react-native';
import useAppStyle from '../../hooks/useAppStyle';
import styles from './styles';
......@@ -14,6 +15,7 @@ import FilterBar from './components/filterBar';
import { useNavigation } from '@react-navigation/native';
import FilterModal from './components/FilterModal';
import {
getTransactionMobileAskPurchaseQuoteDetail,
postTransactionMobileAskPurchasePage,
PostTransactionMobileAskPurchasePageRequest as paramType,
PostTransactionMobileAskPurchasePageResponseDetail as dataType,
......@@ -22,6 +24,8 @@ import { RequireOrderSort, RequireOrderStatusOptions } from './constants';
import CommodityItem from './components/CommodityItem';
import OrderNavBar from '../../components/OrderNavBar';
import { formatDateToTime } from '../../utils/date';
import { Card, Modal, Text } from '@ui-kitten/components';
import Close from '../../../assets/images/close.png'
export interface FilterBarType {
label: string;
......@@ -32,7 +36,7 @@ export interface FilterBarType {
const RequireOrder = () => {
const myStyle = useAppStyle(styles);
const { t } = useLocale('order');
const safeInset = useSafeAreaInsets();
const insets = useSafeAreaInsets();
const navigation = useNavigation();
const [searchcriteria, setSearchcriteria] = useState<paramType>({
pageSize: 8,
......@@ -42,6 +46,10 @@ const RequireOrder = () => {
const [visible, setVisible] = useState<boolean>(false); // 显示筛选modal
const ref = useRef<any>({}); // modal的Ref
const pageRef = useRef<number>(1); // 当前页数
const [isModalOpen, setIsModalOpen] = useState<boolean>(false) // 模块框
const [modalInfoList, setModalInfoList] = useState<any[]>([]) // 模块框数据展示
const [modalTitle, setModalTitle] = useState<string>('')
const handleReset = () => {
ref.current.reset();
......@@ -70,6 +78,28 @@ const RequireOrder = () => {
});
};
const onViewInfo = (type: number, id: string) => {
getTransactionMobileAskPurchaseQuoteDetail({id}).then((res: any) => {
if (res.code === 1000) {
const data = res.data
if (type === 1) { // 查看报价
setModalTitle(t('order.requireOrder.quotationInfo', '报价信息'))
setModalInfoList([
{labe: t('order.requireOrder.supplierQuotation', '供应商报价'), value: ${data?.quoteNo}`},
{labe: t('order.requireOrder.factoryQuotation', '厂家报价'), value: `¥ ${data?.quoteNo}`},
])
} else if (type === 2) { // 查看反馈
setModalTitle(t('order.requireOrder.feedbackInformation', '反馈信息'))
setModalInfoList([
{labe: '', value: data?.feedback},
])
}
setIsModalOpen(true)
}
})
}
const renderCommodityItem = ({
item,
index,
......@@ -77,7 +107,7 @@ const RequireOrder = () => {
item: dataType;
index: number;
}) => {
return <CommodityItem data={item} />;
return <CommodityItem data={item} onViewInfo={onViewInfo} />
};
const getProductList = (): Promise<dataType[]> => {
......@@ -181,6 +211,36 @@ const RequireOrder = () => {
onConfirm={handleConfirm}
setVisible={setVisible}
/>
<Modal
style={myStyle.modalCon}
visible={isModalOpen}
backdropStyle={{ backgroundColor: 'rgba(0, 0, 0, 0.5)' }}
>
<View
style={myStyle.modalInfo}
>
<View style={{padding: 14}}>
<View style={myStyle.modalInfoItem} >
<Text style={{width: '85%', textAlign: 'center'}}>{modalTitle}</Text>
<TouchableOpacity onPress={() => setIsModalOpen(false) } >
<Image style={{width: 24, height: 24}} source={Close} />
</TouchableOpacity>
</View>
{
modalInfoList?.map(item => {
return <View style={myStyle.modalInfoItem} >
{
item.labe &&
<Text style={myStyle.modalTitile}>{ item.labe }</Text>
}
<Text> {item.value}</Text>
</View>
})
}
</View>
</View>
</Modal>
</View>
);
};
......
......@@ -190,4 +190,31 @@ export default (theme: ThemeStyle) =>
'box-bottome-content-button-text': {
color: '#00A98F',
},
// 模块弹框
modalCon: {
width: '100%',
height: '100%',
position: 'absolute',
},
modalInfo: {
height: '50%',
width: '100%',
backgroundColor: '#fff',
position: 'absolute',
bottom: 0
},
modalInfoItem: {
flexDirection: 'row',
display: 'flex',
justifyContent: 'space-between',
marginTop: 12,
alignItems: 'center',
fontSize: 14,
},
modalTitile: {
color: '#91959B',
}
});
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