Commit 343bab2e authored by ganke's avatar ganke Committed by 许佳敏

fix: srm商城跳转供应商会员的链接修改

(cherry picked from commit ecfdcdeb465f2384f9efe8866d1381c4ac32eb90)
parent 4f7a14e7
......@@ -3,21 +3,118 @@ import styles from "./index.less";
import quality from "./quality.png";
import { CaretDownOutlined } from "@ant-design/icons";
import envConfig from "../../../env.config";
import { Popover } from "antd";
import { getMemberAbilityInfoApplyCondition } from "@/services/MemberV2Api";
import { MEMBER_CENTER_URL } from "@/constants";
import StarRate from "../StarRate";
interface Props {
shopMessage: any;
shopId: any;
logo?: string;
userInfo?:any
shopType?: string
}
function ShopTop (props: Props) {
const { shopMessage, logo } = props;
const { shopMessage, logo, userInfo, shopType } = props;
const [shopMessageNew, setShopMessageNew] = useState<any>({});
const [MemberMessage, setMemberMessage] = useState<any>({});
useEffect(() => {
if (shopMessage) {
setShopMessageNew({ ...shopMessage });
}
}, [shopMessage]);
console.log(userInfo, 'userInfo');
/**
* 是否会员
*/
const fnGetUserStatus = () => {
if (!shopMessage.memberId) {
return;
}
let obj = {
upperMemberId: shopMessage?.memberId,
upperRoleId: shopMessage?.roleId,
shopType: shopType
}
console.log(userInfo);
getMemberAbilityInfoApplyCondition(obj).then((res) => {
setMemberMessage(res.data)
})
}
console.log(shopMessageNew, 'shopMessageNewshopMessageNewshopMessageNewshopMessageNew')
const content = (
<ul className={styles['shop-card-warp']}>
<li className={styles['shop-card-item']}>
<div>
<span className={styles['shop-card-title']}>企业实名:</span>
<span className={styles['shop-card-authentication']}>{
shopMessageNew.status?' 已通过会员认证': '未认证'
}</span>
</div>
<div>
<span className={styles['shop-card-title']}>注册资本:</span>
<span className={styles['shop-card-content']}>{shopMessageNew.registeredCapital || '-'}</span>
</div>
</li>
<li className={styles['shop-card-item']}>
<div>
<span className={styles['shop-card-title']}>满意度:</span>
<span className={styles['shop-card-content']}><StarRate value={shopMessageNew.avgTradeCommentStar} showValue={false}/></span>
</div>
<div>
<span className={styles['shop-card-title']}>成立日期:</span>
<span className={styles['shop-card-content']}>{shopMessageNew.establishmentDate || '-'}</span>
</div>
</li>
<li className={styles['shop-card-item']}>
<div>
<span className={styles['shop-card-title']}>所在地区:</span>
<span className={styles['shop-card-content']}>{shopMessageNew.registerArea || '-'}</span>
</div>
</li>
<li className={styles['shop-card-item-second']}>
<span className={styles['shop-card-title-second']}>累计采购询价:</span>
<span>{shopMessageNew.inquiryNum}</span>
</li>
<li className={styles['shop-card-item-second']}>
<span className={styles['shop-card-title-second']}>累计招标次数:</span>
<span>{shopMessageNew.inviteTenderNum}</span>
</li>
<li className={styles['shop-card-item-second']}>
<span className={styles['shop-card-title-second']}>累计竞价次数:</span>
<span>{shopMessageNew.biddingNum}</span>
</li>
<li className={styles['shop-card-item-second']}>
<span className={styles['shop-card-title-second']}>累计采购全部:</span>
<span>¥{shopMessageNew.purchaseAmount}</span>
</li>
{
MemberMessage.show && (
<li>
<div className={styles['shop-card-btn']}>
申请成为入库供应商
{
MemberMessage.validateId ?
<a href={`${MEMBER_CENTER_URL}/memberCenter/memberAbility/profile/query/detail/basicInfo?&validateId=${MemberMessage.validateId}`} className='all-jump'></a>
:
<a href={`${MEMBER_CENTER_URL}/memberCenter/memberAbility/profile/query/apply?upperMemberId=${shopMessage?.memberId}&upperRoleId=${shopMessage?.roleId}`} className='all-jump'></a>
}
</div>
</li>
)
}
</ul>
)
useEffect(()=>{
fnGetUserStatus();
}, [shopMessage])
return (
<div className={styles["company-man"]}>
......@@ -35,8 +132,10 @@ function ShopTop (props: Props) {
</div>
<ul>
<li className={styles["company-title"]}>
{shopMessageNew ? shopMessageNew.memberName : ""}
<CaretDownOutlined className={styles["company-icon"]} translate={0} />
<Popover content={content}>
{shopMessageNew ? shopMessageNew.memberName : ""}
<CaretDownOutlined className={styles["company-icon"]} translate={0} />
</Popover>
</li>
<li>
<img src={quality} alt="" />
......
......@@ -110,7 +110,7 @@ function CompanyTitle(props: Props) {
<span>{MemberMessage.value}</span>
{
MemberMessage.validateId ?
<a href={`${MEMBER_CENTER_URL}/memberAbility/profile/query/detail/basicInfo?&validateId=${MemberMessage.validateId}`} className='all-jump'></a>
<a href={`${MEMBER_CENTER_URL}/memberCenter/memberAbility/profile/query/detail/basicInfo?&validateId=${MemberMessage.validateId}`} className='all-jump'></a>
:
<a href={`${MEMBER_CENTER_URL}/memberCenter/memberAbility/profile/query/apply?upperMemberId=${shopMessage?.memberId}&upperRoleId=${shopMessage?.roleId}`} className='all-jump'></a>
}
......
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