Commit 7c80d65f authored by GuanHua's avatar GuanHua

fix: 小程序装修选择商城类型错误问题修复

parent 15c28662
......@@ -14,6 +14,7 @@ interface MixDrawerProps {
// 1商城,3积分商品,4店铺,5资讯, 6品牌,
type: 1 | 3 | 4 | 5 | 6,
shopId?: number,
environment: number,
// 1.B端 2.C端 3.SRM
property: 1 | 2 | 3,
onConfirm: (record: any) => void,
......@@ -46,7 +47,7 @@ const Title_MAPS = {
}
const MixDrawer: React.FC<MixDrawerProps> = (props: MixDrawerProps) => {
const { visible, type, property, onConfirm, onClose, selectId, filterParam, shopId, selectType = 'radio', layoutType } = props;
const { visible, type, property, onConfirm, onClose, selectId, filterParam, shopId, selectType = 'radio', layoutType, environment } = props;
const [dataSource, setDataSource] = useState<any>([]);
const [totalCount, setTotalCount] = useState<number>(0);
const [selectedRowKeys, setSelectedRowKeys] = useState<any>([]);
......@@ -57,6 +58,7 @@ const MixDrawer: React.FC<MixDrawerProps> = (props: MixDrawerProps) => {
const { memberId, memberRoleId } = getAuth() || {}
useEffect(() => {
console.log(environment, 'environment')
setSelectedRowKeys(selectId ? [selectId] : []);
}, [selectId])
......@@ -74,11 +76,16 @@ const MixDrawer: React.FC<MixDrawerProps> = (props: MixDrawerProps) => {
case 1:
if (layoutType !== 'own') {
_params.type = 1;
_params.environment = 4;
_params.environment = environment;
_params.property = property;
_fetch = PublicApi.getManageShopListAdorn;
} else {
_fetch = PublicApi.getManageWebShopWebFindAppSelfShopByCurrMember;
if (environment === 4) {
_fetch = PublicApi.getManageWebShopWebFindAppSelfShopByCurrMember;
} else if (environment === 3) {
_fetch = PublicApi.getManageWebShopWebFindAppletsSelfShopByCurrMember
}
}
if (keyWord) {
......
......@@ -18,6 +18,7 @@ type SettingPanelType = {
interface MobileSettingPanelProps {
shopId: number,
environment: number,
layoutType: LAYOUT_TYPE
}
......
......@@ -25,6 +25,7 @@ interface CardNavItemProps {
// 当前选中组件的key
selectedKey?: any,
shopId: string,
environment: number,
// 频道 1: 积分兑换; 2:公司介绍; 3:成为会员; 4:行情资讯; 5:最近成交
id?: any,
// 1.B端 2.C端 3.SRM
......@@ -135,7 +136,7 @@ const RedirectTypeList = [
const { onFieldInputChange$ } = FormEffectHooks;
const CardNavItem: React.FC<CardNavItemProps> = (props: CardNavItemProps) => {
const { name, type, url, icon, id, empty, shopId, selectedKey, layoutType } = props;
const { name, type, url, icon, id, empty, environment, shopId, selectedKey, layoutType } = props;
const [actVisible, setActVisible] = useState<boolean>(false);
const [record, setRecord] = useState<any>();
const { memberId, memberRoleId } = getAuth() || {}
......@@ -393,6 +394,7 @@ const CardNavItem: React.FC<CardNavItemProps> = (props: CardNavItemProps) => {
onClose={_onMixClose}
type={1}
property={3}
environment={environment}
onConfirm={_onChooseConfirm}
visible={mixVisible}
/>
......
......@@ -25,14 +25,15 @@ interface PropsSettingsPropsType {
pageConfig: PageConfigType,
layoutType: LAYOUT_TYPE,
shopId: number,
environment: number,
}
const PropsSettings: React.FC<PropsSettingsPropsType> = (props) => {
const { selectedInfo, shopId, layoutType, pageConfig } = props
const { selectedInfo, shopId, environment, layoutType, pageConfig } = props
const renderSettingItem = () => {
const { props: initProps, propsConfig, parentKey } = selectedInfo || {};
const _props = { ...initProps, shopId, layoutType, selectedKey: selectedInfo?.selectedKey }
const _props = { ...initProps, shopId, environment, layoutType, selectedKey: selectedInfo?.selectedKey }
const componentType = propsConfig?.componentType
if (componentType) {
......
......@@ -72,6 +72,7 @@ interface ShopPreviewPropsType {
template: string;
type: number;
shopId: number;
environment: number;
};
};
}
......@@ -80,7 +81,7 @@ const TemplateList = ['science'];
const OwnMallTempleteEdit: React.FC<ShopPreviewPropsType> = props => {
const {
query: { id, template, type, shopId },
query: { id, template, type, shopId, environment = 4 },
} = props.location;
const [loading, setLoading] = useState<boolean>(true);
const [theme, setTheme] = useState<string>('theme-mall-science');
......@@ -88,12 +89,6 @@ const OwnMallTempleteEdit: React.FC<ShopPreviewPropsType> = props => {
const { memberId, memberRoleId } = getAuth() || {};
const [templateInfo, setTemplateInfo] = useState<any>()
const headers: any = {
environment: '4',
type: Number(type),
shopId,
};
useEffect(() => {
if (!TemplateList.includes(template)) {
setTheme(`theme-mall-${TemplateList[0]}`);
......@@ -1119,6 +1114,7 @@ const OwnMallTempleteEdit: React.FC<ShopPreviewPropsType> = props => {
</div>
<MobileSettingPanel
shopId={shopId}
environment={Number(environment)}
layoutType={LAYOUT_TYPE.own}
/>
</div>
......
......@@ -63,7 +63,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/edit?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${detailInfo.shopId}`
} 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.shopId}`
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/mobile/edit?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${detailInfo.shopId}&environment=${detailInfo?.environment}`
} else {
message.info("暂不支持该类型模板装修")
}
......@@ -73,7 +73,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
if(detailInfo?.environment === 1) {
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/preview?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${detailInfo.shopId}`
} 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.shopId}`
window.location.href = `/memberCenter/ownMallAbility/ownMallManager/template/mobile/preview?id=${detailInfo.id}&template=${detailInfo.fileName}&shopId=${detailInfo.shopId}&environment=${detailInfo?.environment}`
} else {
message.info("暂不支持该类型模板预览")
}
......
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