diff --git a/config/config.ts b/config/config.ts index d52205c..2df9daf 100644 --- a/config/config.ts +++ b/config/config.ts @@ -88,7 +88,7 @@ export default defineConfig({ }, define: { // 'process.env.BASE_URL': 'http://xft-cms.51jingcheng.com/api', // 接口服务器地址 - 'process.env.BASE_URL': 'http://cms.gjxfc.com/api', // 接口服务器地址 + 'process.env.BASE_URL': process.env.NODE_ENV === 'development' ? '' : 'http://cms.gjxfc.com/api', // 接口服务器地址 }, /** * @name 国际化插件 diff --git a/config/proxy.ts b/config/proxy.ts index 2e559cb..1afaeda 100644 --- a/config/proxy.ts +++ b/config/proxy.ts @@ -15,7 +15,7 @@ export default { // localhost:8000/api/** -> https://preview.pro.ant.design/api/** '/b2b2c': { // 要代理的地址 - target: 'http://cms.gjxfc.com/api/', + target: 'http://10.10.137.202:8084', // 配置了这个可以从 http 代理到 https // 依赖 origin 的功能可能需要这个,比如 cookie changeOrigin: true, @@ -23,7 +23,7 @@ export default { }, '/oss': { // 要代理的地址 - target: 'http://cms.gjxfc.com/api/', + target: 'http://10.10.137.202:8084', // 配置了这个可以从 http 代理到 https // 依赖 origin 的功能可能需要这个,比如 cookie changeOrigin: true, diff --git a/config/routes.ts b/config/routes.ts index a6685b6..93c41cd 100644 --- a/config/routes.ts +++ b/config/routes.ts @@ -186,6 +186,25 @@ export default [ access: 'dictionaryQuery', component: './Dictionary', }, + { + name: '广告设置', + path: '/ad', + icon: 'ad', + routes: [ + { + name: '开屏广告', + path: 'screen', + // access: 'productCategoryQuery', + component: './ScreenAdvertisement', + }, + { + name: '首页banner', + path: 'banner', + // access: 'productQuery', + component: './ScreenAdvertisement/banner', + } + ] + }, { path: '/' }, { path: '*', layout: false, component: './404' }, ]; diff --git a/src/pages/ProductList/components/UpdateForm.tsx b/src/pages/ProductList/components/UpdateForm.tsx index e6b2199..d185df8 100644 --- a/src/pages/ProductList/components/UpdateForm.tsx +++ b/src/pages/ProductList/components/UpdateForm.tsx @@ -1,8 +1,6 @@ import React, { useEffect, useRef, useState } from 'react'; -import { DrawerForm, ProForm, ProFormCheckbox, ProFormInstance, ProFormText, ProFormUploadButton } from '@ant-design/pro-components'; -import { PlusCircleOutlined } from '@ant-design/icons'; -import { message } from 'antd'; -import Upload, { RcFile, UploadFile, UploadProps } from 'antd/es/upload'; +import { DrawerForm, ProForm, ProFormCheckbox, ProFormInstance, ProFormText } from '@ant-design/pro-components'; +import Upload, { UploadFile, UploadProps } from 'antd/es/upload'; import { specificationListUsingGet } from '@/services/pop-b2b2c/pbcSpecificationController'; import { getRecordByL3CategoryIdUsingGet } from '@/services/pop-b2b2c/pbcCommonDataController'; import ImgCrop from 'antd-img-crop'; @@ -20,13 +18,6 @@ export type UpdateFormProps = { values: Partial; }; -const normFile = (e: any) => { - if (Array.isArray(e)) { - return e; - } - return e?.fileList; -}; - const UpdateForm: React.FC = (props) => { const formRef = useRef(); const [specList, setSpecList] = useState([]) diff --git a/src/pages/ScreenAdvertisement/banner.tsx b/src/pages/ScreenAdvertisement/banner.tsx new file mode 100644 index 0000000..3ede345 --- /dev/null +++ b/src/pages/ScreenAdvertisement/banner.tsx @@ -0,0 +1,242 @@ +/* eslint-disable no-param-reassign */ +import { PlusOutlined } from '@ant-design/icons'; +import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components'; +import { PageContainer } from '@ant-design/pro-layout'; +import { Button, message, Popconfirm, Switch } from 'antd'; +import React, { useRef, useState } from 'react'; +import { Access, useAccess } from 'umi'; +import UpdateForm from './components/UpdateForm'; +import { addOrUpdateScreenAdvertisementUsingPost, changeAdStateUsingGet, getScreenAdPageUsingPost, removeAdUsingPost } from '@/services/pop-b2b2c/pbcScreenAdvertisementController'; + +/** + * 查询表格 + * @param param0 + */ +const fetchData = async (params: API.PbcScreenAdvertisement) => { + const msg = await getScreenAdPageUsingPost(params); + return { + data: msg.data?.records, + total: msg.data?.total, + success: msg.retcode, + } as any; +}; + +/** + * 更新节点 + * @param fields + */ +const handleUpdate = async (fields: API.PbcScreenAdvertisement) => { + const hide = message.loading('正在保存'); + + try { + const msg = await addOrUpdateScreenAdvertisementUsingPost(fields); + hide(); + if (msg.retcode) { + message.success(!fields.pbcId ? '添加成功' : '保存成功'); + return true; + } + message.error(msg.retmsg); + return false; + } catch (error) { + hide(); + message.error(!fields.pbcId ? '添加失败' : '保存失败'); + return false; + } +}; +const handleUpdateState = async (id: number, state: number) => { + const hide = message.loading('正在保存'); + if (!id) return false; + try { + const msg = await changeAdStateUsingGet({ pbcId: id, pbcBusinessState: state }); + hide(); + if (msg.retcode) { + message.success(!id ? '新增成功!' : '保存成功!'); + return true; + } + message.error(msg.retmsg); + return false; + } catch (error) { + hide(); + message.error(!id ? '新增失败,请重试!' : '保存失败,请重试!'); + return false; + } +}; +/** + * 删除节点 + * @param id + */ +const handleRemove = async (id?: number) => { + const hide = message.loading('正在删除'); + if (!id) return false; + + try { + const msg = await removeAdUsingPost({ + pbcId: id, + }); + hide(); + if (msg.retcode) { + message.success('删除成功,即将刷新'); + } else { + message.error(msg.retmsg ?? '删除失败,请重试'); + } + return true; + } catch (error) { + hide(); + message.error('删除失败,请重试'); + return false; + } +}; + +// eslint-disable-next-line @typescript-eslint/ban-types +const TableList: React.FC<{}> = () => { + const access: any = useAccess(); + const actionRef = useRef(); + const [stepFormValues, setStepFormValues] = useState({}); + const [updateModalVisible, handleUpdateModalVisible] = useState(false); + + const columns: ProColumns[] = [ + { + title: '标题', + dataIndex: 'pbcTitle', + }, + { + title: '预览', + dataIndex: 'pbcAdvertisement', + }, + { + title: '创建时间', + dataIndex: 'pbcCreateAt', + valueType: 'dateTime', + search: false, + }, + { + title: '操作', + fixed: 'right', + valueType: 'option', + render: (text, record) => ( + + + { + const success = await handleUpdateState(record.pbcId || 0, value ? 1 : 0); + + if (success) { + if (actionRef.current) { + actionRef.current.reload(); + } + } + }} + /> + + + + + + { + const success = await handleRemove(record.pbcId); + if (success) { + actionRef.current?.reload(); + } + }} + > + + + + + ), + }, + ]; + return ( + + + columns={columns} + actionRef={actionRef} + request={fetchData} + rowKey="pbcId" + size="small" + bordered + search={{ + labelWidth: 'auto', + span: 6, + optionRender: ({ searchText }, { form }) => { + return [ + , + + + , + ]; + }, + }} + pagination={{ + defaultPageSize: 20, + showSizeChanger: true, + }} + scroll={{ + y: 'calc(100vh - 320px)', + }} + dateFormatter="string" + options={false} + toolBarRender={() => []} + /> + {stepFormValues && Object.keys(stepFormValues).length ? ( + { + const success = await handleUpdate(value); + + if (success) { + handleUpdateModalVisible(false); + setStepFormValues({}); + actionRef.current?.reload(); + } + }} + onCancel={() => { + message.destroy(); + handleUpdateModalVisible(false); + }} + afterClose={() => { + setStepFormValues({}); + }} + updateModalVisible={updateModalVisible} + values={stepFormValues} + /> + ) : null} + + ); +}; + +export default TableList; diff --git a/src/pages/ScreenAdvertisement/components/UpdateForm.tsx b/src/pages/ScreenAdvertisement/components/UpdateForm.tsx new file mode 100644 index 0000000..44cec7f --- /dev/null +++ b/src/pages/ScreenAdvertisement/components/UpdateForm.tsx @@ -0,0 +1,133 @@ +import React, { useRef } from 'react'; +import { DrawerForm, ProFormInstance, ProFormText, ProFormUploadButton } from '@ant-design/pro-components'; +import { message } from 'antd'; +import Upload, { RcFile } from 'antd/es/upload'; +export type FormValueType = { + target?: string; + template?: string; + type?: string; + time?: string; + frequency?: string; +} & Partial; +export type UpdateFormProps = { + onCancel: (flag?: boolean, formVals?: FormValueType) => void; + onSubmit: (values: FormValueType) => Promise; + afterClose: () => void; + updateModalVisible: boolean; + values: Partial; +}; + +const UpdateForm: React.FC = (props) => { + const formRef = useRef(); + return ( + { + let pbcAdvertisement = "" + if (value.pbcAdvertisement && value.pbcAdvertisement.length > 0) { + if (value.pbcAdvertisement[0].uid === '-1') { + pbcAdvertisement = value.pbcAdvertisement[0].url || ''; + } + if ( + value.pbcAdvertisement[0].response && + value.pbcAdvertisement[0].response.retcode + ) { + pbcAdvertisement = value.pbcAdvertisement[0].response.data; + } + } + return props.onSubmit({ ...value, pbcAdvertisement, pbcId: props.values.pbcId }) + }} + drawerProps={{ + destroyOnClose: true, + afterOpenChange: (visible) => { + if (!visible) props.afterClose(); + } + }} + + initialValues={{ + pbcTitle: props.values.pbcTitle, + pbcAdvertisement: props.values.pbcAdvertisement ? [{ + uid: '-1', + name: props.values.pbcAdvertisement.substring(props.values.pbcAdvertisement.lastIndexOf('/')), + status: 'done', + url: props.values.pbcAdvertisement, + }] : [] + }} + onOpenChange={(visible) => { + formRef.current?.resetFields(); + if (!visible) { + props.onCancel(); + } + }} + > + + { + switch (info.file.status) { + case 'done': + if (info.file.response.retcode === 0) { + message.error(info.file.response.retmsg); + formRef.current?.setFieldValue('pbcAdvertisement', []) + } + break; + default: + break; + } + }, + action: process.env.BASE_URL + '/oss/imgUpload', + beforeUpload(file: RcFile) { + console.log(file) + const isLt10M = file.size / 1024 / 1024 < 10; + const isLt30M = file.size / 1024 / 1024 < 30; + const isVideo = file.type === 'video/mp4' + if (!isVideo && !isLt10M) { + message.error('图片大小不能超过10MB!'); + } else if (isVideo && !isLt30M) { + message.error('视频大小不能超过30MB!'); + } + return (!isVideo && isLt10M) || (isVideo && isLt30M) || Upload.LIST_IGNORE; + }, + onPreview: async (file) => { + if (file.uid === '-1') { + window.open(file.url); + } + if (file.response && file.response.retcode) { + window.open(file.response.data); + } + }, + listType: 'picture-card', + }} + rules={[ + { required: true, message: '请上传开屏广告图片/视频' }, + ]} + /> + + ); +}; + +export default UpdateForm; diff --git a/src/pages/ScreenAdvertisement/index.less b/src/pages/ScreenAdvertisement/index.less new file mode 100644 index 0000000..760f1d4 --- /dev/null +++ b/src/pages/ScreenAdvertisement/index.less @@ -0,0 +1,16 @@ +.permissionForm { + // background-color: sienna; + // :global(.ant-form-item) { + // margin-bottom: 1px; + // } + :global { + .ant-form-item { + margin-bottom: 0; + .ant-form-item-control-wrapper { + .ant-form-item-control { + line-height: 0px; + } + } + } + } +} diff --git a/src/pages/ScreenAdvertisement/index.tsx b/src/pages/ScreenAdvertisement/index.tsx new file mode 100644 index 0000000..621c3b1 --- /dev/null +++ b/src/pages/ScreenAdvertisement/index.tsx @@ -0,0 +1,243 @@ +/* eslint-disable no-param-reassign */ +import { PlusOutlined } from '@ant-design/icons'; +import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components'; +import { PageContainer } from '@ant-design/pro-layout'; +import { Button, message, Popconfirm, Switch } from 'antd'; +import React, { useRef, useState } from 'react'; +import { Access, useAccess } from 'umi'; +import UpdateForm from './components/UpdateForm'; +import { addOrUpdateScreenAdvertisementUsingPost, changeAdStateUsingGet, getScreenAdPageUsingPost, removeAdUsingPost } from '@/services/pop-b2b2c/pbcScreenAdvertisementController'; + +/** + * 查询表格 + * @param param0 + */ +const fetchData = async (params: API.PbcScreenAdvertisement) => { + const msg = await getScreenAdPageUsingPost(params); + return { + data: msg.data?.records, + total: msg.data?.total, + success: msg.retcode, + } as any; +}; + +/** + * 更新节点 + * @param fields + */ +const handleUpdate = async (fields: API.PbcScreenAdvertisement) => { + const hide = message.loading('正在保存'); + + try { + const msg = await addOrUpdateScreenAdvertisementUsingPost(fields); + hide(); + if (msg.retcode) { + message.success(!fields.pbcId ? '添加成功' : '保存成功'); + return true; + } + message.error(msg.retmsg); + return false; + } catch (error) { + hide(); + message.error(!fields.pbcId ? '添加失败' : '保存失败'); + return false; + } +}; +const handleUpdateState = async (id: number, state: number) => { + const hide = message.loading('正在保存'); + if (!id) return false; + try { + const msg = await changeAdStateUsingGet({ pbcId: id, pbcBusinessState: state }); + hide(); + if (msg.retcode) { + message.success(!id ? '新增成功!' : '保存成功!'); + return true; + } + message.error(msg.retmsg); + return false; + } catch (error) { + hide(); + message.error(!id ? '新增失败,请重试!' : '保存失败,请重试!'); + return false; + } +}; +/** + * 删除节点 + * @param id + */ +const handleRemove = async (id?: number) => { + const hide = message.loading('正在删除'); + if (!id) return false; + + try { + const msg = await removeAdUsingPost({ + pbcId: id, + }); + hide(); + if (msg.retcode) { + message.success('删除成功,即将刷新'); + } else { + message.error(msg.retmsg ?? '删除失败,请重试'); + } + return true; + } catch (error) { + hide(); + message.error('删除失败,请重试'); + return false; + } +}; + +// eslint-disable-next-line @typescript-eslint/ban-types +const TableList: React.FC<{}> = () => { + const access: any = useAccess(); + const actionRef = useRef(); + const [stepFormValues, setStepFormValues] = useState({}); + const [updateModalVisible, handleUpdateModalVisible] = useState(false); + + const columns: ProColumns[] = [ + { + title: '标题', + dataIndex: 'pbcTitle', + }, + { + title: '预览', + dataIndex: 'pbcAdvertisement', + search: false + }, + { + title: '创建时间', + dataIndex: 'pbcCreateAt', + valueType: 'dateTime', + search: false, + }, + { + title: '操作', + fixed: 'right', + valueType: 'option', + render: (text, record) => ( + + + { + const success = await handleUpdateState(record.pbcId || 0, value ? 1 : 0); + + if (success) { + if (actionRef.current) { + actionRef.current.reload(); + } + } + }} + /> + + + + + + { + const success = await handleRemove(record.pbcId); + if (success) { + actionRef.current?.reload(); + } + }} + > + + + + + ), + }, + ]; + return ( + + + columns={columns} + actionRef={actionRef} + request={fetchData} + rowKey="pbcId" + size="small" + bordered + search={{ + labelWidth: 'auto', + span: 6, + optionRender: ({ searchText }, { form }) => { + return [ + , + + + , + ]; + }, + }} + pagination={{ + defaultPageSize: 20, + showSizeChanger: true, + }} + scroll={{ + y: 'calc(100vh - 320px)', + }} + dateFormatter="string" + options={false} + toolBarRender={() => []} + /> + {stepFormValues && Object.keys(stepFormValues).length ? ( + { + const success = await handleUpdate(value); + + if (success) { + handleUpdateModalVisible(false); + setStepFormValues({}); + actionRef.current?.reload(); + } + }} + onCancel={() => { + message.destroy(); + handleUpdateModalVisible(false); + }} + afterClose={() => { + setStepFormValues({}); + }} + updateModalVisible={updateModalVisible} + values={stepFormValues} + /> + ) : null} + + ); +}; + +export default TableList; diff --git a/src/services/pop-b2b2c/errorController.ts b/src/services/pop-b2b2c/errorController.ts index f29cc7f..5f0967b 100644 --- a/src/services/pop-b2b2c/errorController.ts +++ b/src/services/pop-b2b2c/errorController.ts @@ -2,41 +2,41 @@ /* eslint-disable */ import request from '@/utils/request'; -/** error GET /error */ -export async function errorUsingGet(options?: { [key: string]: any }) { - return request>('/error', { +/** errorHtml GET /error */ +export async function errorHtmlUsingGet(options?: { [key: string]: any }) { + return request('/error', { method: 'GET', ...(options || {}), }); } -/** error PUT /error */ -export async function errorUsingPut(options?: { [key: string]: any }) { - return request>('/error', { +/** errorHtml PUT /error */ +export async function errorHtmlUsingPut(options?: { [key: string]: any }) { + return request('/error', { method: 'PUT', ...(options || {}), }); } -/** error POST /error */ -export async function errorUsingPost(options?: { [key: string]: any }) { - return request>('/error', { +/** errorHtml POST /error */ +export async function errorHtmlUsingPost(options?: { [key: string]: any }) { + return request('/error', { method: 'POST', ...(options || {}), }); } -/** error DELETE /error */ -export async function errorUsingDelete(options?: { [key: string]: any }) { - return request>('/error', { +/** errorHtml DELETE /error */ +export async function errorHtmlUsingDelete(options?: { [key: string]: any }) { + return request('/error', { method: 'DELETE', ...(options || {}), }); } -/** error PATCH /error */ -export async function errorUsingPatch(options?: { [key: string]: any }) { - return request>('/error', { +/** errorHtml PATCH /error */ +export async function errorHtmlUsingPatch(options?: { [key: string]: any }) { + return request('/error', { method: 'PATCH', ...(options || {}), }); diff --git a/src/services/pop-b2b2c/index.ts b/src/services/pop-b2b2c/index.ts index 7eb676e..e7ef805 100644 --- a/src/services/pop-b2b2c/index.ts +++ b/src/services/pop-b2b2c/index.ts @@ -19,6 +19,7 @@ import * as pbcProductController from './pbcProductController'; import * as pbcProductHotController from './pbcProductHotController'; import * as pbcQrController from './pbcQrController'; import * as pbcRoleController from './pbcRoleController'; +import * as pbcScreenAdvertisementController from './pbcScreenAdvertisementController'; import * as pbcSearchKeyController from './pbcSearchKeyController'; import * as pbcSmsController from './pbcSmsController'; import * as pbcSmsLogController from './pbcSmsLogController'; @@ -36,6 +37,7 @@ export default { pbcLoginController, pbcBusinessPostConfigController, pbcRoleController, + pbcScreenAdvertisementController, pbcSearchKeyController, pbcSpecificationController, pbcVipGradeController, diff --git a/src/services/pop-b2b2c/pbcCommonDataController.ts b/src/services/pop-b2b2c/pbcCommonDataController.ts index e70ac64..82ae3e5 100644 --- a/src/services/pop-b2b2c/pbcCommonDataController.ts +++ b/src/services/pop-b2b2c/pbcCommonDataController.ts @@ -2,6 +2,14 @@ /* eslint-disable */ import request from '@/utils/request'; +/** dealL3CategoryColorCommonData POST /b2b2c/pbccommondata/dealL3CategoryColorCommonData */ +export async function dealL3CategoryColorCommonDataUsingPost(options?: { [key: string]: any }) { + return request('/b2b2c/pbccommondata/dealL3CategoryColorCommonData', { + method: 'POST', + ...(options || {}), + }); +} + /** 利用三级类目id查询对应的颜色、规格参数 获取规格 GET /b2b2c/pbccommondata/getrecordbyl3categoryid */ export async function getRecordByL3CategoryIdUsingGet( // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) diff --git a/src/services/pop-b2b2c/pbcScreenAdvertisementController.ts b/src/services/pop-b2b2c/pbcScreenAdvertisementController.ts new file mode 100644 index 0000000..bd23857 --- /dev/null +++ b/src/services/pop-b2b2c/pbcScreenAdvertisementController.ts @@ -0,0 +1,92 @@ +// @ts-ignore +/* eslint-disable */ +import request from '@/utils/request'; + +/** 根据id获取开屏广告信息 后台 GET /b2b2c/pbcScreenAdvertisement/adDetail */ +export async function adDetailUsingGet( + // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) + params: API.adDetailUsingGETParams, + options?: { [key: string]: any }, +) { + return request('/b2b2c/pbcScreenAdvertisement/adDetail', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 后台新增或者修改开屏广告 卖家新增或者修改商品 POST /b2b2c/pbcScreenAdvertisement/addOrUpdateScreenAd */ +export async function addOrUpdateScreenAdvertisementUsingPost( + body: API.PbcScreenAdvertisement, + options?: { [key: string]: any }, +) { + return request('/b2b2c/pbcScreenAdvertisement/addOrUpdateScreenAd', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** 更改开屏广告状态,pbcBusinessState 1是起效广告,0是不起效广告,每次最多只有1起效开屏广告 GET /b2b2c/pbcScreenAdvertisement/changeAdState */ +export async function changeAdStateUsingGet( + // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) + params: API.changeAdStateUsingGETParams, + options?: { [key: string]: any }, +) { + return request('/b2b2c/pbcScreenAdvertisement/changeAdState', { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 前端获取生效的开屏广告信息,可能没有 GET /b2b2c/pbcScreenAdvertisement/getFrontAd */ +export async function getFrontAdUsingGet(options?: { [key: string]: any }) { + return request( + '/b2b2c/pbcScreenAdvertisement/getFrontAd', + { + method: 'GET', + ...(options || {}), + }, + ); +} + +/** 获取开屏广告分页 分页 POST /b2b2c/pbcScreenAdvertisement/getScreenAdPage */ +export async function getScreenAdPageUsingPost( + body: API.PbcScreenAdvertisement, + options?: { [key: string]: any }, +) { + return request( + '/b2b2c/pbcScreenAdvertisement/getScreenAdPage', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }, + ); +} + +/** 根据id删除单个开屏广告 POST /b2b2c/pbcScreenAdvertisement/removeAd */ +export async function removeAdUsingPost( + // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) + params: API.removeAdUsingPOSTParams, + options?: { [key: string]: any }, +) { + return request('/b2b2c/pbcScreenAdvertisement/removeAd', { + method: 'POST', + params: { + ...params, + }, + ...(options || {}), + }); +} diff --git a/src/services/pop-b2b2c/pbcUserRecordLogController.ts b/src/services/pop-b2b2c/pbcUserRecordLogController.ts index 7461469..145f644 100644 --- a/src/services/pop-b2b2c/pbcUserRecordLogController.ts +++ b/src/services/pop-b2b2c/pbcUserRecordLogController.ts @@ -232,6 +232,14 @@ export async function overViewUsingPost(options?: { [key: string]: any }) { }); } +/** ownAnalysis POST /b2b2c/statical/ownAnalysis */ +export async function ownAnalysisUsingPost(options?: { [key: string]: any }) { + return request('/b2b2c/statical/ownAnalysis', { + method: 'POST', + ...(options || {}), + }); +} + /** 扫码人明细 POST /b2b2c/statical/peopleScanDetail */ export async function peopleScanDetailUsingPost( body: API.PbcOperationalDashboardDTO, diff --git a/src/services/pop-b2b2c/pbcUsersController.ts b/src/services/pop-b2b2c/pbcUsersController.ts index a768806..ab898a6 100644 --- a/src/services/pop-b2b2c/pbcUsersController.ts +++ b/src/services/pop-b2b2c/pbcUsersController.ts @@ -109,6 +109,42 @@ export async function getUserRecordByIdUsingGet( }); } +/** 导入店铺会员 import POST /b2b2c/pbcusers/importMember */ +export async function importMemberUsingPost( + body: {}, + file?: File, + options?: { [key: string]: any }, +) { + const formData = new FormData(); + + if (file) { + formData.append('file', file); + } + + Object.keys(body).forEach((ele) => { + const item = (body as any)[ele]; + + if (item !== undefined && item !== null) { + if (typeof item === 'object' && !(item instanceof File)) { + if (item instanceof Array) { + item.forEach((f) => formData.append(ele, f || '')); + } else { + formData.append(ele, JSON.stringify(item)); + } + } else { + formData.append(ele, item); + } + } + }); + + return request('/b2b2c/pbcusers/importMember', { + method: 'POST', + data: formData, + requestType: 'form', + ...(options || {}), + }); +} + /** pbcUsersPage 分页,按照搜索条件查询出用户记录 POST /b2b2c/pbcusers/pbcUsersPage */ export async function pbcUsersPageUsingPost(body: API.PageVO, options?: { [key: string]: any }) { return request('/b2b2c/pbcusers/pbcUsersPage', { diff --git a/src/services/pop-b2b2c/typings.d.ts b/src/services/pop-b2b2c/typings.d.ts index 2cfc4b2..c689381 100644 --- a/src/services/pop-b2b2c/typings.d.ts +++ b/src/services/pop-b2b2c/typings.d.ts @@ -1,4 +1,9 @@ declare namespace API { + type adDetailUsingGETParams = { + /** pbcId */ + pbcId: number; + }; + type agreeMemberApplicationUsingGETParams = { /** businessUserId */ businessUserId: number; @@ -102,6 +107,12 @@ declare namespace API { retmsg?: string; }; + type AjaxResultIPagePbcScreenAdvertisement_ = { + data?: IPagePbcScreenAdvertisement_; + retcode?: number; + retmsg?: string; + }; + type AjaxResultIPagePbcUserBusiness_ = { data?: IPagePbcUserBusiness_; retcode?: number; @@ -300,6 +311,12 @@ declare namespace API { retmsg?: string; }; + type AjaxResultPbcScreenAdvertisement_ = { + data?: PbcScreenAdvertisement; + retcode?: number; + retmsg?: string; + }; + type AjaxResultPbcUserBusinessReturnVO_ = { data?: PbcUserBusinessReturnVO; retcode?: number; @@ -356,6 +373,13 @@ declare namespace API { id: number; }; + type changeAdStateUsingGETParams = { + /** pbcBusinessState */ + pbcBusinessState: number; + /** pbcId */ + pbcId: number; + }; + type changeProductStateForAdminUsingGETParams = { /** pcbId */ pcbId: number; @@ -635,6 +659,14 @@ declare namespace API { total?: number; }; + type IPagePbcScreenAdvertisement_ = { + current?: number; + pages?: number; + records?: PbcScreenAdvertisement[]; + size?: number; + total?: number; + }; + type IPagePbcUserBusiness_ = { current?: number; pages?: number; @@ -1569,7 +1601,7 @@ declare namespace API { type PbcGenerateBusinessPosterDTO = { /** 图片地址,不传默认使用商户第一张图片 */ - imageUrl?: string; + image?: string; /** 海报配置id,不传默认用第一个 */ pbcBusinessPostConfigId?: number; }; @@ -1943,6 +1975,8 @@ declare namespace API { pbcProductCategoryId?: number; /** 商品细分类,也就是三级类目名称 */ pbcProductCategoryName?: string; + /** 商品编号 */ + pbcProductCode?: string; /** 产地城市 */ pbcProductOriginalCity?: string; /** 产地城市编码 */ @@ -2144,6 +2178,35 @@ declare namespace API { pbcScanUserNumber?: number; }; + type PbcScreenAdvertisement = { + /** 当前页 */ + current?: number; + /** 条数 */ + pageSize?: number; + /** 开屏广告链接 */ + pbcAdvertisement?: string; + /** 广告是否可用 */ + pbcBusinessState?: number; + /** 创建时间 */ + pbcCreateAt?: string; + /** 创建人 */ + pbcCreateBy?: number; + /** 创建人 */ + pbcCreateByUserName?: string; + /** 主键 */ + pbcId?: number; + /** 状态,0是删除,1是正常,2是作废 */ + pbcState?: number; + /** 广告标题 */ + pbcTitle?: string; + /** 更新时间 */ + pbcUpdateAt?: string; + /** 更新人 */ + pbcUpdateBy?: number; + /** 更新人 */ + pbcUpdateByUserName?: string; + }; + type PbcSearchKeyDTO = { /** 商户id */ businessId?: number; @@ -2685,6 +2748,11 @@ declare namespace API { roleId: number; }; + type removeAdUsingPOSTParams = { + /** pbcId */ + pbcId: number; + }; + type removeCategoryByIdUsingGETParams = { /** id */ id: number;