Commit 16fe2ecb authored by 卢均锐's avatar 卢均锐

feat: c端装修相关drawer修改

-增加活动跳转详情
parent f88de4bd
......@@ -30,5 +30,22 @@
}
}
}
.ant-table-expanded-row {
.ant-table-cell {
background-color: #fff;
}
}
}
}
.defaultTag {
display: inline-block;
padding: 0 8px;
font-size: 12px;
font-weight: 400;
color: #5C626A;
background: #fff;
border-radius: 4px;
border: 1px solid #EDEEEF;
}
......@@ -40,7 +40,7 @@ const _returnCategoryList = (list: any, obj: any) => {
const CommodityDrawer: React.FC<CommodityDrawerProps> = (props: CommodityDrawerProps) => {
const { visible, onClose, onConfirm, selectId, filterParam, selectType = 'radio' } = props;
const { query: { shopId, environment } }: any = history.location
const { query: { shopId } }: any = history.location
const [selectedRowKeys, setSelectedRowKeys] = useState<any>(selectId ? [selectId] : []);
const [selectedRows, setSelectedRows] = useState<any>([]);
const ref = useRef<any>({});
......@@ -50,30 +50,22 @@ const CommodityDrawer: React.FC<CommodityDrawerProps> = (props: CommodityDrawerP
}, [selectId])
const expandedRowRender = (record: any) => {
console.log(record)
const columns = [
{
title: 'id',
dataIndex: 'id',
key: 'id',
render: (_, _record: any) => (
<Space direction='horizontal' style={{ width: 300 }}>
<img src={ActivityImage} style={{ width: 24, height: 24, borderRadius: 4 }} />
<span>{_record?.name}</span>
</Space>
)
}
]
let data: any = [];
for (let i = 0; i < 3; ++i) {
data.push({
key: i,
date: '2014-12-24 23:12:00',
name: 'This is production name',
upgradeNum: 'Upgraded: 56',
});
}
return <Table columns={columns} dataSource={data} pagination={false} showHeader={false} />;
return (
<>
{record?.activityList?.map((item, index) => {
return (
<div key={index} style={{ marginBottom: 8 }}>
<Space direction='horizontal'>
<img src={ActivityImage} style={{ width: 24, height: 24, borderRadius: 4 }} />
<span>{item?.name}</span>
<div className={styles['defaultTag']}>{item?.type}</div>
<StatusTag title={item?.belongType === 1 ? '平台活动' : '商家活动'} type={item?.belongType === 1 ? 'primary' : 'success'} />
</Space>
</div>
)
})}
</>
);
}
const columns = [
......@@ -141,7 +133,6 @@ const CommodityDrawer: React.FC<CommodityDrawerProps> = (props: CommodityDrawerP
const fetchTableData = async (params: any) => {
const _params = {
...params,
// environment,
shopId,
idNotInList: Array.isArray(selectId) ? selectId : [selectId],
...filterParam
......
......@@ -27,13 +27,15 @@ interface CouponsDrawerProps {
visible: boolean,
onClose: () => void,
onConfirm?: (record) => void,
selectId?: number
selectId?: number,
// 1平台,2商家
belongType?: 1 | 2
}
const CouponsDrawer: React.FC<CouponsDrawerProps> = (props: CouponsDrawerProps) => {
const { visible, onClose, onConfirm, selectId } = props;
const { visible, onClose, onConfirm, selectId, belongType } = props;
const { query: { shopId } }: any = history.location
const [type, setType] = useState(1);
const [type, setType] = useState(belongType || 1);
const [selectedRowKeys, setSelectedRowKeys] = useState<any>(selectId ? [selectId] : []);
const [selectedRows, setSelectedRows] = useState<any>([]);
const ref = useRef<any>({});
......
......@@ -84,6 +84,7 @@ const MarketingCardCoupon: React.FC<MarketingCardCouponProps> = (props: Marketin
</div>
<CouponsDrawer
visible={drawerVisible}
belongType={belongType}
onClose={_onClose}
onConfirm={_onChooseConfirm}
selectId={id}
......
......@@ -89,6 +89,7 @@
align-items: center;
justify-content: center;
margin-bottom: 8px;
cursor: pointer;
img {
width: 24px;
......
......@@ -217,7 +217,7 @@ const MarketingCardGood: React.FC<MarketingCardGoodProps> = (props: MarketingCar
<div className={styles['suggestProductCommodity-box-label']}>商品活动</div>
{_record?.activityList?.map((item) => {
return (
<div className={styles['suggestProductCommodity-activityList']}>
<div className={styles['suggestProductCommodity-activityList']} onClick={() => {window.open(`/marketing/marketingSearch/preview?id=${item.id}`)}}>
<img src={ActivityImage} />
<div className={styles['suggestProductCommodity-activityList-name']}>{item.name}</div>
<StatusTag title={item.type} type='danger' />
......
......@@ -89,6 +89,7 @@
align-items: center;
justify-content: center;
margin-bottom: 8px;
cursor: pointer;
img {
width: 24px;
......
......@@ -38,9 +38,15 @@ const SuggestProductCommodity: React.FC<SuggestProductCommodityProps> = (props:
useEffect(() => {
if (id && id != record[0]?.id) {
PublicApi.getProductCommodityGetCommodity({ id }).then((res) => {
const _params: any = {
shopId,
idInList: id,
current: 1,
pageSize: 10
}
PublicApi.getMarketingAdornGoodsListAdorn(_params).then((res) => {
if (res.code === 1000) {
setRecord(res.data);
setRecord(res.data.data);
}
}).catch(err => console.log(err))
} else if (!id) {
......@@ -115,6 +121,14 @@ const SuggestProductCommodity: React.FC<SuggestProductCommodityProps> = (props:
});
};
const _handleToDetailPage = (id, belongType) => {
if (belongType === 1) {
window.open(`/marketing/marketingSearch/preview?id=${id}`);
} else {
window.open(`/marketingManage/merchantMarketing/merchantMarketingSearch/preview?id=${id}`);
}
}
const _record = record;
return (
......@@ -139,7 +153,7 @@ const SuggestProductCommodity: React.FC<SuggestProductCommodityProps> = (props:
<div className={styles['suggestProductCommodity-box-label']}>商品活动</div>
{_record?.activityList?.map((item) => {
return (
<div className={styles['suggestProductCommodity-activityList']}>
<div className={styles['suggestProductCommodity-activityList']} onClick={() => { _handleToDetailPage(item.id, item.belongType) }}>
<img src={ActivityImage} />
<div className={styles['suggestProductCommodity-activityList-name']}>{item.name}</div>
<StatusTag title={item.type} type='danger' />
......
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