Commit 6ed82115 authored by GuanHua's avatar GuanHua

fix: 装修bug修复

parent 9b46a3c5
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
"@lingxi-disign/core": "^1.7.3", "@lingxi-disign/core": "^1.7.3",
"@lingxi-disign/react": "^1.7.6", "@lingxi-disign/react": "^1.7.6",
"@lingxi-disign/react-web": "^1.7.2", "@lingxi-disign/react-web": "^1.7.2",
"@lingxi-disign/ui": "^1.7.2", "@lingxi-disign/ui": "^1.7.3",
"@turf/turf": "^6.4.0", "@turf/turf": "^6.4.0",
"@types/crypto-js": "^4.0.1", "@types/crypto-js": "^4.0.1",
"@types/js-cookie": "^2.2.6", "@types/js-cookie": "^2.2.6",
......
...@@ -1326,6 +1326,20 @@ export const paramsShop = ( ...@@ -1326,6 +1326,20 @@ export const paramsShop = (
} }
} }
break break
case '16':
propsData = get(pageConfig, ['16', 'props']) || {}
const headerPropsData = get(pageConfig, ['17', 'props']) || {}
const brandListPropsData = get(pageConfig, ['18', 'props']) || {}
_params.adornContent.brand = {
style: 0,
status: propsData.status,
details: {
title: headerPropsData?.title,
explain: headerPropsData?.explain,
ids: brandListPropsData?.brandIds
}
}
break
case '12': case '12':
_params.adornContent.suggestProduct = { _params.adornContent.suggestProduct = {
sort: 1, sort: 1,
......
import { ComponentSchemaType, PROPS_TYPES, PROPS_SETTING_TYPES } from '@lingxi-disign/core';;
const MobileBrand: ComponentSchemaType = {
propsConfig: {
children: {
label: '内容',
type: PROPS_TYPES.string,
},
},
};
const Header: ComponentSchemaType = {
fatherNodesRule: ['MobileBrand.children'],
propsConfig: {
componentType: {
label: '编辑',
type: PROPS_SETTING_TYPES.marketingCardHeader
},
},
};
const List: ComponentSchemaType = {
fatherNodesRule: ['MobileBrand.children'],
propsConfig: {
componentType: {
label: '编辑',
type: PROPS_SETTING_TYPES.mobileQualityBrandList
},
},
};
export default {
MobileBrand,
'MobileBrand.Header': Header,
'MobileBrand.List': List,
};
...@@ -58,6 +58,7 @@ import SuggestProduct from './SuggestProduct' ...@@ -58,6 +58,7 @@ import SuggestProduct from './SuggestProduct'
import OwnBanner from './OwnBanner' import OwnBanner from './OwnBanner'
import MallHeader from './MallHeader' import MallHeader from './MallHeader'
import OwnMainNav from './OwnMainNav' import OwnMainNav from './OwnMainNav'
import MobileBrand from './MobileBrand'
export default { export default {
View, View,
...@@ -110,4 +111,5 @@ export default { ...@@ -110,4 +111,5 @@ export default {
OwnBanner, OwnBanner,
MallHeader, MallHeader,
OwnMainNav, OwnMainNav,
...MobileBrand,
} }
...@@ -170,9 +170,10 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) => ...@@ -170,9 +170,10 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) =>
const recordDetail = () => { const recordDetail = () => {
return useMemo(() => { return useMemo(() => {
if (record) { if (record) {
if (type === 1) { const chooseType = fixtureContext?.formActions.getFieldValue('type')
if (chooseType === 1) {
return ( return (
<> <div style={{ width: '100%' }}>
<div className={styles['banner-record-commodity-detail']}> <div className={styles['banner-record-commodity-detail']}>
<img src={record?.mainPic} /> <img src={record?.mainPic} />
<div className={styles['banner-record-commodity-detail-right']}> <div className={styles['banner-record-commodity-detail-right']}>
...@@ -194,10 +195,10 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) => ...@@ -194,10 +195,10 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) =>
) )
})} })}
</div>} </div>}
</> </div>
) )
} }
if (type === 2) { if (chooseType === 2) {
return ( return (
<div className={styles['banner-record-activity']}> <div className={styles['banner-record-activity']}>
<img src={record?.templatePicUrl} /> <img src={record?.templatePicUrl} />
...@@ -211,7 +212,7 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) => ...@@ -211,7 +212,7 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) =>
</div> </div>
) )
} }
if (type === 3) { if (chooseType === 3) {
return ( return (
<div className={styles['banner-record-integral']}> <div className={styles['banner-record-integral']}>
<img src={record?.mainPic} /> <img src={record?.mainPic} />
...@@ -224,7 +225,7 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) => ...@@ -224,7 +225,7 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) =>
</div> </div>
) )
} }
if (type === 4) { if (chooseType === 4) {
return ( return (
<div className={styles['banner-record-shop']}> <div className={styles['banner-record-shop']}>
<img src={record?.logo} /> <img src={record?.logo} />
...@@ -234,7 +235,7 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) => ...@@ -234,7 +235,7 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) =>
</div> </div>
) )
} }
if (type === 5) { if (chooseType === 5) {
return ( return (
<div className={styles['banner-record-activity']}> <div className={styles['banner-record-activity']}>
<img src={record?.imageUrl} /> <img src={record?.imageUrl} />
...@@ -251,7 +252,7 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) => ...@@ -251,7 +252,7 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) =>
} }
} }
return null return null
}, [type, record]) }, [record])
} }
const _showChoose = useMemo(() => { const _showChoose = useMemo(() => {
......
@import "../../common.less";
.banner {
&-box {
margin-bottom: 16px;
:global {
.ant-upload {
width: 100%;
}
}
&-label {
font-size: 12px;
color: #91959B;
margin-bottom: 8px;
}
&-icon {
height: 96px;
background-color: #FAFBFC;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
overflow: hidden;
&>img {
width: 100%;
}
&-add {
width: 24px;
height: 24px;
}
&:hover {
.banner-box-icon-cover {
display: block;
}
}
&-cover {
position: absolute;
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, .1);
display: none;
z-index: 1;
&-delete {
position: absolute;
right: 10px;
top: 10px;
font-size: 20px;
color: #fff;
}
&-bottom {
cursor: pointer;
position: absolute;
height: 24px;
line-height: 24px;
text-align: center;
background-color: rgba(0, 0, 0, 0.24);
font-size: 12px;
color: #fff;
width: 100%;
bottom: 0;
left: 0;
}
}
}
}
&-record {
&-shop {
position: relative;
height: 56px;
border: 1px solid #EDEEEF;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
padding: 0 8px;
margin-bottom: 8px;
&:hover {
.banner-record-shop-mask {
display: block;
}
}
&-mask {
position: absolute;
width: 100%;
height: 100%;
display: none;
background-color: rgba(0, 0, 0, 0.24);
transition: 0.5s all;
z-index: 6;
&-delete {
position: absolute;
right: 10px;
top: 10px;
font-size: 20px;
color: #fff;
cursor: pointer;
}
}
img {
width: 40px;
height: 40px;
margin-right: 8px;
}
}
}
}
import React, { useState, useMemo } from 'react'
import { Button, Tooltip, Input } from 'antd'
import { changeProps } from '@lingxi-disign/core'
import { DeleteOutlined } from '@ant-design/icons';
import { LAYOUT_TYPE } from '@/constants'
import MixDrawer from '@/pages/editor/components/drawer/mixDrawer';
import styles from './index.less'
interface BrandItemType {
id: number,
name: string,
logoUrl: string,
}
interface MobileQualityBrandListProps {
shopId: number,
brandList: BrandItemType[],
brandIds: number[],
layoutType: LAYOUT_TYPE
}
const MobileBrandList: React.FC<MobileQualityBrandListProps> = (props) => {
const { brandList = [], brandIds = [], shopId, layoutType } = props
const [visible, setVisible] = useState<boolean>(false)
const _onClose = () => {
setVisible(false)
}
const _onConfirm = (record: any) => {
changeProps({
props: Object.assign({ ...props }, {
brandIds: [...brandIds, ...record.map((item) => item.id)],
brandList: [...brandList, ...record]
})
})
setVisible(false)
}
const _handleDeleteItem = (deleteId: number) => {
if (deleteId) {
changeProps({
props: Object.assign({ ...props }, {
brandIds: brandIds.filter((item) => item !== deleteId),
brandList: brandList.filter((item) => item.id !== deleteId)
})
})
}
}
const _recordDetail = useMemo(() => {
if (brandList && brandList.length > 0) {
return brandList.map((item) => (
<div className={styles['banner-record-shop']}>
<img src={item?.logoUrl} />
<Tooltip title={item?.name}>
<span>{item?.name}</span>
</Tooltip>
<div className={styles['banner-record-shop-mask']}>
<DeleteOutlined
className={styles['banner-record-shop-mask-delete']}
onClick={() => _handleDeleteItem(item?.id)}
/>
</div>
</div>
))
}
}, [brandList])
return (
<div className={styles['banner']}>
<div className={styles['banner-box']}>
<div className={styles['banner-box-label']}>推荐品牌</div>
<Button onClick={() => setVisible(true)}>选择</Button>
</div>
{_recordDetail}
<MixDrawer
type={6}
layoutType={layoutType}
visible={visible}
selectId={brandIds}
onConfirm={_onConfirm}
property={1}
onClose={_onClose}
selectType='checkbox'
shopId={shopId}
/>
</div>
)
}
export default MobileBrandList
...@@ -16,6 +16,7 @@ import MarketingCardHeader from './components/marketingCardHeader' ...@@ -16,6 +16,7 @@ import MarketingCardHeader from './components/marketingCardHeader'
import BottomNavigationClient from './components/bottomNavigationClient' import BottomNavigationClient from './components/bottomNavigationClient'
import SuggestProduct from './components/suggestProduct' import SuggestProduct from './components/suggestProduct'
import SuggestProductCommodity from './components/suggestProductCommodity' import SuggestProductCommodity from './components/suggestProductCommodity'
import BrandList from './components/brandList'
import { LAYOUT_TYPE } from '@/constants' import { LAYOUT_TYPE } from '@/constants'
import styles from './index.less' import styles from './index.less'
...@@ -75,6 +76,8 @@ const PropsSettings: React.FC<PropsSettingsPropsType> = (props) => { ...@@ -75,6 +76,8 @@ const PropsSettings: React.FC<PropsSettingsPropsType> = (props) => {
return <SuggestProduct {..._props} /> return <SuggestProduct {..._props} />
case PROPS_SETTING_TYPES.suggestProductCommodity: case PROPS_SETTING_TYPES.suggestProductCommodity:
return <SuggestProductCommodity {..._props} /> return <SuggestProductCommodity {..._props} />
case PROPS_SETTING_TYPES.mobileQualityBrandList:
return <BrandList {..._props} />
default: default:
return null return null
} }
......
...@@ -144,6 +144,42 @@ export const defaultConfig: PageConfigType = { ...@@ -144,6 +144,42 @@ export const defaultConfig: PageConfigType = {
}, },
} }
export const brandListConfig = {
'16': {
title: '推荐品牌',
componentName: 'MobileBrand',
hideAction: true,
props: {
status: true,
style: {
margin: '0 8px 8px 8px'
}
},
childNodes: ['17', '18'],
},
'17': {
title: '标题',
componentName: 'MobileBrand.Header',
props: {
title: '精选品牌',
explain: '享专属优惠',
},
childNodes: [],
},
'18': {
title: '品牌列表',
componentName: 'MobileBrand.List',
props: {
brandIds: [],
brandList: [],
style: {
paddingBottom: 12
}
},
childNodes: [],
},
};
export const suggestProductConfig = { export const suggestProductConfig = {
'12': { '12': {
title: '推荐商品', title: '推荐商品',
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
.app-canvas-container { .app-canvas-container {
display: flex; display: flex;
width: 381px; width: 383px;
margin-top: 40px; margin-top: 40px;
margin-bottom: 52px; margin-bottom: 52px;
justify-content: center; justify-content: center;
......
...@@ -28,6 +28,7 @@ import { ...@@ -28,6 +28,7 @@ import {
couponsModalConfig, couponsModalConfig,
defaultConfig, defaultConfig,
suggestProductConfig, suggestProductConfig,
brandListConfig,
} from './config'; } from './config';
import { import {
marketingConfig_1, marketingConfig_1,
...@@ -153,6 +154,21 @@ const OwnMallTempleteEdit: React.FC<ShopPreviewPropsType> = props => { ...@@ -153,6 +154,21 @@ const OwnMallTempleteEdit: React.FC<ShopPreviewPropsType> = props => {
}); });
}; };
const getBrandList = async (ids: number[]) => {
const param: any = {
current: 1,
pageSize: 20,
shopId,
idInList: ids
};
const res = await PublicApi.getSearchCommodityTemplateGetBrandList(param);
message.destroy()
if (res.code === 1000 && res.data.data) {
return res.data.data
}
return [];
};
const getInfoList = async () => { const getInfoList = async () => {
const param: any = { const param: any = {
current: 1, current: 1,
...@@ -934,6 +950,24 @@ const OwnMallTempleteEdit: React.FC<ShopPreviewPropsType> = props => { ...@@ -934,6 +950,24 @@ const OwnMallTempleteEdit: React.FC<ShopPreviewPropsType> = props => {
} }
} }
if (appConfig?.brand) {
const _details = appConfig?.brand?.details;
brandListConfig['16'].props.status = appConfig?.brand.status
if (_details) {
brandListConfig['17'].props = {
title: _details.title,
explain: _details.explain,
}
brandListConfig['18'].props = {
style: {
paddingBottom: 0
},
brandIds: _details?.ids || [],
brandList: await getBrandList(_details.ids)
}
}
}
if (appConfig?.suggestProduct) { if (appConfig?.suggestProduct) {
// 商品推荐 // 商品推荐
const _details = appConfig?.suggestProduct?.details; const _details = appConfig?.suggestProduct?.details;
...@@ -1001,17 +1035,12 @@ const OwnMallTempleteEdit: React.FC<ShopPreviewPropsType> = props => { ...@@ -1001,17 +1035,12 @@ const OwnMallTempleteEdit: React.FC<ShopPreviewPropsType> = props => {
} }
} }
} }
!_mallLayoutConfig['0'].childNodes.includes('12') &&
_mallLayoutConfig['0'].childNodes.push('12');
_mallLayoutConfig['0'].childNodes = [ _mallLayoutConfig['0'].childNodes = [..._mallLayoutConfig['0'].childNodes, '16', '12','13', '14'];
..._mallLayoutConfig['0'].childNodes,
'13',
'14',
];
const config = { const config = {
..._mallLayoutConfig, ..._mallLayoutConfig,
..._other, ..._other,
...brandListConfig,
..._suggestProductConfig, ..._suggestProductConfig,
..._couponsModalConfig, ..._couponsModalConfig,
...defaultConfig, ...defaultConfig,
......
...@@ -28,6 +28,7 @@ import { ...@@ -28,6 +28,7 @@ import {
couponsModalConfig, couponsModalConfig,
defaultConfig, defaultConfig,
suggestProductConfig, suggestProductConfig,
brandListConfig,
} from './config'; } from './config';
import { import {
marketingConfig_1, marketingConfig_1,
...@@ -168,6 +169,21 @@ const OwnMallTempletePreview: React.FC<ShopPreviewPropsType> = props => { ...@@ -168,6 +169,21 @@ const OwnMallTempletePreview: React.FC<ShopPreviewPropsType> = props => {
}); });
}; };
const getBrandList = async (ids: number[]) => {
const param: any = {
current: 1,
pageSize: 20,
shopId,
idInList: ids
};
const res = await PublicApi.getSearchCommodityTemplateGetBrandList(param);
message.destroy()
if (res.code === 1000 && res.data.data) {
return res.data.data
}
return [];
};
const getInfoList = async () => { const getInfoList = async () => {
const param: any = { const param: any = {
current: 1, current: 1,
...@@ -951,6 +967,24 @@ const OwnMallTempletePreview: React.FC<ShopPreviewPropsType> = props => { ...@@ -951,6 +967,24 @@ const OwnMallTempletePreview: React.FC<ShopPreviewPropsType> = props => {
} }
} }
if (appConfig?.brand) {
const _details = appConfig?.brand?.details;
brandListConfig['16'].props.status = appConfig?.brand.status
if (_details) {
brandListConfig['17'].props = {
title: _details.title,
explain: _details.explain,
}
brandListConfig['18'].props = {
style: {
paddingBottom: 0
},
brandIds: _details?.ids || [],
brandList: await getBrandList(_details.ids)
}
}
}
if (appConfig?.suggestProduct) { if (appConfig?.suggestProduct) {
// 商品推荐 // 商品推荐
const _details = appConfig?.suggestProduct?.details; const _details = appConfig?.suggestProduct?.details;
...@@ -1018,17 +1052,11 @@ const OwnMallTempletePreview: React.FC<ShopPreviewPropsType> = props => { ...@@ -1018,17 +1052,11 @@ const OwnMallTempletePreview: React.FC<ShopPreviewPropsType> = props => {
} }
} }
} }
!_mallLayoutConfig['0'].childNodes.includes('12') && _mallLayoutConfig['0'].childNodes = [..._mallLayoutConfig['0'].childNodes, '16', '12','13', '14'];
_mallLayoutConfig['0'].childNodes.push('12');
_mallLayoutConfig['0'].childNodes = [
..._mallLayoutConfig['0'].childNodes,
'13',
'14',
];
const config = { const config = {
..._mallLayoutConfig, ..._mallLayoutConfig,
..._other, ..._other,
...brandListConfig,
..._suggestProductConfig, ..._suggestProductConfig,
..._couponsModalConfig, ..._couponsModalConfig,
...defaultConfig, ...defaultConfig,
......
...@@ -25,7 +25,8 @@ interface ChannelPreviewPropsType { ...@@ -25,7 +25,8 @@ interface ChannelPreviewPropsType {
* 模板名称 * 模板名称
*/ */
template: string; template: string;
type: number type: number,
shopId: string,
} }
} }
} }
...@@ -33,7 +34,7 @@ interface ChannelPreviewPropsType { ...@@ -33,7 +34,7 @@ interface ChannelPreviewPropsType {
const TemplateList = ['science'] const TemplateList = ['science']
const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => { const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
const { query: { id, template, type } } = props.location const { query: { id, template, type, shopId } } = props.location
const userInfo: any = getAuth() || {} const userInfo: any = getAuth() || {}
const [loading, setLoading] = useState<boolean>(true) const [loading, setLoading] = useState<boolean>(true)
const [theme, setTheme] = useState<string>('theme-channel-science') const [theme, setTheme] = useState<string>('theme-channel-science')
...@@ -74,6 +75,9 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => { ...@@ -74,6 +75,9 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
const params: any = { const params: any = {
memberId: userInfo.memberId memberId: userInfo.memberId
} }
const headers: any = {
shopId
}
PublicApi.getTemplateAdornWebChannelFindAllFirstCategory(params).then(res => { PublicApi.getTemplateAdornWebChannelFindAllFirstCategory(params).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
resolve(res.data) resolve(res.data)
......
...@@ -25,6 +25,7 @@ interface ShopEditPropsType { ...@@ -25,6 +25,7 @@ interface ShopEditPropsType {
* 模板名称 * 模板名称
*/ */
template: string; template: string;
shopId: string,
} }
} }
} }
...@@ -32,7 +33,7 @@ interface ShopEditPropsType { ...@@ -32,7 +33,7 @@ interface ShopEditPropsType {
const TemplateList = ['science'] const TemplateList = ['science']
const ShopEdit: React.FC<ShopEditPropsType> = (props) => { const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
const { query: { id, template } } = props.location const { query: { id, template, shopId } } = props.location
const [loading, setLoading] = useState<boolean>(true) const [loading, setLoading] = useState<boolean>(true)
const [theme, setTheme] = useState<string>('theme-shop-science') const [theme, setTheme] = useState<string>('theme-shop-science')
const [componentConfigs, setComponentConfigs] = useState({}) const [componentConfigs, setComponentConfigs] = useState({})
...@@ -94,7 +95,11 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => { ...@@ -94,7 +95,11 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
memberId, memberId,
roleId: memberRoleId roleId: memberRoleId
} }
PublicApi.getTemplateAdornWebStoreFindAllFirstCategory(param).then(res => {
const headers: any = {
shopId
}
PublicApi.getTemplateAdornWebStoreFindAllFirstCategory(param, { headers }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
resolve(res.data) resolve(res.data)
} }
......
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