Commit ad8248f5 authored by GuanHua's avatar GuanHua

Merge branch 'dev' of http://10.0.0.22:3000/lingxi/lingxi-business-system into mobileEdit

parents 6f590ecd a298b483
......@@ -4,7 +4,7 @@ import { inject } from 'mobx-react'
import TemplateItem from '../components/templateItem'
import { PublicApi } from '@/services/api'
import { TEMPLATE_TYPE } from '@/constants'
import { GetTemplatePlatformFindAllTemplateByTypeResponse } from '@/services/TemplateApi'
import { GetTemplateWebPageTemplateWebFindAllTemplateByTypeResponse } from '@/services/TemplateApi'
import styles from './index.less'
interface ShopCenterTemplatePropsType {
......@@ -14,15 +14,14 @@ interface ShopCenterTemplatePropsType {
const ShopTemplate: React.FC<ShopCenterTemplatePropsType> = (props) => {
const { SiteStore: { siteId } } = props
const [templateList, setTemplateList] = useState<GetTemplatePlatformFindAllTemplateByTypeResponse>([])
const [templateList, setTemplateList] = useState<GetTemplateWebPageTemplateWebFindAllTemplateByTypeResponse>([])
useEffect(() => {
let prarm = {
const prarm: any = {
type: TEMPLATE_TYPE.shop,
siteId
}
//@ts-ignore
PublicApi.getTemplatePlatformFindAllTemplateByType(prarm).then(res => {
PublicApi.getTemplateWebPageTemplateWebFindAllTemplateByType(prarm).then(res => {
if (res.code === 1000) {
setTemplateList(res.data)
}
......
import React, { useState, Fragment, useEffect } from 'react'
import { history } from 'umi'
import { LayoutOutlined, EyeOutlined, PlayCircleOutlined, ToTopOutlined, ExclamationCircleOutlined } from '@ant-design/icons'
import { LayoutOutlined, EyeOutlined, ToTopOutlined, ExclamationCircleOutlined } from '@ant-design/icons'
import { Modal, message } from 'antd'
import cx from 'classnames'
import { inject } from 'mobx-react'
......@@ -20,7 +19,6 @@ interface TemplateDetailPropsType {
}
}
const Environment_Status = {
1: {
name: "web"
......@@ -52,27 +50,13 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
const param: any = {
id
}
PublicApi.getTemplatePlatformFindTemplateDetails(param).then(res => {
PublicApi.getTemplateWebPageTemplateWebFindTemplateDetails(param).then(res => {
if (res.code === 1000) {
setDetailInfo(res.data)
}
})
}
/**
* 使用商城页面模板
*/
const handleUseTemplate = () => {
Modal.confirm({
title: '提示',
icon: <ExclamationCircleOutlined />,
content: '是否确认要使用该模板?',
okText: '确认',
cancelText: '取消',
onOk: confirmUseTemplate
})
}
const handleShelfShop = (shelf: number) => {
Modal.confirm({
......@@ -91,19 +75,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
id,
shelf
}
PublicApi.postTemplatePlatformShelfTemplate(param).then(res => {
fetchDetail()
resolve()
})
})
}
const confirmUseTemplate = () => {
return new Promise((resolve) => {
const param: any = {
id: Number(id),
}
PublicApi.postTemplatePlatformUseTemplate(param).then(res => {
PublicApi.postTemplateWebPageTemplateWebShelfTemplate(param).then(res => {
fetchDetail()
resolve()
})
......
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