Commit 3570e92c authored by GuanHua's avatar GuanHua

chore: 更新装修依赖的版本号

parent 2716147e
......@@ -58,10 +58,10 @@
"@ctrl/tinycolor": "^3.4.0",
"@formily/antd": "^1.3.3",
"@formily/antd-components": "^1.3.3",
"@lingxi-disign/core": "^1.0.1",
"@lingxi-disign/react": "^1.0.3",
"@lingxi-disign/core": "^1.0.4",
"@lingxi-disign/react": "^1.0.4",
"@lingxi-disign/react-web": "^1.0.2",
"@lingxi-disign/ui": "^1.0.1",
"@lingxi-disign/ui": "^1.0.4",
"@turf/turf": "^6.4.0",
"@types/crypto-js": "^4.0.1",
"@types/js-cookie": "^2.2.6",
......
......@@ -37,7 +37,6 @@ const MarketingSwitch: React.FC<MarketingSwitchProps> = (props: any) => {
indexKey = "6"
}
const _insertIndex = _pageConfig['0'].childNodes.indexOf(indexKey);
console.log(_pageConfig['0'].childNodes, _insertIndex, indexKey, '_insertIndex')
_pageConfig['0'].childNodes?.splice(_insertIndex, 0, `11-${type}`);
updatePageConfig(_pageConfig);
} else {
......
......@@ -25,7 +25,7 @@ interface CardNavItemProps {
// 当前选中组件的key
selectedKey?: any,
shopId: string,
// 频道 1: 店铺中心; 2:人气店铺; 3:行情资讯; 4:积分兑换
// 频道 1: 积分兑换; 2:公司介绍; 3:成为会员; 4:行情资讯; 5:最近成交
id?: any,
// 1.B端 2.C端 3.SRM
property?: 1 | 2 | 3,
......
import React, { useState, useEffect } from 'react';
import React, { useState, useEffect, useRef } from 'react';
import { history } from 'umi';
import { Button, Tooltip } from 'antd';
import { Button, Tooltip, Input, Tag } from 'antd';
import cloneDeep from 'lodash/cloneDeep';
import { PlusOutlined } from '@ant-design/icons'
import { changeProps, updatePageConfig, PageConfigType } from '@lingxi-disign/core';
import StatusTag from '@/components/StatusTag'
......@@ -19,6 +20,7 @@ import styles from './index.less';
interface MarketingCardGoodProps {
id?: any,
tags?: any,
actType?: any,
exType?: any
// 当前选中组件的key
......@@ -28,12 +30,18 @@ interface MarketingCardGoodProps {
}
const MarketingCardGood: React.FC<MarketingCardGoodProps> = (props: MarketingCardGoodProps) => {
const { id, actType, exType, pageConfig, layoutType } = props;
const { id, actType, exType, pageConfig, tags, layoutType } = props;
const { query: { shopId } }: any = history.location
const [editInputIndex, setEditInputIndex] = useState(-1);
const [record, setRecord] = useState<any>([]);
const [actVisible, setActVisible] = useState(false);
const { memberId, memberRoleId } = getAuth() || {}
const saveEditInputRef = useRef<any>({});
const [editInputValue, setEditInputValue] = useState<any>('');
const [inputValue, setInputValue] = useState<any>('');
const [inputVisible, setInputVisible] = useState(false);
const saveInputRef = useRef<any>({});
useEffect(() => {
if (id && id != record[0]?.id) {
......@@ -47,6 +55,18 @@ const MarketingCardGood: React.FC<MarketingCardGoodProps> = (props: MarketingCar
}
}, [id])
useEffect(() => {
if (inputVisible) {
saveInputRef?.current?.focus();
}
}, [inputVisible])
useEffect(() => {
if (editInputIndex > -1 && editInputValue) {
saveEditInputRef?.current?.focus();
}
}, [editInputIndex, editInputValue])
const fetchData = async (params: GetMarketingAdornActivityGoodsAdornRequest) => {
const common: any = {
...params,
......@@ -204,6 +224,47 @@ const MarketingCardGood: React.FC<MarketingCardGoodProps> = (props: MarketingCar
const _record = record[0];
const _handleClose = (removedTag: any) => {
const _tags = tags?.filter(tag => tag !== removedTag);
changeProps({
props: Object.assign({ ...props }, { tags: _tags })
});
};
const _handleEditInputChange = (e: any) => {
setEditInputValue(e.target.value);
}
const _handleEditInputConfirm = () => {
const newTags = [...tags];
newTags[editInputIndex] = editInputValue;
setEditInputIndex(-1);
setEditInputValue('');
changeProps({
props: Object.assign({ ...props }, { tags: newTags })
});
}
const _handleInputChange = (e: any) => {
setInputValue(e.target.value);
}
const _handleInputConfirm = () => {
let _tags = tags ? [...tags] : [];
if (inputValue && _tags.indexOf(inputValue) === -1) {
_tags = [..._tags, inputValue];
}
setInputVisible(false);
setInputValue('');
changeProps({
props: Object.assign({ ...props }, { tags: _tags })
});
};
const _showInput = () => {
setInputVisible(true)
}
return (
<div className={styles['suggestProductCommodity']}>
{id && record.length > 0 ? (
......@@ -234,6 +295,75 @@ const MarketingCardGood: React.FC<MarketingCardGoodProps> = (props: MarketingCar
)
})}
</div>
<div className={styles['suggestProductCommodity-box']}>
<div className={styles['suggestProductCommodity-box-label']}>活动标签</div>
<>
{tags?.map((tag, index) => {
if (editInputIndex === index) {
return (
<Input
ref={saveEditInputRef}
key={index}
size="small"
className={styles['tag-input']}
defaultValue={editInputValue}
onChange={_handleEditInputChange}
onBlur={_handleEditInputConfirm}
onPressEnter={_handleEditInputConfirm}
/>
);
}
const isLongTag = tag.length > 20;
const tagElem = (
<Tag
className={styles['edit-tag']}
key={tag}
closable
onClose={() => _handleClose(tag)}
color='red'
>
<span
onDoubleClick={e => {
if (index !== 0) {
setEditInputIndex(index);
setEditInputValue(tag);
e.preventDefault();
}
}}
>
{isLongTag ? `${tag.slice(0, 20)}...` : tag}
</span>
</Tag>
);
return isLongTag ? (
<Tooltip title={tag} key={tag}>
{tagElem}
</Tooltip>
) : (
tagElem
);
})}
{inputVisible && (
<Input
ref={saveInputRef}
type="text"
size="small"
className={styles['tag-input']}
defaultValue={inputValue}
onChange={_handleInputChange}
onBlur={_handleInputConfirm}
onPressEnter={_handleInputConfirm}
/>
)}
{!inputVisible && (
<Tag className={styles['site-tag-plus']} onClick={_showInput}>
<PlusOutlined /> 新增标签
</Tag>
)}
</>
</div>
</>
) : (<Button onClick={() => { setActVisible(true) }}>选择活动商品</Button>)}
<ActivityProductDrawer
......
......@@ -47,7 +47,6 @@ import {
import Loading from '../../editor/components/Loading'
import { PublicApi } from '@/services/api'
import { LAYOUT_TYPE } from '@/constants'
import { GetTemplateAdornAppChannelFindResponse, GetTemplateWebMemberChannelWebFindCurrMemberChannelResponse } from '@/services/TemplateV2Api'
// import { GlobalConfig } from '@/global/config'
import MobileSettingPanel from '../../editor/mobileSettingPanel'
import { getAuth } from '@/utils/auth'
......
......@@ -113,7 +113,7 @@ export const marketingConfig_3 = {
componentName: 'MarketingCard.VerticalContainer',
maxLength: 3,
props: {
type: 4,
type: 3,
exType: 1
},
childNodes: [],
......@@ -473,12 +473,12 @@ export const marketingConfig_13 = {
title: '活动商品容器',
canEdit: true,
canHide: false,
componentName: 'MarketingCard.CollageContainer',
componentName: 'MarketingCard.VerticalContainer',
props: {
type: 9,
type: 13,
},
childNodes: [],
childComponentName: 'MarketingCard.CollageContainerItem',
childComponentName: 'MarketingCard.GoodsItem',
addBtnText: '添加商品',
},
};
......@@ -510,7 +510,7 @@ export const marketingConfig_14 = {
componentName: 'MarketingCard.VerticalContainer',
maxLength: 3,
props: {
type: 13,
type: 14,
exType: 1
},
childNodes: [],
......@@ -546,7 +546,7 @@ export const marketingConfig_15 = {
componentName: 'MarketingCard.VerticalContainer',
maxLength: 3,
props: {
type: 13,
type: 15,
exType: 2
},
childNodes: [],
......@@ -582,7 +582,7 @@ export const marketingConfig_16 = {
componentName: 'MarketingCard.VerticalContainer',
maxLength: 3,
props: {
type: 14,
type: 16,
},
childNodes: [],
childComponentName: 'MarketingCard.GoodsItem',
......@@ -617,7 +617,7 @@ export const marketingConfig_17 = {
componentName: 'MarketingCard.VerticalContainer',
maxLength: 3,
props: {
type: 16,
type: 17,
},
childNodes: [],
childComponentName: 'MarketingCard.GoodsItem',
......@@ -646,57 +646,92 @@ export const marketingConfig_18 = {
},
},
'11-18-2': {
title: '套餐容器',
canEdit: true,
canHide: false,
componentName: 'MarketingCard.PackageContainer',
props: {
type: 15,
},
childNodes: ['11-18-2-1', '11-18-2-2'],
},
'11-18-2-1': {
title: '主购商品',
canEdit: true,
canHide: false,
componentName: 'MarketingCard.DetailItem',
props: {
detailType: 'package',
style:{
margin: '12px 12px 0 12px'
}
},
},
'11-18-2-2': {
title: '套餐子容器',
title: '活动商品容器',
canEdit: true,
canHide: false,
componentName: 'MarketingCard.PackageContainerTabs',
componentName: 'MarketingCard.VerticalContainer',
maxLength: 3,
props: {
style:{
margin: '0 12px'
}
type: 18,
},
childComponentName: 'MarketingCard.PackageContainerTabsTabPane',
// addBtnText: '添加子套餐',
childNodes: [],
childProps: {
title: '子套餐容器',
canEdit: false,
canHide: false,
componentName: 'MarketingCard.PackageContainerTabsTabPane',
props: {
title: '套餐',
containerScorll: true,
type: 15,
},
childComponentName: 'MarketingCard.GoodsItem',
// addBtnText: '添加商品',
childNodes: [],
},
}
childComponentName: 'MarketingCard.GoodsItem',
addBtnText: '添加商品',
},
};
// export const marketingConfig_18 = {
// '11-18': {
// title: '活动-套餐',
// componentName: 'MarketingCard',
// props: {
// style: {
// margin: '8px',
// },
// shopColorType: 18
// },
// childNodes: ['11-18-1', '11-18-2'],
// },
// '11-18-1': {
// canEdit: true,
// title: '标题栏',
// componentName: 'MarketingCard.ShopHeader',
// props: {
// type: 18,
// },
// },
// '11-18-2': {
// title: '套餐容器',
// canEdit: true,
// canHide: false,
// componentName: 'MarketingCard.PackageContainer',
// props: {
// type: 15,
// },
// childNodes: ['11-18-2-1', '11-18-2-2'],
// },
// '11-18-2-1': {
// title: '主购商品',
// canEdit: true,
// canHide: false,
// componentName: 'MarketingCard.DetailItem',
// props: {
// detailType: 'package',
// style:{
// margin: '12px 12px 0 12px'
// }
// },
// },
// '11-18-2-2': {
// title: '套餐子容器',
// canEdit: true,
// canHide: false,
// componentName: 'MarketingCard.PackageContainerTabs',
// props: {
// style:{
// margin: '0 12px'
// }
// },
// childComponentName: 'MarketingCard.PackageContainerTabsTabPane',
// // addBtnText: '添加子套餐',
// childNodes: [],
// childProps: {
// title: '子套餐容器',
// canEdit: false,
// canHide: false,
// componentName: 'MarketingCard.PackageContainerTabsTabPane',
// props: {
// title: '套餐',
// containerScorll: true,
// type: 15,
// },
// childComponentName: 'MarketingCard.GoodsItem',
// // addBtnText: '添加商品',
// childNodes: [],
// },
// }
// };
export const marketingConfig_19 = {
'11-19': {
title: '活动-砍价',
......@@ -724,7 +759,7 @@ export const marketingConfig_19 = {
componentName: 'MarketingCard.VerticalContainer',
maxLength: 3,
props: {
type: 11,
type: 19,
},
childNodes: [],
childComponentName: 'MarketingCard.GoodsItem',
......
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