提交 3a2e2915 作者: ZhangLingKun

Merge branch 'develop'

......@@ -3,6 +3,7 @@
#VITE_REQUEST_BASE_URL='https://www.iuav.shop'
#测试服
VITE_REQUEST_BASE_URL='https://test.iuav.shop'
#VITE_REQUEST_BASE_URL='https://120.25.213.190'
#VITE_REQUEST_BASE_URL='https://iuav.mmcuav.cn'
#VITE_REQUEST_BASE_URL='/api'
#旧版接口地址
......
......@@ -14,4 +14,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/admin
newTag: bc9cd408e635ff1422c33129fc8f96d1853de9c0
newTag: ad200dc1515c0c4aabd0709d354c997064ba1b19
......@@ -39,3 +39,33 @@ export type activityDataType = InterFunction<
>;
// 活动-编辑
export type activityEditType = InterFunction<addActivityItemType & { id: number }, null>;
// 后台——签到调整
export type DataInfoType = InterFunction<
{
id: number;
integral: number;
period: number;
status: boolean;
userContinuousCheckInVO: Array<{
bonusPoints: number;
numberOfDays: number;
}>;
},
NonNullable<unknown>
>;
// 小程序签到列表
export type SignInListType = InterFunction<
NonNullable<unknown>,
{
id: number;
integral: number;
period: number;
status: boolean;
userContinuousCheckInVO: Array<{
bonusPoints: number;
numberOfDays: number;
id: number;
signInId: number;
}>;
}[]
>;
......@@ -3,7 +3,9 @@ import {
activityDataType,
activityEditType,
addActivityType,
DataInfoType,
endActivityType,
SignInListType,
splitCouponDownType,
} from '../interface/activityManage';
import axios from '../request';
......@@ -40,4 +42,11 @@ export class ActivityManageAPI {
static getActivityData: activityDataType = (params) => {
return axios.get('malluser/activity/dataInfo', { params });
};
// 活动后台——签到调整
static DataInfo: DataInfoType = (params) => {
return axios.post('/userapp/insertSignIn', params);
};
// 小程序签到列表
static SignInList: SignInListType = (params) => axios.get('/userapp/SignInList', { params });
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import { limitEntity } from '@/api/modules/role';
function useOptionShow(id: number) {
......
/* eslint-disable */
// @ts-nocheck
import { FC, ForwardedRef, forwardRef, useState, useImperativeHandle } from 'react';
import { DatePicker, Form, Input, message, Modal, Radio, Select, Upload } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
......
......@@ -13,7 +13,7 @@ import useOperate from '~/common/hook/optionHook';
// 活动数据-类型
type dataType = (ReturnType<activityDataType> extends Promise<infer T> ? T : never)['result'];
const ActivityList: FC<{}> = () => {
const ActivityList: FC = () => {
const activityRef = useRef();
const tableColumns: ColumnsType<activityItemType> = [
......@@ -31,21 +31,21 @@ const ActivityList: FC<{}> = () => {
title: '活动类型',
align: 'center',
dataIndex: 'activityType',
render: (text: string, record: activityItemType) => (
render: (_text: string, record: activityItemType) => (
<div>{record.activityType === 1 ? '裂变活动' : '普通活动'}</div>
),
},
{
title: '是否展示',
align: 'center',
render: (text: number, record: activityItemType) => (
render: (_text: number, record: activityItemType) => (
<div>{record.show ? '展示' : '隐藏'}</div>
),
},
{
title: '推广简图',
align: 'center',
render: (text: string, record: activityItemType) => (
render: (_text: string, record: activityItemType) => (
<Image src={record.activityImg} width={50} />
),
},
......@@ -62,13 +62,13 @@ const ActivityList: FC<{}> = () => {
{
title: '状态',
align: 'center',
render: (text: string, record: activityItemType) =>
render: (_text: string, record: activityItemType) =>
record.activityStatus === 1 ? '进行中' : '已下线',
},
{
title: '有效期',
align: 'center',
render: (text: string, record: activityItemType) => (
render: (_text: string, record: activityItemType) => (
<div>
<div>起:{record.startTime}</div>
<div>止:{record.endTime}</div>
......@@ -78,7 +78,7 @@ const ActivityList: FC<{}> = () => {
{
title: '操作',
align: 'center',
render: (text: string, record: activityItemType, index: number) => (
render: (_text: string, record: activityItemType, _index: number) => (
<>
<Button
type='link'
......
import React, { FC, useEffect } from 'react';
import { Form, InputNumber, Modal, ModalProps } from 'antd';
import { InterDataType } from '~/api/interface';
import { SignInListType } from '~/api/interface/activityManage';
// 参数
interface selfProps {
data?: InterDataType<SignInListType>[0]['userContinuousCheckInVO'][0];
onSubmit: (data: InterDataType<SignInListType>[0]['userContinuousCheckInVO'][0]) => void;
}
const AddOrEditModal: FC<ModalProps & selfProps> = ({ open, onCancel, title, data, onSubmit }) => {
// 表单钩子
const [editForm] = Form.useForm();
// 提交数据
const handleSubmit = async () => {
const valid = await editForm.validateFields();
if (!valid) return;
onSubmit({
...data,
...valid,
});
};
// 关闭弹窗
const handleCancel = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
editForm.resetFields();
onCancel?.(e);
};
// 组件挂载
useEffect(() => {
if (data) {
editForm.setFieldsValue(data);
} else {
editForm.resetFields();
}
// console.log('组件挂载 --->', data);
}, [open]);
return (
<Modal open={open} onCancel={(e) => handleCancel(e)} title={title} onOk={handleSubmit}>
<Form labelCol={{ span: 6 }} wrapperCol={{ span: 16 }} form={editForm}>
<Form.Item
label='连续签到天数'
name='numberOfDays'
rules={[
{ required: true, message: '请输入连续签到天数' },
{ pattern: /^[0-9]*$/g, message: '请输入整数' },
]}
>
<InputNumber min={1} max={100} placeholder='请输入连续签到天数' addonAfter={'天'} />
</Form.Item>
<Form.Item
label='奖励积分'
name='bonusPoints'
rules={[
{ required: true, message: '请输入奖励积分' },
{ pattern: /^[0-9]*$/g, message: '请输入整数' },
]}
>
<InputNumber min={1} max={10000} placeholder='请输入奖励积分' addonAfter={'积分'} />
</Form.Item>
</Form>
</Modal>
);
};
export default AddOrEditModal;
import { useEffect, useState } from 'react';
import { Button, Form, InputNumber, message, Modal, Switch, Table } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import AddOrEditModal from './comp/addOrEditModal';
import { ActivityManageAPI } from '~/api';
import { InterDataType } from '~/api/interface';
import { SignInListType } from '~/api/interface/activityManage';
const RewardsManageView = () => {
// 表单钩子
const [formRefs] = Form.useForm();
// 连续签到信息
const [signInfoList, setSignInfoList] =
useState<InterDataType<SignInListType>[0]['userContinuousCheckInVO']>();
// 签到信息
const [signData, setSignData] = useState<InterDataType<SignInListType>[0]>();
// 获取签到设置
const getDataInfo = async () => {
const res = await ActivityManageAPI.SignInList();
if (res && res.code === '200') {
if (!res.result?.length) return;
setSignInfoList(res.result[0]?.userContinuousCheckInVO || []);
setSignData(res.result[0]);
formRefs.setFieldsValue({
period: res.result[0].period,
integral: res.result[0].integral,
status: res.result[0].status,
});
}
};
// 需要编辑的数据
const [editData, setEditData] =
useState<InterDataType<SignInListType>[0]['userContinuousCheckInVO'][0]>();
// 编辑弹窗是否展示
const [addEditShow, setAddEditShow] = useState(false);
// 提交数据
const handleSubmit = async () => {
const valid = await formRefs.validateFields();
if (!valid) return;
const res = await ActivityManageAPI.DataInfo({
...valid,
userContinuousCheckInVO: signInfoList?.map((i) => (i.signInId ? i : { ...i, id: undefined })),
id: signData?.id,
});
if (res && res.code === '200') {
message.success('操作成功');
await getDataInfo();
}
// console.log('提价数据 --->', valid);
};
// 删除数据
const handleDelete = (record: InterDataType<SignInListType>[0]) => {
Modal.confirm({
title: '提示',
content: '请确认是否删除?',
onOk: () => {
setSignInfoList(signInfoList?.filter((item) => item.id !== record.id));
message.success('删除成功').then();
},
});
};
// 组件挂载
useEffect(() => {
getDataInfo().then();
}, []);
return (
<>
<div className='rewards-form' style={{ width: '90%' }}>
<Form
labelCol={{ span: 3 }}
wrapperCol={{ offset: 1 }}
form={formRefs}
initialValues={{ show: 1, activityType: 1 }}
>
<Form.Item
label='是否启用'
name='status'
rules={[{ required: true, message: '请选择是否启用' }]}
valuePropName='checked'
>
<Switch />
</Form.Item>
<Form.Item
label='签到周期'
name='period'
rules={[
{ required: true, message: '请输入签到周期' },
{ pattern: /^[0-9]*$/g, message: '请输入整数' },
]}
extra='签到周期需在7-100天内'
>
<InputNumber min={7} max={100} placeholder='请输入签到周期' addonAfter={'天'} />
</Form.Item>
<Form.Item
label='每日奖励'
name='integral'
rules={[
{ required: true, message: '请输入每日签到奖励' },
{ pattern: /^[0-9]*$/g, message: '请输入整数' },
]}
>
<InputNumber min={1} max={10000} placeholder='请输入每日签到奖励' addonAfter={'积分'} />
</Form.Item>
<Form.Item label='连续签到' wrapperCol={{ offset: 1, span: 20 }}>
<Button
type={'primary'}
icon={<PlusOutlined />}
style={{ marginBottom: '16px' }}
onClick={() => setAddEditShow(true)}
>
添加连续签到奖励
</Button>
<Table
size={'small'}
bordered
rowKey='id'
columns={[
{
title: '连续签到天数',
dataIndex: 'numberOfDays',
align: 'center',
width: '100px',
render: (text: string) => `${text}天`,
},
{
title: '奖励积分',
dataIndex: 'bonusPoints',
align: 'center',
width: '100px',
render: (text: string) => `${text}分`,
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
width: '100px',
fixed: 'right',
render: (_value, record) => (
<>
<Button
type={'link'}
onClick={() => {
setEditData(record);
setAddEditShow(true);
}}
>
编辑
</Button>
<Button
type={'link'}
danger
onClick={() =>
handleDelete(record as unknown as InterDataType<SignInListType>[0])
}
>
删除
</Button>
</>
),
},
]}
dataSource={signInfoList}
/>
</Form.Item>
</Form>
</div>
<div
className='rewards-action'
style={{ width: '100%', display: 'flex', justifyContent: 'center' }}
>
<Button type={'primary'} onClick={handleSubmit}>
保存
</Button>
</div>
<AddOrEditModal
open={addEditShow}
title={editData ? '编辑' : '添加'}
data={editData}
onCancel={() => {
setAddEditShow(false);
setEditData(undefined);
}}
onSubmit={(e) => {
// 判断是新增还是编辑
if (signInfoList?.find((i) => i.id === e.id)) {
setSignInfoList(signInfoList?.map((i) => (i.id === e.id ? e : i)));
} else {
// 如果是新增,判断连续签到天数不能重复
if (signInfoList?.find((i) => i.numberOfDays === e.numberOfDays)) {
message.warning('连续签到天数不能重复').then();
return;
}
// 判断连续签到天数不能大于签到周期
if (signData?.period && e.numberOfDays > signData?.period) {
message.warning('连续签到天数不能大于签到周期').then();
return;
}
setSignInfoList([...(signInfoList || []), { ...e, id: new Date().getTime() }]);
}
setAddEditShow(false);
setEditData(undefined);
}}
/>
</>
);
};
export default RewardsManageView;
......@@ -168,7 +168,8 @@ function EquipmentOrderView() {
{
title: '商品',
align: 'center',
width: '20%',
width: '300px',
fixed: 'left',
render: (_text, record) => (
<TableItem
tr={
......@@ -196,7 +197,7 @@ function EquipmentOrderView() {
{
title: '租期',
align: 'center',
width: '15%',
width: '200px',
render: (_text, record) => (
<TableItem
tr={
......@@ -213,10 +214,12 @@ function EquipmentOrderView() {
title: '数量',
align: 'center',
dataIndex: 'wareNum',
width: 100,
render: (text) => <TableItem tr={text} />,
},
{
title: '单价',
width: 200,
align: 'center',
dataIndex: 'unitPrice',
render: (text) => <TableItem tr={<span>¥{text?.toLocaleString()}</span>} />,
......@@ -251,7 +254,7 @@ function EquipmentOrderView() {
title: '订单状态',
dataIndex: 'statusCode',
align: 'center',
width: '10%',
width: '100px',
render: (text: number) => (
<TableItem tr={tranStatusList.find((v) => v.value === String(text))?.label} />
),
......@@ -260,7 +263,7 @@ function EquipmentOrderView() {
title: '押金',
dataIndex: 'deposit',
align: 'center',
width: '10%',
width: '200px',
render: (text: number, record) => (
<TableItem
tr={
......@@ -287,7 +290,7 @@ function EquipmentOrderView() {
title: '实付款',
dataIndex: 'orderTotalAmount',
align: 'center',
width: '10%',
width: '200px',
render: (text, record) => (
<TableItem
tr={
......@@ -314,6 +317,7 @@ function EquipmentOrderView() {
title: '推荐人',
dataIndex: 'userName',
align: 'center',
width: 200,
render: (_text, _record) => <TableItem tr={''} />,
},
{
......
......@@ -117,11 +117,11 @@ function ProductOrderView() {
getTableList();
};
// 订单状态筛选
const statusChangeEvent = (i: number) => {
const statusChangeEvent = (item: { label: string; value: number }, i: number) => {
pagination.current = 1;
pagination.pageSize = 10;
setStatusCodeButtonIndex(i);
query = { ...query, statusCode: tranStatusList[i].value };
query = { ...query, statusCode: item.value };
getTableList();
};
// 跳转订单详情
......@@ -134,7 +134,12 @@ function ProductOrderView() {
if (result) {
const list = result.map((item) => ({ value: item.code, label: item.status }));
setOrderStatusList(list);
setTranStatusList([{ label: '全部', value: undefined }, ...list]);
setTranStatusList([
{ label: '全部', value: undefined },
...(userInfo.companyInfoVO.companyType === 0
? list
: list.filter((v) => ![200, 300, 420].includes(v.value as number))),
]);
}
});
};
......@@ -231,15 +236,8 @@ function ProductOrderView() {
title: '订单金额(元)',
dataIndex: 'orderTotalAmount',
align: 'center',
render: (text) => (
<TableItem tr={<div className='goods-text'>{text?.toLocaleString()}</div>} />
),
},
{
title: '数量',
align: 'center',
width: '15%',
render: (_text, record) => (
width: 280,
render: (text, record) => (
<TableItem
td={
<div>
......@@ -247,6 +245,16 @@ function ProductOrderView() {
<span>{record.createTime}</span>
</div>
}
tr={<div className='goods-text'>{text?.toLocaleString()}</div>}
/>
),
},
{
title: '数量',
align: 'center',
width: '100px',
render: (_text, record) => (
<TableItem
tr={record.skuDTOList.map((v) => (
<div key={v.id} className='goods-text'>
{v.orderNum}
......@@ -258,6 +266,7 @@ function ProductOrderView() {
{
title: '单价',
align: 'center',
width: '200px',
render: (_text, record) => (
<TableItem
tr={record.skuDTOList.map((v) => (
......@@ -272,12 +281,14 @@ function ProductOrderView() {
title: '订单类型',
align: 'center',
dataIndex: 'orderType',
width: '100px',
render: (text) => (
<TableItem tr={<div className='goods-text'>{text ? '意向订单' : '正常订单'}</div>} />
),
},
{
title: '实际支付',
width: '200px',
dataIndex: 'otherAmount',
align: 'center',
render: (text) => (
......@@ -286,6 +297,7 @@ function ProductOrderView() {
},
{
title: '抵扣云享金',
width: '200px',
dataIndex: 'shareAmount',
align: 'center',
render: (text) => (
......@@ -294,6 +306,7 @@ function ProductOrderView() {
},
{
title: '抵扣佣金',
width: '200px',
dataIndex: 'salaryAmount',
align: 'center',
render: (text) => (
......@@ -304,7 +317,7 @@ function ProductOrderView() {
title: '买家',
dataIndex: 'uid',
align: 'center',
width: '10%',
width: '200px',
render: (_text: any, record) => (
<TableItem
tr={
......@@ -333,6 +346,7 @@ function ProductOrderView() {
title: '订单状态',
dataIndex: 'statusCode',
align: 'center',
width: '100px',
render: (text) => (
<TableItem tr={<div>{orderStatusList.find((i) => i.value === text)?.label || text}</div>} />
),
......@@ -340,11 +354,13 @@ function ProductOrderView() {
{
title: '推荐人',
dataIndex: 'userName',
width: '100px',
align: 'center',
render: (_text) => <TableItem tr={<div className='goods-text'>--</div>} />,
},
{
title: '订单交期',
width: '100px',
dataIndex: 'deliveryTime',
align: 'center',
render: (text: string) => (
......@@ -375,7 +391,7 @@ function ProductOrderView() {
dataIndex: 'action',
// align: 'right',
fixed: 'right',
width: '10%',
width: '100px',
onHeaderCell: () => ({
style: {
textAlign: 'center',
......@@ -437,15 +453,12 @@ function ProductOrderView() {
searchData={onFinish}
sufFixBtn={
<>
{(userInfo.companyInfoVO.companyType === 0
? tranStatusList
: tranStatusList.filter((v) => ![200, 300, 420].includes(v.value as number))
)?.map((i, j) => {
{tranStatusList.map((i, j) => {
return (
<Button
key={j}
type={j === statusCodeButtonIndex ? 'primary' : 'default'}
onClick={() => statusChangeEvent(j)}
onClick={() => statusChangeEvent(i, j)}
style={{ marginTop: '5px' }}
>
{i.label}
......
......@@ -2,6 +2,7 @@ import { FC } from 'react';
import { Form, Input, Modal, ModalProps, Select } from 'antd';
import { Uploader } from '~/components/uploader';
import { UploadOutlined } from '@ant-design/icons';
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface selfProps {}
const AddOrEditTagModal: FC<ModalProps & selfProps> = ({ open, onCancel }) => {
......
......@@ -37,6 +37,8 @@ import {
AccountBookOutlined,
EnvironmentOutlined,
BarChartOutlined,
FireOutlined,
InsertRowAboveOutlined,
} from '@ant-design/icons';
import { Spin } from 'antd';
......@@ -169,6 +171,7 @@ import AccountLimit from '~/pages/systemManage/limitManage/roleList'; //账号
import LimitInfo from '~/pages/systemManage/limitManage/limitInfo';
import CustomListDetail from '~/pages/customManage/customList/detail';
import ServiceCategoryDetail from '~/pages/categoryManage/serviceCategoryList/detail';
import RewardsManageView from '~/pages/activityManage/rewardsManage';
const AddressManageView = React.lazy(() => import('~/pages/systemManage/addressManage'));
// const IndustryListView = React.lazy(() => import('~/pages/mallManage/industryManage/industryList')); //行业列表
......@@ -506,6 +509,28 @@ export const routerList: Array<RouteObjectType> = [
],
},
{
path: '/activityManage',
element: <LayoutView />,
errorElement: <ErrorPage />,
meta: {
id: 500,
icon: <FireOutlined />,
title: '营销管理',
},
children: [
{
path: '/activityManage/rewardsManage',
element: withLoadingComponent(<RewardsManageView />),
errorElement: <ErrorPage />,
meta: {
id: 510,
title: '签到奖励',
icon: <InsertRowAboveOutlined />,
},
},
],
},
{
path: '/forumManage',
element: <LayoutView />,
errorElement: <ErrorPage />,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论