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
44fb9147
Commit
44fb9147
authored
Nov 10, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix;渠道商城链接错误时显示问题
parent
ffeba113
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
21 deletions
+38
-21
index.tsx
src/pages/lxMall/commodity/index.tsx
+16
-10
index.tsx
src/pages/lxMall/components/SearchShopResult/index.tsx
+6
-5
LXChannelLayout.tsx
src/pages/lxMall/layouts/LXChannelLayout.tsx
+8
-3
LXIChannelLayout.tsx
src/pages/lxMall/layouts/LXIChannelLayout.tsx
+8
-3
No files found.
src/pages/lxMall/commodity/index.tsx
View file @
44fb9147
...
...
@@ -124,22 +124,28 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
getFn
=
PublicApi
.
postSearchShopEnterpriseGetCommodityList
break
case
LAYOUT_TYPE
.
shop
:
param
.
storeId
=
shopId
getFn
=
PublicApi
.
postSearchShopStoreGetCommodityList
if
(
shopId
)
{
param
.
storeId
=
shopId
getFn
=
PublicApi
.
postSearchShopStoreGetCommodityList
}
break
case
LAYOUT_TYPE
.
channel
:
param
.
channelMemberId
=
memberId
headers
=
{
type
:
3
if
(
memberId
)
{
param
.
channelMemberId
=
memberId
headers
=
{
type
:
3
}
getFn
=
PublicApi
.
postSearchShopChannelGetCommodityList
}
getFn
=
PublicApi
.
postSearchShopChannelGetCommodityList
break
case
LAYOUT_TYPE
.
ichannel
:
param
.
channelMemberId
=
memberId
headers
=
{
type
:
4
if
(
memberId
)
{
param
.
channelMemberId
=
memberId
headers
=
{
type
:
4
}
getFn
=
PublicApi
.
postSearchShopChannelGetCommodityList
}
getFn
=
PublicApi
.
postSearchShopChannelGetCommodityList
break
}
...
...
src/pages/lxMall/components/SearchShopResult/index.tsx
View file @
44fb9147
...
...
@@ -4,10 +4,11 @@ import styles from './index.less'
interface
NoResultPropsType
{
search
?:
string
,
type
?:
number
}
const
SearchShopResult
:
React
.
FC
<
NoResultPropsType
>
=
(
props
)
=>
{
const
{
search
}
=
props
const
{
search
,
type
=
1
}
=
props
return
(
<
div
className=
{
styles
.
no_result_container
}
>
<
div
className=
{
styles
.
no_result
}
>
...
...
@@ -21,11 +22,11 @@ const SearchShopResult: React.FC<NoResultPropsType> = (props) => {
<>
抱歉,没有找到与“
<
span
className=
{
styles
.
no_result_tip_search
}
>
{
search
}
</
span
>
”相关的
店铺
”相关的
{
type
===
1
?
'店铺'
:
'渠道商城'
}
</>
)
:
(
<>
抱歉,没有找到相关的
店铺
抱歉,没有找到相关的
{
type
===
1
?
'店铺'
:
'渠道商城'
}
</>
)
}
...
...
@@ -34,8 +35,8 @@ const SearchShopResult: React.FC<NoResultPropsType> = (props) => {
<
div
className=
{
styles
.
no_result_suggest
}
>
<
ul
className=
{
styles
.
no_result_suggest_list
}
>
<
li
>
出现的可能原因:
</
li
>
<
li
>
1、管理员冻结了该
店铺
</
li
>
<
li
>
2、
店铺
链接出现错误
</
li
>
<
li
>
1、管理员冻结了该
{
type
===
1
?
'店铺'
:
'渠道商城'
}
</
li
>
<
li
>
2、
{
type
===
1
?
'店铺'
:
'渠道商城'
}
链接出现错误
</
li
>
</
ul
>
</
div
>
</
div
>
...
...
src/pages/lxMall/layouts/LXChannelLayout.tsx
View file @
44fb9147
...
...
@@ -10,6 +10,7 @@ import { inject, observer } from 'mobx-react'
import
TopBar
from
'../components/TopBar'
import
{
PublicApi
}
from
'@/services/api'
import
{
GetTemplateChannelFindChannelResponse
}
from
'@/services/TemplateApi'
import
SearchShopResult
from
'../components/SearchShopResult'
import
ChannelHeader
from
'../components/ChannelHeader'
import
MainNav
from
'../components/MainNav'
import
SideNav
from
'../components/SideNav'
...
...
@@ -31,6 +32,7 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
const
{
channelId
}
=
location
.
query
const
[
shopInfo
,
setShopInfo
]
=
useState
<
GetTemplateChannelFindChannelResponse
>
()
const
[
query
,
setQuery
]
=
useState
<
any
>
({})
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
true
)
const
getMenuRouter
=
(
routes
:
any
,
pathname
:
any
)
=>
{
let
list
=
routes
.
filter
((
item
:
any
)
=>
pathname
.
indexOf
(
item
.
key
)
>
-
1
)
...
...
@@ -48,7 +50,7 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
queryParam
=
queryParam
?
JSON
.
parse
(
queryParam
)
:
{}
setQuery
(
queryParam
)
}
catch
(
error
)
{
setLoading
(
false
)
}
},
[])
...
...
@@ -64,6 +66,9 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
if
(
res
.
code
===
1000
)
{
setShopInfo
(
res
.
data
)
}
setLoading
(
false
)
}).
catch
(()
=>
{
setLoading
(
false
)
})
}
...
...
@@ -95,7 +100,7 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
)
}
{
children
&&
React
.
Children
.
map
(
children
,
(
child
:
any
)
=>
{
!
loading
?
shopInfo
?
children
&&
React
.
Children
.
map
(
children
,
(
child
:
any
)
=>
{
return
React
.
cloneElement
(
child
,
{
layoutType
:
LAYOUT_TYPE
.
channel
,
...
...
@@ -105,7 +110,7 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
shopInfo
},
);
})
})
:
<
SearchShopResult
type
=
{
2
}
/> : nul
l
}
</
div
>
<
Footer
/>
...
...
src/pages/lxMall/layouts/LXIChannelLayout.tsx
View file @
44fb9147
...
...
@@ -10,6 +10,7 @@ import { inject, observer } from 'mobx-react'
import
TopBar
from
'../components/TopBar'
import
{
PublicApi
}
from
'@/services/api'
import
{
GetTemplateChannelFindChannelResponse
}
from
'@/services/TemplateApi'
import
SearchShopResult
from
'../components/SearchShopResult'
import
ChannelHeader
from
'../components/ChannelHeader'
import
MainNav
from
'../components/MainNav'
import
SideNav
from
'../components/SideNav'
...
...
@@ -31,6 +32,7 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
const
{
channelId
}
=
location
.
query
const
[
shopInfo
,
setShopInfo
]
=
useState
<
GetTemplateChannelFindChannelResponse
>
()
const
[
query
,
setQuery
]
=
useState
<
any
>
({})
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
true
)
const
getMenuRouter
=
(
routes
:
any
,
pathname
:
any
)
=>
{
let
list
=
routes
.
filter
((
item
:
any
)
=>
pathname
.
indexOf
(
item
.
key
)
>
-
1
)
...
...
@@ -47,7 +49,7 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
queryParam
=
queryParam
?
JSON
.
parse
(
queryParam
)
:
{}
setQuery
(
queryParam
)
}
catch
(
error
)
{
setLoading
(
false
)
}
},
[])
...
...
@@ -64,6 +66,9 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
if
(
res
.
code
===
1000
)
{
setShopInfo
(
res
.
data
)
}
setLoading
(
false
)
}).
catch
(()
=>
{
setLoading
(
false
)
})
}
...
...
@@ -89,7 +94,7 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
)
}
{
children
&&
React
.
Children
.
map
(
children
,
(
child
:
any
)
=>
{
!
loading
?
shopInfo
?
children
&&
React
.
Children
.
map
(
children
,
(
child
:
any
)
=>
{
return
React
.
cloneElement
(
child
,
{
layoutType
:
LAYOUT_TYPE
.
ichannel
,
...
...
@@ -99,7 +104,7 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
shopInfo
},
);
})
})
:
<
SearchShopResult
type
=
{
2
}
/> : nul
l
}
</
div
>
<
Footer
/>
...
...
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