Commit 7154accd authored by Bill's avatar Bill

fix: 修改平台活动页套装bug

parent 5357fc12
......@@ -72,7 +72,7 @@ const UploadFiles: React.FC<PickUploadProps> = (props: PickUploadProps) => {
}, styles.renderFileContainer, fileContainerClassName);
const uploadProps = {
disable: disable,
disabled: disable,
name: 'file',
fileList: files,
accept: accept,
......
......@@ -83,12 +83,13 @@ const Add = () => {
okText: '立即装修',
cancelText: '稍后',
onOk: () => {
history.push(`/marketingManage/marketing/activitiesManagement/fixtures?id=${data.id}`);
history.push(`/marketingManage/marketing/activitiesManagement/fixtures?id=${data}`);
},
onCancel: () => {
history.goBack();
}
});
return;
}
history.goBack();
}
......
......@@ -359,9 +359,9 @@ const activityContainer: PageConfigType = {
componentName: 'CommodityList',
childComponentName: "CommodityList.Item",
addBtnText: '添加商品',
title: '组合促销',
title: '秒杀',
props: {
title: '组合促销',
title: '秒杀',
theme: 0
},
otherProps: {
......@@ -371,7 +371,7 @@ const activityContainer: PageConfigType = {
},
"17-1": {
componentName: 'CommodityList.Item',
title: '组合促销-商品',
title: '秒杀-商品',
props: {},
addBtnText: '添加'
},
......
......@@ -19,8 +19,8 @@ const ThemeItem: React.FC<Iprops> = (props: Iprops) => {
return (
<div className={styles.container}>
<img className={styles.img} />
<span className={styles.name}>竖向布局</span>
{/* <img className={styles.img} /> */}
<span className={styles.name}>{name}</span>
<Radio value={theme} onChange={handleChange} checked={checked} />
</div>
);
......
......@@ -128,7 +128,7 @@ CommodityList.Item = CommodityItem;
/** 套装商品 */
const CommodityTab: React.FC<any> = (props) => {
const { isEmpty, id, productName, productImgUrl, price, goodsSubList } = props;
const { isEmpty, id, productName, productImgUrl, price, goodsSubsidiaryGroupList } = props;
const [activeKey, setActiveKey] = useState<string>("1");
console.log("CommodityTab", props);
......@@ -143,7 +143,7 @@ const CommodityTab: React.FC<any> = (props) => {
return (
<div className={styles.customizeTabBar}>
{
tabInfo.map((_item) => {
tabInfo?.map((_item) => {
return (
<span
onClick={() => setActiveKey(_item.key)}
......@@ -188,47 +188,49 @@ const CommodityTab: React.FC<any> = (props) => {
/>
</div>
<div className={styles.tab}>
<Tabs activeKey={activeKey} renderTabBar={renderTabBar}>
{
goodsSubList.map((_item, _index) => {
const { groupNo, groupPrice, list } = _item;
const discountPrice = groupPrice?.toString().split(".");
const allTotal = list.reduce((sum, _current) => sum += _current.price, 0);
return (
<TabPane key={_item.groupNo.toString()} tab="套装1">
{
list.map((_row, _key) => {
return (
<div className={styles.groupCommodityItem} key={_item}>
<Commodity
name={_row.productName}
image={_row.productImgUrl}
mode="vertical"
footer={<div></div>}
tags={["满300减20"]}
style={{padding: '0'}}
></Commodity>
<Tabs activeKey={activeKey} renderTabBar={renderTabBar}>
{
goodsSubsidiaryGroupList?.map((_item, _index) => {
const { groupNo, groupPrice, goodsSubsidiaryGroupDetailsList } = _item;
const discountPrice = groupPrice?.toString().split(".");
const allTotal = goodsSubsidiaryGroupDetailsList.reduce((sum, _current) => sum += _current.price, 0);
return (
<TabPane key={_item.groupNo.toString()} tab={`套装${_index + 1}`}>
<div className={styles.groupPane}>
{
goodsSubsidiaryGroupDetailsList?.map((_row, _key) => {
return (
<div className={styles.groupCommodityItem} key={_item}>
<Commodity
name={_row.productName}
image={_row.productImgUrl}
mode="vertical"
footer={<div></div>}
tags={["满300减20"]}
style={{padding: '0'}}
></Commodity>
</div>
);
})
}
</div>
<div className={styles.footer}>
<div className={styles.price}>
<div className={styles.discount}>
<span className={styles.priceInt}>{discountPrice[0]}</span>.
<span>{discountPrice?.[1] || '00'}</span>
</div>
<span className={styles.originalPrice}>{allTotal + price}</span>
</div>
);
})
}
<div className={styles.footer}>
<div className={styles.price}>
<div className={styles.discount}>
<span className={styles.priceInt}>{discountPrice[0]}</span>.
<span>{discountPrice?.[1] || '00'}</span>
<div className={styles.button}>
<span>立即抢购</span>
</div>
<span className={styles.originalPrice}>{allTotal + price}</span>
</div>
<div className={styles.button}>
<span>立即抢购</span>
</div>
</div>
</TabPane>
);
})
}
</Tabs>
</TabPane>
);
})
}
</Tabs>
</div>
</>
......
......@@ -2,23 +2,13 @@ import React, { useEffect, useState } from 'react';
import { updatePageConfig } from '@lingxi-disign/core';
import { cloneDeep } from 'lodash';
import pageConfig from '../schema/pageConfig';
import mock from '../mock/index.json';
import { PublicApi } from '@/services/api';
import { usePageStatus } from '@/hooks/usePageStatus';
const getData = async () => {
const random = Math.floor(Math.random() * 3) + 1;
return new Promise((resolve) => {
setTimeout(() => {
resolve(mock);
}, random);
});
};
function useGetLayout() {
const [info, setInfo] = useState<any>(null);
const { id } = usePageStatus();
const [dataSourceFromRequest, setDataSourceFromRequest] = useState<any>(null)
const [dataSourceFromRequest, setDataSourceFromRequest] = useState<any>(null);
useEffect(() => {
async function fetchData() {
......@@ -50,7 +40,7 @@ function useGetLayout() {
};
const grandSonCompoentMap = {
"secondary": 'SecondaryNavigation.Item',
secondary: 'SecondaryNavigation.Item',
flashSale: 'SimpleCommodityList.Item',
saleRanking: 'SimpleCommodityList.Item',
brand: "CategoryList.Item",
......
......@@ -10,6 +10,7 @@ const ProductContainer = (props) => {
alignItems: 'stretch',
padding: '16 0',
minHeight: '20px',
border: '1px solid red',
// backgroundColor: 'red',
};
const itemStyle = {
......
......@@ -16,9 +16,16 @@
margin-bottom: 12px;
.content {
width: 40px;
height: 40px;
display: flex;
flex-direction: column;
align-items: center;
margin-top: 4px;
// background-color: red;
.image {
width: 40px;
height: 40px;
}
}
.empty {
......
......@@ -59,7 +59,8 @@ const Item = (props) => {
return (
<div className={styles.item} >
<div {...divProps} className={wrapClass}>
<img src={icon} style={{width: '100%', height: '100%'}} />
<img src={icon} className={styles.image} />
<div className={styles.name}>{name}</div>
</div>
</div>
);
......
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