Commit 2f74c539 authored by GuanHua's avatar GuanHua

fix: srm针对单个采购门户的链接处理

parent bccabccf
......@@ -51,7 +51,7 @@ const SelectMall: React.FC<SelectMallProps> = (props) => {
// className={styles.selectLangBox}
// >
<Space style={{ cursor: 'pointer' }} size={5}>
<a href={PLATFORM_DOMAIN}>{getMessage('locales.huanyinglaidaoguoneizhan', '欢迎来到国内站')}</a>
<span>{getMessage('locales.huanyinglaidaoguoneizhan', '欢迎来到国内站')}</span>
{/* <CaretDownOutlined translate={0} /> */}
</Space>
// </Dropdown>
......@@ -59,4 +59,3 @@ const SelectMall: React.FC<SelectMallProps> = (props) => {
}
export default observer(SelectMall)
import React, { useState, useEffect } from 'react'
import styles from './index.less'
import quality from './quality.png'
import { CaretDownOutlined } from '@ant-design/icons'
import React, { useState, useEffect } from "react";
import styles from "./index.less";
import quality from "./quality.png";
import { CaretDownOutlined } from "@ant-design/icons";
import envConfig from "../../../env.config";
interface Props {
shopMessage:any,
shopId:any
logo?: string
shopMessage: any;
shopId: any;
logo?: string;
}
function ShopTop(props: Props) {
const { shopMessage, logo } = props;
const [shopMessageNew, setShopMessageNew] = useState({});
console.log(shopMessage, '这里是shopMessage的啦啦啦');
useEffect(()=>{
console.log(shopMessage);
if (shopMessage){
setShopMessageNew({...shopMessage});
}
}, [shopMessage])
return (
<div className={styles['company-man']}>
<div style={{position:'relative'}}>
<img src={logo} alt="" className={styles['logn-img']}/>
<a href="/" className="all-jump"></a>
</div>
<div className={styles['company-logo']}>
<img src={shopMessageNew?.logo} alt="" className={styles['company-logo']}/>
<a href={`/shopIndex/${shopMessageNew?.id}`} className="all-jump"></a>
</div>
<ul>
<li className={styles['company-title']}>
{shopMessageNew?shopMessageNew.memberName:''}
<CaretDownOutlined className={styles['company-icon']} translate={0}/>
</li>
<li>
function ShopTop (props: Props) {
const { shopMessage, logo } = props;
const [shopMessageNew, setShopMessageNew] = useState<any>({});
<img src={quality} alt=""/>
<span className={styles['quality-tips']}>
{shopMessageNew?shopMessageNew.creditPoint:'-'}
</span>
</li>
</ul>
</div>
)
useEffect(() => {
if (shopMessage) {
setShopMessageNew({ ...shopMessage });
}
}, [shopMessage]);
return (
<div className={styles["company-man"]}>
<div style={{ position: "relative" }}>
<img src={logo} alt="" className={styles["logn-img"]} />
<a href={envConfig.SINGLE_SRM !== 'undefined' ? `/shopIndex/${shopMessageNew?.id}` : '/'} className="all-jump"></a>
</div>
<div className={styles["company-logo"]}>
<img
src={shopMessageNew?.logo}
alt=""
className={styles["company-logo"]}
/>
<a href={`/shopIndex/${shopMessageNew?.id}`} className="all-jump"></a>
</div>
<ul>
<li className={styles["company-title"]}>
{shopMessageNew ? shopMessageNew.memberName : ""}
<CaretDownOutlined className={styles["company-icon"]} translate={0} />
</li>
<li>
<img src={quality} alt="" />
<span className={styles["quality-tips"]}>
{shopMessageNew ? shopMessageNew.creditPoint : "-"}
</span>
</li>
</ul>
</div>
);
}
export default ShopTop
export default ShopTop;
......@@ -23,7 +23,8 @@ import styles from './index.less'
import { GlobalConfig } from '@/global/config'
interface FilterTopPropsType {
userInfo?: UserInfoType,
mallInfo: MallInfoType
mallInfo: MallInfoType,
mallHomePath: string,
}
type WsMessage = {
......@@ -45,7 +46,7 @@ type WsMessage = {
const FilterTop: SFC<FilterTopPropsType> = (props) => {
// const { langComponent, name, type, shopUrlParam } = props
const { userInfo, mallInfo } = props
const { userInfo, mallInfo, mallHomePath } = props
const SiteStore: SiteStoreModal = useLocalStore(() => new store().SiteStore)
const { siteUrl } = SiteStore
const { getMessage } = useMessageIntl()
......@@ -60,12 +61,12 @@ const FilterTop: SFC<FilterTopPropsType> = (props) => {
}
/**
* 跳转IM
*/
const fnToChatRoom = ()=>{
if (userInfo){
toChatRoom(userInfo.memberId+'',Number(mallInfo.type))
}
* 跳转IM
*/
const fnToChatRoom = () => {
if (userInfo) {
toChatRoom(userInfo.memberId + '',Number(mallInfo.type))
}
}
const ws = useRef<WebSocket | null>(null);
......@@ -101,7 +102,6 @@ const FilterTop: SFC<FilterTopPropsType> = (props) => {
};
}, [ws, webSocketInit, userInfo]);
return (
<div className={styles.topbar}>
<div className={styles.topbar_container}>
......@@ -118,7 +118,7 @@ const FilterTop: SFC<FilterTopPropsType> = (props) => {
{
userInfo ? (
<li className={cx(styles.topbar_menu_item, styles.username)}>
<a className={styles.username} href='/'>{userInfo.name}</a>
<a className={styles.username} href={mallHomePath}>{userInfo.name}</a>
<CaretDownOutlined className={styles.arrow_icon} translate={0} />
<div className={styles.userInfo_card_split}></div>
<div className={styles.userInfo_card}>
......
......@@ -36,7 +36,7 @@ const MallLayout: SFC<LayoutProps> = (props: LayoutProps): JSX.Element | null =>
return (
<>
<TopBar mallInfo={mallInfo} userInfo={userInfo} />
<TopBar mallInfo={mallInfo} userInfo={userInfo} mallHomePath='/' />
<Header logo={mallInfo?.logoUrl || ''} />
<MainNav />
<div className={styles.container}>
......
......@@ -36,7 +36,7 @@ const MallLayout: SFC<LayoutProps> = (
* 查询采购商户信息
*/
const getMemberPurchaseMain = (id: any) => {
let par = {
let par: any = {
id: urlParam?.id,
memberId: "",
roleId: ""
......@@ -86,7 +86,7 @@ const MallLayout: SFC<LayoutProps> = (
return (
<div>
<TopBar mallInfo={mallInfo} userInfo={userInfo} />
<TopBar mallInfo={mallInfo} userInfo={userInfo} mallHomePath={envConfig.SINGLE_SRM !== 'undefined' ? `${SRM_CENTER_URL}/shopIndex/${urlParam?.id}` : ''} />
<ShopTop
shopMessage={{ ...shopMessage }}
logo={mallInfo?.logoUrl}
......
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