Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
2c747d4a
Commit
2c747d4a
authored
Sep 27, 2021
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 删除Drawer 组件
parent
483cf50c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
165 deletions
+0
-165
index.tsx
...ent/activePage/fixtures/components/ProductPanel/index.tsx
+0
-2
productPanel.less
...vePage/fixtures/components/ProductPanel/productPanel.less
+0
-28
productPanel.tsx
...ivePage/fixtures/components/ProductPanel/productPanel.tsx
+0
-135
No files found.
src/pages/transaction/marketingAbility/marketingActivitiesManagement/activePage/fixtures/components/ProductPanel/index.tsx
View file @
2c747d4a
import
ProductPanel
from
'./productPanel'
;
import
Product
from
'./product'
;
export
{
ProductPanel
,
Product
};
src/pages/transaction/marketingAbility/marketingActivitiesManagement/activePage/fixtures/components/ProductPanel/productPanel.less
deleted
100644 → 0
View file @
483cf50c
.container {
.product {
position: relative;
&:hover {
.actions {
display: block;
}
}
}
.actions {
display: none;
position: absolute;
top: 4px;
right: 8px;
.iconContainer {
background: rgba(0, 0, 0, 0.5);
padding: 2px 4px;
cursor: pointer;
.icon {
color: #fff;
}
}
}
}
src/pages/transaction/marketingAbility/marketingActivitiesManagement/activePage/fixtures/components/ProductPanel/productPanel.tsx
deleted
100644 → 0
View file @
483cf50c
import
React
,
{
useContext
,
useEffect
,
useMemo
,
useState
}
from
'react'
;
import
{
Space
,
message
}
from
'antd'
;
import
{
useSelector
}
from
'@lingxi-disign/react'
;
import
{
useToggle
}
from
'@umijs/hooks'
;
import
{
GetMarketingPlatformActivityListAdornRequest
}
from
'@/services/MaketingV2Api'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
resetCurrentComponent
,}
from
'@lingxi-disign/core'
;
import
{
get
}
from
'lodash'
;
import
styles
from
'./productPanel.less'
;
import
Product
from
'./product'
;
import
Drawer
from
'../Drawer'
;
import
ActivityProductDrawer
from
'../ActivityAreaSetting/activityProductDrawer'
;
import
{
Context
as
ShopContext
}
from
'../../common/context/shopContext'
;
interface
Iprops
{
visible
:
boolean
,
onCancel
?:
null
|
(()
=>
void
)
value
:
any
,
isWithLabels
:
boolean
,
/** 活动类型, */
activityType
?:
number
|
null
}
const
ProductPanel
:
React
.
FC
<
Iprops
>
=
(
props
:
Iprops
)
=>
{
const
{
visible
,
onCancel
,
value
,
isWithLabels
,
activityType
}
=
props
;
const
{
shopId
}
=
useContext
(
ShopContext
)
||
{};
const
{
pageConfig
,
selectedInfo
}
=
useSelector
<
any
,
any
>
([
'pageConfig'
,
'selectedInfo'
]);
const
{
state
:
productVisible
,
toggle
:
setProductVisible
}
=
useToggle
();
const
[
innerProducts
,
setInnerProducts
]
=
useState
<
any
>
(
null
);
const
activityImage
=
useMemo
(()
=>
pageConfig
[
1
]?.
props
?.
imageUrl
,
[
pageConfig
]);
const
cacheProductList
=
useMemo
(()
=>
[
innerProducts
],
[
innerProducts
]);
const
onEdit
=
()
=>
{
setProductVisible
(
true
);
};
useEffect
(()
=>
{
if
(
!
visible
)
{
return
;
}
setInnerProducts
(
value
);
},
[
value
,
visible
]);
const
fetchData
=
async
(
params
:
GetMarketingPlatformActivityListAdornRequest
)
=>
{
const
withActivityType
=
activityType
?
{
activityType
:
activityType
}
:
{};
/** @tofix shopId */
const
common
=
{
...
params
,
shopId
:
shopId
,
...
withActivityType
};
const
isWithActivityType
=
common
;
return
await
PublicApi
.
getMarketingAdornMerchantActivityListAdorn
(
isWithActivityType
as
any
);
};
const
onOk
=
(
data
:
any
)
=>
{
const
target
=
data
[
0
];
if
(
target
.
activityId
!==
innerProducts
.
activityId
||
target
.
id
!==
innerProducts
.
id
)
{
setInnerProducts
(
data
[
0
]);
}
setProductVisible
(
false
);
};
const
handleSubmit
=
()
=>
{
console
.
log
(
innerProducts
)
if
(
innerProducts
===
null
)
{
message
.
error
(
"请选择活动商品"
);
return
;
}
const
currentKey
=
selectedInfo
.
selectedKey
;
const
parentKey
=
selectedInfo
.
parentKey
;
const
parentNode
=
get
(
pageConfig
,
[
parentKey
]);
const
{
childNodes
,
props
}
=
parentNode
;
const
newNodeProps
=
childNodes
.
map
((
_item
)
=>
{
const
elementProps
=
pageConfig
[
_item
].
props
;
if
(
currentKey
===
_item
)
{
return
innerProducts
;
}
return
elementProps
;
});
resetCurrentComponent
({
parentKey
:
parentKey
,
childrenNode
:
newNodeProps
.
map
((
_item
,
index
)
=>
{
const
otherProps
=
isWithLabels
?
{
isWithLabels
:
true
}
:
{};
return
{
key
:
`
${
parentKey
}
-
${
index
+
1
}
`
,
title
:
_item
.
productName
,
props
:
_item
,
componentName
:
props
.
theme
===
2
?
'CommodityList.CommodityTab'
:
'CommodityList.Item'
,
...
otherProps
};
}),
props
:
{
...
props
,
children
:
newNodeProps
.
map
((
_item
)
=>
_item
.
id
),
products
:
newNodeProps
}
});
};
const
onLabelChange
=
(
data
:
{
id
:
number
,
activityId
:
number
,
label
:
string
[]
})
=>
{
const
current
=
{...
innerProducts
};
current
[
"label"
]
=
data
.
label
;
setInnerProducts
(
current
);
};
return
(
<
Drawer
title=
"商品设置"
visible=
{
visible
}
onCancel=
{
onCancel
}
onSubmit=
{
handleSubmit
}
>
<
div
className=
{
styles
.
container
}
>
<
div
className=
{
styles
.
product
}
>
<
Product
activityImage=
{
activityImage
}
onEdit=
{
onEdit
}
isWithLabels=
{
isWithLabels
}
onLabelChange=
{
onLabelChange
}
{
...
innerProducts
}
/>
</
div
>
</
div
>
<
ActivityProductDrawer
activityImage=
{
activityImage
}
products=
{
cacheProductList
}
onOk=
{
onOk
}
fetchData=
{
fetchData
}
visible=
{
productVisible
}
onCancel=
{
()
=>
setProductVisible
(
false
)
}
mode=
"radio"
/>
</
Drawer
>
);
};
export
default
ProductPanel
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment