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