Commit 4654bf4d authored by GuanHua's avatar GuanHua

fix: 自营商城模板关联的商城id问题修改

parent 04431beb
......@@ -26,7 +26,7 @@ import Loading from '../components/Loading'
import { getShopInfoById, GlobalConfig } from '@/global/config'
import { getAuth } from '@/utils/auth'
import styles from './index.less'
import { getManageContentInformationFindAllByRecommendLabel, postManageWebShopWebAll } from '@/services/ManageV2Api'
import { getManageContentInformationFindAllByRecommendLabel } from '@/services/ManageV2Api'
import { getSearchShopSelfGetCustomerCategoryTree } from '@/services/SearchV2Api'
import { getTemplateAdornWebSelfFindAdvertsByType, getTemplateAdornWebSelfFindAllFirstCategory, getTemplateAdornWebSelfFindColumn, getTemplateAdornWebSelfMemberCategoryAdorn } from '@/services/TemplateV2Api'
import useBrickAsync from '../hooks/useBrickAsync'
......@@ -201,8 +201,8 @@ const OwnMallEdit: React.FC<ShopEditPropsType> = (props) => {
const mallPath = `${REQUEST_HEADER}${mallInfo?.url}.${TOP_DOMAIN}`
mainNavConfig[mainNavConfig.key].props.menuData = getDefaultMenuData(mallPath, memberId, navData)
topBarConfig[topBarConfig.key].props.shopname = mallInfo?.sourceShopName || mallInfo?.shopName
const shopInfo = getShopInfoById(mallInfo.shopId)
topBarConfig[topBarConfig.key].props.shopname = mallInfo?.shopName
const shopInfo = getShopInfoById(mallInfo?.sourceShopId)
headerConfig[headerConfig.key].props.logoUrl = shopInfo?.logoUrl
}
......
......@@ -26,7 +26,7 @@ import Loading from '../components/Loading'
import { getShopInfoById, GlobalConfig } from '@/global/config'
import { getAuth } from '@/utils/auth'
import styles from './index.less'
import { getManageContentInformationFindAllByRecommendLabel, postManageWebShopWebAll } from '@/services/ManageV2Api'
import { getManageContentInformationFindAllByRecommendLabel } from '@/services/ManageV2Api'
import { getSearchShopSelfGetCustomerCategoryTree } from '@/services/SearchV2Api'
import { getTemplateAdornWebSelfFindAdvertsByType, getTemplateAdornWebSelfFindAllFirstCategory, getTemplateAdornWebSelfFindColumn, getTemplateAdornWebSelfMemberCategoryAdorn, getTemplateWebPageTemplateWebFindSelfTemplateDetails } from '@/services/TemplateV2Api'
......@@ -198,8 +198,8 @@ const OwnMallEdit: React.FC<ShopEditPropsType> = (props) => {
const mallPath = `${REQUEST_HEADER}${mallInfo?.url}.${TOP_DOMAIN}`
mainNavConfig[mainNavConfig.key].props.menuData = getDefaultMenuData(mallPath, memberId, navData)
topBarConfig[topBarConfig.key].props.shopname = mallInfo?.sourceShopName || mallInfo?.shopName
const shopInfo = getShopInfoById(mallInfo.shopId)
topBarConfig[topBarConfig.key].props.shopname = mallInfo?.shopName
const shopInfo = getShopInfoById(mallInfo?.sourceShopId)
headerConfig[headerConfig.key].props.logoUrl = shopInfo?.logoUrl
}
......
......@@ -58,7 +58,7 @@ const TemplateItem: React.FC<TemplateItemPropsType> = (props) => {
<span>{templateInfo.shopName}</span>
</div>
</div>
<div className={cx(styles.template_item_btn, templateInfo.use === 1 ? styles.active : '')}>
<div className={cx(styles.template_item_btn, (templateInfo.use === 1 && templateInfo.shopId) ? styles.active : '')}>
<PlayCircleOutlined />
<label>{templateInfo.use === 1 ? intl.formatMessage({ id: 'shop.template.button.state.enabling' }) : intl.formatMessage({ id: 'shop.template.button.state.enable' })}</label>
</div>
......
......@@ -32,6 +32,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
const intl = useIntl()
const [isMro, setIsMro] = useState<boolean>(false)
const userInfo = getAuth()
const shopId = detailInfo?.shopId || detailInfo?.sourceShopId
const getMemberShopAll = async (environment: number, property: number) => {
const params = {
......@@ -101,20 +102,21 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
const handleLinkEdit = () => {
if(detailInfo?.environment === 1) {
// 自营商城装修
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/edit?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${detailInfo?.sourceShopId || detailInfo.shopId}&property=${detailInfo?.property}`
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/edit?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${shopId}&property=${detailInfo?.property}`
} else if(detailInfo?.environment === 4 || detailInfo?.environment === 3 || detailInfo?.environment === 2) {
// 自营商城装修
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/mobile/edit?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${detailInfo?.sourceShopId || detailInfo.shopId}&environment=${detailInfo?.environment}&property=${detailInfo?.property}`
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/mobile/edit?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${shopId}&environment=${detailInfo?.environment}&property=${detailInfo?.property}`
} else {
message.info(intl.formatMessage({ id: 'shop.template.edit.tip' }))
}
}
const handleLinkPreview = () => {
const shopId = detailInfo?.shopId || detailInfo?.sourceShopId
if(detailInfo?.environment === 1) {
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/preview?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${detailInfo?.sourceShopId || detailInfo.shopId}&property=${detailInfo?.property}`
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/preview?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${shopId}&property=${detailInfo?.property}`
} else if(detailInfo?.environment === 4 || detailInfo?.environment === 3 || detailInfo?.environment === 2) {
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/mobile/preview?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${detailInfo?.sourceShopId || detailInfo.shopId}&environment=${detailInfo?.environment}&property=${detailInfo?.property}`
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/mobile/preview?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${shopId}&environment=${detailInfo?.environment}&property=${detailInfo?.property}`
} else {
message.info(intl.formatMessage({ id: 'shop.template.preview.tip' }))
}
......@@ -125,7 +127,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
message.info(intl.formatMessage({ id: 'shop.template.edit.tip' }))
return
}
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/categoryNavigation?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${detailInfo?.sourceShopId || detailInfo.shopId}&isSelf=1&property=${detailInfo?.property}`
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/categoryNavigation?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${shopId}&isSelf=1&property=${detailInfo?.property}`
}
const onChangeMroSetting = (e) => {
......@@ -190,7 +192,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
</div>
)
}
<div className={cx(styles.btn, detailInfo?.use === 1 ? styles.use : '')} onClick={() => setUseModalVisible(true)}>
<div className={cx(styles.btn, (detailInfo?.use === 1 && detailInfo?.shopId) ? styles.use : '')} onClick={() => setUseModalVisible(true)}>
<PushpinOutlined />
<label>{detailInfo?.use === 1 ? intl.formatMessage({ id: 'shop.template.button.state.using' }) : intl.formatMessage({ id: 'shop.template.button.state.use' })}</label>
</div>
......
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