Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
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
project
jinfa-admin
Commits
ad7a4e85
Commit
ad7a4e85
authored
Oct 21, 2021
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改品类导航页bug
parent
3bc9eca0
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
75 additions
and
30 deletions
+75
-30
global.d.ts
src/global/config/global.d.ts
+7
-3
product.less
.../activePage/fixtures/components/ProductPanel/product.less
+1
-0
product.tsx
...t/activePage/fixtures/components/ProductPanel/product.tsx
+4
-4
useGetLayout.tsx
...stomized/categoryNavigation/common/hooks/useGetLayout.tsx
+5
-2
editPanel.tsx
...zed/categoryNavigation/components/EditPanel/editPanel.tsx
+3
-3
schema.tsx
...omized/categoryNavigation/components/EditPanel/schema.tsx
+36
-5
index.tsx
.../categoryNavigation/components/FormilyCommodity/index.tsx
+10
-9
index.tsx
...mized/categoryNavigation/components/Layout/Tabs/index.tsx
+5
-2
index.tsx
...geCustomized/components/drawers/commodityDrawer/index.tsx
+4
-2
No files found.
src/global/config/global.d.ts
View file @
ad7a4e85
...
...
@@ -3,11 +3,15 @@ export interface ShopInfo {
name
:
string
;
type
:
number
;
environment
:
number
;
property
?:
any
;
self
:
number
;
memberOperate
:
number
;
logoUrl
:
string
;
describe
?:
any
;
describe
:
string
;
state
:
number
;
url
:
string
;
isDefault
:
number
;
isDefault
?:
any
;
createTime
?:
any
;
}
export
interface
OrderMode
{
...
...
@@ -28,7 +32,7 @@ export interface SiteInfo {
name
:
string
;
logo
:
string
;
siteUrl
:
string
;
symbol
:
string
;
symbol
?:
any
;
}
export
interface
Site
{
...
...
src/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/components/ProductPanel/product.less
View file @
ad7a4e85
...
...
@@ -82,6 +82,7 @@
align-items: center;
width: 100%;
margin-bottom: 8px;
color: #303133;
.activityImg {
width: 24px;
...
...
src/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/components/ProductPanel/product.tsx
View file @
ad7a4e85
...
...
@@ -6,7 +6,7 @@ import { unstable_batchedUpdates } from 'react-dom';
import
styles
from
'./product.less'
;
import
{
priceFormat
}
from
'@/utils/numberFomat'
;
import
StatusTag
from
'@/components/StatusTag'
;
import
defaultActivityImage
from
'@/asserts/activity/ActivityImage.svg'
;
interface
Iprops
{
onEdit
?:
((
data
:
{
id
:
number
,
activityId
:
number
})
=>
void
)
|
null
,
...
...
@@ -30,7 +30,7 @@ interface Iprops {
const
defaultLabel
=
[];
const
Product
:
React
.
FC
<
Iprops
>
=
(
props
:
Iprops
)
=>
{
const
{
onEdit
,
onRemove
,
productName
,
productImgUrl
,
id
,
activityId
,
price
,
activityList
,
isWithLabels
,
activityImage
,
label
=
defaultLabel
,
onLabelChange
=
null
}
=
props
;
const
{
onEdit
,
onRemove
,
productName
,
productImgUrl
,
id
,
activityId
,
price
,
activityList
,
isWithLabels
,
activityImage
=
defaultActivityImage
,
label
=
defaultLabel
,
onLabelChange
=
null
}
=
props
;
const
[
inputVisible
,
setInputVisible
]
=
useState
<
boolean
>
(
false
);
const
[
inputValue
,
setInputValue
]
=
useState
<
string
>
(
""
);
const
inputRef
=
useRef
<
(
Input
)
|
null
>
(
null
);
...
...
@@ -168,11 +168,11 @@ const Product: React.FC<Iprops> = (props: Iprops) => {
{
activityList
?.
map
((
_item
)
=>
{
return
(
<
div
className=
{
styles
.
activityItem
}
key=
{
_item
.
id
}
>
<
a
className=
{
styles
.
activityItem
}
key=
{
_item
.
id
}
href=
{
`/marketingManage/marketing/marketingSearch/preview?id=${_item.id}`
}
target=
"_blank"
>
<
img
className=
{
styles
.
activityImg
}
src=
{
activityImage
}
/>
<
span
className=
{
styles
.
activityName
}
>
{
_item
.
name
}
</
span
>
<
StatusTag
type=
"danger"
title=
{
_item
.
type
}
></
StatusTag
>
</
div
>
</
a
>
);
})
}
...
...
src/pages/pageCustomized/categoryNavigation/common/hooks/useGetLayout.tsx
View file @
ad7a4e85
import
{
useEffect
,
useState
}
from
'react'
;
import
{
updatePageConfig
}
from
'@lingxi-disign/
core
'
;
import
{
updatePageConfig
}
from
'@lingxi-disign/
react
'
;
import
{
cloneDeep
}
from
'lodash'
;
import
pageConfig
from
'../schema/pageConfig'
;
import
{
PublicApi
}
from
'@/services/api'
;
...
...
@@ -92,7 +92,8 @@ function useGetLayout() {
childProps
:
{
otherProps
:
{
type
:
`
${
_child
}
Item`
,
}
},
childNodes
:
[],
},
canDelete
:
false
,
addBtnText
:
'添加子节点'
,
...
...
@@ -118,6 +119,8 @@ function useGetLayout() {
...
cloneconfig
,
...
config
};
console
.
log
(
"fuck"
,
newConfig
)
setDataSourceFromRequest
(
dataFromRequest
);
updatePageConfig
(
newConfig
);
},
[
info
]);
...
...
src/pages/pageCustomized/categoryNavigation/components/EditPanel/editPanel.tsx
View file @
ad7a4e85
...
...
@@ -28,7 +28,7 @@ type SettingPanelType = {
}
const
ComponentSchema
=
{
tabItem
:
tabTitleSchema
,
//
tabItem: tabTitleSchema,
secondaryItem
:
secondaryTabSchema
,
flashSale
:
blockSchema
,
flashSaleItem
:
flashSaleSchema
,
...
...
@@ -74,7 +74,7 @@ const EditPanel = () => {
* 但当一级类型没有被选择的时候,那么必须选择一级导航类型
*/
useEffect
(()
=>
{
if
(
activeKey
===
null
||
previousActiveKey
!==
activeKey
||
(
selectedInfo
as
any
)?.
otherProps
?.
type
===
'tabItem'
)
{
if
(
activeKey
===
null
&&
previousActiveKey
!==
activeKey
)
{
if
(
activeKey
===
null
)
{
message
.
info
(
"请先选择一级导航类型"
);
}
...
...
@@ -243,7 +243,7 @@ const EditPanel = () => {
};
const
currentProps
=
type
===
0
&&
componentType
.
includes
(
'suggestProduct'
)
?
formValueToProps
[
'suggestProduct'
]
:
formValueToProps
[
componentType
];
if
(
componentType
===
'suggestProduct'
||
type
===
0
)
{
if
(
componentType
.
includes
(
'suggestProduct'
)
&&
type
===
0
)
{
setType
(
values
.
type
);
}
changeProps
({
...
...
src/pages/pageCustomized/categoryNavigation/components/EditPanel/schema.tsx
View file @
ad7a4e85
...
...
@@ -15,6 +15,12 @@ export const tabTitleSchema: ISchema = {
type
:
'string'
,
title
:
"{{ text('类型', help('注意:当一级导航确认选择后,不能修改。')) }}"
,
enum
:
[],
"x-rules"
:
[
{
required
:
true
,
message
:
'请选择一级品类'
}
]
},
title
:
{
type
:
'string'
,
...
...
@@ -40,6 +46,12 @@ export const secondaryTabSchema: ISchema = {
type
:
'string'
,
title
:
'类型'
,
enum
:
[],
"x-rules"
:
[
{
required
:
true
,
message
:
'请选择二级类型'
}
]
},
title
:
{
type
:
'string'
,
...
...
@@ -56,6 +68,12 @@ export const secondaryTabSchema: ISchema = {
children
:
null
,
maxCount
:
1
,
},
"x-rules"
:
[
{
required
:
true
,
message
:
'请上传图片'
}
]
}
}
}
...
...
@@ -77,8 +95,13 @@ export const blockSchema: ISchema = {
blockTitle
:
{
type
:
'string'
,
title
:
'标题'
,
"x-rules"
:
[
{
required
:
true
,
message
:
'请填写标题'
}
]
},
}
}
}
...
...
@@ -124,12 +147,20 @@ export const saleRankSchema: ISchema = {
rankProduct
:
{
type
:
'object'
,
"x-component"
:
'FormilyCommodity'
,
"x-component-props"
:
{
commodityKey
:
'saleRanking'
}
},
sale
:
{
type
:
'string'
,
title
:
'销量'
,
"x-rules"
:
[
{
required
:
true
,
message
:
'请填写销量'
,
}
]
}
}
}
}
...
...
@@ -209,7 +240,7 @@ export const productListSchema: ISchema = {
}
};
/**
销量排行
schema */
/**
精选商品
schema */
export
const
commoditySchema
:
ISchema
=
{
type
:
'Object'
,
properties
:
{
...
...
@@ -225,11 +256,11 @@ export const commoditySchema: ISchema = {
"x-component"
:
'FormilyCommodity'
,
'x-component-props'
:
{
isWithLabels
:
true
,
commodityKey
:
'suggestProduct'
}
},
}
}
}
};
src/pages/pageCustomized/categoryNavigation/components/FormilyCommodity/index.tsx
View file @
ad7a4e85
...
...
@@ -6,7 +6,13 @@ import { useFilterSameOption } from '../../common/hooks/useFilterSameOption';
import
{
Product
}
from
'@/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/components/ProductPanel'
;
import
CommodityDrawer
from
'@/pages/pageCustomized/components/drawers/commodityDrawer'
;
type
ComponentTypeProps
=
{
activityType
:
number
,
commodityKey
:
'saleRanking'
|
'suggestProduct'
,
isWithLabels
?:
boolean
}
&
{
[
key
:
string
]:
any
}
interface
Iprops
{
value
:
{
id
:
number
,
...
...
@@ -19,11 +25,7 @@ interface Iprops {
label
:
string
[],
},
props
:
{
[
'x-component-props'
]:
{
activityType
:
number
,
}
&
{
[
key
:
string
]:
any
},
[
'x-component-props'
]:
ComponentTypeProps
,
},
mutators
:
{
change
:
(
params
:
any
)
=>
void
...
...
@@ -37,9 +39,8 @@ const FormilyCommodity: React.FC<Iprops> & { isFieldComponent: boolean } = (prop
const
{
activeKey
}
=
useSelector
<
any
,
"activeKey"
>
([
'activeKey'
]);
const
fixtureContext
=
useContext
(
context
);
const
sameKeyState
=
useFilterSameOption
();
const
disabledSaleRankingKeys
=
useMemo
(()
=>
sameKeyState
[
`tabItem_
${
activeKey
}
_saleRanking`
],
[
sameKeyState
,
activeKey
]);
const
componentProps
=
props
.
props
?.[
'x-component-props'
]
||
{};
const
componentProps
=
props
.
props
?.[
'x-component-props'
]
||
{}
as
ComponentTypeProps
;
const
disabledSaleRankingKeys
=
useMemo
(()
=>
sameKeyState
[
`tabItem_
${
activeKey
}
_
${
componentProps
.
commodityKey
}
`
],
[
sameKeyState
,
activeKey
]);
const
{
state
:
productVisible
,
toggle
:
setProductVisible
}
=
useToggle
();
const
productProps
=
useMemo
(()
=>
({
...
...
src/pages/pageCustomized/categoryNavigation/components/Layout/Tabs/index.tsx
View file @
ad7a4e85
...
...
@@ -177,7 +177,8 @@ const CustomizeTabs: React.FC<Iprops> & { TabItem: typeof TabItem } = (props: Ip
},
otherProps
:
{
type
:
`
${
_item
}
Item`
}
},
childNodes
:
[],
};
cloneDeepPageConfig
[
parentKey
].
childNodes
.
push
(
`
${
parentKey
}
-
${
_rowKey
+
1
}
`
);
});
...
...
@@ -189,7 +190,9 @@ const CustomizeTabs: React.FC<Iprops> & { TabItem: typeof TabItem } = (props: Ip
props
:
_row
,
otherProps
:
{
type
:
`
${
_item
}
Item`
}
},
childNodes
:
[],
};
cloneDeepPageConfig
[
parentKey
].
childNodes
.
push
(
`
${
parentKey
}
-
${
_rowKey
+
1
}
`
);
});
...
...
src/pages/pageCustomized/components/drawers/commodityDrawer/index.tsx
View file @
ad7a4e85
...
...
@@ -19,6 +19,7 @@ import CustomInputSearch from '@/components/NiceForm/components/CustomInputSearc
import
CustomCategorySearch
from
'@/components/NiceForm/components/CustomCategorySearch'
;
import
ActivityImage
from
'@/asserts/activity/ActivityImage.svg'
;
import
moment
from
'moment'
;
...
...
@@ -55,14 +56,15 @@ const CommodityDrawer: React.FC<CommodityDrawerProps> = (props: CommodityDrawerP
<>
{
record
?.
activityList
?.
map
((
item
,
index
)
=>
{
return
(
<
div
key=
{
index
}
style=
{
{
marginBottom
:
8
}
}
>
<
a
key=
{
index
}
style=
{
{
marginBottom
:
8
}
}
href=
{
`/marketingManage/marketing/marketingSearch/preview?id=${item.id}`
}
target=
{
"_blank"
}
>
<
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'
}
/>
<
div
style=
{
{
color
:
'#301333'
}
}
>
有效期:
{
item
.
startTime
&&
moment
(
item
.
startTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
至
{
item
.
endTime
&&
moment
(
item
.
endTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
</
div
>
</
Space
>
</
div
>
</
a
>
);
})
}
</>
...
...
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