Commit 443ef2a8 authored by XieZhiXiong's avatar XieZhiXiong

Merge branch 'dev-srm' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform into dev-srm

parents 1affcf72 32e74e70
...@@ -28,6 +28,8 @@ const defaultCategoryData = { index: 0, firstId: 0, secondId: 0, thirdlyId: 0, f ...@@ -28,6 +28,8 @@ const defaultCategoryData = { index: 0, firstId: 0, secondId: 0, thirdlyId: 0, f
const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => { const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => {
const { siteUrl, siteId } = props.SiteStore const { siteUrl, siteId } = props.SiteStore
const [resUrl, setResUrl] = useState<string>('');
const [door, setDoor] = useState<string>('');
const [formIsHalfFilledOut, setFormIsHalfFilledOut] = useState(false) const [formIsHalfFilledOut, setFormIsHalfFilledOut] = useState(false)
const [form] = Form.useForm() const [form] = Form.useForm()
const [allMallList, setAllMallList] = useState([]) const [allMallList, setAllMallList] = useState([])
...@@ -320,7 +322,7 @@ const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => { ...@@ -320,7 +322,7 @@ const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => {
slideshowBOList: result slideshowBOList: result
}) })
} }
/**
const handleMallSelectChange = (mallId: number) => { const handleMallSelectChange = (mallId: number) => {
setShopId(mallId) setShopId(mallId)
console.log(mallId, shopInfo) console.log(mallId, shopInfo)
...@@ -362,10 +364,6 @@ const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => { ...@@ -362,10 +364,6 @@ const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => {
return result return result
} }
const handleFormValueChange = () => {
setFormIsHalfFilledOut(true)
}
const getSelectMallStoreUrl = () => { const getSelectMallStoreUrl = () => {
if (!shopInfo) { if (!shopInfo) {
return null return null
...@@ -382,6 +380,16 @@ const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => { ...@@ -382,6 +380,16 @@ const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => {
} }
return null return null
} }
*/
const handleFormValueChange = () => {
setFormIsHalfFilledOut(true)
}
/** 获取店铺链接 */
const handleMallSelectChange = (val, option) => {
setDoor(option.children);
setResUrl(`${siteUrl}${option.url}`)
}
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
...@@ -541,13 +549,17 @@ const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => { ...@@ -541,13 +549,17 @@ const PurchasInfo: React.FC<PurchasInfoPropsType> = (props) => {
<Select allowClear value={shopId} className={styles.form_item} onChange={handleMallSelectChange}> <Select allowClear value={shopId} className={styles.form_item} onChange={handleMallSelectChange}>
{ {
allMallList.map(item => ( allMallList.map(item => (
<Select.Option key={item.id} value={item.id}>{item.name}</Select.Option> <Select.Option key={item.id} value={item.id} url={item.url}>{item.name}</Select.Option>
)) ))
} }
</Select> </Select>
{ {resUrl && (
getSelectMallStoreUrl() <div className={styles.shop_url}>
} <span>当前{door}链接:</span>
<label>{resUrl}</label>
<CopyOutlined className={styles.copy_icon} onClick={() => handleCopyLinke(resUrl)} />
</div>
)}
</Form.Item> </Form.Item>
</TabPane> </TabPane>
<TabPane tab='首页轮播图' key='2' forceRender> <TabPane tab='首页轮播图' key='2' forceRender>
......
...@@ -123,7 +123,7 @@ const Material: React.FC<Iprops> = (props: any) => { ...@@ -123,7 +123,7 @@ const Material: React.FC<Iprops> = (props: any) => {
dataIndex: 'category', dataIndex: 'category',
render: (text: any, record: any, index: number) => ( render: (text: any, record: any, index: number) => (
<> <>
{ materielMode === 1 && ( {Array.isArray(record.ids) ? (
<Form.Item <Form.Item
style={{ margin: 0 }} style={{ margin: 0 }}
name={`category_${index + 1}`} name={`category_${index + 1}`}
...@@ -139,8 +139,7 @@ const Material: React.FC<Iprops> = (props: any) => { ...@@ -139,8 +139,7 @@ const Material: React.FC<Iprops> = (props: any) => {
notFoundContent={<Spin size="small" />} notFoundContent={<Spin size="small" />}
/> />
</Form.Item> </Form.Item>
)} ) : (
{ materielMode === 2 && (
<Form.Item <Form.Item
style={{ margin: 0 }} style={{ margin: 0 }}
name={`category_${index + 1}`} name={`category_${index + 1}`}
...@@ -150,6 +149,7 @@ const Material: React.FC<Iprops> = (props: any) => { ...@@ -150,6 +149,7 @@ const Material: React.FC<Iprops> = (props: any) => {
<Input onChange={(e) => handleEdit(e, 'category', index)} /> <Input onChange={(e) => handleEdit(e, 'category', index)} />
</Form.Item> </Form.Item>
)} )}
</> </>
), ),
}, },
...@@ -220,6 +220,7 @@ const Material: React.FC<Iprops> = (props: any) => { ...@@ -220,6 +220,7 @@ const Material: React.FC<Iprops> = (props: any) => {
/** 添加列表 */ /** 添加列表 */
const fetchTableList = (data: any) => { const fetchTableList = (data: any) => {
if (Object.keys(data).length > 0) { if (Object.keys(data).length > 0) {
console.log(data, 98)
setDataSource([...dataSource, data]); setDataSource([...dataSource, data]);
setFlag(false); setFlag(false);
} }
......
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