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
bb37f6f8
Commit
bb37f6f8
authored
Sep 15, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:能力中心装修页面问题修改
parent
d33b180d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
8 deletions
+81
-8
index.tsx
...ngsPanel/propsSettings/components/AdvertSetting/index.tsx
+17
-3
index.tsx
...ingsPanel/propsSettings/components/BrandSetting/index.tsx
+17
-1
index.tsx
...opsSettings/components/CategoryreCommendSetting/index.tsx
+17
-1
GoodsItem.tsx
...Panel/propsSettings/components/GoodsSetting/GoodsItem.tsx
+1
-1
index.tsx
...ingsPanel/propsSettings/components/GoodsSetting/index.tsx
+29
-2
No files found.
src/pages/editor/settingsPanel/propsSettings/components/AdvertSetting/index.tsx
View file @
bb37f6f8
...
...
@@ -3,7 +3,7 @@ import { Button, Input } from 'antd'
import
UploadImage
from
'@/components/UploadImage'
import
{
filterPropsFunction
,
getAdvertType
}
from
'../../../../utils'
import
SettingPanel
from
'../../../../components/SettingPanel'
import
{
message
}
from
'antd'
import
{
message
,
Modal
}
from
'antd'
import
{
isEmpty
}
from
'@formily/antd/esm/shared'
import
{
PublicApi
}
from
'@/services/api'
import
{
clearSelectedStatus
,
changeProps
}
from
'lingxi-editor-core'
;
...
...
@@ -171,13 +171,26 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref)
changeNewProps
(
'advertList'
,
newList
)
}
const
handleCancel
=
useCallback
(()
=>
{
if
(
JSON
.
stringify
(
props
)
!==
JSON
.
stringify
(
newProps
))
{
Modal
.
confirm
({
content
:
"您还没有保存修改的内容,是否确认关闭?"
,
okText
:
"确认"
,
cancelText
:
"取消"
,
onOk
:
()
=>
{
clearSelectedStatus
()
}
})
}
else
{
clearSelectedStatus
()
}
},
[
newProps
])
const
handleConfirmSave
=
useCallback
((
e
:
any
)
=>
{
e
.
preventDefault
();
if
(
JSON
.
stringify
(
props
)
===
JSON
.
stringify
(
newProps
))
{
return
}
setConfirmLoading
(
true
)
saveAdvert
(
newProps
).
then
(()
=>
{
changeProps
({
...
...
@@ -253,6 +266,7 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref)
return
(
<
SettingPanel
confirmLoading=
{
confirmLoading
}
onCancel=
{
handleCancel
}
onOK=
{
handleConfirmSave
}
>
<
div
className=
{
styles
.
advert_setting
}
>
...
...
src/pages/editor/settingsPanel/propsSettings/components/BrandSetting/index.tsx
View file @
bb37f6f8
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
clearSelectedStatus
,
changeProps
}
from
'lingxi-editor-core'
import
{
Row
,
Col
,
Button
,
Input
,
Pagination
,
Form
,
message
}
from
'antd'
import
{
Row
,
Col
,
Button
,
Input
,
Pagination
,
Form
,
message
,
Modal
}
from
'antd'
import
SettingList
from
'../../../../components/SettingList'
import
BrandItem
from
'./BrandItem'
import
SettingPanel
from
'../../../../components/SettingPanel'
...
...
@@ -161,9 +161,25 @@ const BrandSetting: React.FC<ShopSettingPropsType> = (props) => {
setSelectList
(
selectBrandList
)
}
const
handleCancel
=
()
=>
{
if
(
JSON
.
stringify
(
brandList
)
!==
JSON
.
stringify
(
selectBrandList
))
{
Modal
.
confirm
({
content
:
"您还没有保存修改的内容,是否确认关闭?"
,
okText
:
"确认"
,
cancelText
:
"取消"
,
onOk
:
()
=>
{
clearSelectedStatus
()
}
})
}
else
{
clearSelectedStatus
()
}
}
return
(
<
SettingPanel
confirmLoading=
{
confirmLoading
}
onCancel=
{
handleCancel
}
onOK=
{
()
=>
handleConfirm
()
}
>
<
div
className=
{
styles
.
goods_setting
}
>
...
...
src/pages/editor/settingsPanel/propsSettings/components/CategoryreCommendSetting/index.tsx
View file @
bb37f6f8
import
React
,
{
useState
,
useEffect
,
useCallback
}
from
'react'
import
{
Checkbox
,
Row
,
Col
,
message
}
from
'antd'
import
{
Checkbox
,
Row
,
Col
,
message
,
Modal
}
from
'antd'
import
UploadImage
from
'@/components/UploadImage'
import
SettingPanel
from
'../../../../components/SettingPanel'
import
{
clearSelectedStatus
,
changeProps
}
from
'lingxi-editor-core'
...
...
@@ -127,9 +127,25 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
})
}
const
handleCancel
=
useCallback
(()
=>
{
if
(
JSON
.
stringify
(
props
)
!==
JSON
.
stringify
(
newProps
))
{
Modal
.
confirm
({
content
:
"您还没有保存修改的内容,是否确认关闭?"
,
okText
:
"确认"
,
cancelText
:
"取消"
,
onOk
:
()
=>
{
clearSelectedStatus
()
}
})
}
else
{
clearSelectedStatus
()
}
},
[
newProps
])
return
(
<
SettingPanel
confirmLoading=
{
confirmLoading
}
onCancel=
{
handleCancel
}
onOK=
{
handleConfirmSave
}
>
<
div
className=
{
styles
.
category_recommend
}
>
...
...
src/pages/editor/settingsPanel/propsSettings/components/GoodsSetting/GoodsItem.tsx
View file @
bb37f6f8
...
...
@@ -18,7 +18,7 @@ const GoodsItem: React.FC<GoodsItemPropsType> = (props) => {
<
div
className=
{
styles
.
goods_item_info_name
}
>
{
dataInfo
.
goodsName
}
</
div
>
<
div
className=
{
styles
.
goods_item_info_price
}
>
<
i
>
¥
</
i
>
<
span
>
{
dataInfo
.
priceRange
}
</
span
>
<
span
>
{
dataInfo
.
priceRange
||
dataInfo
.
goodsPrice
}
</
span
>
</
div
>
<
div
className=
{
styles
.
goods_item_info_brief
}
>
<
span
>
品类:
</
span
>
...
...
src/pages/editor/settingsPanel/propsSettings/components/GoodsSetting/index.tsx
View file @
bb37f6f8
import
React
,
{
useState
,
useEffect
,
useCallback
}
from
'react'
import
{
clearSelectedStatus
,
changeProps
}
from
'lingxi-editor-core'
import
{
Row
,
Col
,
Button
,
Input
,
Pagination
,
Select
,
Form
,
message
}
from
'antd'
import
{
Row
,
Col
,
Button
,
Input
,
Pagination
,
Select
,
Form
,
message
,
Modal
}
from
'antd'
import
SettingList
from
'../../../../components/SettingList'
import
GoodsItem
from
'./GoodsItem'
import
SettingPanel
from
'../../../../components/SettingPanel'
...
...
@@ -129,6 +129,21 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
}
}
const
handleCancel
=
()
=>
{
if
(
JSON
.
stringify
(
goodsList
)
!==
JSON
.
stringify
(
selectGoodsList
))
{
Modal
.
confirm
({
content
:
"您还没有保存修改的内容,是否确认关闭?"
,
okText
:
"确认"
,
cancelText
:
"取消"
,
onOk
:
()
=>
{
clearSelectedStatus
()
}
})
}
else
{
clearSelectedStatus
()
}
}
const
handleConfirmSave
=
()
=>
{
console
.
log
(
'handleConfirmSave1'
)
if
(
JSON
.
stringify
(
goodsList
)
===
JSON
.
stringify
(
selectGoodsList
))
{
...
...
@@ -141,11 +156,22 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
}
setConfirmLoading
(
true
)
saveGoods
().
then
(()
=>
{
let
newList
=
JSON
.
parse
(
JSON
.
stringify
(
selectGoodsList
))
newList
=
newList
.
map
(
item
=>
{
let
minPrice
=
0
if
(
item
.
priceRange
&&
typeof
item
.
priceRange
===
'string'
)
{
minPrice
=
item
.
priceRange
.
split
(
"~"
)[
0
]
item
.
goodsPrice
=
minPrice
}
return
item
})
changeProps
({
props
:
{
templateid
,
categoryid
,
goodsList
:
selectGoods
List
goodsList
:
new
List
}
})
clearSelectedStatus
()
...
...
@@ -198,6 +224,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
return
(
<
SettingPanel
confirmLoading=
{
confirmLoading
}
onCancel=
{
handleCancel
}
onOK=
{
()
=>
handleConfirm
()
}
>
<
div
className=
{
styles
.
goods_setting
}
>
...
...
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