Commit a298b483 authored by GuanHua's avatar GuanHua

fix: 模板接口地址修改

parent ff6d289e
...@@ -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 { GetTemplatePlatformFindAllTemplateByTypeResponse } from '@/services/TemplateApi' import { GetTemplateWebPageTemplateWebFindAllTemplateByTypeResponse } 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<GetTemplatePlatformFindAllTemplateByTypeResponse>([]) const [templateList, setTemplateList] = useState<GetTemplateWebPageTemplateWebFindAllTemplateByTypeResponse>([])
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)
} }
......
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.getTemplatePlatformFindTemplateDetails(param).then(res => { PublicApi.getTemplateWebPageTemplateWebFindTemplateDetails(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>
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment