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
28ffaa12
Commit
28ffaa12
authored
Jul 13, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix(): 修改门户链接显示
parent
47217bb9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
175 deletions
+48
-175
index.tsx
src/pages/channel/channelInfo/index.tsx
+24
-60
index.tsx
src/pages/handling/handlingInfo/index.tsx
+23
-55
index.tsx
src/pages/logistics/logisticsInfo/index.tsx
+1
-60
No files found.
src/pages/channel/channelInfo/index.tsx
View file @
28ffaa12
...
...
@@ -28,6 +28,8 @@ const defaultCityData = { index: 0, provinceCode: 0, province: '', cityCode: 0,
const
ChannelInfo
:
React
.
FC
<
ShopInfoPropsType
>
=
(
props
)
=>
{
const
{
siteUrl
,
siteId
}
=
props
.
SiteStore
const
[
door
,
setDoor
]
=
useState
<
string
>
(
''
);
const
[
resUrl
,
setResUrl
]
=
useState
<
string
>
(
''
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
<
boolean
>
(
false
)
const
[
formIsHalfFilledOut
,
setFormIsHalfFilledOut
]
=
useState
(
false
)
const
[
form
]
=
Form
.
useForm
()
...
...
@@ -78,7 +80,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
const
fetchAllShop
=
()
=>
{
const
param
:
any
=
{
siteId
,
type
:
2
type
:
3
}
PublicApi
.
getManageShopFindShopsBySiteId
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
...
...
@@ -265,68 +267,26 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
})
}
const
handleMallSelectChange
=
(
mallId
:
number
)
=>
{
setShopId
(
mallId
)
if
(
!
shopInfo
)
{
return
}
if
(
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
const
resUrl
=
getMallItemAndSetUrl
(
mallId
)
setStoreUrl
(
resUrl
)
}
else
{
setStoreUrl
(
null
)
}
const
handleFormValueChange
=
()
=>
{
setFormIsHalfFilledOut
(
true
)
}
const
getMallItemAndSetUrl
=
(
mallId
)
=>
{
let
result
=
""
const
mallItem
=
allMallList
.
filter
(
item
=>
item
.
id
===
mallId
)[
0
]
if
(
!
mallItem
)
{
return
""
}
let
newSiteUrl
=
siteUrl
if
(
newSiteUrl
.
indexOf
(
'http'
)
<
0
)
{
newSiteUrl
=
`
${
REQUEST_HEADER
}${
newSiteUrl
}
`
}
if
(
mallItem
.
environment
===
1
)
{
switch
(
mallItem
.
type
)
{
case
3
:
result
=
`
${
REQUEST_HEADER
}${
GlobalConfig
.
channelRootRoute
}
.
${
TOP_DOMAIN
}
/m
${
shopInfo
.
memberId
}
`
break
case
4
:
result
=
`
${
REQUEST_HEADER
}${
GlobalConfig
.
ichannelRootRoute
}
.
${
TOP_DOMAIN
}
/m
${
shopInfo
.
memberId
}
`
break
default
:
result
=
""
break
/** 获取店铺链接 */
const
checkUrl
=
(
url
)
=>
{
if
(
url
&&
typeof
url
===
'string'
)
{
if
(
url
.
indexOf
(
'/'
)
===
0
)
{
return
url
.
replace
(
'/'
,
''
).
trim
()
}
else
{
return
`
${
url
}
`
.
trim
()
}
}
else
{
result
=
""
}
return
result
}
const
handleFormValueChange
=
()
=>
{
setFormIsHalfFilledOut
(
true
)
}
const
getSelectMallStoreUrl
=
()
=>
{
if
(
!
shopInfo
)
{
return
null
}
if
(
shopId
&&
shopInfo
.
memberId
)
{
const
resUrl
=
getMallItemAndSetUrl
(
shopId
)
return
resUrl
?
(
<
div
className=
{
styles
.
shop_url
}
>
<
span
>
当前商城链接:
</
span
>
<
label
title=
{
resUrl
}
>
{
resUrl
}
</
label
>
<
CopyOutlined
className=
{
styles
.
copy_icon
}
onClick=
{
()
=>
handleCopyLinke
(
resUrl
)
}
/>
</
div
>
)
:
null
const
handleMallSelectChange
=
(
val
,
option
)
=>
{
setDoor
(
option
.
children
);
if
(
option
.
url
)
{
checkUrl
(
option
.
url
)
?
setResUrl
(
`
${
checkUrl
(
option
.
url
)}
.
${
siteUrl
}
`
)
:
setResUrl
(
`
${
siteUrl
}
`
)
}
return
null
}
return
(
...
...
@@ -442,7 +402,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
{
Object
.
keys
(
file
).
length
>
0
&&
(
<
div
className=
{
styles
.
upload_item
}
>
<
div
className=
{
styles
.
upload_left
}
>
<
LinkOutlined
style=
{
{
marginRight
:
'5px'
}
}
/>
<
LinkOutlined
style=
{
{
marginRight
:
'5px'
}
}
/>
<
Typography
.
Link
href=
{
`/api/contract/contractTemplate/downloadContract?contractName=${file.albumName}&contractUrl=${file.albumURL}`
}
target=
"_blank"
...
...
@@ -482,9 +442,13 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
))
}
</
Select
>
{
getSelectMallStoreUrl
()
}
{
resUrl
&&
(
<
div
className=
{
styles
.
shop_url
}
>
<
span
>
当前
{
door
}
链接:
</
span
>
<
label
>
{
resUrl
}
</
label
>
<
CopyOutlined
className=
{
styles
.
copy_icon
}
onClick=
{
()
=>
handleCopyLinke
(
resUrl
)
}
/>
</
div
>
)
}
</
Form
.
Item
>
<
Form
.
Item
label=
{
<
RequireItem
label=
""
/>
}
...
...
src/pages/handling/handlingInfo/index.tsx
View file @
28ffaa12
...
...
@@ -30,6 +30,8 @@ const defaultCategoryData = { index: 0, firstId: 0, secondId: 0, thirdlyId: 0, f
const
HandlingInfo
:
React
.
FC
<
HandlingInfoPropsType
>
=
(
props
)
=>
{
const
{
siteUrl
,
siteId
}
=
props
.
SiteStore
const
[
door
,
setDoor
]
=
useState
<
string
>
(
''
);
const
[
resUrl
,
setResUrl
]
=
useState
<
string
>
(
''
);
const
[
formIsHalfFilledOut
,
setFormIsHalfFilledOut
]
=
useState
(
false
)
const
[
form
]
=
Form
.
useForm
()
const
[
allMallList
,
setAllMallList
]
=
useState
([])
...
...
@@ -80,7 +82,7 @@ const HandlingInfo: React.FC<HandlingInfoPropsType> = (props) => {
const
fetchAllShop
=
()
=>
{
const
param
:
any
=
{
siteId
,
type
:
1
type
:
8
}
PublicApi
.
getManageShopFindShopsBySiteId
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
...
...
@@ -365,64 +367,26 @@ const HandlingInfo: React.FC<HandlingInfoPropsType> = (props) => {
})
}
const
handleMallSelectChange
=
(
mallId
:
number
)
=>
{
setShopId
(
mallId
)
if
(
!
shopInfo
)
{
return
null
}
if
(
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
const
resUrl
=
getMallItemAndSetUrl
(
mallId
)
}
const
handleFormValueChange
=
()
=>
{
setFormIsHalfFilledOut
(
true
)
}
const
getMallItemAndSetUrl
=
(
mallId
)
=>
{
let
result
=
""
const
mallItem
=
allMallList
.
filter
(
item
=>
item
.
id
===
mallId
)[
0
]
if
(
!
mallItem
)
{
return
""
}
if
(
mallItem
.
environment
===
1
)
{
let
newSiteUrl
=
siteUrl
if
(
newSiteUrl
.
indexOf
(
'http'
)
<
0
)
{
newSiteUrl
=
`http://`
+
newSiteUrl
}
switch
(
mallItem
.
type
)
{
case
1
:
result
=
`
${
newSiteUrl
}
/shop?shopId=
${
btoa
(
JSON
.
stringify
({
shopId
:
shopInfo
.
id
,
memberId
:
shopInfo
.
memberId
,
roleId
:
shopInfo
.
roleId
}))}
`
break
case
2
:
result
=
`
${
newSiteUrl
}
/shop/pointsMall?shopId=
${
btoa
(
JSON
.
stringify
({
shopId
:
shopInfo
.
id
,
memberId
:
shopInfo
.
memberId
,
roleId
:
shopInfo
.
roleId
}))}
`
break
default
:
result
=
""
break
/** 获取店铺链接 */
const
checkUrl
=
(
url
)
=>
{
if
(
url
&&
typeof
url
===
'string'
)
{
if
(
url
.
indexOf
(
'/'
)
===
0
)
{
return
url
.
replace
(
'/'
,
''
).
trim
()
}
else
{
return
`
${
url
}
`
.
trim
()
}
}
else
{
result
=
""
}
return
result
}
const
handleFormValueChange
=
()
=>
{
setFormIsHalfFilledOut
(
true
)
}
const
getSelectMallStoreUrl
=
()
=>
{
if
(
!
shopInfo
)
{
return
null
}
if
(
shopId
&&
shopInfo
.
memberId
)
{
const
resUrl
=
getMallItemAndSetUrl
(
shopId
)
return
resUrl
?
(
<
div
className=
{
styles
.
shop_url
}
>
<
span
>
当前店铺链接:
</
span
>
<
label
>
{
resUrl
}
</
label
>
<
CopyOutlined
className=
{
styles
.
copy_icon
}
onClick=
{
()
=>
handleCopyLinke
(
resUrl
)
}
/>
</
div
>
)
:
null
const
handleMallSelectChange
=
(
val
,
option
)
=>
{
setDoor
(
option
.
children
);
if
(
option
.
url
)
{
checkUrl
(
option
.
url
)
?
setResUrl
(
`
${
checkUrl
(
option
.
url
)}
.
${
siteUrl
}
`
)
:
setResUrl
(
`
${
siteUrl
}
`
)
}
return
null
}
return
(
...
...
@@ -638,9 +602,13 @@ const HandlingInfo: React.FC<HandlingInfoPropsType> = (props) => {
))
}
</
Select
>
{
getSelectMallStoreUrl
()
}
{
resUrl
&&
(
<
div
className=
{
styles
.
shop_url
}
>
<
span
>
当前
{
door
}
链接:
</
span
>
<
label
>
{
resUrl
}
</
label
>
<
CopyOutlined
className=
{
styles
.
copy_icon
}
onClick=
{
()
=>
handleCopyLinke
(
resUrl
)
}
/>
</
div
>
)
}
</
Form
.
Item
>
</
TabPane
>
<
TabPane
tab=
'SEO'
key=
'2'
forceRender
>
...
...
src/pages/logistics/logisticsInfo/index.tsx
View file @
28ffaa12
...
...
@@ -82,7 +82,7 @@ const LogisticsInfo: React.FC<LogisticsInfoPropsType> = (props) => {
const
fetchAllShop
=
()
=>
{
const
param
:
any
=
{
siteId
,
type
:
1
type
:
7
}
PublicApi
.
getManageShopFindShopsBySiteId
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
...
...
@@ -352,66 +352,7 @@ const LogisticsInfo: React.FC<LogisticsInfoPropsType> = (props) => {
slideshowBOList
:
result
})
}
/**
const handleMallSelectChange = (mallId: number) => {
setShopId(mallId)
if (!shopInfo) {
return null
}
if (shopInfo.shopId && shopInfo.memberId) {
const resUrl = getMallItemAndSetUrl(mallId)
setStoreUrl(resUrl)
} else {
setStoreUrl(null)
}
}
const getMallItemAndSetUrl = (mallId) => {
let result = ""
const mallItem = allMallList.filter(item => item.id === mallId)[0]
if (!mallItem) {
return ""
}
if (mallItem.environment === 1) {
let newSiteUrl = siteUrl
if (newSiteUrl.indexOf('http') < 0) {
newSiteUrl = `http://` + newSiteUrl
}
switch (mallItem.type) {
case 1:
result = `${newSiteUrl}/shop?shopId=${btoa(JSON.stringify({ shopId: shopInfo.id, memberId: shopInfo.memberId, roleId: shopInfo.roleId }))}`
break
case 2:
result = `${newSiteUrl}/shop/pointsMall?shopId=${btoa(JSON.stringify({ shopId: shopInfo.id, memberId: shopInfo.memberId, roleId: shopInfo.roleId }))}`
break
default:
result = ""
break
}
} else {
result = ""
}
return result
}
const getSelectMallStoreUrl = () => {
if (!shopInfo) {
return null
}
if (shopId && shopInfo.memberId) {
const resUrl = getMallItemAndSetUrl(shopId)
return resUrl ? (
<div className={styles.shop_url}>
<span>当前店铺链接:</span>
<label>{resUrl}</label>
<CopyOutlined className={styles.copy_icon} onClick={() => handleCopyLinke(resUrl)} />
</div>
) : null
}
return null
}
*/
const
handleFormValueChange
=
()
=>
{
setFormIsHalfFilledOut
(
true
)
}
...
...
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