Commit 1b926cde authored by GuanHua's avatar GuanHua

fix: 修改获取店铺信息接口

parent bd6c9875
......@@ -29,7 +29,7 @@
.img_list {
display: flex;
flex-wrap: wrap;
}
.shop_url {
......
......@@ -328,7 +328,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
label={<RequireItem label="公司简介" isRequire={true} />}
rules={[{ required: true, message: "请输入公司简介" }]}
>
<Input.TextArea allowClear rows={5} className={styles.form_item} placeholder="请输入公司简介" maxLength={200} />
<Input.TextArea rows={5} className={styles.form_item} placeholder="请输入公司简介" maxLength={200} />
</Form.Item>
<Form.Item
labelAlign="left"
......@@ -346,8 +346,6 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
</div>
))
}
</div>
<UploadImage
imgUrl={""}
large={true}
......@@ -356,6 +354,8 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
onChange={(url) => handleAddworkshopPics(url)}
/>
</div>
</div>
</Form.Item>
<Form.Item
labelAlign="left"
......@@ -373,8 +373,6 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
</div>
))
}
</div>
<UploadImage
imgUrl={""}
large={true}
......@@ -383,6 +381,8 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
onChange={(url) => handleAddhonorPics(url)}
/>
</div>
</div>
</Form.Item>
<Form.Item
labelAlign="left"
......
......@@ -25,7 +25,7 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
const { search } = history.location.query
useEffect(() => {
if (!!search) {
if (search) {
setSearchValue(search)
} else {
setSearchValue("")
......@@ -48,13 +48,12 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
const applyFroVip = () => {
if (shopInfo) {
let param = {
const param = {
memberId: shopInfo.memberId,
roleId: shopInfo.roleId
}
setApplyLoading(true)
PublicApi.postMemberAbilityMallSubApply(param).then((res) => {
if (res.code === 1000) { }
setApplyLoading(false)
}).catch(() => {
setApplyLoading(false)
......@@ -63,8 +62,8 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
}
const handleCollect = () => {
let status = !collectState
let param = {
const status = !collectState
const param = {
shopId: shopInfo.id,
status
}
......@@ -101,7 +100,7 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
</div>
<div className={styles.shop_header_info_content}>
<div className={styles.shop_header_info_content_name}>
<span>{shopInfo?.company}</span>
<span>{shopInfo?.memberName}</span>
<CaretDownOutlined className={styles.shop_header_info_content_icon} />
</div>
<div className={styles.shop_header_info_content_about}>
......@@ -112,7 +111,7 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
</div>
<div className={styles.shop_header_info_content_about_item}>
<i className={styles.icon}><img src={credit_icon} /></i>
<span>{200}</span>
<span>{shopInfo?.creditPoint || 0}</span>
</div>
</div>
</div>
......
......@@ -67,7 +67,7 @@ const TopBar: React.FC<TopBarPropsType> = (props) => {
{
userInfo ? (
<li className={cx(styles.topbar_menu_item, styles.username)}>
<span className={styles.username}>{userInfo?.name}</span>
<Link className={styles.username} to="/memberCenter/home">{userInfo?.name}</Link>
<CaretDownOutlined className={styles.arrow_icon} />
<div className={styles.userInfo_card_split}></div>
<div className={styles.userInfo_card}>
......
......@@ -85,11 +85,11 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
<Fragment>
<Helmet>
{
shopInfo ? <title>{shopInfo.company}</title> : null
shopInfo ? <title>{shopInfo.memberName}</title> : null
}
</Helmet>
<div className={styles.lxmall_page}>
<TopBar langComponent={<SelectLang />} name={shopInfo?.company} type={LAYOUT_TYPE.channel} shopUrlParam={channelId} />
<TopBar langComponent={<SelectLang />} name={shopInfo?.memberName} type={LAYOUT_TYPE.channel} shopUrlParam={channelId} />
<div className={styles.content}>
{
!menuRouter?.hideHeader && (
......
......@@ -85,11 +85,11 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
<Fragment>
<Helmet>
{
shopInfo ? <title>{shopInfo.company}</title> : null
shopInfo ? <title>{shopInfo.memberName}</title> : null
}
</Helmet>
<div className={styles.lxmall_page}>
<TopBar langComponent={<SelectLang />} name={shopInfo?.company} type={LAYOUT_TYPE.ichannel} shopUrlParam={channelId} />
<TopBar langComponent={<SelectLang />} name={shopInfo?.memberName} type={LAYOUT_TYPE.ichannel} shopUrlParam={channelId} />
<div className={styles.content}>
{
!menuRouter?.hideHeader && (
......
......@@ -64,10 +64,17 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
const fetchShopInfo = (memberId, roleId, storeId) => {
const param: any = {
memberId,
roleId,
storeId
}
PublicApi.getTemplateShopFindShop(param).then(res => {
let getShopInfoFn = null
if(storeId) {
param.storeId = storeId
getShopInfoFn = PublicApi.getTemplateWebMemberShopWebMemberShopMain
} else if(roleId) {
param.roleId = roleId
getShopInfoFn = PublicApi.getTemplateWebMemberShopWebFindByMemberIdAndRoleId
}
console.log(param, "param")
getShopInfoFn && getShopInfoFn(param).then(res => {
if (res.code === 1000) {
setShopInfo(res.data)
}
......@@ -107,7 +114,7 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
<ShopHeader logo={mallInfo.logoUrl} shopId={query.shopId} shopUrlParam={shopId} shopInfo={shopInfo} updateShopInfo={() => handleUpdate()} />
<MainNav menuData={menuData} pathname={location.pathname} type={LAYOUT_TYPE.shop} shopId={query.shopId} shopUrlParam={shopId} />
{
!loading ? shopInfo ? shopInfo.status === 1 ? children && React.Children.map(children, (child: any) => {
!loading ? shopInfo ? children && React.Children.map(children, (child: any) => {
return React.cloneElement(child,
{
layoutType: LAYOUT_TYPE.shop,
......@@ -118,7 +125,7 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
updateShopInfo: () => handleUpdate()
},
);
}) : <SearchShopResult search={shopInfo.company} /> : <SearchShopResult /> : null
}) : <SearchShopResult search={shopInfo.company} /> : <SearchShopResult />
}
</div>
<Footer />
......
......@@ -29,7 +29,7 @@
.img_list {
display: flex;
flex-wrap: wrap;
}
.shop_url {
......
......@@ -65,7 +65,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
roleId: memberRoleId
}
PublicApi.getTemplateShopFindShop(param).then(res => {
PublicApi.getTemplateWebMemberShopWebFindCurrMemberShop(param).then(res => {
const data = res.data
if (res.code === 1000) {
setShopInfo(data)
......@@ -156,7 +156,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
value.storeUrl = storeUrl || `${siteUrl}/shop`
value.shopId = shopId
PublicApi.postTemplateShopSaveShop(value).then(res => {
PublicApi.postTemplateWebMemberShopWebSaveCurrMemberShop(value).then(res => {
if (res.code === 1000) {
fetchShopInfo()
setFormIsHalfFilledOut(false)
......@@ -326,7 +326,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
label={<RequireItem label="公司简介" isRequire={true} />}
rules={[{ required: true, message: "请输入公司简介" }]}
>
<Input.TextArea allowClear rows={5} className={styles.form_item} placeholder="请输入公司简介" maxLength={200} />
<Input.TextArea rows={5} className={styles.form_item} placeholder="请输入公司简介" maxLength={200} />
</Form.Item>
<Form.Item
labelAlign="left"
......@@ -344,8 +344,6 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
</div>
))
}
</div>
<UploadImage
imgUrl={""}
large={true}
......@@ -354,6 +352,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
onChange={(url) => handleAddworkshopPics(url)}
/>
</div>
</div>
</Form.Item>
<Form.Item
labelAlign="left"
......@@ -370,8 +369,6 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
</div>
))
}
</div>
<UploadImage
imgUrl={""}
large={true}
......@@ -380,6 +377,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
onChange={(url) => handleAddhonorPics(url)}
/>
</div>
</div>
</Form.Item>
<Form.Item
labelAlign="left"
......
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