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
6db11ef2
Commit
6db11ef2
authored
Nov 25, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:查询店铺信息接口添加参数
parent
4fc40375
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
11 deletions
+20
-11
index.tsx
src/pages/shop/shopInfo/index.tsx
+20
-11
No files found.
src/pages/shop/shopInfo/index.tsx
View file @
6db11ef2
...
...
@@ -12,6 +12,7 @@ import { GetTemplateShopFindShopResponse } from '@/services/TemplateApi'
import
copy
from
'copy-to-clipboard'
import
cx
from
'classnames'
import
styles
from
'./index.less'
import
{
getAuth
}
from
'@/utils/auth'
import
{
isEmpty
}
from
'@formily/antd/esm/shared'
interface
ShopInfoPropsType
{
...
...
@@ -43,8 +44,11 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
// 根据站点获取商城信息
const
fetchAllShop
=
()
=>
{
//@ts-ignore
PublicApi
.
getManageShopFindShopsBySiteId
({
siteId
,
type
:
1
}).
then
(
res
=>
{
const
param
:
any
=
{
siteId
,
type
:
1
}
PublicApi
.
getManageShopFindShopsBySiteId
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setAllMallList
(
res
.
data
)
}
...
...
@@ -55,7 +59,13 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
* 获取店铺信息
*/
const
fetchShopInfo
=
()
=>
{
PublicApi
.
getTemplateShopFindShop
().
then
(
res
=>
{
const
{
memberId
,
memberRoleId
}
=
getAuth
()
||
{}
const
param
:
any
=
{
memberId
,
roleId
:
memberRoleId
}
PublicApi
.
getTemplateShopFindShop
(
param
).
then
(
res
=>
{
const
data
=
res
.
data
if
(
res
.
code
===
1000
)
{
setShopInfo
(
data
)
...
...
@@ -91,7 +101,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
}
const
handleAddNewCitySelect
=
(
item
:
any
)
=>
{
le
t
temp
=
[...
selectCityData
]
cons
t
temp
=
[...
selectCityData
]
temp
.
push
(
item
)
setSelectCityData
(
temp
)
form
.
setFieldsValue
({
...
...
@@ -135,8 +145,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
const
handleSave
=
(
e
:
any
)
=>
{
e
.
preventDefault
()
console
.
log
(
selectCityData
)
form
.
validateFields
().
then
(
value
=>
{
form
.
validateFields
().
then
((
value
:
any
)
=>
{
if
(
!
checkMemberShopAreas
(
value
.
memberShopAreas
))
{
return
}
...
...
@@ -146,7 +155,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
}
value
.
storeUrl
=
storeUrl
||
`
${
siteUrl
}
/shop`
value
.
shopId
=
shopId
//@ts-ignore
PublicApi
.
postTemplateShopSaveShop
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
fetchShopInfo
()
...
...
@@ -213,7 +222,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
return
null
}
if
(
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
le
t
resUrl
=
getMallItemAndSetUrl
(
mallId
)
cons
t
resUrl
=
getMallItemAndSetUrl
(
mallId
)
setStoreUrl
(
resUrl
)
}
else
{
setStoreUrl
(
null
)
...
...
@@ -223,7 +232,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
const
getMallItemAndSetUrl
=
(
mallId
)
=>
{
let
result
=
""
console
.
log
(
mallId
,
allMallList
,
"mallId"
)
le
t
mallItem
=
allMallList
.
filter
(
item
=>
item
.
id
===
mallId
)[
0
]
cons
t
mallItem
=
allMallList
.
filter
(
item
=>
item
.
id
===
mallId
)[
0
]
if
(
!
mallItem
)
{
return
""
}
...
...
@@ -259,7 +268,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
return
null
}
if
(
shopId
&&
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
le
t
resUrl
=
getMallItemAndSetUrl
(
shopId
)
cons
t
resUrl
=
getMallItemAndSetUrl
(
shopId
)
return
resUrl
?
(
<
div
className=
{
styles
.
shop_url
}
>
<
span
>
当前店铺链接:
</
span
>
...
...
@@ -394,7 +403,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
labelAlign=
"left"
name=
"customerUrl"
label=
{
<
RequireItem
label=
"客服链接"
/>
}
rules=
{
[{
pattern
:
/
(
http|ftp|https
)
:
\/\/[\w\-
_
]
+
(\.[\w\-
_
]
+
)
+
([\w\-
\.
,@?^=%&:
/
~
\+
#
]
*
[\w\-\@
?^=%&
/
~
\
+
#
])?
/
,
message
:
'请输入正确的客服链接'
}]
}
rules=
{
[{
pattern
:
/
(
http|ftp|https
)
:
\/\/[\w\-
_
]
+
(\.[\w\-
_
]
+
)
+
([\w\-
.,@?^=%&:
/
~+#
]
*
[\w\-
@?^=%&
/
~
+#
])?
/
,
message
:
'请输入正确的客服链接'
}]
}
>
<
Input
allowClear
className=
{
styles
.
form_item
}
/>
</
Form
.
Item
>
...
...
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