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
05ffc693
Commit
05ffc693
authored
Nov 30, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix: 修改店铺装修接口传参
parent
e566f995
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
83 additions
and
64 deletions
+83
-64
index.tsx
src/pages/editor/shopEdit/index.tsx
+32
-22
index.tsx
src/pages/lxMall/purchaseOnline/index.tsx
+0
-1
list.tsx
src/pages/lxMall/purchaseOnline/list.tsx
+1
-1
index.tsx
src/pages/lxMall/shop/index.tsx
+18
-17
index.tsx
src/pages/preview/shopPreview/index.tsx
+32
-23
No files found.
src/pages/editor/shopEdit/index.tsx
View file @
05ffc693
...
@@ -10,6 +10,7 @@ import { menuData } from './defaultMenu'
...
@@ -10,6 +10,7 @@ import { menuData } from './defaultMenu'
import
Loading
from
'../components/Loading'
import
Loading
from
'../components/Loading'
import
{
PublicApi
}
from
'@/services/api'
import
{
PublicApi
}
from
'@/services/api'
import
{
GlobalConfig
}
from
'@/global/config'
import
{
GlobalConfig
}
from
'@/global/config'
import
{
getAuth
}
from
'@/utils/auth'
import
styles
from
'./index.less'
import
styles
from
'./index.less'
interface
ShopEditPropsType
{
interface
ShopEditPropsType
{
...
@@ -27,13 +28,14 @@ interface ShopEditPropsType {
...
@@ -27,13 +28,14 @@ interface ShopEditPropsType {
}
}
}
}
le
t
TemplateList
=
[
'science'
]
cons
t
TemplateList
=
[
'science'
]
const
ShopEdit
:
React
.
FC
<
ShopEditPropsType
>
=
(
props
)
=>
{
const
ShopEdit
:
React
.
FC
<
ShopEditPropsType
>
=
(
props
)
=>
{
const
{
query
:
{
id
,
template
}
}
=
props
.
location
const
{
query
:
{
id
,
template
}
}
=
props
.
location
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
true
)
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
true
)
const
[
theme
,
setTheme
]
=
useState
<
string
>
(
'theme-shop-science'
)
const
[
theme
,
setTheme
]
=
useState
<
string
>
(
'theme-shop-science'
)
const
[
componentConfigs
,
setComponentConfigs
]
=
useState
({})
const
[
componentConfigs
,
setComponentConfigs
]
=
useState
({})
const
{
memberId
,
memberRoleId
}
=
getAuth
()
||
{}
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
TemplateList
.
includes
(
template
))
{
if
(
!
TemplateList
.
includes
(
template
))
{
...
@@ -46,11 +48,13 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
...
@@ -46,11 +48,13 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
const
findFirstAdvertsByType
=
()
=>
{
const
findFirstAdvertsByType
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
params
=
{
const
params
:
any
=
{
templateId
:
id
,
templateId
:
id
,
type
:
1
type
:
1
,
memberId
,
roleId
:
memberRoleId
}
}
//@ts-ignore
PublicApi
.
getTemplateShopFindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplateShopFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
...
@@ -63,11 +67,13 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
...
@@ -63,11 +67,13 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
const
findSecondAdvertsByType
=
()
=>
{
const
findSecondAdvertsByType
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
params
=
{
const
params
:
any
=
{
templateId
:
id
,
templateId
:
id
,
type
:
2
type
:
2
,
memberId
,
roleId
:
memberRoleId
}
}
//@ts-ignore
PublicApi
.
getTemplateShopFindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplateShopFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
...
@@ -83,7 +89,11 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
...
@@ -83,7 +89,11 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
*/
*/
const
fetchFirstCategory
=
()
=>
{
const
fetchFirstCategory
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
PublicApi
.
getTemplateShopFindAllFirstCategory
().
then
(
res
=>
{
const
param
:
any
=
{
memberId
,
roleId
:
memberRoleId
}
PublicApi
.
getTemplateShopFindAllFirstCategory
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
}
}
...
@@ -96,12 +106,13 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
...
@@ -96,12 +106,13 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
*/
*/
const
fetchCategoryById
=
(
categoryId
)
=>
{
const
fetchCategoryById
=
(
categoryId
)
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
param
=
{
const
param
:
any
=
{
templateId
:
id
,
templateId
:
id
,
categoryId
categoryId
,
memberId
,
roleId
:
memberRoleId
}
}
// @ts-ignore
PublicApi
.
getTemplateShopFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
PublicApi
.
getTemplateShopFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
...
@@ -139,24 +150,24 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
...
@@ -139,24 +150,24 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
const
shopInfo
=
await
fetchShopInfo
()
const
shopInfo
=
await
fetchShopInfo
()
headerConfig
[
headerConfig
.
key
].
props
.
shopInfo
=
shopInfo
headerConfig
[
headerConfig
.
key
].
props
.
shopInfo
=
shopInfo
const
shopList
=
GlobalConfig
.
web
.
shopInfo
const
shopList
=
GlobalConfig
.
web
.
shopInfo
le
t
webMallInfo
=
shopList
.
filter
(
item
=>
item
.
environment
===
1
&&
item
.
type
===
1
)[
0
]
cons
t
webMallInfo
=
shopList
.
filter
(
item
=>
item
.
environment
===
1
&&
item
.
type
===
1
)[
0
]
headerConfig
[
headerConfig
.
key
].
props
.
logoUrl
=
webMallInfo
.
logoUrl
headerConfig
[
headerConfig
.
key
].
props
.
logoUrl
=
webMallInfo
.
logoUrl
topBarConfig
[
topBarConfig
.
key
].
props
.
shopname
=
webMallInfo
.
name
topBarConfig
[
topBarConfig
.
key
].
props
.
shopname
=
webMallInfo
.
name
AboutUsConfig
[
AboutUsConfig
.
key
].
props
.
shopInfo
=
shopInfo
AboutUsConfig
[
AboutUsConfig
.
key
].
props
.
shopInfo
=
shopInfo
let
initIndex
=
100
let
initIndex
=
100
let
floorLineConfig
:
any
=
{}
let
floorLineConfig
:
any
=
{}
le
t
floorLineKeys
:
any
=
[]
cons
t
floorLineKeys
:
any
=
[]
le
t
firstCategory
:
any
=
await
fetchFirstCategory
()
cons
t
firstCategory
:
any
=
await
fetchFirstCategory
()
for
(
le
t
item
of
firstCategory
)
{
for
(
cons
t
item
of
firstCategory
)
{
le
t
categoryDetail
:
any
=
await
fetchCategoryById
(
item
.
id
)
cons
t
categoryDetail
:
any
=
await
fetchCategoryById
(
item
.
id
)
let
floorLineConfigItem
=
{}
let
floorLineConfigItem
=
{}
floorLineKeys
.
push
(
String
(
initIndex
+
1
))
floorLineKeys
.
push
(
String
(
initIndex
+
1
))
le
t
FloorLine
=
{
cons
t
FloorLine
=
{
[
String
(
initIndex
+
1
)]:
{
[
String
(
initIndex
+
1
)]:
{
"componentName"
:
"ShopFloorLine"
,
"componentName"
:
"ShopFloorLine"
,
"props"
:
{
"props"
:
{
...
@@ -166,7 +177,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
...
@@ -166,7 +177,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
}
}
}
}
le
t
Category
=
{
cons
t
Category
=
{
[
String
(
initIndex
+
2
)]:
{
[
String
(
initIndex
+
2
)]:
{
"componentName"
:
"ShopFloorLine.Category"
,
"componentName"
:
"ShopFloorLine.Category"
,
"props"
:
{
"props"
:
{
...
@@ -177,7 +188,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
...
@@ -177,7 +188,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
},
},
}
}
le
t
Goods
=
{
cons
t
Goods
=
{
[
String
(
initIndex
+
3
)]:
{
[
String
(
initIndex
+
3
)]:
{
"componentName"
:
"ShopFloorLine.Goods"
,
"componentName"
:
"ShopFloorLine.Goods"
,
"props"
:
{
"props"
:
{
...
@@ -194,7 +205,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
...
@@ -194,7 +205,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
}
}
mallLayoutConfig
[
"0"
].
childNodes
=
[...
mallLayoutConfig
[
"0"
].
childNodes
,
...
floorLineKeys
,
serviceAdvertConfig
.
key
,
FooterConfig
.
key
]
mallLayoutConfig
[
"0"
].
childNodes
=
[...
mallLayoutConfig
[
"0"
].
childNodes
,
...
floorLineKeys
,
serviceAdvertConfig
.
key
,
FooterConfig
.
key
]
le
t
config
=
{
cons
t
config
=
{
...
mallLayoutConfig
,
...
mallLayoutConfig
,
...
topBarConfig
,
...
topBarConfig
,
...
topAdvertConfig
,
...
topAdvertConfig
,
...
@@ -227,4 +238,4 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
...
@@ -227,4 +238,4 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
)
:
<
Loading
/>
)
:
<
Loading
/>
}
}
export
default
ShopEdit
export
default
ShopEdit
\ No newline at end of file
src/pages/lxMall/purchaseOnline/index.tsx
View file @
05ffc693
...
@@ -64,7 +64,6 @@ const PurchaseOnline: React.FC<PurchaseOnlinePropsType> = (props) => {
...
@@ -64,7 +64,6 @@ const PurchaseOnline: React.FC<PurchaseOnlinePropsType> = (props) => {
}
}
setLoading
(
true
)
setLoading
(
true
)
//@ts-ignore
PublicApi
.
getOrderRequisitionFormOnlineShoppingList
(
param
).
then
(
res
=>
{
PublicApi
.
getOrderRequisitionFormOnlineShoppingList
(
param
).
then
(
res
=>
{
setLoading
(
false
)
setLoading
(
false
)
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
...
...
src/pages/lxMall/purchaseOnline/list.tsx
View file @
05ffc693
...
@@ -19,7 +19,7 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
...
@@ -19,7 +19,7 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
const
showRequisitionFormAddress
=
(
list
:
any
)
=>
{
const
showRequisitionFormAddress
=
(
list
:
any
)
=>
{
if
(
list
)
{
if
(
list
)
{
le
t
result
=
list
.
map
(
item
=>
`
${
item
.
province
}
/
${
item
.
city
}
`
).
join
(
'、'
)
cons
t
result
=
list
.
map
(
item
=>
`
${
item
.
province
}
/
${
item
.
city
}
`
).
join
(
'、'
)
return
result
return
result
}
}
return
""
return
""
...
...
src/pages/lxMall/shop/index.tsx
View file @
05ffc693
import
React
,
{
useEffect
,
useMemo
,
useState
}
from
'react'
import
React
,
{
useEffect
,
useMemo
,
useState
}
from
'react'
import
Information
from
'../components/Information'
import
FloorAnchor
from
'../components/FloorAnchor'
import
FloorAnchor
from
'../components/FloorAnchor'
import
CommonTitle
from
'../components/CommonTitle'
import
CommonTitle
from
'../components/CommonTitle'
import
FloorSkeleton
from
'../components/FloorSkeleton'
import
FloorSkeleton
from
'../components/FloorSkeleton'
...
@@ -41,12 +40,13 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
...
@@ -41,12 +40,13 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
},
[
shopInfo
])
},
[
shopInfo
])
const
findFirstAdvertsByType
=
()
=>
{
const
findFirstAdvertsByType
=
()
=>
{
let
params
=
{
const
params
:
any
=
{
templateId
:
shopInfo
.
templateId
,
templateId
:
shopInfo
.
templateId
,
type
:
1
,
type
:
1
,
memberId
memberId
,
roleId
:
shopInfo
.
roleId
}
}
//@ts-ignore
PublicApi
.
getTemplateShopFindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplateShopFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
setFirstAdvertList
(
res
.
data
)
setFirstAdvertList
(
res
.
data
)
...
@@ -55,12 +55,12 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
...
@@ -55,12 +55,12 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
}
}
const
findSecondAdvertsByType
=
()
=>
{
const
findSecondAdvertsByType
=
()
=>
{
let
params
=
{
const
params
:
any
=
{
templateId
:
shopInfo
.
templateId
,
templateId
:
shopInfo
.
templateId
,
type
:
2
,
type
:
2
,
memberId
memberId
}
}
//@ts-ignore
PublicApi
.
getTemplateShopFindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplateShopFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
setSecondAdvertList
(
res
.
data
)
setSecondAdvertList
(
res
.
data
)
...
@@ -73,8 +73,11 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
...
@@ -73,8 +73,11 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
*/
*/
const
fetchFirstCategory
=
()
=>
{
const
fetchFirstCategory
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
//@ts-ignore
const
param
:
any
=
{
PublicApi
.
getTemplateShopFindAllFirstCategory
({
memberId
}).
then
(
res
=>
{
memberId
,
roleId
:
shopInfo
.
roleId
}
PublicApi
.
getTemplateShopFindAllFirstCategory
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
setCategoryList
(
res
.
data
)
setCategoryList
(
res
.
data
)
resolve
(
res
.
data
)
resolve
(
res
.
data
)
...
@@ -88,13 +91,13 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
...
@@ -88,13 +91,13 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
*/
*/
const
fetchCategoryById
=
(
categoryId
)
=>
{
const
fetchCategoryById
=
(
categoryId
)
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
param
=
{
const
param
:
any
=
{
templateId
:
shopInfo
.
templateId
,
templateId
:
shopInfo
.
templateId
,
categoryId
,
categoryId
,
memberId
memberId
,
roleId
:
shopInfo
.
roleId
}
}
// @ts-ignore
PublicApi
.
getTemplateShopFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
PublicApi
.
getTemplateShopFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
...
@@ -104,11 +107,11 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
...
@@ -104,11 +107,11 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
}
}
const
getCategoryComponents
=
async
()
=>
{
const
getCategoryComponents
=
async
()
=>
{
le
t
result
=
[]
cons
t
result
=
[]
le
t
firstCategory
:
any
=
await
fetchFirstCategory
()
cons
t
firstCategory
:
any
=
await
fetchFirstCategory
()
if
(
firstCategory
&&
firstCategory
.
length
>
0
)
{
if
(
firstCategory
&&
firstCategory
.
length
>
0
)
{
for
(
le
t
item
of
firstCategory
)
{
for
(
cons
t
item
of
firstCategory
)
{
le
t
categoryDetail
:
any
=
await
fetchCategoryById
(
item
.
id
)
cons
t
categoryDetail
:
any
=
await
fetchCategoryById
(
item
.
id
)
result
.
push
(
result
.
push
(
<
ShopFloorLine
<
ShopFloorLine
anchor=
{
`floorline_${item.id}`
}
anchor=
{
`floorline_${item.id}`
}
...
@@ -126,8 +129,6 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
...
@@ -126,8 +129,6 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
)
)
}
}
setCategoryComponents
(
result
)
setCategoryComponents
(
result
)
}
else
{
}
}
setLoading
(
false
)
setLoading
(
false
)
}
}
...
...
src/pages/preview/shopPreview/index.tsx
View file @
05ffc693
...
@@ -9,6 +9,7 @@ import { menuData } from './defaultMenu'
...
@@ -9,6 +9,7 @@ import { menuData } from './defaultMenu'
import
Loading
from
'../../editor/components/Loading'
import
Loading
from
'../../editor/components/Loading'
import
{
PublicApi
}
from
'@/services/api'
import
{
PublicApi
}
from
'@/services/api'
import
{
GlobalConfig
}
from
'@/global/config'
import
{
GlobalConfig
}
from
'@/global/config'
import
{
getAuth
}
from
'@/utils/auth'
import
styles
from
'./index.less'
import
styles
from
'./index.less'
interface
ShopPreviewPropsType
{
interface
ShopPreviewPropsType
{
...
@@ -26,13 +27,14 @@ interface ShopPreviewPropsType {
...
@@ -26,13 +27,14 @@ interface ShopPreviewPropsType {
}
}
}
}
let
TemplateList
=
[
'science'
]
const
TemplateList
:
string
[]
=
[
'science'
]
const
ShopPreview
:
React
.
FC
<
ShopPreviewPropsType
>
=
(
props
)
=>
{
const
ShopPreview
:
React
.
FC
<
ShopPreviewPropsType
>
=
(
props
)
=>
{
const
{
query
:
{
id
,
template
}
}
=
props
.
location
const
{
query
:
{
id
,
template
}
}
=
props
.
location
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
true
)
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
true
)
const
[
theme
,
setTheme
]
=
useState
<
string
>
(
'theme-shop-science'
)
const
[
theme
,
setTheme
]
=
useState
<
string
>
(
'theme-shop-science'
)
const
[
componentConfigs
,
setComponentConfigs
]
=
useState
({})
const
[
componentConfigs
,
setComponentConfigs
]
=
useState
({})
const
{
memberId
,
memberRoleId
}
=
getAuth
()
||
{}
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
TemplateList
.
includes
(
template
))
{
if
(
!
TemplateList
.
includes
(
template
))
{
...
@@ -45,11 +47,13 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
...
@@ -45,11 +47,13 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
const
findFirstAdvertsByType
=
()
=>
{
const
findFirstAdvertsByType
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
params
=
{
const
params
:
any
=
{
templateId
:
id
,
templateId
:
id
,
type
:
1
type
:
1
,
memberId
,
roleId
:
memberRoleId
}
}
//@ts-ignore
PublicApi
.
getTemplateShopFindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplateShopFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
...
@@ -62,11 +66,13 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
...
@@ -62,11 +66,13 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
const
findSecondAdvertsByType
=
()
=>
{
const
findSecondAdvertsByType
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
params
=
{
const
params
:
any
=
{
templateId
:
id
,
templateId
:
id
,
type
:
2
type
:
2
,
memberId
,
roleId
:
memberRoleId
}
}
//@ts-ignore
PublicApi
.
getTemplateShopFindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplateShopFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
...
@@ -82,8 +88,11 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
...
@@ -82,8 +88,11 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
*/
*/
const
fetchFirstCategory
=
()
=>
{
const
fetchFirstCategory
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
console
.
log
(
111
)
const
param
:
any
=
{
PublicApi
.
getTemplateShopFindAllFirstCategory
().
then
(
res
=>
{
memberId
,
roleId
:
memberRoleId
}
PublicApi
.
getTemplateShopFindAllFirstCategory
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
}
else
{
}
else
{
...
@@ -100,12 +109,13 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
...
@@ -100,12 +109,13 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
*/
*/
const
fetchCategoryById
=
(
categoryId
)
=>
{
const
fetchCategoryById
=
(
categoryId
)
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
param
=
{
const
param
:
any
=
{
templateId
:
id
,
templateId
:
id
,
categoryId
categoryId
,
memberId
,
roleId
:
memberRoleId
}
}
// @ts-ignore
PublicApi
.
getTemplateShopFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
PublicApi
.
getTemplateShopFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
...
@@ -143,24 +153,24 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
...
@@ -143,24 +153,24 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
const
shopInfo
=
await
fetchShopInfo
()
const
shopInfo
=
await
fetchShopInfo
()
headerConfig
[
headerConfig
.
key
].
props
.
shopInfo
=
shopInfo
headerConfig
[
headerConfig
.
key
].
props
.
shopInfo
=
shopInfo
const
shopList
=
GlobalConfig
.
web
.
shopInfo
const
shopList
=
GlobalConfig
.
web
.
shopInfo
le
t
webMallInfo
=
shopList
.
filter
(
item
=>
item
.
environment
===
1
&&
item
.
type
===
1
)[
0
]
cons
t
webMallInfo
=
shopList
.
filter
(
item
=>
item
.
environment
===
1
&&
item
.
type
===
1
)[
0
]
headerConfig
[
headerConfig
.
key
].
props
.
logoUrl
=
webMallInfo
.
logoUrl
headerConfig
[
headerConfig
.
key
].
props
.
logoUrl
=
webMallInfo
.
logoUrl
topBarConfig
[
topBarConfig
.
key
].
props
.
shopname
=
webMallInfo
.
name
topBarConfig
[
topBarConfig
.
key
].
props
.
shopname
=
webMallInfo
.
name
AboutUsConfig
[
AboutUsConfig
.
key
].
props
.
shopInfo
=
shopInfo
AboutUsConfig
[
AboutUsConfig
.
key
].
props
.
shopInfo
=
shopInfo
let
initIndex
=
100
let
initIndex
=
100
let
floorLineConfig
:
any
=
{}
let
floorLineConfig
:
any
=
{}
le
t
floorLineKeys
:
any
=
[]
cons
t
floorLineKeys
:
any
=
[]
le
t
firstCategory
:
any
=
await
fetchFirstCategory
()
cons
t
firstCategory
:
any
=
await
fetchFirstCategory
()
for
(
le
t
item
of
firstCategory
)
{
for
(
cons
t
item
of
firstCategory
)
{
le
t
categoryDetail
:
any
=
await
fetchCategoryById
(
item
.
id
)
cons
t
categoryDetail
:
any
=
await
fetchCategoryById
(
item
.
id
)
let
floorLineConfigItem
=
{}
let
floorLineConfigItem
=
{}
floorLineKeys
.
push
(
String
(
initIndex
+
1
))
floorLineKeys
.
push
(
String
(
initIndex
+
1
))
le
t
FloorLine
=
{
cons
t
FloorLine
=
{
[
String
(
initIndex
+
1
)]:
{
[
String
(
initIndex
+
1
)]:
{
"componentName"
:
"ShopFloorLine"
,
"componentName"
:
"ShopFloorLine"
,
"props"
:
{
"props"
:
{
...
@@ -170,7 +180,7 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
...
@@ -170,7 +180,7 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
}
}
}
}
le
t
Category
=
{
cons
t
Category
=
{
[
String
(
initIndex
+
2
)]:
{
[
String
(
initIndex
+
2
)]:
{
"componentName"
:
"ShopFloorLine.Category"
,
"componentName"
:
"ShopFloorLine.Category"
,
"props"
:
{
"props"
:
{
...
@@ -181,7 +191,7 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
...
@@ -181,7 +191,7 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
},
},
}
}
le
t
Goods
=
{
cons
t
Goods
=
{
[
String
(
initIndex
+
3
)]:
{
[
String
(
initIndex
+
3
)]:
{
"componentName"
:
"ShopFloorLine.Goods"
,
"componentName"
:
"ShopFloorLine.Goods"
,
"props"
:
{
"props"
:
{
...
@@ -198,7 +208,7 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
...
@@ -198,7 +208,7 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
}
}
mallLayoutConfig
[
"0"
].
childNodes
=
[...
mallLayoutConfig
[
"0"
].
childNodes
,
...
floorLineKeys
,
serviceAdvertConfig
.
key
,
FooterConfig
.
key
]
mallLayoutConfig
[
"0"
].
childNodes
=
[...
mallLayoutConfig
[
"0"
].
childNodes
,
...
floorLineKeys
,
serviceAdvertConfig
.
key
,
FooterConfig
.
key
]
le
t
config
=
{
cons
t
config
=
{
...
mallLayoutConfig
,
...
mallLayoutConfig
,
...
topBarConfig
,
...
topBarConfig
,
...
topAdvertConfig
,
...
topAdvertConfig
,
...
@@ -230,4 +240,4 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
...
@@ -230,4 +240,4 @@ const ShopPreview: React.FC<ShopPreviewPropsType> = (props) => {
)
:
<
Loading
/>
)
:
<
Loading
/>
}
}
export
default
ShopPreview
export
default
ShopPreview
\ No newline at end of file
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