Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
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
shenshaokai
jinfa-admin
Commits
a298b483
Commit
a298b483
authored
Dec 14, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 模板接口地址修改
parent
ff6d289e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
40 deletions
+7
-40
index.tsx
src/pages/pageCustomized/shopTemplate/index.tsx
+4
-5
index.tsx
src/pages/pageCustomized/templateDetail/index.tsx
+3
-35
No files found.
src/pages/pageCustomized/shopTemplate/index.tsx
View file @
a298b483
...
@@ -4,7 +4,7 @@ import { inject } from 'mobx-react'
...
@@ -4,7 +4,7 @@ import { inject } from 'mobx-react'
import
TemplateItem
from
'../components/templateItem'
import
TemplateItem
from
'../components/templateItem'
import
{
PublicApi
}
from
'@/services/api'
import
{
PublicApi
}
from
'@/services/api'
import
{
TEMPLATE_TYPE
}
from
'@/constants'
import
{
TEMPLATE_TYPE
}
from
'@/constants'
import
{
GetTemplate
Platform
FindAllTemplateByTypeResponse
}
from
'@/services/TemplateApi'
import
{
GetTemplate
WebPageTemplateWeb
FindAllTemplateByTypeResponse
}
from
'@/services/TemplateApi'
import
styles
from
'./index.less'
import
styles
from
'./index.less'
interface
ShopCenterTemplatePropsType
{
interface
ShopCenterTemplatePropsType
{
...
@@ -14,15 +14,14 @@ interface ShopCenterTemplatePropsType {
...
@@ -14,15 +14,14 @@ interface ShopCenterTemplatePropsType {
const
ShopTemplate
:
React
.
FC
<
ShopCenterTemplatePropsType
>
=
(
props
)
=>
{
const
ShopTemplate
:
React
.
FC
<
ShopCenterTemplatePropsType
>
=
(
props
)
=>
{
const
{
SiteStore
:
{
siteId
}
}
=
props
const
{
SiteStore
:
{
siteId
}
}
=
props
const
[
templateList
,
setTemplateList
]
=
useState
<
GetTemplate
Platform
FindAllTemplateByTypeResponse
>
([])
const
[
templateList
,
setTemplateList
]
=
useState
<
GetTemplate
WebPageTemplateWeb
FindAllTemplateByTypeResponse
>
([])
useEffect
(()
=>
{
useEffect
(()
=>
{
let
prarm
=
{
const
prarm
:
any
=
{
type
:
TEMPLATE_TYPE
.
shop
,
type
:
TEMPLATE_TYPE
.
shop
,
siteId
siteId
}
}
//@ts-ignore
PublicApi
.
getTemplateWebPageTemplateWebFindAllTemplateByType
(
prarm
).
then
(
res
=>
{
PublicApi
.
getTemplatePlatformFindAllTemplateByType
(
prarm
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
setTemplateList
(
res
.
data
)
setTemplateList
(
res
.
data
)
}
}
...
...
src/pages/pageCustomized/templateDetail/index.tsx
View file @
a298b483
import
React
,
{
useState
,
Fragment
,
useEffect
}
from
'react'
import
React
,
{
useState
,
Fragment
,
useEffect
}
from
'react'
import
{
history
}
from
'umi'
import
{
LayoutOutlined
,
EyeOutlined
,
ToTopOutlined
,
ExclamationCircleOutlined
}
from
'@ant-design/icons'
import
{
LayoutOutlined
,
EyeOutlined
,
PlayCircleOutlined
,
ToTopOutlined
,
ExclamationCircleOutlined
}
from
'@ant-design/icons'
import
{
Modal
,
message
}
from
'antd'
import
{
Modal
,
message
}
from
'antd'
import
cx
from
'classnames'
import
cx
from
'classnames'
import
{
inject
}
from
'mobx-react'
import
{
inject
}
from
'mobx-react'
...
@@ -20,7 +19,6 @@ interface TemplateDetailPropsType {
...
@@ -20,7 +19,6 @@ interface TemplateDetailPropsType {
}
}
}
}
const
Environment_Status
=
{
const
Environment_Status
=
{
1
:
{
1
:
{
name
:
"web"
name
:
"web"
...
@@ -52,27 +50,13 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
...
@@ -52,27 +50,13 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
const
param
:
any
=
{
const
param
:
any
=
{
id
id
}
}
PublicApi
.
getTemplate
Platform
FindTemplateDetails
(
param
).
then
(
res
=>
{
PublicApi
.
getTemplate
WebPageTemplateWeb
FindTemplateDetails
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
setDetailInfo
(
res
.
data
)
setDetailInfo
(
res
.
data
)
}
}
})
})
}
}
/**
* 使用商城页面模板
*/
const
handleUseTemplate
=
()
=>
{
Modal
.
confirm
({
title
:
'提示'
,
icon
:
<
ExclamationCircleOutlined
/>,
content
:
'是否确认要使用该模板?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onOk
:
confirmUseTemplate
})
}
const
handleShelfShop
=
(
shelf
:
number
)
=>
{
const
handleShelfShop
=
(
shelf
:
number
)
=>
{
Modal
.
confirm
({
Modal
.
confirm
({
...
@@ -91,19 +75,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
...
@@ -91,19 +75,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
id
,
id
,
shelf
shelf
}
}
PublicApi
.
postTemplatePlatformShelfTemplate
(
param
).
then
(
res
=>
{
PublicApi
.
postTemplateWebPageTemplateWebShelfTemplate
(
param
).
then
(
res
=>
{
fetchDetail
()
resolve
()
})
})
}
const
confirmUseTemplate
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
const
param
:
any
=
{
id
:
Number
(
id
),
}
PublicApi
.
postTemplatePlatformUseTemplate
(
param
).
then
(
res
=>
{
fetchDetail
()
fetchDetail
()
resolve
()
resolve
()
})
})
...
@@ -188,10 +160,6 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
...
@@ -188,10 +160,6 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
<LayoutOutlined />
<LayoutOutlined />
<label>装修</label>
<label>装修</label>
</div>
</div>
{/* <div className={cx(styles.btn, detailInfo?.use === 1 ? styles.use : '')} onClick={() => handleUseTemplate()}>
<PlayCircleOutlined />
<label>{detailInfo?.use === 1 ? '启用中' : '启用'}</label>
</div> */}
</Fragment>
</Fragment>
)
)
}
}
...
...
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