Commit 57feec5f authored by 赵振东's avatar 赵振东

Merge branch 'v2-test' into 'v2-test'

feat: 首页列表,增加关联NC且是集团供应商/采购商的判断 See merge request project/gaohuaxue-mobile-app!91 (cherry picked from commit 3d2fc1b2) e2760265 feat: 首页列表,增加关联NC且是集团供应商/采购商的判断
parent ef9cc178
...@@ -22,6 +22,7 @@ import { getMemberMobileLoginReget } from '../../services/MemberV2Api'; ...@@ -22,6 +22,7 @@ import { getMemberMobileLoginReget } from '../../services/MemberV2Api';
import { getAsyncStorage } from '../../utils/storage'; import { getAsyncStorage } from '../../utils/storage';
import { USER_INFO } from '../../constants'; import { USER_INFO } from '../../constants';
import i18n from '../../locales'; import i18n from '../../locales';
import { useCurrentRole } from '../../hooks/useCurrentRole';
type HomeNavigationProp = CompositeScreenProps< type HomeNavigationProp = CompositeScreenProps<
RootTabScreenProps<'Home'>, RootTabScreenProps<'Home'>,
...@@ -59,6 +60,7 @@ const Home: React.FC<HomeNavigationProp> = ({ navigation, route }) => { ...@@ -59,6 +60,7 @@ const Home: React.FC<HomeNavigationProp> = ({ navigation, route }) => {
const { t } = useLocale('home'); const { t } = useLocale('home');
const [userInfo, setUerInfo] = useState({}); const [userInfo, setUerInfo] = useState({});
const [initColumn, setInitColumn] = useState([]); const [initColumn, setInitColumn] = useState([]);
const { role: currentRole } = useCurrentRole();
const column = [ const column = [
{ label: t('home.OrderList.1'), icon: order, route: 'OrderList' }, { label: t('home.OrderList.1'), icon: order, route: 'OrderList' },
...@@ -111,8 +113,8 @@ const Home: React.FC<HomeNavigationProp> = ({ navigation, route }) => { ...@@ -111,8 +113,8 @@ const Home: React.FC<HomeNavigationProp> = ({ navigation, route }) => {
useEffect(() => { useEffect(() => {
const _roleType = getCurrentRole()?.roleType; const _roleType = getCurrentRole()?.roleType;
// 会员角色类型,1-服务提供者,2-服务消费者 // 会员角色类型,1-服务提供者,2-服务消费者
const _column = [...column];
if (_roleType === roleType.provider) { if (_roleType === roleType.provider) {
const _column = [...column];
_column.splice(3, 1, { _column.splice(3, 1, {
label: t('home.CheckQuotationOrder'), label: t('home.CheckQuotationOrder'),
icon: verify, icon: verify,
...@@ -123,10 +125,16 @@ const Home: React.FC<HomeNavigationProp> = ({ navigation, route }) => { ...@@ -123,10 +125,16 @@ const Home: React.FC<HomeNavigationProp> = ({ navigation, route }) => {
icon: offer, icon: offer,
route: 'CheckRequireOrder', route: 'CheckRequireOrder',
}); });
if (userInfo.businessProcessingSystem === 1 && (currentRole?.roleName === '集团供应商' || currentRole?.roleName === '集团采购商')) {
_column.splice(1, 1)
}
setInitColumn(_column); setInitColumn(_column);
return; return;
} }
setInitColumn(column); if (userInfo.businessProcessingSystem === 1 && (currentRole?.roleName === '集团供应商' || currentRole?.roleName === '集团采购商')) {
_column.splice(1, 1)
}
setInitColumn(_column);
}, [userInfo?.memberRoleId]); }, [userInfo?.memberRoleId]);
const jumpSetting = () => { 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