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
0b7c7d58
Commit
0b7c7d58
authored
Mar 02, 2021
by
Bill
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of 10.0.0.22:lingxi/lingxi-business-paltform into dev
parents
f1b87090
9104204b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
683 additions
and
54 deletions
+683
-54
MobileChannelCategory.ts
...onfigs/componentConfigs/LingXiUI/MobileChannelCategory.ts
+20
-0
index.ts
src/pages/editor/configs/componentConfigs/LingXiUI/index.ts
+2
-0
default_img.png
...s/editor/customComponents/ChannelCategory/default_img.png
+0
-0
index.less
src/pages/editor/customComponents/ChannelCategory/index.less
+60
-0
index.tsx
src/pages/editor/customComponents/ChannelCategory/index.tsx
+106
-0
index.ts
src/pages/editor/customComponents/index.ts
+1
-0
column.tsx
.../propsSettings/components/channelGoods/contant/column.tsx
+42
-0
schema.ts
...l/propsSettings/components/channelGoods/contant/schema.ts
+86
-0
index.less
...ingPanel/propsSettings/components/channelGoods/index.less
+13
-0
index.tsx
...tingPanel/propsSettings/components/channelGoods/index.tsx
+316
-0
index.tsx
src/pages/editor/mobileSettingPanel/propsSettings/index.tsx
+3
-0
config.ts
src/pages/mobileTemplate/channelTemplateEdit/config.ts
+5
-52
index.tsx
src/pages/mobileTemplate/channelTemplateEdit/index.tsx
+29
-2
No files found.
src/pages/editor/configs/componentConfigs/LingXiUI/MobileChannelCategory.ts
0 → 100644
View file @
0b7c7d58
/*
* @Author: ghua
* @Date: 2021-02-26 11:00:24
* @LastEditTime: 2021-03-01 10:15:04
* @LastEditors: Please set LastEditors
* @Description: app渠道商城行业资讯组件
* @FilePath: /lingxi-business-paltform/src/pages/editor/configs/componentConfigs/LingXiUI/MobileChannelHeaderNav.ts
*/
import
{
ComponentConfigTypes
,
PROPS_TYPES
}
from
'lingxi-editor-core'
;
const
MobileChannelCategory
:
ComponentConfigTypes
=
{
propsConfig
:
{
componentType
:
{
label
:
'编辑'
,
type
:
PROPS_TYPES
.
moibileChannelCategory
},
},
};
export
default
MobileChannelCategory
;
src/pages/editor/configs/componentConfigs/LingXiUI/index.ts
View file @
0b7c7d58
...
@@ -32,6 +32,7 @@ import MobileBottomNavigation from './MobileBottomNavigation'
...
@@ -32,6 +32,7 @@ import MobileBottomNavigation from './MobileBottomNavigation'
import
MobileChannelHeaderNav
from
'./MobileChannelHeaderNav'
import
MobileChannelHeaderNav
from
'./MobileChannelHeaderNav'
import
MobileChannelGoodsCard
from
'./MobileChannelGoodsCard'
import
MobileChannelGoodsCard
from
'./MobileChannelGoodsCard'
import
MobileChannelInformation
from
'./MobileChannelInformation'
import
MobileChannelInformation
from
'./MobileChannelInformation'
import
MobileChannelCategory
from
'./MobileChannelCategory'
export
default
{
export
default
{
TopBar
,
TopBar
,
...
@@ -57,6 +58,7 @@ export default {
...
@@ -57,6 +58,7 @@ export default {
MobileChannelGoodsCard
,
MobileChannelGoodsCard
,
MobileChannelInformation
,
MobileChannelInformation
,
MobileBottomNavigation
,
MobileBottomNavigation
,
MobileChannelCategory
,
...
FloorLine
,
...
FloorLine
,
...
ShopFloorLine
,
...
ShopFloorLine
,
...
ShowCase
,
...
ShowCase
,
...
...
src/pages/editor/customComponents/ChannelCategory/default_img.png
0 → 100644
View file @
0b7c7d58
4.05 KB
src/pages/editor/customComponents/ChannelCategory/index.less
0 → 100644
View file @
0b7c7d58
@import '../style/common.less';
.@{prefixCls}-category-list {
background-color: #FFF;
min-height: 78px;
padding-top: 12px;
margin: 0 8px;
border-radius: 8px;
&.hide {
display: none;
}
&-carousel {
position: relative;
}
&-list {
display: flex;
flex-wrap: wrap;
&-item {
width: 20%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-bottom: 12px;
color: #606266;
&-navIcon {
width: 48px;
height: 48px;
background-color: #F9F9F9;
border-radius: 50%;
margin-bottom: 6px;
}
}
&-pagination {
padding-bottom: 12px;
&-wrap {
display: flex;
justify-content: center;
}
&-item {
width: 24px;
height: 3px;
background-color: #EEF0F3;
border-radius: 2px;
&.active {
background-color: @headerNavScienceColor;
}
}
}
}
}
src/pages/editor/customComponents/ChannelCategory/index.tsx
0 → 100644
View file @
0b7c7d58
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'react'
import
{
ConfigConsumer
}
from
'../Generator'
import
{
Carousel
}
from
'antd'
import
{
isEmpty
,
isArray
}
from
'lodash'
import
cx
from
'classnames'
import
{
arrayGroupsByCount
}
from
'@/utils'
import
defaultImg
from
'./default_img.png'
import
styles
from
'./index.less'
interface
DataItemType
{
title
:
string
,
id
:
number
,
imageUrl
:
string
,
}
export
interface
MobileQuickNavPropsType
{
className
?:
string
,
style
?:
React
.
CSSProperties
,
visible
?:
boolean
,
dataList
:
DataItemType
[],
}
const
MobileChannelCategory
:
React
.
FC
<
MobileQuickNavPropsType
>
=
(
props
)
=>
{
const
{
children
,
className
,
style
,
dataList
,
visible
,
...
others
}
=
props
const
[
navList
,
setNavList
]
=
useState
<
any
>
([])
const
[
currentIndex
,
setCurrentIndex
]
=
useState
<
number
>
(
0
)
const
carouselRef
:
any
=
useRef
()
useEffect
(()
=>
{
console
.
log
(
dataList
,
"dataList"
)
if
(
isArray
(
dataList
))
{
setNavList
(
arrayGroupsByCount
(
dataList
,
10
))
}
},
[
dataList
])
const
renderChildren
=
({
getPrefixCls
}:
any
)
=>
{
const
prefixCls
=
getPrefixCls
(
"category-list"
);
const
classNameString
=
cx
(
styles
[
`
${
prefixCls
}
`
],
!
visible
?
styles
.
hide
:
null
)
const
handleCarouselChange
=
(
current
:
number
)
=>
{
setCurrentIndex
(
current
)
}
const
handleGoSlide
=
(
e
,
index
:
number
)
=>
{
e
.
stopPropagation
()
carouselRef
.
current
.
goTo
(
index
,
false
)
}
return
!
isEmpty
(
navList
)
?
(
<
div
className=
{
classNameString
}
style=
{
style
}
{
...
others
}
>
<
Carousel
ref=
{
carouselRef
}
dots=
{
false
}
afterChange=
{
handleCarouselChange
}
className=
{
styles
[
"lingxi-category-list-carousel"
]
}
>
{
!
isEmpty
(
navList
)
&&
navList
.
map
((
listItem
,
listIndex
)
=>
(
<
div
key=
{
`lingxi-category-list-list-${listIndex}`
}
>
<
div
className=
{
styles
[
"lingxi-category-list-list"
]
}
>
{
listItem
.
map
((
item
:
DataItemType
,
index
:
number
)
=>
(
<
div
className=
{
styles
[
"lingxi-category-list-list-item"
]
}
key=
{
`lingxi-category-list-list-item-${index}`
}
>
{
item
.
imageUrl
?
<
img
className=
{
styles
[
"lingxi-category-list-list-item-navIcon"
]
}
src=
{
item
.
imageUrl
}
/>
:
<
img
className=
{
styles
[
"lingxi-category-list-list-item-navIcon"
]
}
src=
{
defaultImg
}
/>
}
<
span
className=
{
styles
[
"lingxi-category-list-list-item-navText"
]
}
>
{
item
.
title
}
</
span
>
</
div
>
))
}
</
div
>
</
div
>
))
}
</
Carousel
>
{
navList
.
length
>
1
&&
(
<
div
className=
{
styles
[
"lingxi-category-list-list-pagination"
]
}
style=
{
{
justifyContent
:
'center'
}
}
>
<
div
className=
{
styles
[
"lingxi-category-list-list-pagination-wrap"
]
}
style=
{
styles
.
paginationStyle
}
>
{
navList
.
map
((
_
:
any
,
listIndex
:
number
)
=>
(
<
div
key=
{
`lingxi-category-list-list-pagination-item-${listIndex}`
}
className=
{
cx
(
styles
[
"lingxi-category-list-list-pagination-item"
],
currentIndex
===
listIndex
?
styles
.
active
:
{})
}
onClick=
{
(
e
)
=>
handleGoSlide
(
e
,
listIndex
)
}
/>
))
}
</
div
>
</
div
>
)
}
</
div
>
)
:
null
}
return
<
ConfigConsumer
>
{
renderChildren
}
</
ConfigConsumer
>
}
MobileChannelCategory
.
defaultProps
=
{
dataList
:
[],
visible
:
true
,
}
export
default
MobileChannelCategory
src/pages/editor/customComponents/index.ts
View file @
0b7c7d58
...
@@ -9,3 +9,4 @@
...
@@ -9,3 +9,4 @@
export
{
default
as
MobileChannelHeaderNav
}
from
'./ChannelHeaderNav'
export
{
default
as
MobileChannelHeaderNav
}
from
'./ChannelHeaderNav'
export
{
default
as
MobileChannelGoodsCard
}
from
'./ChannelGoodsCard'
export
{
default
as
MobileChannelGoodsCard
}
from
'./ChannelGoodsCard'
export
{
default
as
MobileChannelInformation
}
from
'./ChannelInformation'
export
{
default
as
MobileChannelInformation
}
from
'./ChannelInformation'
export
{
default
as
MobileChannelCategory
}
from
'./ChannelCategory'
src/pages/editor/mobileSettingPanel/propsSettings/components/channelGoods/contant/column.tsx
0 → 100644
View file @
0b7c7d58
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/channelGoods/contant/schema.ts
0 → 100644
View file @
0b7c7d58
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/channelGoods/index.less
0 → 100644
View file @
0b7c7d58
@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/channelGoods/index.tsx
0 → 100644
View file @
0b7c7d58
This diff is collapsed.
Click to expand it.
src/pages/editor/mobileSettingPanel/propsSettings/index.tsx
View file @
0b7c7d58
...
@@ -6,6 +6,7 @@ import QuickNav from './components/quickNav'
...
@@ -6,6 +6,7 @@ import QuickNav from './components/quickNav'
import
HeadBackground
from
'./components/headBackground'
import
HeadBackground
from
'./components/headBackground'
import
RecommendCommodity
from
'./components/recommendCommodity'
import
RecommendCommodity
from
'./components/recommendCommodity'
import
BottomNavigation
from
'./components/bottomNavigation'
import
BottomNavigation
from
'./components/bottomNavigation'
import
MobileChannelGoods
from
'./components/channelGoods'
import
styles
from
'./index.less'
import
styles
from
'./index.less'
import
{
ConsoleSqlOutlined
}
from
'@ant-design/icons'
;
import
{
ConsoleSqlOutlined
}
from
'@ant-design/icons'
;
...
@@ -32,6 +33,8 @@ const PropsSettings: React.FC<PropsSettingsPropsType> = (props) => {
...
@@ -32,6 +33,8 @@ const PropsSettings: React.FC<PropsSettingsPropsType> = (props) => {
return
<
Banner
{
...
initProps
}
/>
return
<
Banner
{
...
initProps
}
/>
case
PROPS_TYPES
.
mobileQuickNav
:
case
PROPS_TYPES
.
mobileQuickNav
:
return
<
QuickNav
{
...
initProps
}
/>
return
<
QuickNav
{
...
initProps
}
/>
case
PROPS_TYPES
.
mobileChannelGoodsCard
:
return
<
MobileChannelGoods
{
...
initProps
}
/>
case
PROPS_TYPES
.
mobileBottomNavigation
:
case
PROPS_TYPES
.
mobileBottomNavigation
:
return
<
BottomNavigation
{
...
initProps
}
/>
return
<
BottomNavigation
{
...
initProps
}
/>
default
:
default
:
...
...
src/pages/mobileTemplate/channelTemplateEdit/config.ts
View file @
0b7c7d58
...
@@ -97,63 +97,16 @@ export const mobileBanner = {
...
@@ -97,63 +97,16 @@ export const mobileBanner = {
}
}
}
}
export
const
mobile
QuickNav
=
{
export
const
mobile
ChannelCategory
=
{
key
:
"4"
,
key
:
"4"
,
"4"
:
{
"4"
:
{
"componentName"
:
"Mobile
QuickNav
"
,
"componentName"
:
"Mobile
ChannelCategory
"
,
"componentType"
:
PROPS_TYPES
.
mo
bileQuickNav
,
"componentType"
:
PROPS_TYPES
.
mo
ibileChannelCategory
,
"title"
:
"
导航模块
"
,
"title"
:
"
商品品类
"
,
"canEdit"
:
false
,
"canEdit"
:
false
,
"canHide"
:
false
,
"canHide"
:
false
,
"props"
:
{
"props"
:
{
"canEdit"
:
false
,
dataList
:
[]
"style"
:
{
paddingTop
:
'12px'
,
margin
:
'0 8px'
,
borderRadius
:
'8px'
,
},
dataList
:
[
{
"id"
:
1
,
"expand"
:
false
,
"icon"
:
"https://shushangyun-lingxi.oss-cn-shenzhen.aliyuncs.com/c5d66f1488cc47d0a73279ce1ef11c991610677462848.png"
,
"type"
:
1
,
"name"
:
"商城"
,
"url"
:
""
},
{
"id"
:
2
,
"expand"
:
false
,
"icon"
:
"https://shushangyun-lingxi.oss-cn-shenzhen.aliyuncs.com/9f105bdebcfb4010b5827f7b64fb53281610696444606.png"
,
"type"
:
2
,
"name"
:
"分类"
,
"url"
:
""
},
{
"id"
:
3
,
"expand"
:
false
,
"icon"
:
"https://shushangyun-lingxi.oss-cn-shenzhen.aliyuncs.com/d4383c684c6e4707b405f46f281796d71610696469970.png"
,
"type"
:
3
,
"name"
:
"积分兑换"
,
"url"
:
""
},
{
"id"
:
4
,
"expand"
:
false
,
"icon"
:
"https://shushangyun-lingxi.oss-cn-shenzhen.aliyuncs.com/d4383c684c6e4707b405f46f281796d71610696469970.png"
,
"type"
:
4
,
"name"
:
"公司介绍"
,
"url"
:
""
},
{
"id"
:
5
,
"expand"
:
false
,
"icon"
:
"https://shushangyun-lingxi.oss-cn-shenzhen.aliyuncs.com/441a66ebeb3b45e6a64ecfa9977f411c1610696489991.png"
,
"type"
:
5
,
"name"
:
"成为会员"
,
"url"
:
""
},
]
}
}
}
}
}
}
...
...
src/pages/mobileTemplate/channelTemplateEdit/index.tsx
View file @
0b7c7d58
...
@@ -18,7 +18,7 @@ import {
...
@@ -18,7 +18,7 @@ import {
divWrap
,
divWrap
,
mobileChannelHeaderNav
,
mobileChannelHeaderNav
,
mobileBanner
,
mobileBanner
,
mobile
QuickNav
,
mobile
ChannelCategory
,
mobileChannelGoodsCard
,
mobileChannelGoodsCard
,
mobileChannelInformation
,
mobileChannelInformation
,
mobileBottomNavigation
,
mobileBottomNavigation
,
...
@@ -186,6 +186,28 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
...
@@ -186,6 +186,28 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
})
})
}
}
/**
* 获取品类树
*/
const
getCustomerCategoryTreeById
=
(
channelMemberId
:
number
)
=>
{
return
new
Promise
((
resolve
)
=>
{
const
param
:
any
=
{
channelMemberId
,
}
PublicApi
.
getSearchMobileShopChannelGetCustomerCategoryTree
(
param
).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
else
{
resolve
([])
}
}).
catch
(()
=>
{
resolve
([])
})
})
}
const
getComponentsConfig
=
async
()
=>
{
const
getComponentsConfig
=
async
()
=>
{
try
{
try
{
const
appConfig
=
await
getAppChannelConfig
()
const
appConfig
=
await
getAppChannelConfig
()
...
@@ -195,6 +217,11 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
...
@@ -195,6 +217,11 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
const
channelInfo
=
await
fetchChannelInfo
()
const
channelInfo
=
await
fetchChannelInfo
()
mobileChannelHeaderNav
[
mobileChannelHeaderNav
.
key
].
props
.
name
=
channelInfo
.
memberName
mobileChannelHeaderNav
[
mobileChannelHeaderNav
.
key
].
props
.
name
=
channelInfo
.
memberName
if
(
channelInfo
.
memberId
)
{
const
categoryList
=
await
getCustomerCategoryTreeById
(
channelInfo
.
memberId
)
mobileChannelCategory
[
mobileChannelCategory
.
key
].
props
.
dataList
=
categoryList
}
if
(
appConfig
?.
advertBO
)
{
if
(
appConfig
?.
advertBO
)
{
mobileBanner
[
mobileBanner
.
key
].
props
.
dataList
=
appConfig
?.
advertBO
.
advertDetailsBOList
mobileBanner
[
mobileBanner
.
key
].
props
.
dataList
=
appConfig
?.
advertBO
.
advertDetailsBOList
}
}
...
@@ -204,7 +231,7 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
...
@@ -204,7 +231,7 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
...
mobileChannelHeaderNav
,
...
mobileChannelHeaderNav
,
...
divWrap
,
...
divWrap
,
...
mobileBanner
,
...
mobileBanner
,
...
mobile
QuickNav
,
...
mobile
ChannelCategory
,
...
mobileChannelGoodsCard
,
...
mobileChannelGoodsCard
,
...
mobileChannelInformation
,
...
mobileChannelInformation
,
...
mobileBottomNavigation
,
...
mobileBottomNavigation
,
...
...
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