Commit 9f0fa3fb authored by GuanHua's avatar GuanHua
parents 947080ec ad7a4e85
...@@ -3,11 +3,15 @@ export interface ShopInfo { ...@@ -3,11 +3,15 @@ export interface ShopInfo {
name: string; name: string;
type: number; type: number;
environment: number; environment: number;
property?: any;
self: number;
memberOperate: number;
logoUrl: string; logoUrl: string;
describe: string; describe: string;
state: number; state: number;
url: string; url: string;
isDefault: number; isDefault?: any;
createTime?: any;
} }
export interface OrderMode { export interface OrderMode {
...@@ -28,7 +32,7 @@ export interface SiteInfo { ...@@ -28,7 +32,7 @@ export interface SiteInfo {
name: string; name: string;
logo: string; logo: string;
siteUrl: string; siteUrl: string;
symbol: string; symbol?: any;
} }
export interface Site { export interface Site {
......
...@@ -82,6 +82,7 @@ ...@@ -82,6 +82,7 @@
align-items: center; align-items: center;
width: 100%; width: 100%;
margin-bottom: 8px; margin-bottom: 8px;
color: #303133;
.activityImg { .activityImg {
width: 24px; width: 24px;
......
...@@ -6,7 +6,7 @@ import { unstable_batchedUpdates } from 'react-dom'; ...@@ -6,7 +6,7 @@ import { unstable_batchedUpdates } from 'react-dom';
import styles from './product.less'; import styles from './product.less';
import { priceFormat } from '@/utils/numberFomat'; import { priceFormat } from '@/utils/numberFomat';
import StatusTag from '@/components/StatusTag'; import StatusTag from '@/components/StatusTag';
import defaultActivityImage from '@/asserts/activity/ActivityImage.svg';
interface Iprops { interface Iprops {
onEdit?: ((data: { id: number, activityId: number}) => void) | null, onEdit?: ((data: { id: number, activityId: number}) => void) | null,
...@@ -30,7 +30,7 @@ interface Iprops { ...@@ -30,7 +30,7 @@ interface Iprops {
const defaultLabel = []; const defaultLabel = [];
const Product: React.FC<Iprops> = (props: Iprops) => { const Product: React.FC<Iprops> = (props: Iprops) => {
const { onEdit, onRemove, productName, productImgUrl, id, activityId, price, activityList, isWithLabels, activityImage, label = defaultLabel, onLabelChange = null } = props; const { onEdit, onRemove, productName, productImgUrl, id, activityId, price, activityList, isWithLabels, activityImage = defaultActivityImage, label = defaultLabel, onLabelChange = null } = props;
const [inputVisible, setInputVisible] = useState<boolean>(false); const [inputVisible, setInputVisible] = useState<boolean>(false);
const [inputValue, setInputValue] = useState<string>(""); const [inputValue, setInputValue] = useState<string>("");
const inputRef = useRef<(Input) | null>(null); const inputRef = useRef<(Input) | null>(null);
...@@ -168,11 +168,11 @@ const Product: React.FC<Iprops> = (props: Iprops) => { ...@@ -168,11 +168,11 @@ const Product: React.FC<Iprops> = (props: Iprops) => {
{ {
activityList?.map((_item) => { activityList?.map((_item) => {
return ( return (
<div className={styles.activityItem} key={_item.id}> <a className={styles.activityItem} key={_item.id} href={`/marketingManage/marketing/marketingSearch/preview?id=${_item.id}`} target="_blank">
<img className={styles.activityImg} src={activityImage} /> <img className={styles.activityImg} src={activityImage} />
<span className={styles.activityName}>{_item.name}</span> <span className={styles.activityName}>{_item.name}</span>
<StatusTag type="danger" title={_item.type}></StatusTag> <StatusTag type="danger" title={_item.type}></StatusTag>
</div> </a>
); );
}) })
} }
......
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { updatePageConfig } from '@lingxi-disign/core'; import { updatePageConfig } from '@lingxi-disign/react';
import { cloneDeep } from 'lodash'; import { cloneDeep } from 'lodash';
import pageConfig from '../schema/pageConfig'; import pageConfig from '../schema/pageConfig';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
...@@ -92,7 +92,8 @@ function useGetLayout() { ...@@ -92,7 +92,8 @@ function useGetLayout() {
childProps: { childProps: {
otherProps: { otherProps: {
type: `${_child}Item`, type: `${_child}Item`,
} },
childNodes: [],
}, },
canDelete: false, canDelete: false,
addBtnText: '添加子节点', addBtnText: '添加子节点',
...@@ -118,6 +119,8 @@ function useGetLayout() { ...@@ -118,6 +119,8 @@ function useGetLayout() {
...cloneconfig, ...cloneconfig,
...config ...config
}; };
console.log("fuck",newConfig)
setDataSourceFromRequest(dataFromRequest); setDataSourceFromRequest(dataFromRequest);
updatePageConfig(newConfig); updatePageConfig(newConfig);
}, [info]); }, [info]);
......
...@@ -28,7 +28,7 @@ type SettingPanelType = { ...@@ -28,7 +28,7 @@ type SettingPanelType = {
} }
const ComponentSchema = { const ComponentSchema = {
tabItem: tabTitleSchema, // tabItem: tabTitleSchema,
secondaryItem: secondaryTabSchema, secondaryItem: secondaryTabSchema,
flashSale: blockSchema, flashSale: blockSchema,
flashSaleItem: flashSaleSchema, flashSaleItem: flashSaleSchema,
...@@ -74,7 +74,7 @@ const EditPanel = () => { ...@@ -74,7 +74,7 @@ const EditPanel = () => {
* 但当一级类型没有被选择的时候,那么必须选择一级导航类型 * 但当一级类型没有被选择的时候,那么必须选择一级导航类型
*/ */
useEffect(() => { useEffect(() => {
if (activeKey === null || previousActiveKey !== activeKey || (selectedInfo as any)?.otherProps?.type === 'tabItem') { if (activeKey === null && previousActiveKey !== activeKey) {
if(activeKey === null) { if(activeKey === null) {
message.info("请先选择一级导航类型"); message.info("请先选择一级导航类型");
} }
...@@ -243,7 +243,7 @@ const EditPanel = () => { ...@@ -243,7 +243,7 @@ const EditPanel = () => {
}; };
const currentProps = type === 0 && componentType.includes('suggestProduct') ? formValueToProps['suggestProduct'] : formValueToProps[componentType]; const currentProps = type === 0 && componentType.includes('suggestProduct') ? formValueToProps['suggestProduct'] : formValueToProps[componentType];
if(componentType === 'suggestProduct' || type === 0) { if(componentType.includes('suggestProduct') && type === 0) {
setType(values.type); setType(values.type);
} }
changeProps({ changeProps({
......
...@@ -15,6 +15,12 @@ export const tabTitleSchema: ISchema = { ...@@ -15,6 +15,12 @@ export const tabTitleSchema: ISchema = {
type: 'string', type: 'string',
title: "{{ text('类型', help('注意:当一级导航确认选择后,不能修改。')) }}", title: "{{ text('类型', help('注意:当一级导航确认选择后,不能修改。')) }}",
enum: [], enum: [],
"x-rules": [
{
required: true,
message: '请选择一级品类'
}
]
}, },
title: { title: {
type: 'string', type: 'string',
...@@ -40,6 +46,12 @@ export const secondaryTabSchema: ISchema = { ...@@ -40,6 +46,12 @@ export const secondaryTabSchema: ISchema = {
type: 'string', type: 'string',
title: '类型', title: '类型',
enum: [], enum: [],
"x-rules": [
{
required: true,
message: '请选择二级类型'
}
]
}, },
title: { title: {
type: 'string', type: 'string',
...@@ -56,6 +68,12 @@ export const secondaryTabSchema: ISchema = { ...@@ -56,6 +68,12 @@ export const secondaryTabSchema: ISchema = {
children: null, children: null,
maxCount: 1, maxCount: 1,
}, },
"x-rules": [
{
required: true,
message: '请上传图片'
}
]
} }
} }
} }
...@@ -77,8 +95,13 @@ export const blockSchema: ISchema = { ...@@ -77,8 +95,13 @@ export const blockSchema: ISchema = {
blockTitle: { blockTitle: {
type: 'string', type: 'string',
title: '标题', title: '标题',
"x-rules": [
{
required: true,
message: '请填写标题'
}
]
}, },
} }
} }
} }
...@@ -124,12 +147,20 @@ export const saleRankSchema: ISchema = { ...@@ -124,12 +147,20 @@ export const saleRankSchema: ISchema = {
rankProduct: { rankProduct: {
type: 'object', type: 'object',
"x-component": 'FormilyCommodity', "x-component": 'FormilyCommodity',
"x-component-props": {
commodityKey: 'saleRanking'
}
}, },
sale: { sale: {
type: 'string', type: 'string',
title: '销量', title: '销量',
"x-rules": [
{
required: true,
message: '请填写销量',
}
]
} }
} }
} }
} }
...@@ -209,7 +240,7 @@ export const productListSchema: ISchema = { ...@@ -209,7 +240,7 @@ export const productListSchema: ISchema = {
} }
}; };
/** 销量排行schema */ /** 精选商品schema */
export const commoditySchema: ISchema = { export const commoditySchema: ISchema = {
type: 'Object', type: 'Object',
properties: { properties: {
...@@ -225,11 +256,11 @@ export const commoditySchema: ISchema = { ...@@ -225,11 +256,11 @@ export const commoditySchema: ISchema = {
"x-component": 'FormilyCommodity', "x-component": 'FormilyCommodity',
'x-component-props': { 'x-component-props': {
isWithLabels: true, isWithLabels: true,
commodityKey: 'suggestProduct'
} }
}, },
} }
} }
} }
}; };
...@@ -6,7 +6,13 @@ import { useFilterSameOption } from '../../common/hooks/useFilterSameOption'; ...@@ -6,7 +6,13 @@ import { useFilterSameOption } from '../../common/hooks/useFilterSameOption';
import { Product } from '@/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/components/ProductPanel'; import { Product } from '@/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/components/ProductPanel';
import CommodityDrawer from '@/pages/pageCustomized/components/drawers/commodityDrawer'; import CommodityDrawer from '@/pages/pageCustomized/components/drawers/commodityDrawer';
type ComponentTypeProps = {
activityType: number,
commodityKey: 'saleRanking' | 'suggestProduct',
isWithLabels?: boolean
} & {
[key: string]: any
}
interface Iprops { interface Iprops {
value: { value: {
id: number, id: number,
...@@ -19,11 +25,7 @@ interface Iprops { ...@@ -19,11 +25,7 @@ interface Iprops {
label: string[], label: string[],
}, },
props: { props: {
['x-component-props']: { ['x-component-props']: ComponentTypeProps,
activityType: number,
} & {
[key: string]: any
},
}, },
mutators: { mutators: {
change: (params: any) => void change: (params: any) => void
...@@ -37,9 +39,8 @@ const FormilyCommodity: React.FC<Iprops> & { isFieldComponent: boolean } = (prop ...@@ -37,9 +39,8 @@ const FormilyCommodity: React.FC<Iprops> & { isFieldComponent: boolean } = (prop
const { activeKey } = useSelector<any, "activeKey" >(['activeKey']); const { activeKey } = useSelector<any, "activeKey" >(['activeKey']);
const fixtureContext = useContext(context); const fixtureContext = useContext(context);
const sameKeyState = useFilterSameOption(); const sameKeyState = useFilterSameOption();
const disabledSaleRankingKeys = useMemo(() => sameKeyState[`tabItem_${activeKey}_saleRanking`], [sameKeyState, activeKey]); const componentProps = props.props?.['x-component-props'] || {} as ComponentTypeProps;
const disabledSaleRankingKeys = useMemo(() => sameKeyState[`tabItem_${activeKey}_${componentProps.commodityKey}`], [sameKeyState, activeKey]);
const componentProps = props.props?.['x-component-props'] || {};
const { state: productVisible, toggle: setProductVisible } = useToggle(); const { state: productVisible, toggle: setProductVisible } = useToggle();
const productProps = useMemo(() => ({ const productProps = useMemo(() => ({
......
...@@ -177,7 +177,8 @@ const CustomizeTabs: React.FC<Iprops> & { TabItem: typeof TabItem } = (props: Ip ...@@ -177,7 +177,8 @@ const CustomizeTabs: React.FC<Iprops> & { TabItem: typeof TabItem } = (props: Ip
}, },
otherProps: { otherProps: {
type: `${_item}Item` type: `${_item}Item`
} },
childNodes: [],
}; };
cloneDeepPageConfig[parentKey].childNodes.push(`${parentKey}-${_rowKey + 1}`); cloneDeepPageConfig[parentKey].childNodes.push(`${parentKey}-${_rowKey + 1}`);
}); });
...@@ -189,7 +190,9 @@ const CustomizeTabs: React.FC<Iprops> & { TabItem: typeof TabItem } = (props: Ip ...@@ -189,7 +190,9 @@ const CustomizeTabs: React.FC<Iprops> & { TabItem: typeof TabItem } = (props: Ip
props: _row, props: _row,
otherProps: { otherProps: {
type: `${_item}Item` type: `${_item}Item`
} },
childNodes: [],
}; };
cloneDeepPageConfig[parentKey].childNodes.push(`${parentKey}-${_rowKey + 1}`); cloneDeepPageConfig[parentKey].childNodes.push(`${parentKey}-${_rowKey + 1}`);
}); });
......
...@@ -19,6 +19,7 @@ import CustomInputSearch from '@/components/NiceForm/components/CustomInputSearc ...@@ -19,6 +19,7 @@ import CustomInputSearch from '@/components/NiceForm/components/CustomInputSearc
import CustomCategorySearch from '@/components/NiceForm/components/CustomCategorySearch'; import CustomCategorySearch from '@/components/NiceForm/components/CustomCategorySearch';
import ActivityImage from '@/asserts/activity/ActivityImage.svg'; import ActivityImage from '@/asserts/activity/ActivityImage.svg';
import moment from 'moment';
...@@ -55,14 +56,15 @@ const CommodityDrawer: React.FC<CommodityDrawerProps> = (props: CommodityDrawerP ...@@ -55,14 +56,15 @@ const CommodityDrawer: React.FC<CommodityDrawerProps> = (props: CommodityDrawerP
<> <>
{record?.activityList?.map((item, index) => { {record?.activityList?.map((item, index) => {
return ( return (
<div key={index} style={{ marginBottom: 8 }}> <a key={index} style={{ marginBottom: 8 }} href={`/marketingManage/marketing/marketingSearch/preview?id=${item.id}`} target={"_blank"}>
<Space direction='horizontal'> <Space direction='horizontal'>
<img src={ActivityImage} style={{ width: 24, height: 24, borderRadius: 4 }} /> <img src={ActivityImage} style={{ width: 24, height: 24, borderRadius: 4 }} />
<span>{item?.name}</span> <span>{item?.name}</span>
<div className={styles['defaultTag']}>{item?.type}</div> <div className={styles['defaultTag']}>{item?.type}</div>
<StatusTag title={item?.belongType === 1 ? '平台活动' : '商家活动'} type={item?.belongType === 1 ? 'primary' : 'success'} /> <StatusTag title={item?.belongType === 1 ? '平台活动' : '商家活动'} type={item?.belongType === 1 ? 'primary' : 'success'} />
<div style={{color: '#301333'}}>有效期:{item.startTime && moment(item.startTime).format('YYYY-MM-DD HH:mm:ss')}{item.endTime && moment(item.endTime).format('YYYY-MM-DD HH:mm:ss')} </div>
</Space> </Space>
</div> </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