Commit 1436f214 authored by 前端-李俊鑫's avatar 前端-李俊鑫

chore: 自营商城seo设置以及关于我们设置-接口调整

parent ccdb8c98
......@@ -321,7 +321,9 @@ export enum DOORTYPE {
/** 渠道门户 */
PLACE_DOORTYPE,
/** 采购门户 */
PROCUREMENT_DOORTYPE
PROCUREMENT_DOORTYPE,
/** 自营门户 */
OWN_DOORTYPE
}
/** 年加工额 */
......
......@@ -6,11 +6,21 @@
}
.mallLink {
display: flex;
align-items: center;
font-size: 12px;
color: #91959B;
& > span {
color: #252D37;
}
.link {
padding: 0 5px;
}
}
.copy_icon {
cursor: pointer;
}
}
\ No newline at end of file
}
import { useEffect, useState, useRef } from 'react';
import { Tabs, Form, Button, Card, Select, Input, Tooltip, Typography, Row, Col, Anchor } from 'antd';
import { Form, Button, Card, Select, Input, Tooltip, Typography, Row, Col, message } from 'antd';
import RequireItem from '@/components/RequireItem';
import { history, Prompt } from 'umi';
import { Prompt } from 'umi';
import { PublicApi } from '@/services/api';
import { QuestionCircleOutlined, SaveOutlined } from '@ant-design/icons';
import PeripheralLayout from '@/pages/transaction/components/detailLayout';
import { CopyOutlined, SaveOutlined } from '@ant-design/icons';
import { validatorByte } from '@/utils/regExp';
import ReutrnEle from '@/components/ReturnEle';
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PAGE_TYPE, PAGE_TYPE_OPTIONS } from './constant'
import copy from 'copy-to-clipboard'
import TabAnchor from '@/components/TabAnchor'
import CitySelect from '@/components/CitySelect'
import ImgUpload, { imgUploadRefProps } from '@/components/ImgUpload'
......@@ -37,6 +35,12 @@ const tabLink = [
{ id: '4', title: '宣传画册' },
]
const handleCopyLinke = (link: string) => {
if (copy(link)) {
message.success('复制成功!')
}
}
const defaultCityData = { index: 0, provinceCode: 0, province: '', cityCode: 0, city: '' }
const OwnMallAboutUs = () => {
......@@ -77,7 +81,7 @@ const OwnMallAboutUs = () => {
temp.push(item)
setSelectCityData(temp)
form.setFieldsValue({
memberChannelAreas: temp
memberShopAreas: temp
})
}
......@@ -86,14 +90,14 @@ const OwnMallAboutUs = () => {
temp = temp.filter((item: any) => item.index !== index)
setSelectCityData(temp)
form.setFieldsValue({
memberChannelAreas: temp
memberShopAreas: temp
})
}
const handleCityChange = (data: any) => {
setSelectCityData(data)
form.setFieldsValue({
memberChannelAreas: data
memberShopAreas: data
})
}
......@@ -117,7 +121,7 @@ const OwnMallAboutUs = () => {
}
console.log(`params`, params)
setSaveLoading(true)
PublicApi.postManageShopAboutSubmit(params).then(res => {
PublicApi.postTemplateWebMemberSelfWebSaveCurrMemberSelf(params).then(res => {
if (res.code === 1000) {
setIsFormChange(false)
}
......@@ -129,7 +133,7 @@ const OwnMallAboutUs = () => {
// 根据站点获取自营商城
const getAllMallList = () => {
PublicApi.getManageWebShopWebFindWebEnterpriseSelfShop({ siteId }).then(res => {
PublicApi.getManageWebShopWebFindWebEnterpriseSelfShop({ siteId: String(siteId) }).then(res => {
if (res.code === 1000) {
const data = res.data.map(item => {
return {
......@@ -144,9 +148,9 @@ const OwnMallAboutUs = () => {
})
}
// 获取关于我们详情
// 获取自营商城关于我们详情
const getAboutUsInfo = () => {
PublicApi.getManageShopAboutGet().then(res => {
PublicApi.getTemplateWebMemberSelfWebFindCurrMemberSelf().then(res => {
const { code, data } = res
if (code === 1000 && data) {
const { albumName, albumUrl, honorPics, workshopPics, ...rest } = data
......@@ -161,7 +165,7 @@ const OwnMallAboutUs = () => {
setIsFormChange(false)
setAlbumUrls(newAlbumUrls)
setSelectCityData(rest.memberChannelAreas)
setSelectCityData(rest.memberShopAreas)
setMallUrl(rest.url)
}
})
......@@ -196,7 +200,7 @@ const OwnMallAboutUs = () => {
</Col>
<Col span={12}>
<Form.Item
name='memberChannelAreas'
name='memberShopAreas'
label={<RequireItem label="业务覆盖地市" isRequire={true}/>}
rules={[
{ required: true, message: "请选择业务覆盖地市" }
......@@ -216,7 +220,13 @@ const OwnMallAboutUs = () => {
<Form.Item name='shopId'>
<Select placeholder='请选择自营商城' allowClear options={allMallList} onChange={selectMall}/>
</Form.Item>
<Form.Item name='url'><div className={styles.mallLink}>当前自营商城链接: <span>{mallUrl}</span></div></Form.Item>
<Form.Item name='url'>
<div className={styles.mallLink}>
<span>当前自营商城链接: </span>
<span className={styles.link}>{mallUrl || '-'}</span>
{mallUrl && <Tooltip title='复制'><CopyOutlined className={styles.copy_icon} onClick={() => handleCopyLinke(mallUrl)} /></Tooltip>}
</div>
</Form.Item>
</Form.Item>
</Col>
</Row>
......
import { useEffect, useState, useRef } from 'react';
import { Tabs, Form, Button, Card, Select, Input, Tooltip, Typography, Row, Col, Anchor } from 'antd';
/*
* @Author: Crayon
* @Date: 2021-09-28 13:55:40
* @LastEditTime: 2021-10-19 14:30:13
* @LastEditors: Crayon
* @Description: 自营商城seo信息新增/修改
* @FilePath: \lingxi-business-paltform\src\pages\ownMall\ownMallManager\ownMallSeo\add.tsx
*/
import { useEffect, useState } from 'react';
import { Form, Button, Card, Select, Input, Tooltip, Typography, Row, Col } from 'antd';
import RequireItem from '@/components/RequireItem';
import { history, Prompt } from 'umi';
import { PublicApi } from '@/services/api';
import { QuestionCircleOutlined, SaveOutlined } from '@ant-design/icons';
import PeripheralLayout from '@/pages/transaction/components/detailLayout';
import { validatorByte } from '@/utils/regExp';
import ReutrnEle from '@/components/ReturnEle';
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PAGE_TYPE, PAGE_TYPE_OPTIONS } from './constant'
import { DOORTYPE } from '@/constants/procurement'
import TabAnchor from '@/components/TabAnchor'
import styles from './index.less'
......@@ -43,18 +51,21 @@ const SeoAdd = () => {
const params = {
id,
name: PAGE_TYPE[values.type],
doorType: DOORTYPE.OWN_DOORTYPE, // 门户类型:1-店铺门户 2-渠道门户 3-采购门户 4-自营门户
...values,
}
setSaveLoading(true)
const requestApi = id ? PublicApi.postManageActivityShopSeoUpdate : PublicApi.postManageActivityShopSeoAdd
const requestApi = id ? PublicApi.postTemplateWebSeoWebUpdate : PublicApi.postTemplateWebSeoWebAdd
requestApi(params).then(res => {
if (res.code === 1000) {
setIsFormChange(false)
setTimeout(() => {
history.goBack()
}, 500)
} else {
setSaveLoading(false)
}
}).finally(() => {
}).catch(() => {
setSaveLoading(false)
})
})
......@@ -62,7 +73,7 @@ const SeoAdd = () => {
useEffect(() => {
if (id) {
PublicApi.getManageActivityShopSeoGet({ id }).then(res => {
PublicApi.getTemplateWebSeoWebGet({ id }).then(res => {
if (res.code === 1000) {
form.setFieldsValue(res.data)
}
......@@ -90,8 +101,8 @@ const SeoAdd = () => {
<Col span={12}>
<Form.Item
name='type'
label={<RequireItem label="页面名称" isRequire={true} />}
rules={[{ required: true, message: "请选择页面名称" }]}
label={<RequireItem label="页面类型" isRequire={true} />}
rules={[{ required: true, message: "请选择页面类型" }]}
>
<Select options={PAGE_TYPE_OPTIONS} disabled={isView} />
</Form.Item>
......@@ -152,4 +163,4 @@ const SeoAdd = () => {
)
}
export default SeoAdd
\ No newline at end of file
export default SeoAdd
......@@ -13,6 +13,7 @@ import NiceForm from '@/components/NiceForm';
import { PlusOutlined } from '@ant-design/icons'
import { PublicApi } from '@/services/api'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { DOORTYPE } from '@/constants/procurement'
const formActions = createFormActions();
......@@ -118,18 +119,17 @@ const SeoList: React.FC<{}> = () => {
// 停用/启用
const handleModify = async (record: any) => {
await PublicApi.postManageActivityShopSeoUpdateStatus({
await PublicApi.postTemplateWebSeoWebUpdateStatus({
id: record.id,
enableStatus: record.status === 1 ? 0 : 1
status: record.status === 1 ? 0 : 1
})
ref.current.reload()
}
// 删除
const handleDelete = async (id) => {
const res = await PublicApi.getManageActivityShopSeoDelete({ id })
const res = await PublicApi.postTemplateWebSeoWebDelete({ id })
if (res.code === 1000) {
message.success('删除成功')
ref.current.reload()
}
}
......@@ -137,7 +137,7 @@ const SeoList: React.FC<{}> = () => {
// 获取列表
const fetchData = (params: any) => {
return new Promise((resolve) => {
PublicApi.getManageActivityShopSeoPage({ ...params }).then(res => {
PublicApi.getTemplateWebSeoWebPage({ doorType: DOORTYPE.OWN_DOORTYPE, ...params }).then(res => {
resolve(res.data)
})
})
......
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