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
73bc1c7f
Commit
73bc1c7f
authored
Jul 13, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix(物流门户,渠道门户,店铺门户,加工门户): 门户链接选择
parent
e11db7f2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
76 deletions
+30
-76
index.tsx
src/pages/channel/channelInfo/index.tsx
+2
-6
index.tsx
src/pages/handling/handlingInfo/index.tsx
+2
-6
index.tsx
src/pages/logistics/logisticsInfo/index.tsx
+2
-6
index.tsx
src/pages/shop/shopInfo/index.tsx
+24
-58
No files found.
src/pages/channel/channelInfo/index.tsx
View file @
73bc1c7f
...
...
@@ -78,11 +78,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
// 根据站点获取商城信息
const
fetchAllShop
=
()
=>
{
const
param
:
any
=
{
siteId
,
type
:
3
}
PublicApi
.
getManageShopFindShopsBySiteId
(
param
).
then
(
res
=>
{
PublicApi
.
getManageShopFindByDoorType
({
doorType
:
2
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setAllMallList
(
res
.
data
)
}
...
...
@@ -438,7 +434,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
<
Select
allowClear
value=
{
shopId
}
className=
{
styles
.
form_item
}
onChange=
{
handleMallSelectChange
}
>
{
allMallList
.
map
(
item
=>
(
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
>
{
item
.
name
}
</
Select
.
Option
>
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
url=
{
item
.
url
}
>
{
item
.
name
}
</
Select
.
Option
>
))
}
</
Select
>
...
...
src/pages/handling/handlingInfo/index.tsx
View file @
73bc1c7f
...
...
@@ -80,11 +80,7 @@ const HandlingInfo: React.FC<HandlingInfoPropsType> = (props) => {
// 根据站点获取商城信息
const
fetchAllShop
=
()
=>
{
const
param
:
any
=
{
siteId
,
type
:
8
}
PublicApi
.
getManageShopFindShopsBySiteId
(
param
).
then
(
res
=>
{
PublicApi
.
getManageShopFindByDoorType
({
doorType
:
5
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setAllMallList
(
res
.
data
)
}
...
...
@@ -598,7 +594,7 @@ const HandlingInfo: React.FC<HandlingInfoPropsType> = (props) => {
<
Select
allowClear
value=
{
shopId
}
className=
{
styles
.
form_item
}
onChange=
{
handleMallSelectChange
}
>
{
allMallList
.
map
(
item
=>
(
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
>
{
item
.
name
}
</
Select
.
Option
>
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
url=
{
item
.
url
}
>
{
item
.
name
}
</
Select
.
Option
>
))
}
</
Select
>
...
...
src/pages/logistics/logisticsInfo/index.tsx
View file @
73bc1c7f
...
...
@@ -80,11 +80,7 @@ const LogisticsInfo: React.FC<LogisticsInfoPropsType> = (props) => {
// 根据站点获取商城信息
const
fetchAllShop
=
()
=>
{
const
param
:
any
=
{
siteId
,
type
:
7
}
PublicApi
.
getManageShopFindShopsBySiteId
(
param
).
then
(
res
=>
{
PublicApi
.
getManageShopFindByDoorType
({
doorType
:
4
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setAllMallList
(
res
.
data
)
}
...
...
@@ -542,7 +538,7 @@ const LogisticsInfo: React.FC<LogisticsInfoPropsType> = (props) => {
<
Select
allowClear
value=
{
shopId
}
className=
{
styles
.
form_item
}
onChange=
{
handleMallSelectChange
}
>
{
allMallList
.
map
(
item
=>
(
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
url=
{
item
.
url
}
>
{
item
.
name
}
</
Select
.
Option
>
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
url=
{
item
.
url
}
>
{
item
.
name
}
</
Select
.
Option
>
))
}
</
Select
>
...
...
src/pages/shop/shopInfo/index.tsx
View file @
73bc1c7f
...
...
@@ -26,6 +26,8 @@ const defaultCityData = { index: 0, provinceCode: 0, province: '', cityCode: 0,
const
ShopInfo
:
React
.
FC
<
ShopInfoPropsType
>
=
(
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
([])
...
...
@@ -74,11 +76,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
// 根据站点获取商城信息
const
fetchAllShop
=
()
=>
{
const
param
:
any
=
{
siteId
,
type
:
1
}
PublicApi
.
getManageShopFindShopsBySiteId
(
param
).
then
(
res
=>
{
PublicApi
.
getManageShopFindByDoorType
({
doorType
:
1
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setAllMallList
(
res
.
data
)
}
...
...
@@ -257,62 +255,26 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
})
}
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
handleFormValueChange
=
()
=>
{
setFormIsHalfFilledOut
(
true
)
}
const
getMallItemAndSetUrl
=
(
mallId
)
=>
{
let
result
=
""
const
mallItem
=
allMallList
.
filter
(
item
=>
item
.
id
===
mallId
)[
0
]
if
(
!
mallItem
)
{
return
""
}
if
(
mallItem
.
environment
===
1
)
{
switch
(
mallItem
.
type
)
{
case
1
:
result
=
`
${
REQUEST_HEADER
}${
mallItem
.
url
}
.
${
TOP_DOMAIN
}
/shop/
${
shopInfo
.
memberId
}
_
${
shopInfo
.
roleId
}
`
break
// case 2:
// result = `${REQUEST_HEADER}${mallItem.url}.${TOP_DOMAIN}/shop/${shopInfo.memberId}_${shopInfo.roleId}/integral`
// 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
(
...
...
@@ -461,13 +423,17 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
<
Select
allowClear
value=
{
shopId
}
className=
{
styles
.
form_item
}
onChange=
{
handleMallSelectChange
}
>
{
allMallList
.
map
(
item
=>
(
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
>
{
item
.
name
}
</
Select
.
Option
>
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
url=
{
item
.
url
}
>
{
item
.
name
}
</
Select
.
Option
>
))
}
</
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=
""
/>
}
...
...
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