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
linweijiong
jinfa-platform
Commits
042464df
Commit
042464df
authored
Jan 18, 2021
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: app店铺模板装修
parent
fe3f8ec9
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
671 additions
and
720 deletions
+671
-720
index.tsx
src/pages/editor/components/toolBar/index.tsx
+54
-60
index.tsx
...ileSettingPanel/propsSettings/components/banner/index.tsx
+0
-8
index.tsx
...ngPanel/propsSettings/components/headBackground/index.tsx
+46
-558
index.tsx
...eSettingPanel/propsSettings/components/quickNav/index.tsx
+48
-31
column.tsx
...Settings/components/recommendCommodity/contant/column.tsx
+42
-0
schema.ts
...sSettings/components/recommendCommodity/contant/schema.ts
+86
-0
index.less
...el/propsSettings/components/recommendCommodity/index.less
+13
-0
index.tsx
...nel/propsSettings/components/recommendCommodity/index.tsx
+351
-0
index.tsx
src/pages/editor/mobileSettingPanel/propsSettings/index.tsx
+6
-0
index.tsx
...ingsPanel/propsSettings/components/GoodsSetting/index.tsx
+2
-3
config.ts
src/pages/mobileTemplate/shopTemplateEdit/config.ts
+1
-0
index.tsx
src/pages/mobileTemplate/shopTemplateEdit/index.tsx
+22
-60
No files found.
src/pages/editor/components/toolBar/index.tsx
View file @
042464df
...
...
@@ -16,7 +16,7 @@ interface ToolBarPropsType {
}
const
ToolBar
:
React
.
FC
<
ToolBarPropsType
>
=
(
props
)
=>
{
const
{
type
=
1
,
title
=
"首页"
,
showActions
,
templateId
}
=
props
const
{
type
=
1
,
title
=
"首页"
,
showActions
,
templateId
,
layoutType
}
=
props
const
[
saveLoading
,
setSaveLoading
]
=
useState
<
boolean
>
(
false
)
const
{
componentConfigs
}
=
useSelector
<
ComponentConfigsType
,
STATE_PROPS
>
([
'componentConfigs'
])
...
...
@@ -39,72 +39,66 @@ const ToolBar: React.FC<ToolBarPropsType> = (props) => {
const
handleSave
=
useCallback
(()
=>
{
const
param
:
any
=
{
templateId
:
Number
(
templateId
),
appEnterpriseBO
:
{},
}
Object
.
keys
(
componentConfigs
).
forEach
(
key
=>
{
const
componentConfigsItem
=
componentConfigs
[
key
]
if
(
componentConfigsItem
.
componentType
)
{
switch
(
componentConfigsItem
.
componentType
)
{
case
PROPS_TYPES
.
mobileHeaderNav
:
param
.
appEnterpriseBO
.
topBO
=
{
style
:
componentConfigsItem
.
props
.
styleTheme
||
0
,
status
:
true
,
topDetailsBOList
:
componentConfigsItem
.
props
.
dataList
||
[]
}
break
case
PROPS_TYPES
.
mobileBanner
:
param
.
appEnterpriseBO
.
advertBO
=
{
status
:
componentConfigsItem
.
props
.
visible
||
true
,
advertDetailsBOList
:
componentConfigsItem
.
props
.
dataList
||
[]
}
break
case
PROPS_TYPES
.
mobileQuickNav
:
param
.
appEnterpriseBO
.
functionBO
=
{
status
:
componentConfigsItem
.
props
.
visible
||
true
,
functionDetailsBO
:
componentConfigsItem
.
props
.
dataList
||
[]
}
break
case
PROPS_TYPES
.
mobileShowCase
:
param
.
appEnterpriseBO
.
showcaseBO
=
{
style
:
componentConfigsItem
.
props
.
styleTheme
||
0
,
status
:
componentConfigsItem
.
props
.
visible
||
true
,
showcaseDetailsBO
:
componentConfigsItem
.
props
.
dataList
||
[]
}
break
case
PROPS_TYPES
.
mobileRecommentShops
:
param
.
appEnterpriseBO
.
storeBO
=
{
status
:
componentConfigsItem
.
props
.
visible
||
true
,
storeIdList
:
componentConfigsItem
.
props
.
dataList
?
componentConfigsItem
.
props
.
dataList
.
map
(
item
=>
item
.
selectId
)
:
[]
}
break
case
PROPS_TYPES
.
mobileQuality
:
param
.
appEnterpriseBO
.
excellentBO
=
{
status
:
componentConfigsItem
.
props
.
visible
||
true
,
excellentDetailsBO
:
componentConfigsItem
.
props
.
dataList
||
[]
}
break
case
PROPS_TYPES
.
mobileBottomNavigation
:
param
.
appEnterpriseBO
.
bottomBO
=
{
status
:
true
,
bottomDetailsBOList
:
componentConfigsItem
.
props
.
dataList
||
[]
}
break
default
:
break
if
(
layoutType
===
LAYOUT_TYPE
.
shop
)
{
param
.
appStoreBO
=
{}
Object
.
keys
(
componentConfigs
).
forEach
(
key
=>
{
const
componentConfigsItem
=
componentConfigs
[
key
]
if
(
componentConfigsItem
.
componentType
)
{
switch
(
componentConfigsItem
.
componentType
)
{
case
PROPS_TYPES
.
mobileShopHeaderNav
:
param
.
appStoreBO
.
backdropBO
=
{
status
:
false
,
backdrop
:
componentConfigsItem
.
props
.
backdrop
||
''
}
break
case
PROPS_TYPES
.
mobileBanner
:
param
.
appStoreBO
.
advertBO
=
{
status
:
false
,
advertDetailsBOList
:
componentConfigsItem
.
props
.
dataList
||
[]
}
break
case
PROPS_TYPES
.
mobileQuickNav
:
param
.
appStoreBO
.
functionBO
=
{
status
:
false
,
functionDetailsBO
:
componentConfigsItem
.
props
.
dataList
||
[]
}
break
case
PROPS_TYPES
.
mobileShopCommodity
:
param
.
appStoreBO
.
productBO
=
{
status
:
false
,
title
:
componentConfigsItem
.
props
.
title
,
productIdList
:
componentConfigsItem
.
props
.
productIdList
,
}
break
default
:
break
}
}
}
})
})
}
else
if
(
layoutType
===
LAYOUT_TYPE
.
channel
)
{
param
.
appChannelBO
=
{}
}
console
.
log
(
JSON
.
stringify
(
param
),
"param"
)
saveAppEnterprise
(
param
)
},
[
componentConfigs
])
const
saveAppEnterprise
=
(
param
)
=>
{
PublicApi
.
postTemplateAdornAppEnterpriseSave
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
message
.
destroy
()
message
.
success
(
"保存成功"
)
}
})
let
postFn
if
(
layoutType
===
LAYOUT_TYPE
.
shop
)
{
postFn
=
PublicApi
.
postTemplateAdornAppStoreSave
}
else
if
(
layoutType
===
LAYOUT_TYPE
.
channel
)
{
postFn
=
PublicApi
.
postTemplateAdornAppChannelSave
}
if
(
postFn
)
{
postFn
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
message
.
destroy
()
message
.
success
(
"保存成功"
)
}
})
}
}
return
(
...
...
src/pages/editor/mobileSettingPanel/propsSettings/components/banner/index.tsx
View file @
042464df
...
...
@@ -51,14 +51,6 @@ const RedirectTypeList = [
label
:
'积分详情'
,
},
{
value
:
3
,
label
:
'店铺主页'
,
},
{
value
:
4
,
label
:
'资讯详情'
,
},
{
value
:
5
,
label
:
'不跳转'
,
},
...
...
src/pages/editor/mobileSettingPanel/propsSettings/components/headBackground/index.tsx
View file @
042464df
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
Button
,
Input
,
Select
,
Checkbox
,
message
}
from
'antd'
import
{
PlusOutlined
,
DeleteOutlined
}
from
'@ant-design/icons'
import
{
changeProps
}
from
'lingxi-editor-core'
import
{
ReactSortable
}
from
"react-sortablejs"
import
React
,
{
useState
}
from
'react'
import
{
PlusOutlined
}
from
'@ant-design/icons'
import
ImageBox
from
'@/components/ImageBox'
import
cx
from
'classnames'
import
isEmpty
from
'lodash/isEmpty'
import
ModalTable
from
'@/components/ModalTable'
import
{
changeProps
}
from
'lingxi-editor-core'
import
UploadImage
from
'@/components/UploadImage'
import
{
PublicApi
}
from
'@/services/api'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
{
numFormat
,
priceFormat
}
from
'@/utils/numberFomat'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
SearchSelect
from
'@/components/NiceForm/components/SearchSelect'
import
Search
from
'@/components/NiceForm/components/Search'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
{
formProduct
,
basicSchema
}
from
'./contant/schema'
import
tableColumn
from
'./contant/column'
import
arrowRightIcon
from
'@/assets/icons/arrow_right.png'
import
arrowLeftIcon
from
'@/assets/icons/arrow_left.png'
import
arrowUpIcon
from
'@/assets/icons/arrow_up.png'
import
arrowDownIcon
from
'@/assets/icons/arrow_down.png'
import
sortIcon
from
'@/assets/icons/sort_icon.png'
import
styles
from
'./index.less'
interface
DataItemType
{
sort
:
number
,
id
:
number
,
name
:
string
,
img
:
string
,
type
:
number
,
expand
:
boolean
,
selectInfo
?:
any
}
interface
BannerPropsType
{
dataList
:
DataItemType
[],
visible
:
boolean
,
}
const
RedirectTypeList
=
[
{
value
:
1
,
label
:
'商品详情'
,
},
{
value
:
2
,
label
:
'积分详情'
,
},
{
value
:
3
,
label
:
'店铺主页'
,
},
{
value
:
4
,
label
:
'资讯详情'
,
},
{
value
:
5
,
label
:
'不跳转'
,
},
]
const
modalWidthMap
=
{
1
:
960
,
2
:
960
,
3
:
600
,
4
:
600
backdrop
:
string
,
}
const
HeadBackground
:
React
.
FC
<
BannerPropsType
>
=
(
props
)
=>
{
const
{
dataList
,
visible
}
=
props
const
[
list
,
setList
]
=
useState
<
DataItemType
[]
>
([])
const
[
modalVisible
,
setModalVisible
]
=
useState
<
boolean
>
(
false
)
const
[
currentInfo
,
setCurrentInfo
]
=
useState
<
DataItemType
>
()
const
[
productRowSelection
,
productRowCtl
]
=
useRowSelectionTable
({
type
:
'radio'
})
useEffect
(()
=>
{
initDataList
()
},
[
dataList
])
const
initDataList
=
()
=>
{
if
(
dataList
)
{
const
newDataList
=
dataList
.
map
((
item
:
DataItemType
,
index
:
number
)
=>
{
item
.
sort
=
index
+
1
item
.
expand
=
item
.
expand
||
false
return
item
})
setList
(
newDataList
)
}
}
const
handleExpand
=
async
(
sort
:
number
,
expand
:
boolean
)
=>
{
const
newList
=
[...
list
]
for
(
const
item
of
newList
)
{
if
(
item
.
sort
===
sort
)
{
item
.
expand
=
expand
// 获取当前选择链接的信息
if
(
item
.
id
&&
!
item
.
selectInfo
)
{
item
.
selectInfo
=
await
getSelectInfo
(
item
)
}
}
else
{
item
.
expand
=
false
}
}
setList
(
newList
)
}
/**
* 根据选中的类型和id获取信息
* @param data
*/
const
getSelectInfo
=
(
data
:
DataItemType
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
getFn
:
any
=
null
const
param
:
any
=
{}
switch
(
data
.
type
)
{
case
1
:
case
2
:
param
.
commodityId
=
data
.
id
getFn
=
PublicApi
.
getSearchMobileShopStoreGetCommodityDetail
break
default
:
break
}
getFn
&&
getFn
(
param
).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
}
const
sortUp
=
(
index
:
number
,
item
:
DataItemType
)
=>
{
const
newList
=
JSON
.
parse
(
JSON
.
stringify
(
list
))
const
tempItem
=
JSON
.
parse
(
JSON
.
stringify
(
item
))
const
temp
=
newList
[
index
-
1
]
newList
[
index
-
1
]
=
item
newList
[
index
-
1
].
id
=
temp
.
id
newList
[
index
]
=
temp
newList
[
index
].
id
=
tempItem
.
id
setList
(
newList
)
changeProps
({
props
:
Object
.
assign
({...
props
},
{
dataList
:
newList
})
})
}
const
sortDown
=
(
index
:
number
,
item
:
DataItemType
)
=>
{
const
newList
=
JSON
.
parse
(
JSON
.
stringify
(
list
))
const
temp
=
newList
[
index
+
1
]
const
tempItem
=
JSON
.
parse
(
JSON
.
stringify
(
item
))
newList
[
index
+
1
]
=
item
newList
[
index
+
1
].
id
=
temp
.
id
newList
[
index
]
=
temp
newList
[
index
].
id
=
tempItem
.
id
setList
(
newList
)
changeProps
({
props
:
Object
.
assign
({...
props
},
{
dataList
:
newList
})
})
}
const
handleIconChange
=
(
url
:
string
,
sort
:
number
)
=>
{
const
newList
=
[...
list
]
newList
.
map
(
item
=>
{
if
(
item
.
sort
===
sort
)
{
item
.
img
=
url
}
})
setList
(
newList
)
changeProps
({
props
:
Object
.
assign
({
...
props
},
{
dataList
:
newList
})
})
}
/**
* 显示隐藏模块
*/
const
handleHideChange
=
(
e
)
=>
{
const
checked
=
e
.
target
.
checked
changeProps
({
props
:
Object
.
assign
({
...
props
},
{
visible
:
!
checked
})
})
}
/**
* 根据id删除某一项
* @param id
*/
const
handleClickItem
=
(
sort
:
number
)
=>
{
const
newList
=
[...
list
]
const
result
=
newList
.
filter
(
item
=>
item
.
sort
!==
sort
)
setList
(
result
)
changeProps
({
props
:
Object
.
assign
({
...
props
},
{
dataList
:
result
})
})
}
/**
* 修改跳转类型
*/
const
handleTypeChange
=
(
type
:
number
,
sort
:
number
)
=>
{
const
newList
=
[...
list
]
newList
.
map
(
item
=>
{
if
(
item
.
sort
===
sort
)
{
item
.
type
=
type
item
.
selectInfo
=
null
}
})
setList
(
newList
)
changeProps
({
props
:
Object
.
assign
({
...
props
},
{
dataList
:
newList
})
})
}
/**
* 修改名称
* @param value
* @param id
*/
const
handleNameChange
=
(
value
:
string
,
sort
:
number
)
=>
{
const
newList
=
[...
list
]
newList
.
map
(
item
=>
{
if
(
item
.
sort
===
sort
)
{
item
.
name
=
value
}
})
setList
(
newList
)
changeProps
({
props
:
Object
.
assign
({
...
props
},
{
dataList
:
newList
})
})
}
/**
* 添加广告
*/
const
handleAddItem
=
()
=>
{
const
newList
=
[...
list
]
const
newItem
:
DataItemType
=
{
sort
:
newList
.
length
+
1
,
id
:
0
,
expand
:
true
,
img
:
""
,
type
:
0
,
name
:
""
}
handleExpand
(
newItem
.
id
,
true
)
setList
([...
newList
,
newItem
])
changeProps
({
props
:
Object
.
assign
({
...
props
},
{
dataList
:
[...
newList
,
newItem
]
})
})
}
const
{
backdrop
}
=
props
const
[
expandState
,
setExpandState
]
=
useState
<
boolean
>
(
true
)
/**
* 删除跳转选项
* @param sort
*/
const
handleDeleteSelectItem
=
(
sort
:
number
)
=>
{
const
newList
=
[...
list
]
newList
.
map
(
item
=>
{
if
(
item
.
sort
===
sort
)
{
item
.
id
=
0
,
item
.
selectInfo
=
null
}
})
setList
(
newList
)
const
handleBackdropChange
=
(
url
:
string
)
=>
{
changeProps
({
props
:
Object
.
assign
({
...
props
},
{
dataList
:
newList
})
props
:
Object
.
assign
({
...
props
},
{
backdrop
:
url
})
})
}
/**
* 根据类型显示选择的信息
* @param type 1-商品详情 2-积分详情 3-店铺主页 4-资讯详情 5-不跳转
*/
const
renderSelectItemByType
=
(
type
:
number
,
item
:
DataItemType
)
=>
{
switch
(
type
)
{
case
1
:
return
(
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
></
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
div
className=
{
styles
.
selectInfoBox
}
>
<
ImageBox
direction=
"column"
width=
{
60
}
height=
{
60
}
imgUrl=
{
item
.
selectInfo
.
mainPic
}
/>
<
div
className=
{
styles
.
selectInfo
}
>
<
div
className=
{
styles
.
selectInfo_name
}
>
{
item
.
selectInfo
.
name
}
</
div
>
<
div
className=
{
styles
.
selectInfo_price
}
>
¥
{
priceFormat
(
item
.
selectInfo
.
min
)
}
</
div
>
</
div
>
<
div
className=
{
styles
.
selectInfoBox_delete
}
onClick=
{
()
=>
handleDeleteSelectItem
(
item
.
sort
)
}
>
<
DeleteOutlined
/>
</
div
>
</
div
>
</
div
>
</
div
>
)
case
2
:
return
(
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
></
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
div
className=
{
styles
.
selectInfoBox
}
>
<
ImageBox
direction=
"column"
width=
{
60
}
height=
{
60
}
imgUrl=
{
item
.
selectInfo
.
mainPic
}
/>
<
div
className=
{
cx
(
styles
.
selectInfo
,
styles
.
integral
)
}
>
<
div
className=
{
styles
.
selectInfo_name
}
>
{
item
.
selectInfo
.
name
}
</
div
>
<
div
className=
{
styles
.
selectInfo_price
}
>
{
numFormat
(
item
.
selectInfo
.
min
)
}
积分
</
div
>
</
div
>
<
div
className=
{
styles
.
selectInfoBox_delete
}
onClick=
{
()
=>
handleDeleteSelectItem
(
item
.
sort
)
}
>
<
DeleteOutlined
/>
</
div
>
</
div
>
</
div
>
</
div
>
)
case
3
:
return
(
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
></
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
div
className=
{
styles
.
selectInfoBox
}
>
<
ImageBox
direction=
"column"
width=
{
60
}
height=
{
60
}
imgUrl=
{
item
.
selectInfo
.
logo
}
/>
<
div
className=
{
cx
(
styles
.
selectInfo
,
styles
.
shop
)
}
>
<
div
className=
{
styles
.
selectInfo_name
}
>
{
item
.
selectInfo
.
memberName
}
</
div
>
</
div
>
<
div
className=
{
styles
.
selectInfoBox_delete
}
onClick=
{
()
=>
handleDeleteSelectItem
(
item
.
sort
)
}
>
<
DeleteOutlined
/>
</
div
>
</
div
>
</
div
>
</
div
>
)
case
4
:
return
(
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
></
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
div
className=
{
styles
.
selectInfoBox
}
>
<
ImageBox
direction=
"column"
width=
{
60
}
height=
{
60
}
imgUrl=
{
item
.
selectInfo
.
imageUrl
}
/>
<
div
className=
{
cx
(
styles
.
selectInfo
,
styles
.
information
)
}
>
<
div
className=
{
styles
.
selectInfo_name
}
>
{
item
.
selectInfo
.
title
}
</
div
>
</
div
>
<
div
className=
{
styles
.
selectInfoBox_delete
}
onClick=
{
()
=>
handleDeleteSelectItem
(
item
.
sort
)
}
>
<
DeleteOutlined
/>
</
div
>
</
div
>
</
div
>
</
div
>
)
default
:
return
null
}
}
/**
* 打开选择模态框
* @param sort
* @param type
*/
const
handleOpenSelectModal
=
(
item
:
DataItemType
)
=>
{
setCurrentInfo
(
item
)
setModalVisible
(
true
)
}
const
handleModalOk
=
async
()
=>
{
const
selectResult
=
productRowCtl
.
selectRow
[
0
]
if
(
!
selectResult
)
{
message
.
info
(
"请选择"
)
return
null
}
const
newList
=
[...
list
]
newList
.
map
(
item
=>
{
if
(
item
.
sort
===
currentInfo
?.
sort
)
{
item
.
id
=
selectResult
.
id
item
.
selectInfo
=
selectResult
}
})
setList
(
newList
)
changeProps
({
props
:
Object
.
assign
({
...
props
},
{
dataList
:
newList
})
})
setModalVisible
(
false
)
}
const
handleModalCancel
=
async
()
=>
{
setModalVisible
(
false
)
}
/**
* 获取模态框数据
* @param param
*/
const
fetchTableList
=
async
(
param
:
any
)
=>
{
const
params
:
any
=
{
...
param
,
}
let
getFn
:
any
=
null
switch
(
currentInfo
?.
type
)
{
case
1
:
params
.
priceTypeList
=
[
1
]
params
.
idNotInList
=
[
currentInfo
.
id
]
getFn
=
PublicApi
.
postSearchMobileShopEnterpriseGetCommodityList
break
case
2
:
params
.
priceTypeList
=
[
3
]
params
.
idNotInList
=
[
currentInfo
.
id
]
getFn
=
PublicApi
.
postSearchMobileShopScoreGetCommodityList
break
case
3
:
params
.
idList
=
[
currentInfo
.
id
]
getFn
=
PublicApi
.
getTemplateWebMemberShopWebPageByIdNotIn
break
case
4
:
params
.
idList
=
[
currentInfo
.
id
]
getFn
=
PublicApi
.
getManageContentInformationPageByIdNotIn
break
default
:
break
}
const
res
=
getFn
?
await
getFn
(
params
,
{
ctlType
:
'none'
})
:
await
new
Promise
((
resolve
)
=>
resolve
({
data
:
[],
totolCount
:
0
}))
return
res
.
data
}
/**
* 根据类型显示文案
* @param type
*/
const
showTextByType
=
(
type
:
number
)
=>
{
switch
(
type
)
{
case
1
:
return
"商品"
case
2
:
return
"商品"
case
3
:
return
"店铺"
case
4
:
return
"资讯"
default
:
return
""
}
}
return
(
<
div
className=
{
styles
.
setting
}
>
{
/* <div className={styles.hideModule}>
<Checkbox checked={!visible} onChange={handleHideChange}>隐藏整个模块</Checkbox>
</div> */
}
<
ReactSortable
list=
{
list
}
setList=
{
(
newList
)
=>
{
setList
(
newList
)
if
(
!
isEmpty
(
newList
))
{
changeProps
({
props
:
Object
.
assign
({
...
props
},
{
dataList
:
newList
})
})
}
}
}
handle=
".draghandle"
>
{
list
.
map
((
item
,
index
)
=>
(
<
div
className=
{
styles
.
setting_line
}
key=
{
`setting_${index}`
}
>
<
div
className=
{
styles
.
setting_line_main
}
>
<
div
className=
{
styles
.
setting_line_name
}
>
<
div
style=
{
{
flex
:
1
}
}
onClick=
{
()
=>
handleExpand
(
item
.
sort
,
!
item
.
expand
)
}
>
{
item
.
expand
?
<
img
className=
{
styles
.
icon
}
src=
{
arrowLeftIcon
}
/>
:
<
img
className=
{
styles
.
icon
}
src=
{
arrowRightIcon
}
/>
}
<
span
>
{
item
.
name
}
</
span
>
</
div
>
<
div
className=
{
styles
.
setting_line_operation
}
>
<
Button
type=
"link"
disabled=
{
index
===
0
}
onClick=
{
()
=>
sortUp
(
index
,
item
)
}
className=
{
styles
.
setting_line_operation_btn
}
icon=
{
<
img
className=
{
styles
.
setting_line_operation_btn_icon
}
src=
{
arrowUpIcon
}
/>
}
></
Button
>
<
Button
type=
"link"
disabled=
{
index
===
list
.
length
-
1
}
onClick=
{
()
=>
sortDown
(
index
,
item
)
}
className=
{
styles
.
setting_line_operation_btn
}
icon=
{
<
img
className=
{
styles
.
setting_line_operation_btn_icon
}
src=
{
arrowDownIcon
}
/>
}
></
Button
>
<
Button
type=
"link"
className=
{
cx
(
styles
.
setting_line_operation_btn
,
"draghandle"
)
}
icon=
{
<
img
className=
{
styles
.
setting_line_operation_btn_icon
}
src=
{
sortIcon
}
/>
}
></
Button
>
</
div
>
</
div
>
<
div
className=
{
styles
.
setting_line
}
>
<
div
className=
{
styles
.
setting_line_main
}
>
<
div
className=
{
styles
.
setting_line_name
}
>
<
div
style=
{
{
flex
:
1
}
}
onClick=
{
()
=>
setExpandState
(
!
expandState
)
}
>
{
!!
item
.
expand
&&
(
<
div
className=
{
styles
.
setting_line_addItem
}
>
<
div
className=
{
styles
.
deleteItem
}
>
<
label
onClick=
{
()
=>
handleClickItem
(
item
.
sort
)
}
>
<
DeleteOutlined
className=
{
styles
.
deleteItem_icon
}
/>
<
span
>
删除入口
</
span
>
</
label
>
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
>
名称:
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
Input
value=
{
item
.
name
}
onChange=
{
(
e
)
=>
handleNameChange
(
e
.
target
.
value
,
item
.
sort
)
}
/>
</
div
>
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
>
图片:
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
div
className=
{
styles
.
uploadIconWrap
}
>
<
ImageBox
className=
{
styles
.
uploadPreview
}
width=
{
90
}
height=
{
90
}
imgUrl=
{
item
.
img
}
/>
<
UploadImage
fileMaxSize=
{
200
}
onChange=
{
(
url
)
=>
handleIconChange
(
url
,
item
.
sort
)
}
listType=
"text"
>
<
div
className=
{
styles
.
uploadIconBtn
}
>
<
PlusOutlined
className=
{
styles
.
uploadIconBtnIcon
}
/>
<
span
>
点击上传
</
span
>
</
div
>
</
UploadImage
>
</
div
>
<
label
className=
{
styles
.
uploadIconTip
}
>
图片建议尺寸:1920*750
</
label
>
<
label
className=
{
styles
.
uploadIconTip
}
>
大小:不超过200k
</
label
>
</
div
>
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
>
跳转类型:
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
Select
style=
{
{
width
:
'100%'
}
}
value=
{
item
.
type
||
undefined
}
onChange=
{
(
value
)
=>
handleTypeChange
(
value
,
item
.
sort
)
}
>
{
RedirectTypeList
.
map
(
item
=>
(<
Select
.
Option
value=
{
item
.
value
}
key=
{
`redirect_type_${item.value}`
}
>
{
item
.
label
}
</
Select
.
Option
>))
}
</
Select
>
</
div
>
</
div
>
{
item
.
type
!==
5
&&
(
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
>
跳转
{
showTextByType
(
item
.
type
)
}
:
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
Button
className=
{
styles
.
selectBtn
}
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
handleOpenSelectModal
(
item
)
}
>
选择
{
showTextByType
(
item
.
type
)
}
</
Button
>
</
div
>
</
div
>
)
}
{
item
.
selectInfo
?
renderSelectItemByType
(
item
.
type
,
item
)
:
null
}
</
div
>
)
expandState
?
<
img
className=
{
styles
.
icon
}
src=
{
arrowLeftIcon
}
/>
:
<
img
className=
{
styles
.
icon
}
src=
{
arrowRightIcon
}
/>
}
<
span
>
背景图
</
span
>
</
div
>
</
div
>
))
}
</
ReactSortable
>
<
Button
className=
{
styles
.
selectBtn
}
icon=
{
<
PlusOutlined
/>
}
onClick=
{
handleAddItem
}
>
添加广告
</
Button
>
<
ModalTable
modalTitle=
{
`选择${showTextByType(currentInfo?.type || 1)}`
}
width=
{
modalWidthMap
[
currentInfo
?.
type
||
1
]
}
confirm=
{
handleModalOk
}
cancel=
{
handleModalCancel
}
scroll=
{
{
y
:
400
}
}
visible=
{
modalVisible
}
columns=
{
tableColumn
[
currentInfo
?.
type
||
1
]
}
rowSelection=
{
productRowSelection
}
fetchTableData=
{
params
=>
fetchTableList
(
params
)
}
formilyProps=
{
{
ctx
:
{
schema
:
currentInfo
?.
type
===
1
?
formProduct
:
basicSchema
,
components
:
{
ModalSearch
:
Search
,
SearchSelect
,
Submit
}
,
effects
:
(
$
,
actions
)
=>
{
actions
.
reset
()
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'name'
,
FORM_FILTER_PATH
,
);
}
}
expandState
&&
(
<
div
className=
{
styles
.
setting_line_addItem
}
>
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
>
名称:
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
背景图
</
div
>
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
>
图片:
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
div
className=
{
styles
.
uploadIconWrap
}
>
<
ImageBox
className=
{
styles
.
uploadPreview
}
width=
{
90
}
height=
{
90
}
imgUrl=
{
backdrop
}
/>
<
UploadImage
fileMaxSize=
{
200
}
onChange=
{
(
url
)
=>
handleBackdropChange
(
url
)
}
listType=
"text"
>
<
div
className=
{
styles
.
uploadIconBtn
}
>
<
PlusOutlined
className=
{
styles
.
uploadIconBtnIcon
}
/>
<
span
>
点击上传
</
span
>
</
div
>
</
UploadImage
>
</
div
>
<
label
className=
{
styles
.
uploadIconTip
}
>
图片建议尺寸:1920*750
</
label
>
<
label
className=
{
styles
.
uploadIconTip
}
>
大小:不超过200k
</
label
>
</
div
>
</
div
>
</
div
>
)
}
}
resetModal=
{
{
destroyOnClose
:
true
}
}
tableProps=
{
{
rowKey
:
'id'
,
onRow
:
(
record
)
=>
({
onClick
:
()
=>
{
productRowCtl
.
setSelectRow
([
record
]);
productRowCtl
.
setSelectedRowKeys
([
record
.
id
]);
},
})
}
}
/>
</
div
>
</
div
>
</
div
>
)
}
...
...
src/pages/editor/mobileSettingPanel/propsSettings/components/quickNav/index.tsx
View file @
042464df
...
...
@@ -29,50 +29,27 @@ interface QuickNavPropsType {
visible
:
boolean
,
}
// 跳转类型:1-商品 2-分类 3-积分兑换 4-公司介绍 5-成为会员 12-外部链接(可多个)
const
RedirectTypeList
=
[
{
value
:
1
,
label
:
'
找现货
'
,
label
:
'
商品
'
,
},
{
value
:
2
,
label
:
'
找供应
'
,
label
:
'
分类
'
,
},
{
value
:
3
,
label
:
'
发布求购
'
,
label
:
'
积分兑换
'
,
},
{
value
:
4
,
label
:
'
求购列表
'
,
label
:
'
公司介绍
'
,
},
{
value
:
5
,
label
:
'换积分'
,
},
{
value
:
6
,
label
:
'找店铺'
,
},
{
value
:
7
,
label
:
'看资讯'
,
},
{
value
:
8
,
label
:
'授信申请'
,
},
{
value
:
9
,
label
:
'人气店铺'
,
},
{
value
:
10
,
label
:
'求购动态'
,
},
{
value
:
11
,
label
:
'最新成交'
,
label
:
'成为会员'
,
},
{
value
:
12
,
...
...
@@ -234,6 +211,26 @@ const QuickNav: React.FC<QuickNavPropsType> = (props) => {
}
/**
* 修改广告链接
* @param value
* @param id
*/
const
handleUrlChange
=
(
value
:
string
,
id
:
number
)
=>
{
console
.
log
(
value
,
"value"
)
const
newList
=
[...
list
]
newList
.
map
(
item
=>
{
if
(
item
.
id
===
id
)
{
item
.
url
=
`https://
${
value
}
`
}
})
setList
(
newList
)
changeProps
({
props
:
Object
.
assign
({
...
props
},
{
dataList
:
newList
})
})
}
/**
* 添加广告
*/
const
handleAddItem
=
()
=>
{
...
...
@@ -253,6 +250,14 @@ const QuickNav: React.FC<QuickNavPropsType> = (props) => {
})
}
const
judgedItemNotInList
=
(
item
,
type
:
number
)
=>
{
if
(
item
.
value
===
type
)
{
return
true
}
return
list
.
every
(
listItem
=>
listItem
.
type
!==
item
.
value
)
}
return
(
<
div
className=
{
styles
.
setting
}
>
{
/* <div className={styles.hideModule}>
...
...
@@ -308,11 +313,21 @@ const QuickNav: React.FC<QuickNavPropsType> = (props) => {
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
Select
style=
{
{
width
:
'100%'
}
}
value=
{
item
.
type
||
undefined
}
onChange=
{
(
value
)
=>
handleTypeChange
(
value
,
item
.
id
)
}
>
{
RedirectTypeList
.
map
(
item
=>
(<
Select
.
Option
value=
{
item
.
value
}
key=
{
`redirect_type_${item.value}`
}
>
{
i
tem
.
label
}
</
Select
.
Option
>))
RedirectTypeList
.
map
(
selectItem
=>
judgedItemNotInList
(
selectItem
,
item
.
type
)
&&
(<
Select
.
Option
value=
{
selectItem
.
value
}
key=
{
`redirect_type_${selectItem.value}`
}
>
{
selectI
tem
.
label
}
</
Select
.
Option
>))
}
</
Select
>
</
div
>
</
div
>
{
item
.
type
===
12
&&
(
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
>
链接地址:
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
Input
addonBefore=
"https://"
value=
{
item
.
url
}
onChange=
{
(
e
)
=>
handleUrlChange
(
e
.
target
.
value
,
item
.
id
)
}
/>
</
div
>
</
div
>
)
}
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
>
图标:
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
...
...
@@ -340,7 +355,9 @@ const QuickNav: React.FC<QuickNavPropsType> = (props) => {
</
div
>
))
}
</
ReactSortable
>
<
Button
className=
{
styles
.
selectBtn
}
icon=
{
<
PlusOutlined
/>
}
onClick=
{
handleAddItem
}
>
添加功能模块
</
Button
>
{
list
.
length
<=
5
&&
<
Button
className=
{
styles
.
selectBtn
}
icon=
{
<
PlusOutlined
/>
}
onClick=
{
handleAddItem
}
>
添加功能模块
</
Button
>
}
</
div
>
)
}
...
...
src/pages/editor/mobileSettingPanel/propsSettings/components/recommendCommodity/contant/column.tsx
0 → 100644
View file @
042464df
import
React
from
'react'
import
{
numFormat
,
priceFormat
}
from
'@/utils/numberFomat'
import
ImageBox
from
'@/components/ImageBox'
const
showMainPic
=
(
mainPic
:
string
)
=>
<
ImageBox
width=
{
32
}
height=
{
32
}
imgUrl=
{
mainPic
}
/>
export
const
promptCommodityColumn
=
[
{
title
:
'ID'
,
dataIndex
:
'id'
,
key
:
'id'
,
width
:
80
,
},
{
title
:
"商品图片"
,
dataIndex
:
"mainPic"
,
render
:
(
mainPic
:
string
)
=>
showMainPic
(
mainPic
)
},
{
title
:
"商品名称"
,
dataIndex
:
"name"
,
width
:
280
,
ellipsis
:
true
,
},
{
title
:
"品类"
,
render
:
(
_
,
record
)
=>
record
.
customerCategory
?
record
.
customerCategory
.
name
:
""
,
ellipsis
:
true
,
},
{
title
:
"品牌"
,
render
:
(
_
,
record
)
=>
record
.
brand
?
record
.
brand
.
name
:
""
,
ellipsis
:
true
,
},
{
title
:
"价格"
,
dataIndex
:
"min"
,
render
:
(
_
,
record
)
=>
`¥
${
priceFormat
(
record
.
min
)}
`
},
]
export
default
promptCommodityColumn
src/pages/editor/mobileSettingPanel/propsSettings/components/recommendCommodity/contant/schema.ts
0 → 100644
View file @
042464df
import
{
ISchema
}
from
'@formily/antd'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
{
PublicApi
}
from
'@/services/api'
export
const
formProduct
:
ISchema
=
{
type
:
'object'
,
properties
:
{
name
:
{
type
:
'string'
,
'x-component'
:
'ModalSearch'
,
'x-component-props'
:
{
placeholder
:
'搜索'
,
align
:
'flex-left'
,
},
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'flex-layout'
,
'x-component-props'
:
{
rowStyle
:
{
flexWrap
:
'nowrap'
,
style
:
{
marginRight
:
0
}
},
colStyle
:
{
marginTop
:
20
,
},
},
properties
:
{
customerCategoryId
:
{
type
:
'string'
,
"x-component"
:
'SearchSelect'
,
"x-component-props"
:
{
placeholder
:
'请选择品类'
,
className
:
'fixed-ant-selected-down'
,
// 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
queryParams
:
{
storeId
:
2
,
},
fetchSearch
:
PublicApi
.
getProductSelectGetSelectCategory
,
style
:
{
width
:
160
}
}
},
brandId
:
{
type
:
'string'
,
"x-component"
:
'SearchSelect'
,
"x-component-props"
:
{
placeholder
:
'请选择品牌'
,
queryParams
:
{
storeId
:
2
,
},
fetchSearch
:
PublicApi
.
getSearchMobileShopStoreGetBrand
,
style
:
{
width
:
160
}
}
},
submit
:
{
"x-component"
:
'Submit'
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
'查询'
}
}
}
}
}
}
export
const
basicSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
name
:
{
type
:
'string'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
placeholder
:
'搜索'
,
align
:
'flex-left'
,
},
},
}
}
src/pages/editor/mobileSettingPanel/propsSettings/components/recommendCommodity/index.less
0 → 100644
View file @
042464df
@import "../../../../../../global//styles/utils.less";
@import "../../common.less";
.selectBtn {
display: block;
width: 100%;
background-color: #FAFBFC;
border: 1px dashed #D8DDE6;
}
.uploadPreview {
border: 1px solid #EBECF0;
}
src/pages/editor/mobileSettingPanel/propsSettings/components/recommendCommodity/index.tsx
0 → 100644
View file @
042464df
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
Button
,
Input
,
Select
,
Checkbox
,
message
}
from
'antd'
import
{
PlusOutlined
,
DeleteOutlined
}
from
'@ant-design/icons'
import
{
changeProps
}
from
'lingxi-editor-core'
import
{
ReactSortable
}
from
"react-sortablejs"
import
ImageBox
from
'@/components/ImageBox'
import
cx
from
'classnames'
import
isEmpty
from
'lodash/isEmpty'
import
ModalTable
from
'@/components/ModalTable'
import
UploadImage
from
'@/components/UploadImage'
import
{
PublicApi
}
from
'@/services/api'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
{
numFormat
,
priceFormat
}
from
'@/utils/numberFomat'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
SearchSelect
from
'@/components/NiceForm/components/SearchSelect'
import
Search
from
'@/components/NiceForm/components/Search'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
{
formProduct
,
basicSchema
}
from
'./contant/schema'
import
promptCommodityColumn
from
'./contant/column'
import
arrowRightIcon
from
'@/assets/icons/arrow_right.png'
import
arrowLeftIcon
from
'@/assets/icons/arrow_left.png'
import
arrowUpIcon
from
'@/assets/icons/arrow_up.png'
import
arrowDownIcon
from
'@/assets/icons/arrow_down.png'
import
sortIcon
from
'@/assets/icons/sort_icon.png'
import
styles
from
'./index.less'
interface
DataItemType
{
sort
:
number
,
id
:
number
,
name
:
string
,
img
:
string
,
type
:
number
,
expand
:
boolean
,
selectInfo
?:
any
}
interface
BannerPropsType
{
dataList
:
DataItemType
[],
productIdList
:
number
[],
storeId
:
number
,
title
:
string
,
}
const
RedirectTypeList
=
[
{
value
:
1
,
label
:
'商品详情'
,
},
{
value
:
2
,
label
:
'积分详情'
,
},
{
value
:
5
,
label
:
'不跳转'
,
},
]
const
modalWidthMap
=
{
1
:
960
,
2
:
960
,
3
:
600
,
4
:
600
}
const
RecommendCommodity
:
React
.
FC
<
BannerPropsType
>
=
(
props
)
=>
{
const
{
dataList
,
title
,
storeId
,
productIdList
}
=
props
const
[
expandState
,
setExpandState
]
=
useState
<
boolean
>
(
true
)
const
[
list
,
setList
]
=
useState
<
DataItemType
[]
>
([])
const
[
modalVisible
,
setModalVisible
]
=
useState
<
boolean
>
(
false
)
const
[
currentInfo
,
setCurrentInfo
]
=
useState
<
DataItemType
>
()
const
[
recommendTitle
,
setRecommendTitle
]
=
useState
<
string
>
(
title
)
const
[
productRowSelection
,
productRowCtl
]
=
useRowSelectionTable
()
/**
* 根据选中的类型和id获取信息
* @param data
*/
const
getSelectInfo
=
(
data
:
DataItemType
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
getFn
:
any
=
null
const
param
:
any
=
{}
switch
(
data
.
type
)
{
case
1
:
case
2
:
param
.
commodityId
=
data
.
id
getFn
=
PublicApi
.
getSearchMobileShopStoreGetCommodityDetail
break
default
:
break
}
getFn
&&
getFn
(
param
).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
}
/**
* 修改名称
* @param value
* @param id
*/
const
handleNameChange
=
(
value
:
string
)
=>
{
setRecommendTitle
(
value
)
changeProps
({
props
:
Object
.
assign
({
...
props
},
{
title
:
value
})
})
}
/**
* 删除跳转选项
* @param sort
*/
const
handleDeleteSelectItem
=
(
sort
:
number
)
=>
{
const
newList
=
[...
list
]
newList
.
map
(
item
=>
{
if
(
item
.
sort
===
sort
)
{
item
.
id
=
0
,
item
.
selectInfo
=
null
}
})
setList
(
newList
)
changeProps
({
props
:
Object
.
assign
({
...
props
},
{
dataList
:
newList
})
})
}
/**
* 根据类型显示选择的信息
* @param type 1-商品详情 2-积分详情 3-店铺主页 4-资讯详情 5-不跳转
*/
const
renderSelectItemByType
=
(
type
:
number
,
item
:
DataItemType
)
=>
{
switch
(
type
)
{
case
1
:
return
(
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
></
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
div
className=
{
styles
.
selectInfoBox
}
>
<
ImageBox
direction=
"column"
width=
{
60
}
height=
{
60
}
imgUrl=
{
item
.
selectInfo
.
mainPic
}
/>
<
div
className=
{
styles
.
selectInfo
}
>
<
div
className=
{
styles
.
selectInfo_name
}
>
{
item
.
selectInfo
.
name
}
</
div
>
<
div
className=
{
styles
.
selectInfo_price
}
>
¥
{
priceFormat
(
item
.
selectInfo
.
min
)
}
</
div
>
</
div
>
<
div
className=
{
styles
.
selectInfoBox_delete
}
onClick=
{
()
=>
handleDeleteSelectItem
(
item
.
sort
)
}
>
<
DeleteOutlined
/>
</
div
>
</
div
>
</
div
>
</
div
>
)
case
2
:
return
(
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
></
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
div
className=
{
styles
.
selectInfoBox
}
>
<
ImageBox
direction=
"column"
width=
{
60
}
height=
{
60
}
imgUrl=
{
item
.
selectInfo
.
mainPic
}
/>
<
div
className=
{
cx
(
styles
.
selectInfo
,
styles
.
integral
)
}
>
<
div
className=
{
styles
.
selectInfo_name
}
>
{
item
.
selectInfo
.
name
}
</
div
>
<
div
className=
{
styles
.
selectInfo_price
}
>
{
numFormat
(
item
.
selectInfo
.
min
)
}
积分
</
div
>
</
div
>
<
div
className=
{
styles
.
selectInfoBox_delete
}
onClick=
{
()
=>
handleDeleteSelectItem
(
item
.
sort
)
}
>
<
DeleteOutlined
/>
</
div
>
</
div
>
</
div
>
</
div
>
)
case
3
:
return
(
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
></
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
div
className=
{
styles
.
selectInfoBox
}
>
<
ImageBox
direction=
"column"
width=
{
60
}
height=
{
60
}
imgUrl=
{
item
.
selectInfo
.
logo
}
/>
<
div
className=
{
cx
(
styles
.
selectInfo
,
styles
.
shop
)
}
>
<
div
className=
{
styles
.
selectInfo_name
}
>
{
item
.
selectInfo
.
memberName
}
</
div
>
</
div
>
<
div
className=
{
styles
.
selectInfoBox_delete
}
onClick=
{
()
=>
handleDeleteSelectItem
(
item
.
sort
)
}
>
<
DeleteOutlined
/>
</
div
>
</
div
>
</
div
>
</
div
>
)
case
4
:
return
(
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
></
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
div
className=
{
styles
.
selectInfoBox
}
>
<
ImageBox
direction=
"column"
width=
{
60
}
height=
{
60
}
imgUrl=
{
item
.
selectInfo
.
imageUrl
}
/>
<
div
className=
{
cx
(
styles
.
selectInfo
,
styles
.
information
)
}
>
<
div
className=
{
styles
.
selectInfo_name
}
>
{
item
.
selectInfo
.
title
}
</
div
>
</
div
>
<
div
className=
{
styles
.
selectInfoBox_delete
}
onClick=
{
()
=>
handleDeleteSelectItem
(
item
.
sort
)
}
>
<
DeleteOutlined
/>
</
div
>
</
div
>
</
div
>
</
div
>
)
default
:
return
null
}
}
/**
* 打开选择模态框
* @param sort
* @param type
*/
const
handleOpenSelectModal
=
()
=>
{
setModalVisible
(
true
)
}
const
handleModalOk
=
async
()
=>
{
const
selectResult
=
productRowCtl
.
selectRow
if
(
!
selectResult
||
isEmpty
(
selectResult
))
{
message
.
info
(
"请选择"
)
return
null
}
// const newList = [...list]
// newList.map(item => {
// if (item.sort === currentInfo?.sort) {
// item.id = selectResult.id
// item.selectInfo = selectResult
// }
// })
// setList(newList)
changeProps
({
props
:
Object
.
assign
({
...
props
},
{
productIdList
:
productRowCtl
.
selectedRowKeys
})
})
setModalVisible
(
false
)
}
const
handleModalCancel
=
async
()
=>
{
setModalVisible
(
false
)
}
/**
* 获取模态框数据
* @param param
*/
const
fetchTableList
=
async
(
param
:
any
)
=>
{
const
params
:
any
=
{
...
param
,
priceTypeList
:
[
1
],
idNotInList
:
productIdList
,
storeId
}
const
res
=
await
PublicApi
.
postSearchMobileShopStoreGetCommodityList
(
params
,
{
ctlType
:
'none'
})
return
res
.
data
}
return
(
<
div
className=
{
styles
.
setting
}
>
{
/* <div className={styles.hideModule}>
<Checkbox checked={!visible} onChange={handleHideChange}>隐藏整个模块</Checkbox>
</div> */
}
<
div
className=
{
styles
.
setting_line
}
>
<
div
className=
{
styles
.
setting_line_main
}
>
<
div
className=
{
styles
.
setting_line_name
}
>
<
div
style=
{
{
flex
:
1
}
}
onClick=
{
()
=>
setExpandState
(
!
expandState
)
}
>
{
expandState
?
<
img
className=
{
styles
.
icon
}
src=
{
arrowLeftIcon
}
/>
:
<
img
className=
{
styles
.
icon
}
src=
{
arrowRightIcon
}
/>
}
<
span
>
{
title
}
</
span
>
</
div
>
</
div
>
{
expandState
&&
(
<
div
className=
{
styles
.
setting_line_addItem
}
>
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
>
名称:
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
Input
value=
{
recommendTitle
}
onChange=
{
(
e
)
=>
handleNameChange
(
e
.
target
.
value
)
}
/>
</
div
>
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line
}
>
<
div
className=
{
styles
.
setting_line_addItem_line_label
}
>
推荐商品:
</
div
>
<
div
className=
{
styles
.
setting_line_addItem_line_brief
}
>
<
Button
className=
{
styles
.
selectBtn
}
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
handleOpenSelectModal
()
}
>
选择商品
</
Button
>
</
div
>
</
div
>
{
/* {
item.selectInfo ? renderSelectItemByType(item.type, item) : null
} */
}
</
div
>
)
}
</
div
>
</
div
>
<
ModalTable
modalTitle=
"选择商品"
width=
{
960
}
confirm=
{
handleModalOk
}
cancel=
{
handleModalCancel
}
scroll=
{
{
y
:
400
}
}
visible=
{
modalVisible
}
columns=
{
promptCommodityColumn
}
rowSelection=
{
productRowSelection
}
fetchTableData=
{
params
=>
fetchTableList
(
params
)
}
formilyProps=
{
{
ctx
:
{
schema
:
basicSchema
,
components
:
{
ModalSearch
:
Search
,
SearchSelect
,
Submit
}
,
effects
:
(
$
,
actions
)
=>
{
actions
.
reset
()
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'name'
,
FORM_FILTER_PATH
,
);
}
}
}
}
resetModal=
{
{
destroyOnClose
:
true
}
}
tableProps=
{
{
rowKey
:
'id'
,
onRow
:
(
record
)
=>
({
onClick
:
()
=>
{
if
(
!
productRowCtl
.
selectRow
.
includes
(
record
))
{
productRowCtl
.
setSelectRow
([...
productRowCtl
.
selectRow
,
record
]);
productRowCtl
.
setSelectedRowKeys
([...
productRowCtl
.
selectRow
.
map
(
item
=>
item
.
id
),
record
.
id
]);
}
else
{
productRowCtl
.
setSelectRow
(
productRowCtl
.
selectRow
.
filter
(
selectRowItem
=>
selectRowItem
.
id
!==
record
.
id
));
productRowCtl
.
setSelectedRowKeys
(
productRowCtl
.
selectedRowKeys
.
filter
(
selectedRowKeysItem
=>
selectedRowKeysItem
!==
record
.
id
))
}
},
})
}
}
/>
</
div
>
)
}
export
default
RecommendCommodity
src/pages/editor/mobileSettingPanel/propsSettings/index.tsx
View file @
042464df
...
...
@@ -3,6 +3,8 @@ import { SelectedInfoType, clearSelectedStatus, PROPS_TYPES } from 'lingxi-edito
import
HeaderNav
from
'./components/headerNav'
import
Banner
from
'./components/banner'
import
QuickNav
from
'./components/quickNav'
import
HeadBackground
from
'./components/headBackground'
import
RecommendCommodity
from
'./components/recommendCommodity'
import
BottomNavigation
from
'./components/bottomNavigation'
import
styles
from
'./index.less'
...
...
@@ -19,6 +21,10 @@ const PropsSettings: React.FC<PropsSettingsPropsType> = (props) => {
if
(
componentType
)
{
switch
(
componentType
.
type
)
{
case
PROPS_TYPES
.
mobileShopHeaderNav
:
return
<
HeadBackground
{
...
initProps
}
/>
case
PROPS_TYPES
.
mobileShopCommodity
:
return
<
RecommendCommodity
{
...
initProps
}
/>
case
PROPS_TYPES
.
mobileHeaderNav
:
return
<
HeaderNav
{
...
initProps
}
/>
case
PROPS_TYPES
.
mobileBanner
:
...
...
src/pages/editor/settingsPanel/propsSettings/components/GoodsSetting/index.tsx
View file @
042464df
...
...
@@ -5,7 +5,6 @@ import SettingList from '../../../../components/SettingList'
import
GoodsItem
from
'./GoodsItem'
import
SettingPanel
from
'../../../../components/SettingPanel'
import
{
CaretUpOutlined
,
CaretDownOutlined
}
from
'@ant-design/icons'
import
{
GetTemplatePlatformFindGoodsListResponseDetail
}
from
'@/services/TemplateApi'
import
{
PublicApi
}
from
'@/services/api'
import
{
filterProps
}
from
'../../../../utils'
import
styles
from
'./index.less'
...
...
@@ -37,7 +36,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const
{
templateid
,
categoryid
,
goodsList
=
[],
templateType
}
=
props
const
[
current
,
setCurrent
]
=
useState
<
number
>
(
1
)
const
[
pageSize
,
setPageSize
]
=
useState
<
number
>
(
10
)
const
[
noSelectGoods
,
setNoSelectGoods
]
=
useState
<
GetTemplatePlatformFindGoodsListResponseDetail
[]
>
([])
const
[
noSelectGoods
,
setNoSelectGoods
]
=
useState
<
any
[]
>
([])
const
[
selectList
,
setSelectList
]
=
useState
<
any
>
([])
const
[
selectGoodsList
,
setSelectGoodsList
]
=
useState
<
any
>
(
goodsList
)
const
[
goodsIds
,
setGoodsIds
]
=
useState
<
any
>
([])
...
...
@@ -240,7 +239,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
postFn
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
()
resolve
(
true
)
}
else
{
reject
()
}
...
...
src/pages/mobileTemplate/shopTemplateEdit/config.ts
View file @
042464df
...
...
@@ -21,6 +21,7 @@ export const mobileShopHeaderNav = {
key
:
"1"
,
"1"
:
{
"componentName"
:
"MobileShopHeaderNav"
,
"componentType"
:
PROPS_TYPES
.
mobileShopHeaderNav
,
"title"
:
"背景图编辑"
,
"canEdit"
:
true
,
"canHide"
:
false
,
...
...
src/pages/mobileTemplate/shopTemplateEdit/index.tsx
View file @
042464df
...
...
@@ -25,7 +25,7 @@ import {
import
Loading
from
'../../editor/components/Loading'
import
{
PublicApi
}
from
'@/services/api'
import
{
LAYOUT_TYPE
}
from
'@/constants'
import
{
GetTemplateAdornAppStoreFindResponse
}
from
'@/services/TemplateApi'
import
{
GetTemplateAdornAppStoreFindResponse
,
GetTemplateWebMemberShopWebFindByMemberIdAndRoleIdResponse
}
from
'@/services/TemplateApi'
// import { GlobalConfig } from '@/global/config'
import
MobileSettingPanel
from
'../../editor/mobileSettingPanel'
import
{
getAuth
}
from
'@/utils/auth'
...
...
@@ -67,7 +67,7 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
/**
* 获取店铺信息
*/
const
fetchShopInfo
=
()
=>
{
const
fetchShopInfo
=
()
:
Promise
<
GetTemplateWebMemberShopWebFindByMemberIdAndRoleIdResponse
>
=>
{
return
new
Promise
((
resolve
)
=>
{
const
param
:
any
=
{
memberId
,
...
...
@@ -191,73 +191,35 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
const
getComponentsConfig
=
async
()
=>
{
try
{
//
const appConfig = await getAppShopConfig()
//
console.log(appConfig, "appConfig")
const
appConfig
=
await
getAppShopConfig
()
console
.
log
(
appConfig
,
"appConfig"
)
//店铺信息
const
shopInfo
=
await
fetchShopInfo
()
mobileShopHeaderNav
[
mobileShopHeaderNav
.
key
].
props
.
shopInfo
=
shopInfo
// if(appConfig?.topBO) {
// // 顶部导航
// mobileHeaderNav[mobileHeaderNav.key].props.styleTheme = appConfig?.topBO.style
// mobileHeaderNav[mobileHeaderNav.key].props.dataList = appConfig?.topBO.topDetailsBOList
// }
// if(appConfig?.advertBO) {
// // 轮播广告
// mobileBanner[mobileBanner.key].props = {
// visible: appConfig.advertBO.status,
// dataList: appConfig.advertBO.advertDetailsBOList
// }
// }
mobileShopCommodityList
[
mobileShopCommodityList
.
key
].
props
.
storeId
=
shopInfo
.
id
// if(appConfig?.functionBO) {
// // 功能入口
// mobileQuickNav[mobileQuickNav.key].props = {
// visible: appConfig.functionBO.status,
// dataList: appConfig.functionBO.functionDetailsBO,
// }
// }
// if(appConfig?.showcaseBO) {
// // 橱窗推荐
// mobileShowCase[mobileShowCase.key].props = {
// visible: appConfig?.showcaseBO.status,
// dataList: appConfig?.showcaseBO.showcaseDetailsBO,
// }
// }
// if(appConfig?.storeBO) {
// const storeBOParam = {
// current: 1,
// pageSize: 100,
// idList: appConfig?.storeBO.storeIdList || [],
// }
// console.log(storeBOParam, "storeBOParam")
// const storeBORes = await getRecommendShopList(storeBOParam)
if
(
appConfig
?.
backdropBO
)
{
mobileShopHeaderNav
[
mobileShopHeaderNav
.
key
].
props
.
backdrop
=
appConfig
?.
backdropBO
.
backdrop
}
// // 推荐店铺
// mobileRecommendShops[mobileRecommendShops.key].props = {
// visible: appConfig?.storeBO.status,
// dataList: getStoreBOList(storeBORes),
// }
// }
if
(
appConfig
?.
advertBO
)
{
mobileBanner
[
mobileBanner
.
key
].
props
.
dataList
=
appConfig
?.
advertBO
.
advertDetailsBOList
}
// if(appConfig?.excellentBO) {
// // 优质推荐
// mobileQuality[mobileQuality.key].props = {
// visible: appConfig?.excellentBO.status,
// dataList: await getExcellentDetailsBO(appConfig?.excellentBO.excellentDetailsBO),
// }
// }
if
(
appConfig
?.
functionBO
)
{
mobileQuickNav
[
mobileQuickNav
.
key
].
props
.
dataList
=
appConfig
?.
functionBO
.
functionDetailsBO
}
// if(appConfig?.bottomBO) {
// // 底部导航
// mobileBottomNavigation[mobileBottomNavigation.key].props = {
// visible: appConfig?.bottomBO.status,
// dataList: appConfig?.bottomBO.bottomDetailsBOList,
// }
// }
if
(
appConfig
?.
productBO
)
{
mobileShopCommodityList
[
mobileShopCommodityList
.
key
].
props
=
{
title
:
appConfig
.
productBO
.
title
,
productIdList
:
appConfig
.
productBO
.
productIdList
}
}
else
{
mobileShopCommodityList
[
mobileShopCommodityList
.
key
].
props
.
title
=
'热销商品'
}
const
config
=
{
...
mallLayoutConfig
,
...
...
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