dev-v2
Joe 10 months ago
parent 3872f1fbdf
commit f2ec57601c

@ -165,6 +165,38 @@ export default [
},
]
},
{
name: '课程管理',
path: '/training-classes',
icon: 'book',
routes: [
{
name: '课程类型管理',
path: 'category',
// access: 'trainingClassesCategoryQuery',
component: './TrainingClasses/category',
},
// {
// name: '商品管理',
// path: 'list',
// access: 'productQuery',
// component: './ProductList',
// },
// {
// name: '新增商品',
// path: 'add',
// hideInMenu: true,
// component: './ProductList/add',
// },
// {
// name: '详情',
// path: 'detail/:id',
// access: 'productQuery',
// hideInMenu: true,
// component: './ProductList/detail',
// },
]
},
{
name: '内容管理',
path: '/content-list',

@ -0,0 +1,450 @@
import Constants from '@/constants';
import { getPbcBusinessListUsingPost } from '@/services/pop-b2b2c/pbcBusinessController';
import { listAdminTreeUsingGet } from '@/services/pop-b2b2c/pbcCategoryController';
import { getRecordByL3CategoryIdUsingGet } from '@/services/pop-b2b2c/pbcCommonDataController';
import { addOrUpdateProductForAdminUsingPost } from '@/services/pop-b2b2c/pbcProductController';
import { getCities } from '@/utils/cities';
import {
ProCard,
ProForm,
ProFormCascader,
ProFormDigit,
ProFormInstance,
ProFormList,
ProFormSelect,
ProFormText,
ProFormTextArea,
ProFormUploadButton,
} from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-layout';
import { DndContext, DragEndEvent, PointerSensor, useSensor } from '@dnd-kit/core';
import { arrayMove, SortableContext, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable';
import { Button, Col, message, Row } from 'antd';
import Upload, { RcFile, UploadFile } from 'antd/es/upload';
import React, { useRef, useState } from 'react';
import { CSS } from '@dnd-kit/utilities';
interface DraggableUploadListItemProps {
originNode: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
file: UploadFile<any>;
}
const DraggableUploadListItem = ({ originNode, file }: DraggableUploadListItemProps) => {
let { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
id: file.uid,
});
const style: React.CSSProperties = {
transform: CSS.Translate.toString(transform),
transition,
cursor: 'move',
};
return (
<div
ref={setNodeRef}
style={style}
// prevent preview event when drag end
className={isDragging ? 'is-dragging' : ''}
{...attributes}
{...listeners}
>
{/* hide error tooltip when dragging */}
{file.status === 'error' && isDragging ? originNode.props.children : originNode}
</div>
);
};
const Detail: React.FC<any> = () => {
const [cities] = useState(() => getCities())
const [colorData, setColorData] = useState<API.PbcCommonData[]>()
const [commonDataList, setCommonDataList] = useState<API.PbcCommonData[]>()
const formRef = useRef<ProFormInstance>();
const onSave = () => {
formRef.current?.submit()
const values = formRef.current?.getFieldsValue()
console.log(values.colorItems)
console.log(values.specItems)
}
const handleCategoryChange = (value: any[], items: API.PbcCategory[]) => {
const [c1, c2, c3] = items
formRef.current?.setFieldsValue({
pbcProductTopCategoryName: c1?.pbcCategoryName,
pbcProductParentCategoryName: c2?.pbcCategoryName,
pbcProductCategoryName: c3?.pbcCategoryName,
})
if (value.length === 3) {
getRecordByL3CategoryIdUsingGet({ l3CategoryId: value[2] }).then(res => {
if (res.retcode && res.data) {
setColorData(res.data.colorData)
setCommonDataList(res.data.commonDataList)
}
})
}
}
const onSubmit = async (values: any) => {
let pbcProductOriginalProvince = undefined, pbcProductOriginalCity = undefined;
if (values?.pbcZone?.length) {
([pbcProductOriginalProvince, pbcProductOriginalCity] = values.pbcZone);
}
const [pbcProductTopCategoryId, pbcProductParentCategoryId, pbcProductCategoryId] = values.pbcProductCategoryIdList
console.log(values.colorItems)
console.log(values.specItems)
const specItems: API.PbcProductCommonData[] = []
if (colorData && values.colorItems && values.colorItems.length > 0) {
for (let i = 0; i < values.colorItems.length; i++) {
const element = values.colorItems[i];
specItems.push({
pbcCommonDataId: colorData.length > 0 ? colorData[0].pbcId : undefined,
pbcSystemName: '颜色',
pbcSystemInputType: 'text',
pbcCommonDataSystem: element.name,
pbcColorImageUrl: element.value.length > 0 ? element.value[0].response.data : ''
})
}
}
if (commonDataList) {
for (let i = 0; i < commonDataList.length; i++) {
const element = commonDataList[i];
console.log(values[`value${i}`])
let name = ''
if (element.pbcSystemInputType === 'select' && element.commonDataValueList) {
name = element.commonDataValueList.find(e => e.pbcId === values[`value${i}`])?.pbcSystemValue || ''
}
specItems.push({
pbcCommonDataId: element.pbcId,
pbcSystemName: element.pbcSystemName,
pbcSystemInputType: element.pbcSystemInputType,
pbcCommonDataValueId: element.pbcSystemInputType === 'select' ? values[`value${i}`] : undefined,
pbcCommonDataSystemValue: element.pbcSystemInputType === 'select' ? name : undefined,
pbcCommonDataSystem: element.pbcSystemInputType === 'select' ? undefined : values[`value${i}`]
})
}
}
const params: API.PbcProductDTO = {
...values,
pbcProductOriginalProvince,
pbcProductOriginalCity,
pbcProductTopCategoryId,
pbcProductParentCategoryId,
pbcProductCategoryId,
productCommonDataList: specItems,
pbcProductImages: values.pbcProductImages.filter((e: any) => e.response && e.response.data).map((e: any) => e.response.data).join(','),
pbcProductDetailImages: values.pbcProductDetailImages.filter((e: any) => e.response && e.response.data).map((e: any) => e.response.data).join(','),
pbcZone: undefined,
colorItems: undefined,
specItems: undefined,
pbcProductCategoryIdList: undefined,
}
const msg = await addOrUpdateProductForAdminUsingPost(params)
if (msg.retcode) {
message.success("创建成功!")
history.back();
return true
} else {
message.error(msg.retmsg)
return false
}
}
const sensor = useSensor(PointerSensor, {
activationConstraint: { distance: 10 },
});
const onDragEnd = ({ active, over }: DragEndEvent, fieldName: string) => {
if (active.id !== over?.id) {
const arr = formRef.current?.getFieldValue(fieldName) || []
const activeIndex = arr.findIndex((i: any) => i.uid === active.id);
const overIndex = arr.findIndex((i: any) => i.uid === over?.id);
const newArr = arrayMove(arr, activeIndex, overIndex)
formRef.current?.setFieldValue(fieldName, newArr)
}
};
return (
<PageContainer
header={{
title: '',
}}
footer={[
<Button
key="back"
onClick={() => {
history.back();
}}
>
</Button>,
<Button type="primary" key="submit" onClick={onSave}>
</Button>
]}
>
<ProForm layout="horizontal" labelAlign="left" requiredMark={false} formRef={formRef} onFinish={onSubmit} submitter={false}>
<ProFormText name="pbcProductTopCategoryName" hidden />
<ProFormText name="pbcProductParentCategoryName" hidden />
<ProFormText name="pbcProductCategoryName" hidden />
<ProCard title="基本信息" style={{ marginBottom: 12 }}>
<Row gutter={20}>
<Col span={8}>
<ProFormSelect
label="所属商户"
name="pbcBusinessId"
rules={[
{ required: true, message: '请选择所属商户' }
]}
request={ async () => {
const msg = await getPbcBusinessListUsingPost();
if (msg.retcode && msg.data) {
return msg.data;
}
return [];
}}
fieldProps={{
showSearch: true,
fieldNames: { label: 'pbcBusinessName', value: 'pbcId' }
}}
/>
</Col>
<Col span={8}>
<ProFormText label="编号" name="pbcProductCode" rules={[
{ required: true, message: '请输入商品编号' },
]} />
</Col>
<Col span={8}>
<ProFormText label="名称" name="pbcProductTitle" rules={[
{ required: true, message: '请输入商品名称' },
]} />
</Col>
</Row>
<Row gutter={20}>
<Col span={8}>
<ProFormCascader label="产地" name="pbcZone" fieldProps={{ options: cities }} />
</Col>
<Col span={8}>
<ProFormText label="价格" name="pbcProductPrice" rules={[
{ required: true, message: '请输入商品价格' },
]} fieldProps={{ prefix: '¥' }} />
</Col>
<Col span={8}>
<ProFormDigit label="库存" name="pbcProductStock" min={0} fieldProps={{ precision: 0 }} rules={[
{ required: true, message: '请输入商品库存' },
]} />
</Col>
</Row>
<Row gutter={20}>
<Col span={8}>
<ProFormText label="货架号" name="pbcProductShelfNumber" rules={[
{ required: true, message: '请输入货架号' }
]} />
</Col>
<Col span={8}>
<ProFormCascader label="类目" name="pbcProductCategoryIdList"
request={ async () => {
const msg = await listAdminTreeUsingGet({ type: 2 });
if (msg.retcode && msg.data) {
return msg.data;
}
return [];
}}
fieldProps={{fieldNames: { label: 'pbcCategoryName', value: 'pbcId', children: 'children' }, onChange: handleCategoryChange}}
rules={[
{ required: true, message: '请选择类目' },
]} />
</Col>
</Row>
{colorData ? <ProForm.Item isListField style={{ marginBlockEnd: 0 }} label="颜色" required>
<ProFormList
name="colorItems"
creatorButtonProps={{
creatorButtonText: '新增',
icon: false,
type: 'link',
style: { width: 'unset' },
}}
copyIconProps={false}
deleteIconProps={{ tooltipText: '删除' }}
itemRender={({ listDom, action }) => (
<div
style={{
display: 'inline-flex',
marginInlineEnd: 25,
}}
>
{listDom}
{action}
</div>
)}
>
<Row align="middle" gutter={20}>
<Col span={12}>
<ProFormText width="sm" name={['name']} placeholder="请输入颜色名" rules={[
{ required: true, message: '请输入颜色名' }
]} />
</Col>
<Col span={12}>
<ProFormUploadButton
name={['value']}
fieldProps={{
name: 'file',
accept: 'image/*',
headers: {
authorization: localStorage.getItem('token') ?? '',
},
action: process.env.BASE_URL + '/oss/imgUpload',
beforeUpload(file: RcFile) {
const isLt2M = file.size / 1024 / 1024 < 10;
if (!isLt2M) {
message.error('图片大小不能超过10MB!');
}
return isLt2M || 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: '请上传颜色图片' },
]}
max={1}
/>
</Col>
</Row>
</ProFormList>
</ProForm.Item> : null}
<Row gutter={20}>
<Col span={24}>
<DndContext sensors={[sensor]} onDragEnd={(event) => onDragEnd(event, "pbcProductImages")}>
<SortableContext items={formRef.current?.getFieldValue("pbcProductImages") ? formRef.current?.getFieldValue("pbcProductImages").map((i: any) => i.uid) : []} strategy={verticalListSortingStrategy}>
<ProFormUploadButton
label="相册图"
name="pbcProductImages"
fieldProps={{
name: 'file',
accept: 'image/*',
multiple: true,
headers: {
authorization: localStorage.getItem('token') ?? '',
},
itemRender: (originNode, file) => <DraggableUploadListItem originNode={originNode} file={file} />,
action: process.env.BASE_URL + '/oss/imgUpload',
beforeUpload(file: RcFile) {
const isLt2M = file.size / 1024 / 1024 < 10;
if (!isLt2M) {
message.error('图片大小不能超过10MB!');
}
return isLt2M || 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: '请上传相册图' },
]}
/>
</SortableContext>
</DndContext>
</Col>
</Row>
<Row gutter={20}>
<Col span={24}>
<DndContext sensors={[sensor]} onDragEnd={(event) => onDragEnd(event, "pbcProductDetailImages")}>
<SortableContext items={formRef.current?.getFieldValue("pbcProductDetailImages") ? formRef.current?.getFieldValue("pbcProductDetailImages").map((i: any) => i.uid) : []} strategy={verticalListSortingStrategy}>
<ProFormUploadButton
label="详情图"
name="pbcProductDetailImages"
fieldProps={{
name: 'file',
accept: 'image/*',
multiple: true,
headers: {
authorization: localStorage.getItem('token') ?? '',
},
itemRender: (originNode, file) => <DraggableUploadListItem originNode={originNode} file={file} />,
action: process.env.BASE_URL + '/oss/imgUpload',
beforeUpload(file: RcFile) {
const isLt2M = file.size / 1024 / 1024 < 10;
if (!isLt2M) {
message.error('图片大小不能超过10MB!');
}
return isLt2M || 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: '请上传详情图' },
]}
/>
</SortableContext>
</DndContext>
</Col>
</Row>
{commonDataList ? commonDataList.map((e, index) => <Row key={e.pbcId} align="middle" gutter={20}>
<Col span={6}>
<ProFormText width="sm" disabled name={`name${index}`} initialValue={e.pbcSystemName} placeholder="请输入规格名称" rules={[
{ required: true, message: '请输入规格名称' }
]} />
</Col>
<Col span={6}>
{e.pbcSystemInputType === 'select' ? <ProFormSelect name={`value${index}`} options={e.commonDataValueList?.map(item => {
return {
label: item.pbcSystemValue || '',
value: item.pbcId
}
})} /> : <ProFormText width="sm" name={`value${index}`} placeholder="请输入规格描述" />
}
</Col>
</Row>) : null}
<Row gutter={20}>
<Col span={24}>
<ProFormTextArea label="详情描述" name="pbcProductDetail" />
</Col>
</Row>
<Row gutter={20}>
<Col span={8}>
<ProFormSelect label="可见范围" name="pbcProductType" valueEnum={Constants.pbcProductType} rules={[
{ required: true, message: '请选择可见范围' },
]} />
</Col>
<Col span={8}>
<ProFormSelect label="状态" name="pbcState" valueEnum={Constants.pbcState} rules={[
{ required: true, message: '请选择上下架状态' },
]} />
</Col>
</Row>
</ProCard>
</ProForm>
</PageContainer>
);
};
export default Detail;

@ -0,0 +1,198 @@
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 } from 'antd';
import React, { useRef, useState } from 'react';
import { Access, useAccess } from 'umi';
import UpdateForm from './components/UpdateForm';
import { addOrUpdateClassesTypeUsingPost, getClassesTypePageUsingPost, removeTrainingClassesTypeUsingGet } from '@/services/pop-b2b2c/pbcTrainingClassesTypeController';
/**
*
* @param param0
*/
const fetchData = async (params: any) => {
const msg = await getClassesTypePageUsingPost({ pbcType: params.pbcType || '' });
return {
data: msg.data?.records || [],
total: msg.data?.total,
success: msg.retcode,
} as any;
};
/**
*
* @param fields
*/
const handleUpdate = async (fields: API.PbcTrainingClassesType_) => {
const hide = message.loading('正在保存');
try {
const msg = await addOrUpdateClassesTypeUsingPost({ ...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;
}
};
/**
*
* @param id
*/
const handleRemove = async (fields: API.PbcTrainingClassesType_) => {
const hide = message.loading('正在删除');
if (!fields.pbcId) return false;
try {
const msg = await removeTrainingClassesTypeUsingGet({ pbcId: fields.pbcId });
hide();
if (msg.retcode) {
message.success('删除成功,即将刷新');
} else {
message.error(msg.retmsg ?? '删除失败,请重试');
}
return true;
} catch (error) {
hide();
message.error('删除失败,请重试');
return false;
}
};
const TableList: React.FC<any> = () => {
const access: any = useAccess();
const actionRef = useRef<ActionType>();
const [stepFormValues, setStepFormValues] = useState<API.PbcTrainingClassesType_>({});
const [updateModalVisible, handleUpdateModalVisible] = useState<boolean>(false);
const columns: ProColumns<API.PbcTrainingClassesType_>[] = [
{
title: '课程类型',
dataIndex: 'PbcTrainingClassesType_Name',
},
{
title: '创建时间',
dataIndex: 'pbcCreateAt',
valueType: 'date',
search: false,
},
{
title: '操作',
valueType: 'option',
width: 180,
render: (text, record) => (
<span>
<Access key="config" accessible={access.productCategorySave}>
<Button
size="small"
type="link"
onClick={() => {
handleUpdateModalVisible(true);
setStepFormValues(record);
}}
>
</Button>
</Access>
<Access key="remove" accessible={access.productCategoryDelete}>
<Popconfirm
title={`确定需要删除该课程类型?`}
onConfirm={async () => {
const success = await handleRemove(record);
if (success) actionRef.current?.reload();
}}
>
<Button size="small" type="link" danger>
</Button>
</Popconfirm>
</Access>
</span>
),
},
];
return (
<PageContainer
header={{
title: '',
breadcrumb: {},
}}
>
<ProTable<API.PbcTrainingClassesType_>
columns={columns}
actionRef={actionRef}
request={fetchData}
rowKey="pbcId"
size="small"
bordered
search={{
labelWidth: 'auto',
span: 6,
optionRender: ({ searchText }, { form }) => {
return [
<Button
key="button"
type="primary"
onClick={() => {
form?.submit();
}}
>
{searchText}
</Button>,
<Access key="primary" accessible={access.productCategorySave}>
<Button
icon={<PlusOutlined />}
type="primary"
onClick={() => {
handleUpdateModalVisible(true);
setStepFormValues({
pbcId: undefined,
});
}}
>
</Button>
</Access>,
];
},
}}
pagination={false}
scroll={{
y: 'calc(100vh - 320px)',
}}
dateFormatter="string"
options={false}
toolBarRender={() => []}
/>
{stepFormValues && Object.keys(stepFormValues).length ? (
<UpdateForm
onSubmit={async (value: any) => {
const success = await handleUpdate(value);
if (success) {
handleUpdateModalVisible(false);
setStepFormValues({});
actionRef.current?.reload();
}
}}
onCancel={() => {
message.destroy();
handleUpdateModalVisible(false);
}}
updateModalVisible={updateModalVisible}
values={stepFormValues}
/>
) : null}
</PageContainer>
);
};
export default TableList;

@ -0,0 +1,59 @@
import React, { useRef } from 'react';
import { DrawerForm, ProFormInstance, ProFormText } from '@ant-design/pro-components';
export type FormValueType = {
target?: string;
template?: string;
type?: string;
time?: string;
frequency?: string;
} & Partial<API.PbcTrainingClassesType_>;
export type UpdateFormProps = {
onCancel: (flag?: boolean, formVals?: FormValueType) => void;
onSubmit: (values: FormValueType) => Promise<void>;
updateModalVisible: boolean;
values: Partial<API.PbcTrainingClassesType_>;
};
const UpdateForm: React.FC<UpdateFormProps> = (props) => {
const formRef = useRef<ProFormInstance>();
return (
<DrawerForm
width={640}
requiredMark={false}
title={props.values.pbcId ? '编辑' : '新增'}
open={props.updateModalVisible}
formRef={formRef}
onFinish={(value) => {
return props.onSubmit({ ...props.values, ...value })
}}
drawerProps={{
destroyOnClose: true,
}}
initialValues={{
pbcType: props.values.pbcType
}}
onOpenChange={(visible) => {
formRef.current?.resetFields();
if (!visible) {
props.onCancel();
}
}}
>
<ProFormText
placeholder={'请输入课程名称'}
label="课程名称"
rules={[
{
required: true,
message: '课程名称为必填项',
},
]}
width="md"
name="pbcType"
/>
</DrawerForm>
);
};
export default UpdateForm;

@ -0,0 +1,184 @@
import {
changeProductStateForAdminUsingGet,
productDetailForAdminUsingGet,
} from '@/services/pop-b2b2c/pbcProductController';
import { CheckCircleOutlined, InfoCircleOutlined } from '@ant-design/icons';
import { ProCard } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-layout';
import { Access, useAccess, useParams } from '@umijs/max';
import { Button, Col, Descriptions, Image, message, Row, Tag } from 'antd';
import React, { useEffect, useState } from 'react';
const Detail: React.FC<any> = () => {
const params = useParams();
const access: any = useAccess();
const [info, setInfo] = useState<API.PbcProductVO>({});
const [images, setImages] = useState<string[]>([]);
const [detailImages, setDetailImages] = useState<string[]>([]);
const getInfo = () => {
if (params.id) {
productDetailForAdminUsingGet({ productId: parseInt(params.id) }).then((res) => {
if (res.retcode && res.data) {
setInfo(res.data);
if (res.data.pbcProductImages) {
const arr = res.data.pbcProductImages.split(',');
setImages(arr);
}
if (res.data.pbcProductDetailImages) {
const arr = res.data.pbcProductDetailImages.split(',');
setDetailImages(arr);
}
}
});
}
};
useEffect(() => {
getInfo();
}, []);
return (
<PageContainer
header={{
title: '',
}}
footer={
info.pbcState !== 3
? [
<Button
key="back"
onClick={() => {
history.back();
}}
>
</Button>,
<Access key="no" accessible={access.productUpdateState}>
<Button
type="primary"
onClick={() => {
changeProductStateForAdminUsingGet({
pcbId: info.pbcId || 0,
state: info.pbcState === 1 ? 2 : 1,
}).then((res) => {
if (res.retcode) {
message.success(info.pbcState === 1 ? '已下架' : '已上架');
getInfo();
} else {
message.error(res.retmsg);
}
});
}}
>
{info.pbcState === 1 ? '下架' : '上架'}
</Button>
</Access>,
]
: [
<Button
key="back"
onClick={() => {
history.back();
}}
>
</Button>,
]
}
>
<ProCard style={{ marginBottom: 12 }}>
<Descriptions
bordered
title={
<>
<span style={{ marginRight: 20 }}></span>
{info.pbcState === 1 ? (
<Tag icon={<CheckCircleOutlined />} color="success">
</Tag>
) : (
<Tag icon={<InfoCircleOutlined />} color="default">
</Tag>
)}
</>
}
column={3}
>
<Descriptions.Item label="名称">{info.pbcProductTitle}</Descriptions.Item>
<Descriptions.Item label="商品类目">
{info.pbcProductTopCategoryName}/{info.pbcProductParentCategoryName}/
{info.pbcProductCategoryName}
</Descriptions.Item>
<Descriptions.Item label="价格">¥{info.pbcProductPrice}</Descriptions.Item>
<Descriptions.Item label="颜色" span={3}>
<div style={{ display: 'flex', flexWrap: 'wrap', width: 1000 }}>
{info.colorDataList?.map((e) => (
<Row
key={e.pbcId}
style={{ width: 200, marginBottom: 10, marginRight: 20, alignItems: 'center' }}
justify="space-evenly"
>
<Col span={8}>{e.pbcCommonDataSystem}</Col>
<Col span={8}>
<Image width={100} src={e.pbcColorImageUrl} />
</Col>
</Row>
))}
</div>
</Descriptions.Item>
<Descriptions.Item label="相册图片" span={3}>
<div style={{ display: 'flex', width: '100%', flexWrap: 'wrap' }}>
<Image.PreviewGroup>
{images.map((e) => (
<div key={e} style={{ marginBottom: 10, marginRight: 20 }}>
<Image width={100} src={e} />
</div>
))}
</Image.PreviewGroup>
</div>
</Descriptions.Item>
<Descriptions.Item label="详情图" span={3}>
<div style={{ display: 'flex', width: '100%', flexWrap: 'wrap' }}>
<Image.PreviewGroup>
{detailImages.map((e) => (
<div key={e} style={{ marginBottom: 10, marginRight: 20 }}>
<Image width={100} src={e} />
</div>
))}
</Image.PreviewGroup>
</div>
</Descriptions.Item>
<Descriptions.Item label="规格" span={3}>
{info.productCommonDataList?.map((e) => (
<Row
key={e.pbcId}
style={{ width: 150, marginBottom: 10, marginRight: 20, alignItems: 'center' }}
justify="space-evenly"
>
<Col style={{ color: 'rgb(170, 170, 170)' }} span={8}>
{e.pbcSystemName}
</Col>
<Col span={8}>
{e.pbcSystemInputType === 'select'
? e.pbcCommonDataSystemValue
: e.pbcCommonDataSystem}
</Col>
</Row>
))}
</Descriptions.Item>
<Descriptions.Item label="详情描述" span={3}>
{info.pbcProductDetail}
</Descriptions.Item>
<Descriptions.Item label="可见范围" span={3}>
{info.pbcProductVipLevels}
</Descriptions.Item>
</Descriptions>
</ProCard>
</PageContainer>
);
};
export default Detail;

@ -0,0 +1,223 @@
import Constants from '@/constants';
import { getPbcBusinessListUsingPost } from '@/services/pop-b2b2c/pbcBusinessController';
import { listAdminTreeUsingGet } from '@/services/pop-b2b2c/pbcCategoryController';
import {
changeProductStateForAdminUsingGet,
getProductPageForAdminUsingPost,
} from '@/services/pop-b2b2c/pbcProductController';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-layout';
import { Access, Link, useAccess, history } from '@umijs/max';
import { Button, message } from 'antd';
import moment from 'moment';
import React, { useRef } from 'react';
/**
*
* @param param0
*/
const fetchData = async (params: any) => {
if (params.pbcProductCategoryId && params.pbcProductCategoryId.length === 3) {
params.pbcProductCategoryId = params.pbcProductCategoryId[2];
}
params.pbcUserType = 2
const msg = await getProductPageForAdminUsingPost(params);
return {
data: msg.data?.records,
total: msg.data?.total,
success: msg.retcode,
} as any;
};
// eslint-disable-next-line @typescript-eslint/ban-types
const TableList: React.FC<{}> = () => {
const actionRef = useRef<ActionType>();
const access: any = useAccess();
const columns: ProColumns<API.PbcProduct>[] = [
{
title: '商品类目',
dataIndex: 'pbcProductCategoryId',
hideInTable: true,
valueType: 'cascader',
fieldProps: {
fieldNames: { label: 'pbcCategoryName', value: 'pbcId', children: 'children' },
},
request: async () => {
const msg = await listAdminTreeUsingGet({ type: 2 });
if (msg.retcode && msg.data) {
return msg.data;
}
return [];
},
},
{
title: '商品大类',
dataIndex: 'pbcProductTopCategoryName',
search: false,
},
{
title: '商品中类',
dataIndex: 'pbcProductParentCategoryName',
search: false,
},
{
title: '商品小类',
dataIndex: 'pbcProductCategoryName',
search: false,
},
{
title: '商品名称',
dataIndex: 'pbcProductTitle',
},
{
title: '款号',
dataIndex: 'pbcProductCode',
},
{
title: '价格',
dataIndex: 'pbcProductPrice',
search: false,
},
{
title: '所属商户',
dataIndex: 'pbcBusinessName',
search: false,
},
{
title: '所属商户',
dataIndex: 'pbcBusinessId',
hideInTable: true,
valueType: 'select',
fieldProps: {
showSearch: true,
fieldNames: { label: 'pbcBusinessName', value: 'pbcId' },
},
request: async () => {
const msg = await getPbcBusinessListUsingPost();
if (msg.retcode && msg.data) {
return msg.data;
}
return [];
},
},
{
title: '创建时间',
dataIndex: 'pbcCreateAt',
hideInTable: true,
fieldProps:{
maxDate: moment()
},
valueType: 'dateRange'
},
{
title: '产品类型',
dataIndex: 'pbcProductType',
valueType: 'select',
valueEnum: Constants.pbcProductTypeList,
search: false
},
{
title: '状态',
dataIndex: 'pbcState',
valueType: 'select',
valueEnum: Constants.pbcProductState,
},
{
title: '操作',
fixed: 'right',
valueType: 'option',
render: (text, record) => (
<span>
<Link to={'/product/detail/' + record.pbcId}></Link>
<Access key="config" accessible={access.productUpdateState}>
{record.pbcState === 1 ? (
<Button
type="link"
onClick={() => {
changeProductStateForAdminUsingGet({ pcbId: record.pbcId || 0, state: 2 }).then(
(res) => {
if (res.retcode) {
message.success('已下架');
actionRef.current?.reload();
} else {
message.error(res.retmsg);
}
},
);
}}
>
</Button>
) : (
<Button
type="link"
onClick={() => {
changeProductStateForAdminUsingGet({ pcbId: record.pbcId || 0, state: 1 }).then(
(res) => {
if (res.retcode) {
message.success('已上架');
actionRef.current?.reload();
} else {
message.error(res.retmsg);
}
},
);
}}
>
</Button>
)}
</Access>
</span>
),
},
];
return (
<PageContainer
header={{
title: '',
breadcrumb: {},
}}
>
<ProTable<API.PbcProduct>
columns={columns}
actionRef={actionRef}
request={(param: any) => {
const queryParam = {
...param,
startDate: param.pbcCreateAt && param.pbcCreateAt.length > 1 ? param.pbcCreateAt[0] : undefined,
endDate: param.pbcCreateAt && param.pbcCreateAt.length > 1 ? param.pbcCreateAt[1] + ' 23:59:59' : undefined
}
return fetchData(queryParam);
}}
rowKey="pbcId"
size="small"
bordered
search={{
labelWidth: 'auto',
span: 6,
}}
pagination={{
defaultPageSize: 20,
showSizeChanger: true,
}}
toolbar={{
actions: [
<Access key="add" accessible={access.productAdd}>
<Button type="primary" onClick={() => history.push('/product/add')}></Button>
</Access>
]
}}
scroll={{
y: 'calc(100vh - 320px)',
}}
dateFormatter="string"
options={false}
toolBarRender={() => []}
/>
</PageContainer>
);
};
export default TableList;

@ -2,41 +2,41 @@
/* eslint-disable */
import request from '@/utils/request';
/** errorHtml GET /error */
export async function errorHtmlUsingGet(options?: { [key: string]: any }) {
return request<API.ModelAndView>('/error', {
/** error GET /error */
export async function errorUsingGet(options?: { [key: string]: any }) {
return request<Record<string, any>>('/error', {
method: 'GET',
...(options || {}),
});
}
/** errorHtml PUT /error */
export async function errorHtmlUsingPut(options?: { [key: string]: any }) {
return request<API.ModelAndView>('/error', {
/** error PUT /error */
export async function errorUsingPut(options?: { [key: string]: any }) {
return request<Record<string, any>>('/error', {
method: 'PUT',
...(options || {}),
});
}
/** errorHtml POST /error */
export async function errorHtmlUsingPost(options?: { [key: string]: any }) {
return request<API.ModelAndView>('/error', {
/** error POST /error */
export async function errorUsingPost(options?: { [key: string]: any }) {
return request<Record<string, any>>('/error', {
method: 'POST',
...(options || {}),
});
}
/** errorHtml DELETE /error */
export async function errorHtmlUsingDelete(options?: { [key: string]: any }) {
return request<API.ModelAndView>('/error', {
/** error DELETE /error */
export async function errorUsingDelete(options?: { [key: string]: any }) {
return request<Record<string, any>>('/error', {
method: 'DELETE',
...(options || {}),
});
}
/** errorHtml PATCH /error */
export async function errorHtmlUsingPatch(options?: { [key: string]: any }) {
return request<API.ModelAndView>('/error', {
/** error PATCH /error */
export async function errorUsingPatch(options?: { [key: string]: any }) {
return request<Record<string, any>>('/error', {
method: 'PATCH',
...(options || {}),
});

@ -15,22 +15,31 @@ import * as pbcContentTypeController from './pbcContentTypeController';
import * as pbcEmailController from './pbcEmailController';
import * as pbcImageController from './pbcImageController';
import * as pbcLoginController from './pbcLoginController';
import * as pbcLogisticsController from './pbcLogisticsController';
import * as pbcOssImgController from './pbcOssImgController';
import * as pbcProductController from './pbcProductController';
import * as pbcProductHotController from './pbcProductHotController';
import * as pbcQrController from './pbcQrController';
import * as pbcRequirementController from './pbcRequirementController';
import * as pbcRequirementReplyController from './pbcRequirementReplyController';
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';
import * as pbcSpecificationController from './pbcSpecificationController';
import * as pbcTrainingClassesChapterController from './pbcTrainingClassesChapterController';
import * as pbcTrainingClassesController from './pbcTrainingClassesController';
import * as pbcTrainingClassesTypeController from './pbcTrainingClassesTypeController';
import * as pbcTrainingClassesVideoController from './pbcTrainingClassesVideoController';
import * as pbcTrainingClassesVideoRecordController from './pbcTrainingClassesVideoRecordController';
import * as pbcUserBusinessController from './pbcUserBusinessController';
import * as pbcUserCollectController from './pbcUserCollectController';
import * as pbcUserMessageController from './pbcUserMessageController';
import * as pbcUserRecordLogController from './pbcUserRecordLogController';
import * as pbcUsersController from './pbcUsersController';
import * as pbcVipGradeController from './pbcVipGradeController';
import * as pbcVodController from './pbcVodController';
import * as wxController from './wxController';
export default {
pbcSmsLogController,
@ -38,10 +47,18 @@ export default {
pbcLoginController,
pbcBannerController,
pbcBusinessPostConfigController,
pbcLogisticsController,
pbcRequirementController,
pbcRequirementReplyController,
pbcRoleController,
pbcScreenAdvertisementController,
pbcSearchKeyController,
pbcSpecificationController,
pbcTrainingClassesController,
pbcTrainingClassesChapterController,
pbcTrainingClassesTypeController,
pbcTrainingClassesVideoController,
pbcTrainingClassesVideoRecordController,
pbcVipGradeController,
pbcBusinessController,
pbcBusinessApprovalController,
@ -63,4 +80,5 @@ export default {
wxController,
errorController,
pbcOssImgController,
pbcVodController,
};

@ -0,0 +1,48 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** 地址解析 地址解析:通过详细地址返回省市区 GET /b2b2c/pbcLogistics/addressAnalysis */
export async function addressAnalysisUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.addressAnalysisUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResult>('/b2b2c/pbcLogistics/addressAnalysis', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 通过快递单号查询物流公司 通过快递单号查询物流公司 GET /b2b2c/pbcLogistics/queryCompany */
export async function queryCompanyUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.queryCompanyUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResult>('/b2b2c/pbcLogistics/queryCompany', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 通过快递单号查询快递轨迹 通过快递单号查询快递轨迹 GET /b2b2c/pbcLogistics/queryTrack */
export async function queryTrackUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.queryTrackUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResult>('/b2b2c/pbcLogistics/queryTrack', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}

@ -0,0 +1,140 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** 买家新增或者修改需求 POST /b2b2c/pbcRequirement/addOrUpdateRequirement */
export async function addOrUpdateRequirementUsingPost(
body: API.PbcRequirement_,
options?: { [key: string]: any },
) {
return request<API.AjaxResult>('/b2b2c/pbcRequirement/addOrUpdateRequirement', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 后台审核需求 后台 GET /b2b2c/pbcRequirement/admin/approvalRequirement/${param0} */
export async function approvalRequirementForAdminUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.approvalRequirementForAdminUsingGETParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<API.AjaxResultString_>(
`/b2b2c/pbcRequirement/admin/approvalRequirement/${param0}`,
{
method: 'GET',
params: {
...queryParams,
},
...(options || {}),
},
);
}
/** 后台获取需求分页 分页 POST /b2b2c/pbcRequirement/admin/getRequirementPage */
export async function getRequirementPageForAdminUsingPost(
body: API.PbcRequirement_,
options?: { [key: string]: any },
) {
return request<API.AjaxResultIPagePbcRequirement_>(
'/b2b2c/pbcRequirement/admin/getRequirementPage',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
},
);
}
/** 后台根据id获取需求详情 前端 GET /b2b2c/pbcRequirement/admin/requirementDetail */
export async function requirementDetailForAdminUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.requirementDetailForAdminUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResultPbcRequirement_>('/b2b2c/pbcRequirement/admin/requirementDetail', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 卖家更改审核需求状态 买家 GET /b2b2c/pbcRequirement/buyer/changeRequirementState/${param0} */
export async function changeRequirementStateForBuyerUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.changeRequirementStateForBuyerUsingGETParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<API.AjaxResultString_>(
`/b2b2c/pbcRequirement/buyer/changeRequirementState/${param0}`,
{
method: 'GET',
params: {
...queryParams,
},
...(options || {}),
},
);
}
/** 买家获取我的需求分页 分页 POST /b2b2c/pbcRequirement/buyer/getRequirementPage */
export async function getRequirementPageForBuyerUsingPost(
body: API.PbcRequirement_,
options?: { [key: string]: any },
) {
return request<API.AjaxResultIPagePbcRequirement_>(
'/b2b2c/pbcRequirement/buyer/getRequirementPage',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
},
);
}
/** 前端根据id获取需求详情 前端 GET /b2b2c/pbcRequirement/front/requirementDetail */
export async function requirementDetailForFrontUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.requirementDetailForFrontUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResultPbcRequirement_>('/b2b2c/pbcRequirement/front/requirementDetail', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 卖家获取需求大厅分页 分页 POST /b2b2c/pbcRequirement/seller/getRequirementPage */
export async function getRequirementPageForSellerUsingPost(
body: API.PbcRequirement_,
options?: { [key: string]: any },
) {
return request<API.AjaxResultIPagePbcRequirement_>(
'/b2b2c/pbcRequirement/seller/getRequirementPage',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
},
);
}

@ -0,0 +1,33 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** 新增回复 POST /b2b2c/pbcRequirementReply/addRequirementReply */
export async function addRequirementReplyUsingPost(
body: API.PbcRequirementReply_,
options?: { [key: string]: any },
) {
return request<API.AjaxResultString_>('/b2b2c/pbcRequirementReply/addRequirementReply', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 根据id删除单个回复 GET /b2b2c/pbcRequirementReply/removeRequirementReply */
export async function removeRequirementReplyUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.removeRequirementReplyUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResultString_>('/b2b2c/pbcRequirementReply/removeRequirementReply', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}

@ -0,0 +1,51 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** 后台新增或者修改章节 POST /b2b2c/pbcTrainingClassesChapter/addOrUpdateChapter */
export async function addOrUpdateChapterUsingPost(
body: API.PbcTrainingClassesChapter_,
options?: { [key: string]: any },
) {
return request<API.AjaxResultString_>('/b2b2c/pbcTrainingClassesChapter/addOrUpdateChapter', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 根据id获取章节信息 后台 GET /b2b2c/pbcTrainingClassesChapter/chapterDetail */
export async function chapterDetailUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.chapterDetailUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResultPbcTrainingClassesChapter_>(
'/b2b2c/pbcTrainingClassesChapter/chapterDetail',
{
method: 'GET',
params: {
...params,
},
...(options || {}),
},
);
}
/** 根据id删除单个章节 GET /b2b2c/pbcTrainingClassesChapter/removeChapter */
export async function removeChapterUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.removeChapterUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResultString_>('/b2b2c/pbcTrainingClassesChapter/removeChapter', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}

@ -0,0 +1,105 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** 后台新增或者修改课程 POST /b2b2c/pbcTrainingClasses/addOrUpdateClass */
export async function addOrUpdateClassUsingPost(
body: API.PbcTrainingClasses_,
options?: { [key: string]: any },
) {
return request<API.AjaxResultPbcTrainingClasses_>('/b2b2c/pbcTrainingClasses/addOrUpdateClass', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 后台根据id获取课程信息 后台 GET /b2b2c/pbcTrainingClasses/admin/classDetail */
export async function classDetailForAdminUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.classDetailForAdminUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResultPbcTrainingClassesPageDTO_>(
'/b2b2c/pbcTrainingClasses/admin/classDetail',
{
method: 'GET',
params: {
...params,
},
...(options || {}),
},
);
}
/** 后台获取课程分页 分页 POST /b2b2c/pbcTrainingClasses/admin/getClassPage */
export async function getClassPageForAdminUsingPost(
body: API.PbcTrainingClasses_,
options?: { [key: string]: any },
) {
return request<API.AjaxResultIPagePbcTrainingClasses_>(
'/b2b2c/pbcTrainingClasses/admin/getClassPage',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
},
);
}
/** 前端根据id获取课程信息 前端 GET /b2b2c/pbcTrainingClasses/front/classDetail */
export async function classDetailForFrontUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.classDetailForFrontUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResultPbcTrainingClassesPageDTO_>(
'/b2b2c/pbcTrainingClasses/front/classDetail',
{
method: 'GET',
params: {
...params,
},
...(options || {}),
},
);
}
/** 前端获取课程分页 分页 POST /b2b2c/pbcTrainingClasses/front/getClassPage */
export async function getClassPageForFrontUsingPost(
body: API.PbcTrainingClasses_,
options?: { [key: string]: any },
) {
return request<API.AjaxResultIPagePbcTrainingClasses_>(
'/b2b2c/pbcTrainingClasses/front/getClassPage',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
},
);
}
/** 根据id删除单个课程 GET /b2b2c/pbcTrainingClasses/removeClass */
export async function removeClassUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.removeClassUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResultString_>('/b2b2c/pbcTrainingClasses/removeClass', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}

@ -0,0 +1,91 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** 后台新增或者修改课程类型 POST /b2b2c/pbcTrainingClassesType/addOrUpdateClassesType */
export async function addOrUpdateClassesTypeUsingPost(
body: API.PbcTrainingClassesType_,
options?: { [key: string]: any },
) {
return request<API.AjaxResultString_>('/b2b2c/pbcTrainingClassesType/addOrUpdateClassesType', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 后台获取课程类型列表 POST /b2b2c/pbcTrainingClassesType/admin/getClassesTypeList */
export async function getClassesTypeListForAdminUsingPost(options?: { [key: string]: any }) {
return request<API.AjaxResultListPbcTrainingClassesType_>(
'/b2b2c/pbcTrainingClassesType/admin/getClassesTypeList',
{
method: 'POST',
...(options || {}),
},
);
}
/** 根据id获取课程类型信息 后台 GET /b2b2c/pbcTrainingClassesType/classesTypeDetail */
export async function classesTypeDetailUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.classesTypeDetailUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResultPbcTrainingClassesType_>(
'/b2b2c/pbcTrainingClassesType/classesTypeDetail',
{
method: 'GET',
params: {
...params,
},
...(options || {}),
},
);
}
/** 前端获取课程类型列表 POST /b2b2c/pbcTrainingClassesType/front/getClassesTypeList */
export async function getClassesTypeListForFrontUsingPost(options?: { [key: string]: any }) {
return request<API.AjaxResultListPbcTrainingClassesType_>(
'/b2b2c/pbcTrainingClassesType/front/getClassesTypeList',
{
method: 'POST',
...(options || {}),
},
);
}
/** 获取课程类型分页 分页 POST /b2b2c/pbcTrainingClassesType/getClassesTypePage */
export async function getClassesTypePageUsingPost(
body: API.PbcTrainingClassesType_,
options?: { [key: string]: any },
) {
return request<API.AjaxResultIPagePbcTrainingClassesType_>(
'/b2b2c/pbcTrainingClassesType/getClassesTypePage',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
},
);
}
/** 根据id删除单个课程类型 GET /b2b2c/pbcTrainingClassesType/removeTrainingClassesType */
export async function removeTrainingClassesTypeUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.removeTrainingClassesTypeUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResultString_>('/b2b2c/pbcTrainingClassesType/removeTrainingClassesType', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}

@ -0,0 +1,105 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** 后台新增或者修改视频 POST /b2b2c/pbcTrainingClassesVideo/addOrUpdateVideo */
export async function addOrUpdateVideoUsingPost(
body: API.PbcTrainingClassesVideo_,
options?: { [key: string]: any },
) {
return request<API.AjaxResult>('/b2b2c/pbcTrainingClassesVideo/addOrUpdateVideo', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 根据id获取视频播放凭证 GET /b2b2c/pbcTrainingClassesVideo/getVideoAuthById */
export async function getVideoAuthByIdUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.getVideoAuthByIdUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResultString_>('/b2b2c/pbcTrainingClassesVideo/getVideoAuthById', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 根据id删除单个视频 GET /b2b2c/pbcTrainingClassesVideo/removeVideo */
export async function removeVideoUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.removeVideoUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResultString_>('/b2b2c/pbcTrainingClassesVideo/removeVideo', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 上传视频到vod并且获取到视频的详情 POST /b2b2c/pbcTrainingClassesVideo/uploadVideoAndGetInfo */
export async function uploadVideoAndGetInfoUsingPost(
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<API.AjaxResultJSONObject_>(
'/b2b2c/pbcTrainingClassesVideo/uploadVideoAndGetInfo',
{
method: 'POST',
data: formData,
requestType: 'form',
...(options || {}),
},
);
}
/** 根据id获取视频信息 后台 GET /b2b2c/pbcTrainingClassesVideo/videoDetail */
export async function videoDetailUsingGet(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.videoDetailUsingGETParams,
options?: { [key: string]: any },
) {
return request<API.AjaxResultPbcTrainingClassesVideo_>(
'/b2b2c/pbcTrainingClassesVideo/videoDetail',
{
method: 'GET',
params: {
...params,
},
...(options || {}),
},
);
}

@ -0,0 +1,21 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** 前端新增或者修改用户视频观看记录 POST /b2b2c/pbcTrainingClassesVideoRecord/addOrUpdateUserVideoRecord */
export async function addOrUpdateUserVideoRecordUsingPost(
body: API.PbcTrainingClassesVideoRecord_,
options?: { [key: string]: any },
) {
return request<API.AjaxResult>(
'/b2b2c/pbcTrainingClassesVideoRecord/addOrUpdateUserVideoRecord',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
},
);
}

@ -0,0 +1,70 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** 根据video id删除视频,后端自用 DELETE /vodFile/deleteAliyunVideo/${param0} */
export async function deleteAliyunVideoUsingDelete(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.deleteAliyunVideoUsingDELETEParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<API.AjaxResult>(`/vodFile/deleteAliyunVideo/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || {}),
});
}
/** 根据video id获取播放凭证,后端自用 DELETE /vodFile/getVideoAuthByVideoId/${param0} */
export async function getVideoAuthByVideoIdUsingDelete(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.getVideoAuthByVideoIdUsingDELETEParams,
options?: { [key: string]: any },
) {
const { id: param0, ...queryParams } = params;
return request<API.AjaxResultGetVideoPlayAuthResponse_>(
`/vodFile/getVideoAuthByVideoId/${param0}`,
{
method: 'DELETE',
params: { ...queryParams },
...(options || {}),
},
);
}
/** 上传视频到vod,测试用 POST /vodFile/upload */
export async function uploadVideoUsingPost(
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<API.AjaxResultString_>('/vodFile/upload', {
method: 'POST',
data: formData,
requestType: 'form',
...(options || {}),
});
}

@ -4,6 +4,11 @@ declare namespace API {
pbcId: number;
};
type addressAnalysisUsingGETParams = {
/** address */
address: string;
};
type agreeMemberApplicationUsingGETParams = {
/** businessUserId */
businessUserId: number;
@ -41,6 +46,12 @@ declare namespace API {
retmsg?: string;
};
type AjaxResultGetVideoPlayAuthResponse_ = {
data?: GetVideoPlayAuthResponse;
retcode?: number;
retmsg?: string;
};
type AjaxResultInt_ = {
data?: number;
retcode?: number;
@ -107,6 +118,12 @@ declare namespace API {
retmsg?: string;
};
type AjaxResultIPagePbcRequirement_ = {
data?: IPagePbcRequirement_;
retcode?: number;
retmsg?: string;
};
type AjaxResultIPagePbcRole_ = {
data?: IPagePbcRole_;
retcode?: number;
@ -119,6 +136,18 @@ declare namespace API {
retmsg?: string;
};
type AjaxResultIPagePbcTrainingClasses_ = {
data?: IPagePbcTrainingClasses_;
retcode?: number;
retmsg?: string;
};
type AjaxResultIPagePbcTrainingClassesType_ = {
data?: IPagePbcTrainingClassesType_;
retcode?: number;
retmsg?: string;
};
type AjaxResultIPagePbcUserBusiness_ = {
data?: IPagePbcUserBusiness_;
retcode?: number;
@ -155,6 +184,12 @@ declare namespace API {
retmsg?: string;
};
type AjaxResultJSONObject_ = {
data?: JSONObject;
retcode?: number;
retmsg?: string;
};
type AjaxResultListPbcAuthority_ = {
data?: PbcAuthority[];
retcode?: number;
@ -221,6 +256,12 @@ declare namespace API {
retmsg?: string;
};
type AjaxResultListPbcTrainingClassesType_ = {
data?: PbcTrainingClassesType_[];
retcode?: number;
retmsg?: string;
};
type AjaxResultListPbcUserMessage_ = {
data?: PbcUserMessage[];
retcode?: number;
@ -329,12 +370,48 @@ declare namespace API {
retmsg?: string;
};
type AjaxResultPbcRequirement_ = {
data?: PbcRequirement_;
retcode?: number;
retmsg?: string;
};
type AjaxResultPbcScreenAdvertisement_ = {
data?: PbcScreenAdvertisement;
retcode?: number;
retmsg?: string;
};
type AjaxResultPbcTrainingClasses_ = {
data?: PbcTrainingClasses_;
retcode?: number;
retmsg?: string;
};
type AjaxResultPbcTrainingClassesChapter_ = {
data?: PbcTrainingClassesChapter_;
retcode?: number;
retmsg?: string;
};
type AjaxResultPbcTrainingClassesPageDTO_ = {
data?: PbcTrainingClassesPageDTO;
retcode?: number;
retmsg?: string;
};
type AjaxResultPbcTrainingClassesType_ = {
data?: PbcTrainingClassesType_;
retcode?: number;
retmsg?: string;
};
type AjaxResultPbcTrainingClassesVideo_ = {
data?: PbcTrainingClassesVideo_;
retcode?: number;
retmsg?: string;
};
type AjaxResultPbcUserBusinessReturnVO_ = {
data?: PbcUserBusinessReturnVO;
retcode?: number;
@ -371,6 +448,13 @@ declare namespace API {
retmsg?: string;
};
type approvalRequirementForAdminUsingGETParams = {
/** id */
id: number;
/** pbcApprovalStatus */
pbcApprovalStatus: number;
};
type approvalSignYUsingGETParams = {
/** pbcId */
pbcId: number;
@ -424,6 +508,13 @@ declare namespace API {
state: number;
};
type changeRequirementStateForBuyerUsingGETParams = {
/** id */
id: number;
/** pbcBusinessState */
pbcBusinessState: number;
};
type changeUnreadStateUsingGETParams = {
/** businessId */
businessId: number;
@ -434,6 +525,11 @@ declare namespace API {
businessUserId: number;
};
type chapterDetailUsingGETParams = {
/** pbcId */
pbcId: number;
};
type checkEmailVerificationCodeUsingGETParams = {
/** email */
email: string;
@ -451,6 +547,26 @@ declare namespace API {
productId: number;
};
type classDetailForAdminUsingGETParams = {
/** pbcId */
pbcId: number;
};
type classDetailForFrontUsingGETParams = {
/** pbcId */
pbcId: number;
};
type classesTypeDetailUsingGETParams = {
/** pbcId */
pbcId: number;
};
type deleteAliyunVideoUsingDELETEParams = {
/** id */
id: string;
};
type deleteProductUsingGETParams = {
/** pcbId */
pcbId: number;
@ -547,6 +663,22 @@ declare namespace API {
phone: string;
};
type getVideoAuthByIdUsingGETParams = {
/** pbcId */
pbcId: number;
};
type getVideoAuthByVideoIdUsingDELETEParams = {
/** id */
id: string;
};
type GetVideoPlayAuthResponse = {
playAuth?: string;
requestId?: string;
videoMeta?: VideoMeta;
};
type getWXSignUsingGET1Params = {
/** url */
url: string;
@ -694,6 +826,14 @@ declare namespace API {
total?: number;
};
type IPagePbcRequirement_ = {
current?: number;
pages?: number;
records?: PbcRequirement_[];
size?: number;
total?: number;
};
type IPagePbcRole_ = {
current?: number;
pages?: number;
@ -710,6 +850,22 @@ declare namespace API {
total?: number;
};
type IPagePbcTrainingClasses_ = {
current?: number;
pages?: number;
records?: PbcTrainingClasses_[];
size?: number;
total?: number;
};
type IPagePbcTrainingClassesType_ = {
current?: number;
pages?: number;
records?: PbcTrainingClassesType_[];
size?: number;
total?: number;
};
type IPagePbcUserBusiness_ = {
current?: number;
pages?: number;
@ -2196,6 +2352,81 @@ declare namespace API {
vipNumber?: number;
};
type PbcRequirement_ = {
/** 当前页 */
current?: number;
/** 条数 */
pageSize?: number;
/** 审核状态0表示审核中1表示审核通过2表示审核未通过 */
pbcApprovalStatus?: number;
/** 需求预算,可以填入文字描述 */
pbcBudget?: string;
/** 需求状态0表示进行中1表示已解决2表示已关闭 */
pbcBusinessState?: number;
/** 创建时间 */
pbcCreateAt?: string;
/** 创建人 */
pbcCreateBy?: number;
/** 创建人 */
pbcCreateByUserName?: string;
/** 需求描述 */
pbcDescription?: string;
/** 主键 */
pbcId?: number;
/** 需求图片 */
pbcImages?: string;
/** 状态,0是删除1是正常2是作废 */
pbcState?: number;
/** 需求标题 */
pbcTitle?: string;
/** 更新时间 */
pbcUpdateAt?: string;
/** 更新人 */
pbcUpdateBy?: number;
/** 更新人 */
pbcUpdateByUserName?: string;
pbcUsers?: PbcUsers;
/** 后端使用,创建结束时间 */
publishEndTime?: string;
/** 后端使用,创建开始时间 */
publishStartTime?: string;
replyList?: PbcRequirementReply_[];
};
type PbcRequirementReply_ = {
pbcBusiness?: PbcBusiness;
/** 回复的用户所属商户id前端不需要传 */
pbcBusinessId?: number;
/** 创建时间 */
pbcCreateAt?: string;
/** 创建人 */
pbcCreateBy?: number;
/** 创建人 */
pbcCreateByUserName?: string;
/** 主键 */
pbcId?: number;
/** 回复内容 */
pbcReplyContent?: string;
/** 需求回复的id */
pbcReplyId?: number;
/** 0回复的主题1回复某条回复 */
pbcReplyType?: number;
/** 回复用户id */
pbcReplyUserId?: number;
/** 需求id */
pbcRequirementId?: number;
/** 状态,0是删除1是正常2是作废 */
pbcState?: number;
/** 更新时间 */
pbcUpdateAt?: string;
/** 更新人 */
pbcUpdateBy?: number;
/** 更新人 */
pbcUpdateByUserName?: string;
pbcUsers?: PbcUsers;
replyList?: PbcRequirementReply_[];
};
type PbcRole = {
/** 创建时间 */
pbcCreateAt?: string;
@ -2337,6 +2568,169 @@ declare namespace API {
pbcUpdateByUserName?: string;
};
type PbcTrainingClasses_ = {
/** 当前页 */
current?: number;
/** 条数 */
pageSize?: number;
/** 课时 */
pbcClassesSubCount?: number;
/** 课程类型id */
pbcClassesTypeId?: number;
/** 课程类型名称 */
pbcClassesTypeName?: string;
/** 浏览数 */
pbcClassesViewCount?: number;
/** 创建时间 */
pbcCreateAt?: string;
/** 创建人 */
pbcCreateBy?: number;
/** 创建人 */
pbcCreateByUserName?: string;
/** 主键 */
pbcId?: number;
/** 课程图片 */
pbcImages?: string;
/** 状态,0是删除1是正常2是作废 */
pbcState?: number;
/** 教学方式,枚举,线上,线下 */
pbcTeachMethod?: string;
/** 课程标题 */
pbcTitle?: string;
/** 结束时间 */
pbcTrainingEndDatetime?: string;
/** 开始时间 */
pbcTrainingStartDatetime?: string;
/** 枚举0未开始1进行中2已结束 */
pbcTrainingState?: number;
/** 更新时间 */
pbcUpdateAt?: string;
/** 更新人 */
pbcUpdateBy?: number;
/** 更新人 */
pbcUpdateByUserName?: string;
};
type PbcTrainingClassesChapter_ = {
/** 章节名称 */
pbcChapterName?: string;
/** 课程id */
pbcClassesId?: number;
/** 创建时间 */
pbcCreateAt?: string;
/** 创建人 */
pbcCreateBy?: number;
/** 创建人 */
pbcCreateByUserName?: string;
/** 主键 */
pbcId?: number;
/** 章节排序 */
pbcSort?: number;
/** 状态,0是删除1是正常2是作废 */
pbcState?: number;
/** 更新时间 */
pbcUpdateAt?: string;
/** 更新人 */
pbcUpdateBy?: number;
/** 更新人 */
pbcUpdateByUserName?: string;
videoList?: PbcTrainingClassesVideo_[];
};
type PbcTrainingClassesPageDTO = {
chapterList?: PbcTrainingClassesChapter_[];
pbcTrainingClasses?: PbcTrainingClasses_;
};
type PbcTrainingClassesType_ = {
/** 当前页 */
current?: number;
/** 条数 */
pageSize?: number;
/** 创建时间 */
pbcCreateAt?: string;
/** 创建人 */
pbcCreateBy?: number;
/** 创建人 */
pbcCreateByUserName?: string;
/** 主键 */
pbcId?: number;
/** 状态,0是删除1是正常2是作废 */
pbcState?: number;
pbcType?: string;
/** 更新时间 */
pbcUpdateAt?: string;
/** 更新人 */
pbcUpdateBy?: number;
/** 更新人 */
pbcUpdateByUserName?: string;
};
type PbcTrainingClassesVideo_ = {
/** 章节id */
pbcChapterId?: number;
/** 课程id */
pbcClassesId?: number;
/** 创建时间 */
pbcCreateAt?: string;
/** 创建人 */
pbcCreateBy?: number;
/** 创建人 */
pbcCreateByUserName?: string;
/** 文件类型1是vod点播视频 */
pbcFileType?: number;
/** 主键 */
pbcId?: number;
/** 视频排序 */
pbcSort?: number;
/** 状态,0是删除1是正常2是作废 */
pbcState?: number;
/** 更新时间 */
pbcUpdateAt?: string;
/** 更新人 */
pbcUpdateBy?: number;
/** 更新人 */
pbcUpdateByUserName?: string;
/** 文件地址或video id */
pbcVideoAddress?: string;
/** 视频时长 */
pbcVideoDuration?: string;
/** 视频名称 */
pbcVideoName?: string;
videoRecord?: PbcTrainingClassesVideoRecord_;
};
type PbcTrainingClassesVideoRecord_ = {
/** 章节id */
pbcChapterId?: number;
/** 课程id */
pbcClassesId?: number;
/** 创建时间 */
pbcCreateAt?: string;
/** 创建人 */
pbcCreateBy?: number;
/** 创建人 */
pbcCreateByUserName?: string;
/** 主键 */
pbcId?: number;
/** 状态,0是删除1是正常2是作废 */
pbcState?: number;
/** 视频状态0是未完成1是已完成 */
pbcStatus?: number;
/** 更新时间 */
pbcUpdateAt?: string;
/** 更新人 */
pbcUpdateBy?: number;
/** 更新人 */
pbcUpdateByUserName?: string;
/** 用户id */
pbcUserId?: number;
/** 视频id */
pbcVideoId?: number;
/** 视频进度 */
pbcVideoSpeed?: string;
};
type PbcUserBusiness_ = {
/** 商户手机号 */
pbcBusinessContactMobile?: string;
@ -2843,6 +3237,16 @@ declare namespace API {
roleId: number;
};
type queryCompanyUsingGETParams = {
/** expressNo */
expressNo: string;
};
type queryTrackUsingGETParams = {
/** expressNo */
expressNo: string;
};
type removeAdUsingGETParams = {
/** pbcId */
pbcId: number;
@ -2858,6 +3262,16 @@ declare namespace API {
id: number;
};
type removeChapterUsingGETParams = {
/** pbcId */
pbcId: number;
};
type removeClassUsingGETParams = {
/** pbcId */
pbcId: number;
};
type removeGradeByIdUsingPOSTParams = {
/** id */
id: number;
@ -2868,6 +3282,16 @@ declare namespace API {
hotProductId: number;
};
type removeRequirementReplyUsingGETParams = {
/** pbcId */
pbcId: number;
};
type removeTrainingClassesTypeUsingGETParams = {
/** pbcId */
pbcId: number;
};
type removeUserCollectByIdUsingGETParams = {
/** collectId */
collectId: number;
@ -2878,6 +3302,21 @@ declare namespace API {
productId: number;
};
type removeVideoUsingGETParams = {
/** pbcId */
pbcId: number;
};
type requirementDetailForAdminUsingGETParams = {
/** pbcId */
pbcId: number;
};
type requirementDetailForFrontUsingGETParams = {
/** pbcId */
pbcId: number;
};
type resetPasswordUsingGETParams = {
/** id */
id: number;
@ -3047,6 +3486,19 @@ declare namespace API {
searchKey?: string;
};
type videoDetailUsingGETParams = {
/** pbcId */
pbcId: number;
};
type VideoMeta = {
coverURL?: string;
duration?: number;
status?: string;
title?: string;
videoId?: string;
};
type View = {
contentType?: string;
};

Loading…
Cancel
Save