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
39b9be9e
Commit
39b9be9e
authored
Mar 03, 2022
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 收藏管理自营商城商品详情链接跳转问题修复
parent
f5da3f56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
22 deletions
+44
-22
index.ts
src/global/config/index.ts
+10
-0
commodity.tsx
src/pages/systemSetting/collection/commodity.tsx
+34
-22
No files found.
src/global/config/index.ts
View file @
39b9be9e
...
...
@@ -12,6 +12,7 @@ import { RootObject } from './global'
interface
NewRootObject
extends
RootObject
{
channelRootRoute
:
string
;
ichannelRootRoute
:
string
;
getSelfMallUrl
:
()
=>
string
}
const
channelRootRoute
=
'channel'
...
...
@@ -26,4 +27,13 @@ export const getShopInfoById = (shopId: number) => {
}
export
const
getSelfMallUrl
=
()
=>
{
const
selfMallItem
=
SELF_CONFIG
.
web
.
shopInfo
.
filter
((
item
)
=>
item
.
environment
===
1
&&
item
.
property
===
3
&&
item
.
self
===
1
&&
item
.
isDefault
===
1
)[
0
]
return
selfMallItem
?
selfMallItem
?.
url
:
'own'
}
export
const
GlobalConfig
:
NewRootObject
=
SELF_CONFIG
src/pages/systemSetting/collection/commodity.tsx
View file @
39b9be9e
...
...
@@ -4,13 +4,15 @@ import { Button, message, Modal, Pagination } from 'antd'
import
{
StarFilled
}
from
'@ant-design/icons'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
ShopCredit
from
'@/components/ShopCredit'
import
{
getShopInfoById
}
from
'@/global/config'
import
{
getShopInfoById
,
getSelfMallUrl
}
from
'@/global/config'
import
{
numFormat
}
from
'@/utils/numberFomat'
import
moment
from
'moment'
import
{
COMMODITY_TYPE
,
CHANNEL_CENTER_URL
,
ENTERPRISE_CENTER_URL
,
REQUEST_HEADER
,
TOP_DOMAIN
}
from
'@/constants'
import
{
COMMODITY_TYPE
,
REQUEST_HEADER
,
TOP_DOMAIN
}
from
'@/constants'
import
{
postManageWebShopWebAll
,
PostManageWebShopWebAllResponse
}
from
'@/services/ManageV2Api'
import
styles
from
'./index.less'
import
{
getSearchShopCommodityCollectGetCommodityCollectList
,
postSearchShopCommodityCollectChannelDeleteCommodityCollectById
,
postSearchShopCommodityCollectDeleteCommodityCollectById
}
from
'@/services/SearchV2Api'
;
import
{
useIntl
}
from
'umi'
import
{
getAuth
}
from
'@/utils/auth'
;
const
Commodity
:
React
.
FC
=
()
=>
{
const
intl
=
useIntl
();
...
...
@@ -40,33 +42,43 @@ const Commodity: React.FC = () => {
})
}
const
linkToDetail
=
(
detail
)
=>
{
const
linkToDetail
=
async
(
detail
)
=>
{
if
(
detail
.
isPublish
)
{
const
el
=
document
.
createElement
(
'a'
)
const
shopInfo
=
getShopInfoById
(
detail
.
shopId
)
if
(
!
shopInfo
)
return
const
mallUrl
=
`
${
REQUEST_HEADER
}${
shopInfo
.
url
}
.
${
TOP_DOMAIN
}
`
if
(
detail
.
channelMemberId
)
{
switch
(
detail
.
commodity
.
priceType
)
{
case
1
:
case
2
:
el
.
href
=
`
${
mallUrl
}
/
${
detail
.
channelMemberId
}
/commodity/detail/
${
detail
.
commodity
.
id
}
`
;
break
case
3
:
el
.
href
=
`
${
mallUrl
}
/
${
detail
.
channelMemberId
}
/integral/detail/
${
detail
.
commodity
.
id
}
`
;
break
if
(
shopInfo
)
{
const
mallUrl
=
`
${
REQUEST_HEADER
}${
shopInfo
.
url
}
.
${
TOP_DOMAIN
}
`
if
(
detail
.
channelMemberId
)
{
switch
(
detail
.
commodity
.
priceType
)
{
case
1
:
case
2
:
el
.
href
=
`
${
mallUrl
}
/
${
detail
.
channelMemberId
}
/commodity/detail/
${
detail
.
commodity
.
id
}
`
;
break
case
3
:
el
.
href
=
`
${
mallUrl
}
/
${
detail
.
channelMemberId
}
/integral/detail/
${
detail
.
commodity
.
id
}
`
;
break
}
}
else
{
switch
(
detail
.
commodity
.
priceType
)
{
case
1
:
case
2
:
el
.
href
=
`
${
mallUrl
}
/shop/
${
detail
.
commodity
.
memberId
}
_
${
detail
.
commodity
.
memberRoleId
}
/commodity/detail/
${
detail
.
commodity
.
id
}
`
;
break
case
3
:
el
.
href
=
`
${
mallUrl
}
/shop/
${
detail
.
commodity
.
memberId
}
_
${
detail
.
commodity
.
memberRoleId
}
/integral/detail/
${
detail
.
commodity
.
id
}
`
;
break
}
}
}
else
{
switch
(
detail
.
commodity
.
priceType
)
{
case
1
:
case
2
:
el
.
href
=
`
${
mallUrl
}
/shop/
${
detail
.
commodity
.
memberId
}
_
${
detail
.
commodity
.
memberRoleId
}
/commodity/detail/
${
detail
.
commodity
.
id
}
`
;
break
case
3
:
el
.
href
=
`
${
mallUrl
}
/shop/
${
detail
.
commodity
.
memberId
}
_
${
detail
.
commodity
.
memberRoleId
}
/integral/detail/
${
detail
.
commodity
.
id
}
`
;
break
const
selfMallUrl
=
getSelfMallUrl
()
if
(
selfMallUrl
)
{
const
url
=
`
${
REQUEST_HEADER
}${
selfMallUrl
}
.
${
TOP_DOMAIN
}
`
el
.
href
=
`
${
url
}
/
${
detail
.
commodity
.
memberId
}
/commodity/detail/
${
detail
.
commodity
.
id
}
`
;
}
else
{
return
}
}
el
.
target
=
'_blank'
;
el
.
id
=
detail
.
commodity
.
id
// 防止反复添加
...
...
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