Commit e2760265 authored by 赵振东's avatar 赵振东

feat: 首页列表,增加关联NC且是集团供应商/采购商的判断

parent 0814c0d5
......@@ -22,6 +22,7 @@ import { getMemberMobileLoginReget } from '../../services/MemberV2Api';
import { getAsyncStorage } from '../../utils/storage';
import { USER_INFO } from '../../constants';
import i18n from '../../locales';
import { useCurrentRole } from '../../hooks/useCurrentRole';
type HomeNavigationProp = CompositeScreenProps<
RootTabScreenProps<'Home'>,
......@@ -59,6 +60,7 @@ const Home: React.FC<HomeNavigationProp> = ({ navigation, route }) => {
const { t } = useLocale('home');
const [userInfo, setUerInfo] = useState({});
const [initColumn, setInitColumn] = useState([]);
const { role: currentRole } = useCurrentRole();
const column = [
{ label: t('home.OrderList.1'), icon: order, route: 'OrderList' },
......@@ -111,8 +113,8 @@ const Home: React.FC<HomeNavigationProp> = ({ navigation, route }) => {
useEffect(() => {
const _roleType = getCurrentRole()?.roleType;
// 会员角色类型,1-服务提供者,2-服务消费者
if (_roleType === roleType.provider) {
const _column = [...column];
if (_roleType === roleType.provider) {
_column.splice(3, 1, {
label: t('home.CheckQuotationOrder'),
icon: verify,
......@@ -123,10 +125,16 @@ const Home: React.FC<HomeNavigationProp> = ({ navigation, route }) => {
icon: offer,
route: 'CheckRequireOrder',
});
if (userInfo.businessProcessingSystem === 1 && (currentRole?.roleName === '集团供应商' || currentRole?.roleName === '集团采购商')) {
_column.splice(1, 1)
}
setInitColumn(_column);
return;
}
setInitColumn(column);
if (userInfo.businessProcessingSystem === 1 && (currentRole?.roleName === '集团供应商' || currentRole?.roleName === '集团采购商')) {
_column.splice(1, 1)
}
setInitColumn(_column);
}, [userInfo?.memberRoleId]);
const jumpSetting = () => {
......
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