提交 a38d7f4f 作者: ZhangLingKun

功能:eslint --fix

上级 cde9a40b
import { PointManageAPI } from './modules/pointManageAPI';
import { ActivityManageAPI } from './modules/activityManage';
import { CouponManageAPI } from './modules/couponManage'
import { CommonAPI } from "./modules/common";
import { MakeManageAPI } from './modules/makeManage'
import { ActivityManageAPI } from './modules/activityManage';
import { CouponManageAPI } from './modules/couponManage';
import { CommonAPI } from './modules/common';
import { MakeManageAPI } from './modules/makeManage';
export {
PointManageAPI,
ActivityManageAPI,
CommonAPI,
CouponManageAPI,
MakeManageAPI
};
export { PointManageAPI, ActivityManageAPI, CommonAPI, CouponManageAPI, MakeManageAPI };
// 活动-裂变优惠券下拉类型
import { InterFunction, InterItemFunction } from "~/api/interface";
import { SplitCouponItemType } from "~/api/interface/couponManage";
import { InterFunction, InterItemFunction } from '~/api/interface';
import { SplitCouponItemType } from '~/api/interface/couponManage';
// 裂变优惠券-下拉
export type splitCouponDownType = InterFunction<
{ type: number },
SplitCouponItemType[]
>;
export type splitCouponDownType = InterFunction<{ type: number }, SplitCouponItemType[]>;
// 活动新增-type
export type addActivityItemType = {
......@@ -21,7 +18,7 @@ export type addActivityItemType = {
show: number;
startTime: string;
time?: any[];
redirectPath?: "";
redirectPath?: '';
};
export type addActivityType = InterFunction<addActivityItemType, null>;
// 活动-列表
......@@ -41,7 +38,4 @@ export type activityDataType = InterFunction<
{ countFinishParticipate: number; countParticipate: number }
>;
// 活动-编辑
export type activityEditType = InterFunction<
addActivityItemType & { id: number },
null
>;
export type activityEditType = InterFunction<addActivityItemType & { id: number }, null>;
import {
InterFunction,
InterItemFunction,
InterListFunction,
} from "~/api/interface";
import { PaginationEntity } from "~/common/interface/PaginationEntity";
import { InterFunction, InterItemFunction, InterListFunction } from '~/api/interface';
import { PaginationEntity } from '~/common/interface/PaginationEntity';
// 裂变优惠券-表格数据类型
export type SplitCouponItemType = {
......@@ -25,10 +21,7 @@ export type SplitCouponSearchType = {
useType?: number;
state?: boolean;
};
export type SplitCouponListType = InterItemFunction<
SplitCouponSearchType,
SplitCouponItemType[]
>;
export type SplitCouponListType = InterItemFunction<SplitCouponSearchType, SplitCouponItemType[]>;
// 裂变优惠券-新建-数据类型
// 基本信息
export type baseInfoType = {
......@@ -137,13 +130,10 @@ export type couponDetailItemType = {
transferorTime: string;
};
export type couponDetailType = InterItemFunction<
couponDetailSearchType,
couponDetailItemType[]
>;
export type couponDetailType = InterItemFunction<couponDetailSearchType, couponDetailItemType[]>;
export type couponDetailExportType = InterFunction<
couponDetailSearchType & Pick<PaginationEntity, "pageNo" | "pageSize">,
couponDetailSearchType & Pick<PaginationEntity, 'pageNo' | 'pageSize'>,
any
>;
......@@ -157,10 +147,7 @@ export type ListBrandInfoType = InterListFunction<
export type CouponSaveType = InterFunction<any, any>;
// 增发优惠券
export type CouponIncreaseType = InterFunction<
{ id: number; count: number },
{}
>;
export type CouponIncreaseType = InterFunction<{ id: number; count: number }, {}>;
// 获取优惠券使用数据
export type CouponGetDataType = InterFunction<
......
import { InterFunction, InterItemFunction } from "~/api/interface";
import { InterFunction, InterItemFunction } from '~/api/interface';
// 品牌管理-新增
export type MakeAddType = InterFunction<{ brandName: string }, null>;
......
......@@ -5,41 +5,39 @@ import {
addActivityType,
endActivityType,
splitCouponDownType,
} from "../interface/activityManage";
import axios from "../request";
} from '../interface/activityManage';
import axios from '../request';
export class ActivityManageAPI {
// 活动-裂变优惠券-下拉
static getActivityCouponPullDown: splitCouponDownType = (params) => {
return axios.get("userpay/coupon/back/getActivityCouponPullDown", {
return axios.get('userpay/coupon/back/getActivityCouponPullDown', {
params,
});
};
// 活动-新增
static createActivity: addActivityType = (data) => {
return axios.post("malluser/activity/create", data);
return axios.post('malluser/activity/create', data);
};
// 活动-编辑
static editActivity: activityEditType = (data) => {
return axios.post("malluser/activity/update", data);
return axios.post('malluser/activity/update', data);
};
// 活动-列表
static getActivityList: activeTableItemType = (params) => {
return axios.get("malluser/activity/list", { params });
return axios.get('malluser/activity/list', { params });
};
// 活动-结束
static endActivity: endActivityType = (params) => {
return axios.get("malluser/activity/stop", { params });
return axios.get('malluser/activity/stop', { params });
};
// 活动-数据
static getActivityData: activityDataType = (params) => {
return axios.get("malluser/activity/dataInfo", { params });
return axios.get('malluser/activity/dataInfo', { params });
};
}
import axios from "../request";
import axios from '../request';
// 运营人员
export interface operateEntity {
......@@ -14,8 +14,8 @@ export interface loginEntity {
}
export class CommonAPI {
static Login = (data: Pick<loginEntity, "accountNo" | "passWord">): any => {
return axios.post("userservlet/auth/platformLogin", {
static Login = (data: Pick<loginEntity, 'accountNo' | 'passWord'>): any => {
return axios.post('userservlet/auth/platformLogin', {
...data,
portType: 1,
});
......@@ -23,21 +23,21 @@ export class CommonAPI {
// 上传图片
static commonUpload = (data: FormData) => {
return axios.post("ossservlet/upload/osses", data);
return axios.post('ossservlet/upload/osses', data);
};
// 上传图片
static fileUpload = (data: FormData) => {
return axios.post("ossservlet/upload/oss", data);
return axios.post('ossservlet/upload/oss', data);
};
// 运营人员列表
static operateList(operateName: string) {
return axios.post("orderservlet/ordertask/listOperate", { operateName });
return axios.post('orderservlet/ordertask/listOperate', { operateName });
}
// 销售人员列表
static getSaleList() {
return axios.get("userservlet/useraccount/getSaleList");
return axios.get('userservlet/useraccount/getSaleList');
}
}
import axios from "../request";
import axios from '../request';
import {
couponDetailExportType,
couponDetailType,
......@@ -10,55 +10,55 @@ import {
ListBrandInfoType,
SplitCouponAddType,
SplitCouponListType,
} from "~/api/interface/couponManage";
} from '~/api/interface/couponManage';
export class CouponManageAPI {
// 优惠券管理-裂变优惠券列表
static getPageActivityList: SplitCouponListType = (data) => {
return axios.post("userpay/coupon/back/pageActivityList", data);
return axios.post('userpay/coupon/back/pageActivityList', data);
};
// 优惠券管理-裂变优惠券新建
static saveActivity: SplitCouponAddType = (data) => {
return axios.post("userpay/coupon/back/saveActivity", data);
return axios.post('userpay/coupon/back/saveActivity', data);
};
// 优惠券管理-裂变优惠券新建
static CouponPageList: CouponPageListType = (data) => {
return axios.post("userpay/coupon/back/pageList", data);
return axios.post('userpay/coupon/back/pageList', data);
};
// 优惠券明细
static getCouponDetail: couponDetailType = (data) => {
return axios.post("userpay/coupon/back/getUserCouponList", data);
return axios.post('userpay/coupon/back/getUserCouponList', data);
};
// 优惠券明细-导出
static downloadCouponUserList: couponDetailExportType = (data) => {
return axios.post("userpay/coupon/back/downloadCouponUserList", data, {
responseType: "blob",
return axios.post('userpay/coupon/back/downloadCouponUserList', data, {
responseType: 'blob',
});
};
// 新增优惠券
static CouponSave: CouponSaveType = (data) => {
return axios.post("/userpay/coupon/back/save", data, {
headers: { "Content-Type": "multipart/form-data" },
return axios.post('/userpay/coupon/back/save', data, {
headers: { 'Content-Type': 'multipart/form-data' },
});
};
// 增发优惠券
static CouponIncrease: CouponIncreaseType = (params) => {
return axios.post("/userpay/coupon/back/increase", {}, { params });
return axios.post('/userpay/coupon/back/increase', {}, { params });
};
// 获取优惠券详情
static CouponGetData: CouponGetDataType = (params) => {
return axios.get("/userpay/coupon/back/getData", { params });
return axios.get('/userpay/coupon/back/getData', { params });
};
// 关闭优惠券
static CouponShutDown: CouponShutDownType = (params) => {
return axios.post("/userpay/coupon/back/shutDown", {}, { params });
return axios.post('/userpay/coupon/back/shutDown', {}, { params });
};
}
......@@ -3,27 +3,27 @@ import {
MakeDeleteType,
MakeEditType,
MakeListType,
} from "~/api/interface/makeManage";
import axios from "../request";
} from '~/api/interface/makeManage';
import axios from '../request';
export class MakeManageAPI {
// 品牌-新增
static addBrandInfo: MakeAddType = (params) => {
return axios.get("uavgoods/brand/addBrandInfo", { params });
return axios.get('uavgoods/brand/addBrandInfo', { params });
};
// 品牌-编辑
static editBrandInfo: MakeEditType = (params) => {
return axios.get("uavgoods/brand/editBrandInfo", { params });
return axios.get('uavgoods/brand/editBrandInfo', { params });
};
// 品牌-列表
static getListBrandInfo: MakeListType = (params) => {
return axios.get("uavgoods/brand/listBrandInfo", { params });
return axios.get('uavgoods/brand/listBrandInfo', { params });
};
// 品牌刪除
static deleteBrandInfo: MakeDeleteType = (params) => {
return axios.get("uavgoods/brand/deleteBrandInfo", { params });
return axios.get('uavgoods/brand/deleteBrandInfo', { params });
};
}
......@@ -24,11 +24,11 @@
}
.ant-table-row:nth-child(odd) {
background: #FCFCFC;
background: #fcfcfc;
}
.ant-table-row:nth-child(odd) > td {
background: #FCFCFC;
background: #fcfcfc;
}
::-webkit-scrollbar {
......
import { useEffect, useState } from "react";
import { RoleAPI } from "@/api";
import { limitEntity } from "@/api/modules/role";
import { useEffect, useState } from 'react';
import { RoleAPI } from '@/api';
import { limitEntity } from '@/api/modules/role';
function useOptionShow(id: number) {
// const [show, setShow] = useState<boolean>(false);
return JSON.parse(localStorage.getItem("routeList") as string)?.some(
(v: limitEntity) => v.id === id
return JSON.parse(localStorage.getItem('routeList') as string)?.some(
(v: limitEntity) => v.id === id,
);
// useEffect(() => {
// RoleAPI.getListCuserMenuInfo().then((res: any) => {
......
import React from "react";
import "./index.scss";
import React from 'react';
import './index.scss';
interface PropsType {
children: React.ReactNode;
}
const Box: React.FC<PropsType> = ({ children }) => {
return <div className="box-wrap">{children}</div>;
return <div className='box-wrap'>{children}</div>;
};
export default Box;
//$page-background: #F6F7FB;
$page-background: #F3F6FF ;
$page-background: #f3f6ff;
.layout-view {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
.layout-bg{
.layout-bg {
background: $page-background;
}
......@@ -47,7 +47,7 @@ $page-background: #F3F6FF ;
.ant-menu-dark {
background: transparent;
}
.ant-layout-sider-children{
.ant-layout-sider-children {
border-radius: 10px;
overflow: hidden;
}
......@@ -76,7 +76,7 @@ $page-background: #F3F6FF ;
background-color: #fff;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
color: #556DA7;
color: #556da7;
}
.sider-collapsed {
......@@ -98,11 +98,11 @@ $page-background: #F3F6FF ;
}
}
:where(.css-dev-only-do-not-override-rvhhh3).ant-menu-light.ant-menu-inline .ant-menu-sub.ant-menu-inline {
:where(.css-dev-only-do-not-override-rvhhh3).ant-menu-light.ant-menu-inline
.ant-menu-sub.ant-menu-inline {
background: none;
}
.layout-logo {
height: 100%;
//width: 170px;
......@@ -162,7 +162,7 @@ $page-background: #F3F6FF ;
.user-name {
font-size: 12px;
font-weight: normal;
color: #556DA7 ;
color: #556da7;
//color: #F6F7FB;
}
}
......@@ -171,7 +171,7 @@ $page-background: #F3F6FF ;
margin-right: 10px;
width: 24px;
height: 24px;
border:1px solid #ffffff;
border: 1px solid #ffffff;
//border:1px solid #1677ff;
border-radius: 2px;
padding: 0;
......
......@@ -11,16 +11,15 @@
.hamburger.is-active {
transform: rotate(180deg) translateY(3px);
}
.effective{
.ant-btn-default{
.effective {
.ant-btn-default {
// display: none;
background-color: #1677ff !important;
&:hover {
background-color: #4893fd !important;
}
}
.ant-btn-primary{
.ant-btn-primary {
display: none;
}
}
......@@ -27,23 +27,26 @@
margin-bottom: 15px;
padding-right: 15px;
div, .ant-btn {
div,
.ant-btn {
margin-right: 10px;
}
div:last-child, .ant-btn:last-child {
div:last-child,
.ant-btn:last-child {
margin-right: 0 !important;
}
.backButton{
.backButton {
position: absolute;
top: 0;
right: 0;
}
}
.search-sufFixBtn{
.search-sufFixBtn {
margin-bottom: 10px;
div, .ant-btn {
div,
.ant-btn {
margin-right: 10px;
}
}
......
import { Form, Input, Button, Select, DatePicker } from "antd";
import moment from "dayjs";
import {
SearchOutlined,
ReloadOutlined,
ExportOutlined,
} from "@ant-design/icons";
import React, { useImperativeHandle } from "react";
import "./index.scss";
import { Form, Input, Button, Select, DatePicker } from 'antd';
import moment from 'dayjs';
import { SearchOutlined, ReloadOutlined, ExportOutlined } from '@ant-design/icons';
import React, { useImperativeHandle } from 'react';
import './index.scss';
const { RangePicker } = DatePicker;
// 搜索列表的类型
export interface searchColumns {
type: "input" | "select" | "rangePicker" | "DatePicker" | "Select";
type: 'input' | 'select' | 'rangePicker' | 'DatePicker' | 'Select';
label?: string;
name: string;
placeholder: string;
......@@ -27,7 +23,7 @@ export interface searchColumns {
onSelect?: (value: any) => void;
disable?: boolean;
onChange?: any;
showTime?: { format: "HH:mm:ss" };
showTime?: { format: 'HH:mm:ss' };
}
// 组件的类型
......@@ -69,18 +65,17 @@ const Index: React.FC<propsType> = (props) => {
const handleSubmit = (data: any) => {
// console.log("提交数据 --->", data);
if (data.startTime) {
data.startTime = moment(data.startTime).format("YYYY-MM-DD");
data.startTime = moment(data.startTime).format('YYYY-MM-DD');
} else {
data.startTime = undefined;
}
Object.keys(data).forEach((k) => {
const isRangPicker: boolean | undefined =
props.search &&
props.search.some((v) => v.name === k && v.type === "rangePicker");
props.search && props.search.some((v) => v.name === k && v.type === 'rangePicker');
if (Array.isArray(data[k]) && isRangPicker) {
data[k] = [
`${moment(data[k][0]).format("YYYY-MM-DD")} 00:00:00`,
`${moment(data[k][1]).format("YYYY-MM-DD")} 23:59:59`,
`${moment(data[k][0]).format('YYYY-MM-DD')} 00:00:00`,
`${moment(data[k][1]).format('YYYY-MM-DD')} 23:59:59`,
];
}
});
......@@ -94,38 +89,34 @@ const Index: React.FC<propsType> = (props) => {
props.exportEvent();
};
return (
<div className="header">
{props?.preFixBtn && (
<div className="search-children">{props?.preFixBtn}</div>
)}
<div className='header'>
{props?.preFixBtn && <div className='search-children'>{props?.preFixBtn}</div>}
<Form
layout="inline"
layout='inline'
form={form}
initialValues={{ layout: "inline" }}
initialValues={{ layout: 'inline' }}
onFinish={handleSubmit}
>
{props?.child && <div className="search-children">{props?.child}</div>}
{props?.children && (
<div className="search-children">{props?.children}</div>
)}
{props?.child && <div className='search-children'>{props?.child}</div>}
{props?.children && <div className='search-children'>{props?.children}</div>}
{props?.search?.map((item: any) => {
return (
<Form.Item
name={item.name}
label={item.label}
key={item.name}
style={{ marginBottom: "10px" }}
style={{ marginBottom: '10px' }}
>
{item.type === "input" ? (
{item.type === 'input' ? (
<Input
placeholder={item.placeholder}
allowClear
style={{ width: item.width ? `${item.width}px` : "150px" }}
style={{ width: item.width ? `${item.width}px` : '150px' }}
maxLength={50}
/>
) : item.type === "select" ? (
) : item.type === 'select' ? (
<Select
style={{ width: item.width ? `${item.width}px` : "200px" }}
style={{ width: item.width ? `${item.width}px` : '200px' }}
placeholder={item.placeholder}
allowClear
>
......@@ -137,14 +128,14 @@ const Index: React.FC<propsType> = (props) => {
);
})}
</Select>
) : item.type === "Select" ? (
) : item.type === 'Select' ? (
<Select
style={{ width: item.width ? `${item.width}px` : "200px" }}
style={{ width: item.width ? `${item.width}px` : '200px' }}
placeholder={item.placeholder}
allowClear
options={item.options}
/>
) : item.type === "rangePicker" ? (
) : item.type === 'rangePicker' ? (
<RangePicker
// showTime={{
// // hideDisabledOptions: true,
......@@ -153,64 +144,48 @@ const Index: React.FC<propsType> = (props) => {
// moment("23:59:59", "HH:mm:ss"),
// ],
// }}
format="YYYY-MM-DD"
style={{ width: item.width ? `${item.width}px` : "220px" }}
format='YYYY-MM-DD'
style={{ width: item.width ? `${item.width}px` : '220px' }}
/>
) : item.type === "DatePicker" ? (
) : item.type === 'DatePicker' ? (
<DatePicker
showTime={item.showTime}
style={{ width: item.width ? `${item.width}px` : "180px" }}
style={{ width: item.width ? `${item.width}px` : '180px' }}
/>
) : (
""
''
)}
</Form.Item>
);
})}
{props?.search && props?.search?.length > 0 && (
<>
<Form.Item style={{ marginBottom: "10px" }}>
<Button
type="primary"
htmlType="submit"
icon={<SearchOutlined />}
>
<Form.Item style={{ marginBottom: '10px' }}>
<Button type='primary' htmlType='submit' icon={<SearchOutlined />}>
搜索
</Button>
</Form.Item>
<Form.Item style={{ marginBottom: "10px" }}>
<Button
type="primary"
onClick={handleRest}
icon={<ReloadOutlined />}
>
<Form.Item style={{ marginBottom: '10px' }}>
<Button type='primary' onClick={handleRest} icon={<ReloadOutlined />}>
重置
</Button>
</Form.Item>
{!!props.otherChild && (
<Form.Item style={{ marginBottom: "10px" }}>
{props.otherChild}
</Form.Item>
<Form.Item style={{ marginBottom: '10px' }}>{props.otherChild}</Form.Item>
)}
</>
)}
{props.isExport ? (
<Form.Item style={{ marginBottom: "10px" }}>
<Button
type="primary"
onClick={exportClick}
icon={<ExportOutlined />}
>
<Form.Item style={{ marginBottom: '10px' }}>
<Button type='primary' onClick={exportClick} icon={<ExportOutlined />}>
导出
</Button>
</Form.Item>
) : (
""
''
)}
</Form>
{!!props?.sufFixBtn && (
<div className="search-sufFixBtn">{props?.sufFixBtn}</div>
)}
{!!props?.sufFixBtn && <div className='search-sufFixBtn'>{props?.sufFixBtn}</div>}
</div>
);
};
......
import React from "react";
import React from 'react';
interface PropsType {
children: React.ReactNode;
......@@ -6,5 +6,5 @@ interface PropsType {
export const TableBox: React.FC<PropsType> = (props) => {
const { children } = props;
return <div className="table-body-box">{children}</div>;
return <div className='table-body-box'>{children}</div>;
};
import { Modal, Table } from "antd";
import { FC } from "react";
import { ColumnsType } from "antd/es/table";
import { PropsType } from "~/common/interface/modal";
import { activityDataType } from "~/api/interface/activityManage";
import { Modal, Table } from 'antd';
import { FC } from 'react';
import { ColumnsType } from 'antd/es/table';
import { PropsType } from '~/common/interface/modal';
import { activityDataType } from '~/api/interface/activityManage';
// 活动数据-类型
type dataType = (ReturnType<activityDataType> extends Promise<infer T>
? T
: never)["result"];
type dataType = (ReturnType<activityDataType> extends Promise<infer T> ? T : never)['result'];
interface selfProps {
activityData: dataType | undefined;
}
const ActivityDataModal: FC<
Pick<PropsType, "isModalVisible" | "handleCancel"> & selfProps
> = ({ isModalVisible, handleCancel, activityData }) => {
const ActivityDataModal: FC<Pick<PropsType, 'isModalVisible' | 'handleCancel'> & selfProps> = ({
isModalVisible,
handleCancel,
activityData,
}) => {
const columns: ColumnsType<dataType> = [
{
title: "参与总人数",
dataIndex: "countFinishParticipate",
align: "center",
title: '参与总人数',
dataIndex: 'countFinishParticipate',
align: 'center',
},
{
title: "参与成功人数",
dataIndex: "countParticipate",
align: "center",
title: '参与成功人数',
dataIndex: 'countParticipate',
align: 'center',
},
];
return (
<Modal
open={isModalVisible}
title="活动数据"
onCancel={() => handleCancel()}
footer={null}
>
<Modal open={isModalVisible} title='活动数据' onCancel={() => handleCancel()} footer={null}>
{activityData && (
<Table
columns={columns}
pagination={false}
dataSource={[activityData]}
bordered
rowKey="countFinishParticipate"
rowKey='countFinishParticipate'
/>
)}
</Modal>
......
body{
background-color:rgb(245,246,250);
position: relative;
.login-warp{
width:100%;
height:100%;
padding-top:calc(((100vh - (576px / 5 * 4)) / 2) - 20px);
body {
background-color: rgb(245, 246, 250);
position: relative;
.login-warp {
width: 100%;
height: 100%;
padding-top: calc(((100vh - (576px / 5 * 4)) / 2) - 20px);
}
.login-view {
margin: 0 auto;
width: calc(1200px / 5 * 4);
height: calc(600px / 5 * 4);
background-image: url(../../../assets/image/login.jpg);
background-size: 100% 100%;
border-radius: 16px;
overflow: hidden;
box-shadow: 0px 20px 30px rgba(112, 158, 254, 0.45);
display: flex;
flex-wrap: wrap;
.login-flex {
flex: 1;
}
.login-view{
margin:0 auto;
width:calc(1200px / 5 * 4);
height:calc(600px / 5 * 4);
background-image:url(../../../assets/image/login.jpg);
background-size:100% 100%;
border-radius:16px;
overflow:hidden;
box-shadow:0px 20px 30px rgba(112,158,254,0.45);
display:flex;
flex-wrap: wrap;
.login-flex{
flex:1;
.login-content {
text-align: center;
color: #000;
.login-title {
margin-top: 158px;
font-size: 24px;
}
.login-text {
margin-top: 26px;
font-size: 20px;
}
.login-detail {
margin-top: 44px;
font-size: 13px;
color: rgba(0, 0, 0, 0.5);
}
}
.login-form {
.login-image {
margin: 62px auto 46px;
width: 84px;
height: 84px;
background-image: url(../../../assets/image/logo.png);
background-size: 100%;
border: 4px #fff solid;
border-radius: 50%;
box-shadow: 3px 3px 30px #dddddd;
}
.login-input {
.ant-form-item {
line-height: 54px;
}
.login-content{
text-align:center;
color: #000;
.login-title{
margin-top: 158px;
font-size: 24px;
}
.login-text{
margin-top: 26px;
font-size: 20px;
}
.login-detail{
margin-top: 44px;
font-size: 13px;
color: rgba(0,0,0,.5);
}
.ant-input-affix-wrapper {
background-color: #fff;
border-radius: 22px;
line-height: 30px;
border: none;
box-shadow: 3px 3px 30px #dddddd;
}
.login-form{
.login-image{
margin: 62px auto 46px;
width: 84px;
height: 84px;
background-image:url(../../../assets/image/logo.png);
background-size:100%;
border: 4px #fff solid;
border-radius:50%;
box-shadow:3px 3px 30px #dddddd;
}
.login-input{
.ant-form-item{
line-height: 54px;
}
.ant-input-affix-wrapper{
background-color:#fff;
border-radius:22px;
line-height: 30px;
border: none;
box-shadow:3px 3px 30px #dddddd;
}
}
.login-password{
margin-bottom:-8px;
}
.login-remember{
margin-bottom: 0;
transform: scale(0.8);
.ant-checkbox-checked .ant-checkbox-inner {
background-color: rgb(102,122,255);
border-color: rgb(102,122,255);
}
}
.login-submit{
width:210px;
font-size:13px;
background:rgb(102,122,255);
border:rgb(102,122,255);
box-shadow:3px 3px 30px #dddddd;
}
}
.login-password {
margin-bottom: -8px;
}
.login-remember {
margin-bottom: 0;
transform: scale(0.8);
.ant-checkbox-checked .ant-checkbox-inner {
background-color: rgb(102, 122, 255);
border-color: rgb(102, 122, 255);
}
}
.login-submit {
width: 210px;
font-size: 13px;
background: rgb(102, 122, 255);
border: rgb(102, 122, 255);
box-shadow: 3px 3px 30px #dddddd;
}
}
}
}
import { FC } from "react";
import { Modal, Descriptions } from "antd";
import { PropsType } from "~/common/interface/modal";
import { couponDetailItemType } from "~/api/interface/couponManage";
import { FC } from 'react';
import { Modal, Descriptions } from 'antd';
import { PropsType } from '~/common/interface/modal';
import { couponDetailItemType } from '~/api/interface/couponManage';
const contentStyle = { width: "100px" };
const contentStyle = { width: '100px' };
const DataModal: FC<
Pick<PropsType, "isModalVisible" | "handleCancel"> & {
Pick<PropsType, 'isModalVisible' | 'handleCancel'> & {
couponDetailItem: couponDetailItemType | undefined;
}
> = ({ isModalVisible, handleCancel, couponDetailItem }) => {
return (
<Modal
open={isModalVisible}
title="查看详情"
title='查看详情'
footer={null}
onCancel={() => handleCancel()}
width={650}
>
<Descriptions bordered size="small">
<Descriptions.Item label="兑换时间" contentStyle={contentStyle}>
<Descriptions bordered size='small'>
<Descriptions.Item label='兑换时间' contentStyle={contentStyle}>
{couponDetailItem?.createTime}
</Descriptions.Item>
<Descriptions.Item label="兑换比例" contentStyle={contentStyle}>
<Descriptions.Item label='兑换比例' contentStyle={contentStyle}>
{couponDetailItem?.conversionRatio}
</Descriptions.Item>
{(couponDetailItem?.gainType === "presented" ||
couponDetailItem?.gainType === "acquire") && (
{(couponDetailItem?.gainType === 'presented' ||
couponDetailItem?.gainType === 'acquire') && (
<>
<Descriptions.Item label="转赠人UID" contentStyle={contentStyle}>
<Descriptions.Item label='转赠人UID' contentStyle={contentStyle}>
{couponDetailItem?.transferorUid}
</Descriptions.Item>
<Descriptions.Item label="获赠人UID" contentStyle={contentStyle}>
<Descriptions.Item label='获赠人UID' contentStyle={contentStyle}>
{couponDetailItem?.receiveUid}
</Descriptions.Item>
<Descriptions.Item label="转赠时间" contentStyle={contentStyle}>
<Descriptions.Item label='转赠时间' contentStyle={contentStyle}>
{couponDetailItem?.transferorTime}
</Descriptions.Item>
<Descriptions.Item label="获赠时间" contentStyle={contentStyle}>
<Descriptions.Item label='获赠时间' contentStyle={contentStyle}>
{couponDetailItem?.createTime}
</Descriptions.Item>
</>
......
import React, { useState } from "react";
import { DatePicker, Form, Input, message, Modal, Radio } from "antd";
import moment from "moment";
import React, { useState } from 'react';
import { DatePicker, Form, Input, message, Modal, Radio } from 'antd';
import moment from 'moment';
// 传参类型
interface propType {
......@@ -30,7 +30,7 @@ export const AddEditModal: React.FC<propType> = (props: propType) => {
form
.validateFields()
.then((values) => {
console.log("handleOk -->", values);
console.log('handleOk -->', values);
})
.catch((err) => {
message
......@@ -41,59 +41,53 @@ export const AddEditModal: React.FC<propType> = (props: propType) => {
});
};
return (
<Modal
open={open}
title={title}
onCancel={handleCancel}
onOk={handleOk}
destroyOnClose
>
<Modal open={open} title={title} onCancel={handleCancel} onOk={handleOk} destroyOnClose>
<Form
name="addForm"
name='addForm'
form={form}
labelAlign="right"
labelAlign='right'
// layout="inline"
>
<Form.Item
label="规则名称"
name="ruleName"
rules={[{ required: true, message: "请输入规则名称" }]}
label='规则名称'
name='ruleName'
rules={[{ required: true, message: '请输入规则名称' }]}
>
<Input placeholder="请输入规则名称" maxLength={20} allowClear />
<Input placeholder='请输入规则名称' maxLength={20} allowClear />
</Form.Item>
<Form.Item label="兑换比例(积分:券额)" required>
<Form.Item label='兑换比例(积分:券额)' required>
<Form.Item
name="year"
rules={[{ required: true, message: "请输入积分比例" }]}
style={{ display: "inline-block", width: "calc(50% - 8px)" }}
name='year'
rules={[{ required: true, message: '请输入积分比例' }]}
style={{ display: 'inline-block', width: 'calc(50% - 8px)' }}
>
<Input placeholder="请输入积分比例" />
<Input placeholder='请输入积分比例' />
</Form.Item>
<Form.Item
name="month"
rules={[{ required: true, message: "请输入券额比例" }]}
name='month'
rules={[{ required: true, message: '请输入券额比例' }]}
style={{
display: "inline-block",
width: "calc(50% - 8px)",
margin: "0 8px",
display: 'inline-block',
width: 'calc(50% - 8px)',
margin: '0 8px',
}}
>
<Input placeholder="请输入券额比例" />
<Input placeholder='请输入券额比例' />
</Form.Item>
</Form.Item>
<div style={{ transform: "translateY(-10px)" }}>
<div style={{ transform: 'translateY(-10px)' }}>
说明:若兑换比例为1:20,则1积分可兑20元VIP优惠券,且为无门槛优惠券
</div>
<Form.Item
label="生效时间"
name="ruleSetting"
rules={[{ required: true, message: "请选择生效时间" }]}
label='生效时间'
name='ruleSetting'
rules={[{ required: true, message: '请选择生效时间' }]}
initialValue={0}
>
<Radio.Group
options={[
{ label: "立即生效", value: 0 },
{ label: "手动设置", value: 1 },
{ label: '立即生效', value: 0 },
{ label: '手动设置', value: 1 },
]}
value={radioValue}
onChange={({ target: { value } }) => {
......@@ -103,16 +97,16 @@ export const AddEditModal: React.FC<propType> = (props: propType) => {
</Form.Item>
{radioValue === 1 && (
<Form.Item
label="手动设置"
name="ruleTime"
rules={[{ required: radioValue === 1, message: "请设置生效时间" }]}
label='手动设置'
name='ruleTime'
rules={[{ required: radioValue === 1, message: '请设置生效时间' }]}
>
<DatePicker
placeholder="请输入账号有效期"
placeholder='请输入账号有效期'
allowClear
showTime={{ format: "HH:mm:ss" }}
format="YYYY-MM-DD HH:mm:ss"
style={{ width: "100%" }}
showTime={{ format: 'HH:mm:ss' }}
format='YYYY-MM-DD HH:mm:ss'
style={{ width: '100%' }}
disabledDate={(current) => {
// 限制时间不可早于当日
return current && current <= moment();
......
import React, { useEffect, useState } from "react";
import { Descriptions, message, Modal } from "antd";
import { CouponManageAPI } from "~/api";
import { CouponGetDataType } from "~/api/interface/couponManage";
import React, { useEffect, useState } from 'react';
import { Descriptions, message, Modal } from 'antd';
import { CouponManageAPI } from '~/api';
import { CouponGetDataType } from '~/api/interface/couponManage';
// 传参类型
interface propType {
......@@ -12,11 +12,9 @@ interface propType {
}
// 列表的类型
type DetailType = (ReturnType<CouponGetDataType> extends Promise<infer T>
? T
: never)["result"];
type DetailType = (ReturnType<CouponGetDataType> extends Promise<infer T> ? T : never)['result'];
const contentStyle = { width: "100px" };
const contentStyle = { width: '100px' };
export const DataModal: React.FC<propType> = (props: propType) => {
// 组件默认值
......@@ -36,7 +34,7 @@ export const DataModal: React.FC<propType> = (props: propType) => {
const res = await CouponManageAPI.CouponGetData({
id: data.id,
});
if (res && res.code === "200") {
if (res && res.code === '200') {
setCouponDetail(res.result);
}
};
......@@ -54,23 +52,23 @@ export const DataModal: React.FC<propType> = (props: propType) => {
destroyOnClose
width={650}
>
<Descriptions column={3} bordered size="small">
<Descriptions.Item contentStyle={contentStyle} label="总发行量">
<Descriptions column={3} bordered size='small'>
<Descriptions.Item contentStyle={contentStyle} label='总发行量'>
{couponDetail?.couponTotal}
</Descriptions.Item>
<Descriptions.Item contentStyle={contentStyle} label="领取量">
<Descriptions.Item contentStyle={contentStyle} label='领取量'>
{couponDetail?.receiveQuantity}
</Descriptions.Item>
<Descriptions.Item contentStyle={contentStyle} label="领取率">
<Descriptions.Item contentStyle={contentStyle} label='领取率'>
{couponDetail?.claimRate}
</Descriptions.Item>
<Descriptions.Item contentStyle={contentStyle} label="使用量">
<Descriptions.Item contentStyle={contentStyle} label='使用量'>
{couponDetail?.usageAmount}
</Descriptions.Item>
<Descriptions.Item contentStyle={contentStyle} label="有效使用量">
<Descriptions.Item contentStyle={contentStyle} label='有效使用量'>
{couponDetail?.accountPaid}
</Descriptions.Item>
<Descriptions.Item contentStyle={contentStyle} label="有效使用率">
<Descriptions.Item contentStyle={contentStyle} label='有效使用率'>
{couponDetail?.availability}
</Descriptions.Item>
</Descriptions>
......
import React, { useEffect } from "react";
import { Form, Input, message, Modal } from "antd";
import { maxLength } from "~/utils/validateUtils";
import { CouponManageAPI } from "~/api";
import React, { useEffect } from 'react';
import { Form, Input, message, Modal } from 'antd';
import { maxLength } from '~/utils/validateUtils';
import { CouponManageAPI } from '~/api';
// 传参类型
interface propType {
......@@ -59,8 +59,8 @@ export const IncreaseModal: React.FC<propType> = (props: propType) => {
id: data.id,
count: Number(values.count),
});
if (res && res.code === "200") {
message.success("操作成功").then();
if (res && res.code === '200') {
message.success('操作成功').then();
handleCancel();
}
};
......@@ -82,31 +82,25 @@ export const IncreaseModal: React.FC<propType> = (props: propType) => {
width={400}
>
<Form
name="addForm"
name='addForm'
form={form}
labelAlign="right"
labelAlign='right'
labelCol={{ span: 8 }}
// layout="inline"
>
<Form.Item label="当前发行总量" name="lastTotal">
<Input
placeholder="请输入当前发行总量"
maxLength={20}
allowClear
disabled
suffix="张"
/>
<Form.Item label='当前发行总量' name='lastTotal'>
<Input placeholder='请输入当前发行总量' maxLength={20} allowClear disabled suffix='张' />
</Form.Item>
<Form.Item
label="新增发行量"
name="count"
label='新增发行量'
name='count'
rules={[
{ required: true, message: "请输入新增发行量" },
{ required: true, message: '请输入新增发行量' },
// 增发合计不能超过100000
{
validator: (rule, value) => {
if (Number(data.lastTotal) + Number(value) > 100000) {
return Promise.reject("增发合计不能超过100000");
return Promise.reject('增发合计不能超过100000');
}
return Promise.resolve();
},
......@@ -114,23 +108,23 @@ export const IncreaseModal: React.FC<propType> = (props: propType) => {
]}
>
<Input
placeholder="请输入新增发行量"
placeholder='请输入新增发行量'
maxLength={20}
allowClear
prefix="+"
suffix="张"
type="number"
prefix='+'
suffix='张'
type='number'
onChange={handleIncrease}
onInput={maxLength}
/>
</Form.Item>
<Form.Item label="更新后总发行量" name="lastTotalBefore">
<Form.Item label='更新后总发行量' name='lastTotalBefore'>
<Input
placeholder="请输入更新后总发行量"
placeholder='请输入更新后总发行量'
maxLength={20}
allowClear
disabled
suffix="张"
suffix='张'
/>
</Form.Item>
</Form>
......
import { FC, forwardRef, useImperativeHandle } from "react";
import "./index.scss";
import { Form, Input } from "antd";
import { baseInfoType } from "~/api/interface/couponManage";
import { FC, forwardRef, useImperativeHandle } from 'react';
import './index.scss';
import { Form, Input } from 'antd';
import { baseInfoType } from '~/api/interface/couponManage';
interface selfPops {
ref: any;
......@@ -16,9 +16,9 @@ const BaseInfo: FC<selfPops> = forwardRef(({ isDetail }, ref) => {
}));
return (
<div className="split-coupon-base-info">
<div className="title">基本信息</div>
<div className="base-info-form">
<div className='split-coupon-base-info'>
<div className='title'>基本信息</div>
<div className='base-info-form'>
<Form
labelCol={{ span: 2 }}
wrapperCol={{ span: 5 }}
......@@ -26,11 +26,11 @@ const BaseInfo: FC<selfPops> = forwardRef(({ isDetail }, ref) => {
disabled={isDetail}
>
<Form.Item
label="优惠券名称"
name="couponName"
rules={[{ required: true, message: "请输入优惠券名称" }]}
label='优惠券名称'
name='couponName'
rules={[{ required: true, message: '请输入优惠券名称' }]}
>
<Input placeholder="请输入优惠券名称" maxLength={10} />
<Input placeholder='请输入优惠券名称' maxLength={10} />
</Form.Item>
</Form>
</div>
......
.add-or-edit-or-detail-wrap{
.add-or-edit-or-detail-wrap {
min-width: 1200px;
height: 100%;
position: relative;
.add-or-edit-or-detail{
.add-or-edit-or-detail {
height: calc(100% - 50px);
overflow-y: auto;
.split-coupon-base-info,.share-coupon-info,.shared-coupon-info{
padding: 10px;
.split-coupon-base-info,
.share-coupon-info,
.shared-coupon-info {
padding: 10px;
background-color: #fff;
margin-bottom: 20px;
.title{
.title {
font-size: 20px;
font-weight: bold;
color: #000;
margin-bottom: 10px;
}
}
.ant-form-item{
.ant-form-item {
margin-bottom: 10px;
}
}
.footer-operate{
.footer-operate {
position: absolute;
bottom: -15px;
left: -10px;
height: 80px;
width: calc(100% + 20px) ;
width: calc(100% + 20px);
background-color: #fff;
box-shadow: 0 -1px 2px 0 rgba(0,0,0,0.1);
box-shadow: 0 -1px 2px 0 rgba(0, 0, 0, 0.1);
display: flex;
align-items: center;
justify-content: center;
button{
button {
width: 100px;
}
button:first-child{
button:first-child {
margin-right: 150px;
}
}
}
import { FC, useEffect, useRef, useState } from "react";
import "./index.scss";
import { Button, message } from "antd";
import { useNavigate } from "react-router-dom";
import dayJs from "dayjs";
import qs from "query-string";
import BaseInfo from "./components/baseInfo";
import ShareCouponInfo from "./components/shareCouponInfo";
import SharedCouponInfo from "./components/sharedCouponInfo";
import { MakeManageAPI } from "~/api/modules/makeManage";
import { MakeItemEntity } from "~/api/interface/makeManage";
import { CouponManageAPI } from "~/api";
import { FC, useEffect, useRef, useState } from 'react';
import './index.scss';
import { Button, message } from 'antd';
import { useNavigate } from 'react-router-dom';
import dayJs from 'dayjs';
import qs from 'query-string';
import BaseInfo from './components/baseInfo';
import ShareCouponInfo from './components/shareCouponInfo';
import SharedCouponInfo from './components/sharedCouponInfo';
import { MakeManageAPI } from '~/api/modules/makeManage';
import { MakeItemEntity } from '~/api/interface/makeManage';
import { CouponManageAPI } from '~/api';
const SplitCouponOperate: FC<any> = (props) => {
const history = useNavigate();
......@@ -21,13 +21,11 @@ const SplitCouponOperate: FC<any> = (props) => {
const [makeList, setMakeList] = useState<MakeItemEntity[]>([]);
// 品牌-列表
const getMakeList = () => {
MakeManageAPI.getListBrandInfo({ pageNo: 1, pageSize: 999999 }).then(
({ result }) => {
setMakeList(result.list || []);
}
);
MakeManageAPI.getListBrandInfo({ pageNo: 1, pageSize: 999999 }).then(({ result }) => {
setMakeList(result.list || []);
});
};
const [splitCouponId, setSplitCouponId] = useState<string>("");
const [splitCouponId, setSplitCouponId] = useState<string>('');
// 详情
const getSplitCouponDetail = (couponId: string) => {
CouponManageAPI.getPageActivityList({
......@@ -37,22 +35,15 @@ const SplitCouponOperate: FC<any> = (props) => {
useType: 2,
}).then(({ result }) => {
if (result.list[0]) {
(shareCouponRef.current as any).setCouponType(
result.list[0].couponType
);
(shareCouponRef.current as any).setCouponType(result.list[0].couponType);
const { beSharedCoupon } = result.list[0];
(sharedCouponRef.current as any).setCouponType(
beSharedCoupon.couponType
);
(sharedCouponRef.current as any).setCouponType(beSharedCoupon.couponType);
(baseInfoRef.current as any).getForm().setFieldsValue({
couponName: result.list[0].couponName,
});
(shareCouponRef.current as any).getForm().setFieldsValue({
primaryKey: (result.list[0].primaryKey as any).split(",").map(Number),
time: [
dayJs(result.list[0].useStartTime),
dayJs(result.list[0].useEndTime),
],
primaryKey: (result.list[0].primaryKey as any).split(',').map(Number),
time: [dayJs(result.list[0].useStartTime), dayJs(result.list[0].useEndTime)],
couponMoney: result.list[0].couponMoney,
couponType: result.list[0].couponType,
minPrice: result.list[0].minPrice || undefined,
......@@ -64,9 +55,7 @@ const SplitCouponOperate: FC<any> = (props) => {
userTag: beSharedCoupon.userTag || undefined,
});
(sharedCouponRef.current as any).getForm().setFieldsValue({
beSharedPrimaryKey: (beSharedCoupon.primaryKey as any)
.split(",")
.map(Number),
beSharedPrimaryKey: (beSharedCoupon.primaryKey as any).split(',').map(Number),
beSharedCouponMoney: beSharedCoupon.couponMoney,
beSharedCouponType: beSharedCoupon.couponType,
beSharedMinPrice: beSharedCoupon.minPrice || undefined,
......@@ -87,22 +76,18 @@ const SplitCouponOperate: FC<any> = (props) => {
getSharedCouponForm().validateFields(),
])
.then((values) => {
values[1].useStartTime = `${dayJs(values[1].time[0]).format(
"YYYY-MM-DD"
)} 00:00:00`;
values[1].useEndTime = `${dayJs(values[1].time[1]).format(
"YYYY-MM-DD"
)} 23:59:59`;
values[1].primaryKey = values[1].primaryKey.join(",");
values[2].beSharedPrimaryKey = values[2].beSharedPrimaryKey.join(",");
values[1].useStartTime = `${dayJs(values[1].time[0]).format('YYYY-MM-DD')} 00:00:00`;
values[1].useEndTime = `${dayJs(values[1].time[1]).format('YYYY-MM-DD')} 23:59:59`;
values[1].primaryKey = values[1].primaryKey.join(',');
values[2].beSharedPrimaryKey = values[2].beSharedPrimaryKey.join(',');
delete values[1].time;
CouponManageAPI.saveActivity({
...values[0],
...values[1],
...values[2],
}).then(({ code, message: msg }) => {
if (code === "200") {
message.success("新增成功");
if (code === '200') {
message.success('新增成功');
getBaseInfoForm().resetFields();
getShareCouponForm().resetFields();
getSharedCouponForm().resetFields();
......@@ -124,7 +109,7 @@ const SplitCouponOperate: FC<any> = (props) => {
useEffect(() => {
getMakeList();
if (props.location) {
const { id: splitCouponId }: any = qs.parse(props.location.search);
const { id: splitCouponId }: any = qs.parse(props.location.search);
setSplitCouponId(splitCouponId);
if (splitCouponId) {
getSplitCouponDetail(splitCouponId);
......@@ -133,16 +118,12 @@ const SplitCouponOperate: FC<any> = (props) => {
}, []);
return (
<div className="add-or-edit-or-detail-wrap">
<div className="add-or-edit-or-detail">
<div className='add-or-edit-or-detail-wrap'>
<div className='add-or-edit-or-detail'>
{/* 基本信息 */}
<BaseInfo ref={baseInfoRef} isDetail={!!splitCouponId} />
{/* 分享者优惠券 */}
<ShareCouponInfo
ref={shareCouponRef}
makeList={makeList}
isDetail={!!splitCouponId}
/>
<ShareCouponInfo ref={shareCouponRef} makeList={makeList} isDetail={!!splitCouponId} />
{/* 被分享者优惠券 */}
<SharedCouponInfo
ref={sharedCouponRef}
......@@ -151,10 +132,10 @@ const SplitCouponOperate: FC<any> = (props) => {
isDetail={!!splitCouponId}
/>
</div>
<div className="footer-operate">
<div className='footer-operate'>
<Button onClick={backRoute}>返回</Button>
{!splitCouponId && (
<Button type="primary" onClick={addSplitCouponSubmit}>
<Button type='primary' onClick={addSplitCouponSubmit}>
确定
</Button>
)}
......
.split-coupon-list{
.ant-table-thead > tr > th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan])::before{
.split-coupon-list {
.ant-table-thead
> tr
> th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not(
[colspan]
)::before {
width: 0;
}
.ant-table-tbody > tr{
.ant-table-tbody > tr {
border-bottom: 1px solid #999;
}
}
import React from 'react';
import { Image } from 'antd';
function DetailDelivery() {
return (
<div className={'detail-delivery detail-half'}>
<div className={'detail-title'}>收货信息</div>
<div className={'detail-text'}>收货人:测试</div>
<div className={'detail-text'}>手机号:15889328503</div>
<div className={'detail-text'}>
收货地址:广东省深圳市南山区仙鼓路(南山区万科云城(仙鼓路西50米))
</div>
<div className={'detail-title'}>物流信息</div>
<div className={'detail-text'}>物流单号:YT6732436785799</div>
<div className={'detail-text'}>物流进度:--</div>
<div className={'detail-title'}>验收信息</div>
<div className={'detail-text'}>验收状态:已验收</div>
<div className={'detail-text'}>验收凭证:</div>
<div className={'detail-image'}>
{[
'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/infrastructure-05-05.png',
'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/infrastructure-05-05.png',
].map((i, j) => (
<Image key={j} className={'image'} src={i} alt='付款凭证' />
))}
</div>
</div>
);
}
export default DetailDelivery;
import { useState } from 'react';
import { Table } from 'antd';
import { ColumnsType } from 'antd/es/table';
// 表格数据类型
type TableType = any;
function DetailInformation() {
// 表格数据
const [tableData] = useState<TableType>([{ id: 1 }]);
// 表格结构
const columns: ColumnsType<TableType[0]> = [
{
title: '商品',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '单价(元)',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '数量',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '订单状态',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '实收款',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
];
return (
<div className={'detail-information'}>
<div className={'detail-title'}>订单明细</div>
<div className={'detail-text'}>
<span className={'item'}>订单编号:UD202302181041156087</span>
<span className={'item'}>创建时间:2023-02-18 10:41:16</span>
<span className={'item'}>合同编号:UAV202334741131</span>
</div>
<Table
style={{ margin: '20px auto', width: '90%' }}
size='small'
dataSource={tableData}
columns={columns}
rowKey='id'
bordered
pagination={false}
// rowSelection={{ selectedRowKeys, onChange: onSelectChange }}
/>
</div>
);
}
export default DetailInformation;
import React from 'react';
import { Button, Image } from 'antd';
function DetailPurchaser() {
return (
<div className={'detail-purchaser detail-half'}>
<div className={'detail-title'}>买家信息</div>
<div className={'detail-text'}>UID: UID4460817</div>
<div className={'detail-text'}>企业: 浙江科比特创新科技有限公司</div>
<div className={'detail-text'}>备注: 测试单,不用管</div>
<div className={'detail-title'}>合同信息</div>
<div className={'detail-text'}>合同编号: UAV202334741131</div>
<div className={'detail-text'}>合同状态: 已归档</div>
<div className={'detail-text'}>
合同操作:
<Button type={'link'}>平台签署</Button>
<Button type={'link'}>查看</Button>
<Button type={'link'}>下载</Button>
</div>
<div className={'detail-title'}>付款凭证</div>
<div className={'detail-text'}>预付款:</div>
<div className={'detail-image'}>
{[
'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/infrastructure-05-05.png',
'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/infrastructure-05-05.png',
].map((i, j) => (
<Image key={j} className={'image'} src={i} alt='付款凭证' />
))}
</div>
<div className={'detail-text'}>尾款:</div>
<div className={'detail-image'}>
{[
'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/infrastructure-05-05.png',
'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/infrastructure-05-05.png',
].map((i, j) => (
<Image key={j} className={'image'} src={i} alt='付款凭证' />
))}
</div>
<div className={'detail-text'}>全款:</div>
<div className={'detail-image'}>
{[
'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/infrastructure-05-05.png',
'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/infrastructure-05-05.png',
].map((i, j) => (
<Image key={j} className={'image'} src={i} alt='付款凭证' />
))}
</div>
</div>
);
}
export default DetailPurchaser;
.order-detail {
position: relative;
box-sizing: border-box;
.order-head {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
.head-text {
font-size: 13px;
font-weight: 600;
color: #000000;
div {
margin-bottom: 10px;
span {
margin-right: 20px;
}
}
}
}
.detail-wrap {
position: relative;
width: 100%;
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
margin-top: 15px;
padding-bottom: 100px;
.detail-information {
margin-top: 10px;
width: 100%;
}
.detail-half {
width: 50%;
}
.detail-title {
font-size: 13px;
font-weight: 600;
color: #000000;
margin-bottom: 15px;
margin-top: 20px;
}
.detail-title:first-child {
margin-top: 0;
}
.detail-text {
margin-bottom: 10px;
.item {
margin-right: 20px;
}
}
.detail-image {
display: flex;
justify-content: flex-start;
margin-left: 56px;
margin-top: -20px;
margin-bottom: 10px;
.image {
width: 68px;
height: 68px;
//margin-right: 10px;
}
.ant-image {
margin-right: 10px;
}
}
}
}
import { useEffect } from 'react';
import { useNavigate, useSearchParams } from 'react-router-dom';
import { Button } from 'antd';
import './index.scss';
import DetailDelivery from '~/pages/orderManage/productOrder/comp/detailDelivery';
import DetailPurchaser from '~/pages/orderManage/productOrder/comp/detailPurchaser';
import DetailInformation from '~/pages/orderManage/productOrder/comp/detailInformation';
function EquipmentOrderDetail() {
// 路由钩子
const navigate = useNavigate();
// 参数钩子
const [searchParams] = useSearchParams();
// 接收到的参数
const id = searchParams.get('id');
// 返回上一页
const handleBack = () => {
navigate(-1);
};
// componentDidMount
useEffect(() => {
console.log('拿到的id是 --->', id);
}, [id]);
return (
<div className={'order-detail'}>
<div className={'order-head'}>
<div className='head-text'>
<div>
<span>订单编号:R2023051916330461</span>
<span>合同编号:UAV202334741131</span>
</div>
<div>
<span>当前状态:交易完成</span>
<span>创建时间:2023-02-18 10:41:16</span>
</div>
</div>
<Button type={'primary'} onClick={() => handleBack()}>
返回
</Button>
</div>
<div className={'detail-wrap'}>
<DetailPurchaser />
<DetailDelivery />
<DetailInformation />
</div>
</div>
);
}
export default EquipmentOrderDetail;
import React from 'react';
import { useState } from 'react';
import SearchBox from '~/components/search-box';
import { Button, Table } from 'antd';
import { ColumnsType } from 'antd/es/table';
import { useNavigate } from 'react-router-dom';
import qs from 'query-string';
// 表格数据类型
type TableType = any;
// 订单状态搜索列表
const statusCodeButtonList = [
{ value: -1, label: '全部订单' },
{ value: 0, label: '沟通意向' },
{ value: 1, label: '签约付款' },
{ value: 2, label: '待发货' },
{ value: 3, label: '待收货' },
{ value: 4, label: '已完成' },
{ value: 5, label: '已关闭' },
];
function EquipmentOrderView() {
return <div>EquipmentOrderView</div>;
// 路由钩子
const navigate = useNavigate();
// 当前选择的是第几个按钮
const [statusCodeButtonIndex, setStatusCodeButtonIndex] = useState<number>(0);
// 表格分页配置
const [pagination] = useState({
total: 0,
pageSize: 10,
current: 1,
totalPage: 0,
});
// 表格数据
const [tableData] = useState<TableType>([{ id: 1 }]);
// 订单状态筛选
const statusChangeEvent = (i: number) => {
console.log('订单状态筛选 --->', i);
setStatusCodeButtonIndex(i);
};
// 跳转订单详情
const handleDetail = (record: TableType[0]) => {
console.log('跳转订单详情 --->', record.id);
navigate(`/orderManage/equipmentOrder/detail?${qs.stringify({ id: record.id })}`);
};
// 表格结构
const columns: ColumnsType<TableType[0]> = [
{
title: '商品',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '单价(元)',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '数量',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '买家',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '订单状态',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '实收款',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '相关运营',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '推荐人',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '订单交期',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '备注',
dataIndex: 'remark',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
fixed: 'right',
render: (_text, record) => (
<>
<Button type={'link'} onClick={() => handleDetail(record)}>
详情
</Button>
</>
),
},
];
return (
<>
<SearchBox
search={[
{
label: '订单编号',
name: 'keyword',
type: 'input',
placeholder: '请输入订单编号',
},
{
label: '买家账号',
name: 'keyword2',
type: 'input',
placeholder: '请输入用户账号',
},
{
label: '相关销售',
name: 'saleId',
type: 'Select',
placeholder: '请选择相关销售',
options: [],
},
{
label: '时间',
name: 'time',
type: 'rangePicker',
placeholder: '请选择创建时间',
},
]}
searchData={(e: any) => console.log('提交数据 --->', e)}
sufFixBtn={
<>
{statusCodeButtonList?.map((i, j) => {
return (
<Button
key={j}
type={j === statusCodeButtonIndex ? 'primary' : 'default'}
onClick={() => statusChangeEvent(j)}
style={{ marginTop: '5px' }}
>
{i.label}
</Button>
);
})}
</>
}
/>
<Table
size='small'
dataSource={tableData}
columns={columns}
rowKey='id'
scroll={{ x: 1200 }}
pagination={{
total: pagination.total,
pageSize: pagination.pageSize,
current: pagination.current,
showSizeChanger: true,
showQuickJumper: true,
// onChange: (page: number, pageSize: number) =>
// paginationChange(page, pageSize),
showTotal: (total, range) => `当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`,
}}
// rowSelection={{ selectedRowKeys, onChange: onSelectChange }}
/>
</>
);
}
export default EquipmentOrderView;
import React from 'react';
import { Image } from 'antd';
function DetailDelivery() {
return (
<div className={'detail-delivery detail-half'}>
<div className={'detail-title'}>收货信息</div>
<div className={'detail-text'}>收货人:测试</div>
<div className={'detail-text'}>手机号:15889328503</div>
<div className={'detail-text'}>
收货地址:广东省深圳市南山区仙鼓路(南山区万科云城(仙鼓路西50米))
</div>
<div className={'detail-title'}>物流信息</div>
<div className={'detail-text'}>物流单号:YT6732436785799</div>
<div className={'detail-text'}>物流进度:--</div>
<div className={'detail-title'}>验收信息</div>
<div className={'detail-text'}>验收状态:已验收</div>
<div className={'detail-text'}>验收凭证:</div>
<div className={'detail-image'}>
{[
'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/infrastructure-05-05.png',
'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/infrastructure-05-05.png',
].map((i, j) => (
<Image key={j} className={'image'} src={i} alt='付款凭证' />
))}
</div>
</div>
);
}
export default DetailDelivery;
import { useState } from 'react';
import { Table } from 'antd';
import { ColumnsType } from 'antd/es/table';
// 表格数据类型
type TableType = any;
function DetailInformation() {
// 表格数据
const [tableData] = useState<TableType>([{ id: 1 }]);
// 表格结构
const columns: ColumnsType<TableType[0]> = [
{
title: '商品',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '单价(元)',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '数量',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '订单状态',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '实收款',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
];
return (
<div className={'detail-information'}>
<div className={'detail-title'}>订单明细</div>
<div className={'detail-text'}>
<span className={'item'}>订单编号:UD202302181041156087</span>
<span className={'item'}>创建时间:2023-02-18 10:41:16</span>
<span className={'item'}>合同编号:UAV202334741131</span>
</div>
<Table
style={{ margin: '20px auto', width: '90%' }}
size='small'
dataSource={tableData}
columns={columns}
rowKey='id'
bordered
pagination={false}
// rowSelection={{ selectedRowKeys, onChange: onSelectChange }}
/>
</div>
);
}
export default DetailInformation;
import React from 'react';
import { Button, Image } from 'antd';
function DetailPurchaser() {
return (
<div className={'detail-purchaser detail-half'}>
<div className={'detail-title'}>买家信息</div>
<div className={'detail-text'}>UID: UID4460817</div>
<div className={'detail-text'}>企业: 浙江科比特创新科技有限公司</div>
<div className={'detail-text'}>备注: 测试单,不用管</div>
<div className={'detail-title'}>合同信息</div>
<div className={'detail-text'}>合同编号: UAV202334741131</div>
<div className={'detail-text'}>合同状态: 已归档</div>
<div className={'detail-text'}>
合同操作:
<Button type={'link'}>平台签署</Button>
<Button type={'link'}>查看</Button>
<Button type={'link'}>下载</Button>
</div>
<div className={'detail-title'}>付款凭证</div>
<div className={'detail-text'}>预付款:</div>
<div className={'detail-image'}>
{[
'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/infrastructure-05-05.png',
'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/infrastructure-05-05.png',
].map((i, j) => (
<Image key={j} className={'image'} src={i} alt='付款凭证' />
))}
</div>
<div className={'detail-text'}>尾款:</div>
<div className={'detail-image'}>
{[
'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/infrastructure-05-05.png',
'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/infrastructure-05-05.png',
].map((i, j) => (
<Image key={j} className={'image'} src={i} alt='付款凭证' />
))}
</div>
<div className={'detail-text'}>全款:</div>
<div className={'detail-image'}>
{[
'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/infrastructure-05-05.png',
'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/infrastructure-05-05.png',
].map((i, j) => (
<Image key={j} className={'image'} src={i} alt='付款凭证' />
))}
</div>
</div>
);
}
export default DetailPurchaser;
.order-detail {
position: relative;
box-sizing: border-box;
.order-head {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
.head-text {
font-size: 13px;
font-weight: 600;
color: #000000;
div {
margin-bottom: 10px;
span {
margin-right: 20px;
}
}
}
}
.detail-wrap {
position: relative;
width: 100%;
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
margin-top: 15px;
padding-bottom: 100px;
.detail-information {
margin-top: 10px;
width: 100%;
}
.detail-half {
width: 50%;
}
.detail-title {
font-size: 13px;
font-weight: 600;
color: #000000;
margin-bottom: 15px;
margin-top: 20px;
}
.detail-title:first-child {
margin-top: 0;
}
.detail-text {
margin-bottom: 10px;
.item {
margin-right: 20px;
}
}
.detail-image {
display: flex;
justify-content: flex-start;
margin-left: 56px;
margin-top: -20px;
margin-bottom: 10px;
.image {
width: 68px;
height: 68px;
//margin-right: 10px;
}
.ant-image {
margin-right: 10px;
}
}
}
}
import { useEffect } from 'react';
import { useNavigate, useSearchParams } from 'react-router-dom';
import { Button } from 'antd';
import './index.scss';
import DetailDelivery from '~/pages/orderManage/serviceOrder/comp/detailDelivery';
import DetailPurchaser from '~/pages/orderManage/serviceOrder/comp/detailPurchaser';
import DetailInformation from '~/pages/orderManage/serviceOrder/comp/detailInformation';
function ServiceOrderDetail() {
// 路由钩子
const navigate = useNavigate();
// 参数钩子
const [searchParams] = useSearchParams();
// 接收到的参数
const id = searchParams.get('id');
// 返回上一页
const handleBack = () => {
navigate(-1);
};
// componentDidMount
useEffect(() => {
console.log('拿到的id是 --->', id);
}, [id]);
return (
<div className={'order-detail'}>
<div className={'order-head'}>
<div className='head-text'>
<div>
<span>订单编号:R2023051916330461</span>
<span>合同编号:UAV202334741131</span>
</div>
<div>
<span>当前状态:交易完成</span>
<span>创建时间:2023-02-18 10:41:16</span>
</div>
</div>
<Button type={'primary'} onClick={() => handleBack()}>
返回
</Button>
</div>
<div className={'detail-wrap'}>
<DetailPurchaser />
<DetailDelivery />
<DetailInformation />
</div>
</div>
);
}
export default ServiceOrderDetail;
import React from 'react';
import { useState } from 'react';
import SearchBox from '~/components/search-box';
import { Button, Table } from 'antd';
import { ColumnsType } from 'antd/es/table';
import { useNavigate } from 'react-router-dom';
import qs from 'query-string';
// 表格数据类型
type TableType = any;
// 订单状态搜索列表
const statusCodeButtonList = [
{ value: -1, label: '全部订单' },
{ value: 0, label: '沟通意向' },
{ value: 1, label: '签约付款' },
{ value: 2, label: '待发货' },
{ value: 3, label: '待收货' },
{ value: 4, label: '已完成' },
{ value: 5, label: '已关闭' },
];
function ServiceOrderView() {
return <div>ServiceOrderView</div>;
// 路由钩子
const navigate = useNavigate();
// 当前选择的是第几个按钮
const [statusCodeButtonIndex, setStatusCodeButtonIndex] = useState<number>(0);
// 表格分页配置
const [pagination] = useState({
total: 0,
pageSize: 10,
current: 1,
totalPage: 0,
});
// 表格数据
const [tableData] = useState<TableType>([{ id: 1 }]);
// 订单状态筛选
const statusChangeEvent = (i: number) => {
console.log('订单状态筛选 --->', i);
setStatusCodeButtonIndex(i);
};
// 跳转订单详情
const handleDetail = (record: TableType[0]) => {
console.log('跳转订单详情 --->', record.id);
navigate(`/orderManage/serviceOrder/detail?${qs.stringify({ id: record.id })}`);
};
// 表格结构
const columns: ColumnsType<TableType[0]> = [
{
title: '商品',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '单价(元)',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '数量',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '买家',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '订单状态',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '实收款',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '相关运营',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '推荐人',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '订单交期',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '备注',
dataIndex: 'remark',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
fixed: 'right',
render: (_text, record) => (
<>
<Button type={'link'} onClick={() => handleDetail(record)}>
详情
</Button>
</>
),
},
];
return (
<>
<SearchBox
search={[
{
label: '订单编号',
name: 'keyword',
type: 'input',
placeholder: '请输入订单编号',
},
{
label: '买家账号',
name: 'keyword2',
type: 'input',
placeholder: '请输入用户账号',
},
{
label: '相关销售',
name: 'saleId',
type: 'Select',
placeholder: '请选择相关销售',
options: [],
},
{
label: '时间',
name: 'time',
type: 'rangePicker',
placeholder: '请选择创建时间',
},
]}
searchData={(e: any) => console.log('提交数据 --->', e)}
sufFixBtn={
<>
{statusCodeButtonList?.map((i, j) => {
return (
<Button
key={j}
type={j === statusCodeButtonIndex ? 'primary' : 'default'}
onClick={() => statusChangeEvent(j)}
style={{ marginTop: '5px' }}
>
{i.label}
</Button>
);
})}
</>
}
/>
<Table
size='small'
dataSource={tableData}
columns={columns}
rowKey='id'
scroll={{ x: 1200 }}
pagination={{
total: pagination.total,
pageSize: pagination.pageSize,
current: pagination.current,
showSizeChanger: true,
showQuickJumper: true,
// onChange: (page: number, pageSize: number) =>
// paginationChange(page, pageSize),
showTotal: (total, range) => `当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`,
}}
// rowSelection={{ selectedRowKeys, onChange: onSelectChange }}
/>
</>
);
}
export default ServiceOrderView;
import { Form, Input, message, Modal, Radio, Select } from "antd";
import React, { useEffect, useState } from "react";
import { debounce } from "lodash";
import { PointManageAPI } from "@/api";
import { Form, Input, message, Modal, Radio, Select } from 'antd';
import React, { useEffect, useState } from 'react';
import { debounce } from 'lodash';
import { PointManageAPI } from '@/api';
// 传参类型
interface propType {
......@@ -60,7 +60,7 @@ const DivideAddEditModal: React.FC<propType> = (props: propType) => {
pageSize: pagination.pageSize,
...value,
});
if (res && res.code === "200") {
if (res && res.code === '200') {
const { list, pageNo, totalCount, pageSize, totalPage } = res.result; // 解构
const arr = list?.map((i) => ({
value: i.id,
......@@ -111,17 +111,16 @@ const DivideAddEditModal: React.FC<propType> = (props: propType) => {
...values,
orderId: orderData.orderId,
orderNO: orderData.orderNo,
uid: mallUserList.find((i) => i.value === values.mallUserId)?.uid || "",
userName:
mallUserList.find((i) => i.value === values.mallUserId)?.userName || "",
uid: mallUserList.find((i) => i.value === values.mallUserId)?.uid || '',
userName: mallUserList.find((i) => i.value === values.mallUserId)?.userName || '',
ruleType: 1,
});
if (res && res.code === "200") {
if (res && res.code === '200') {
push({
...data,
...res?.result,
});
message.success(data?.id ? "修改成功" : "添加成功").then();
message.success(data?.id ? '修改成功' : '添加成功').then();
handleCancel();
}
};
......@@ -139,37 +138,31 @@ const DivideAddEditModal: React.FC<propType> = (props: propType) => {
setDivideMethod(data.proportionMode);
}, [open]);
return (
<Modal
open={open}
title={title}
onCancel={handleCancel}
onOk={handleOk}
destroyOnClose
>
<Modal open={open} title={title} onCancel={handleCancel} onOk={handleOk} destroyOnClose>
<Form
name="addForm"
name='addForm'
form={form}
labelAlign="right"
labelAlign='right'
labelCol={{ span: 5 }}
wrapperCol={{ span: 10 }}
>
<Form.Item
label="其它分成对象"
name="proportionObjName"
rules={[{ required: true, message: "请输入其它分成对象" }]}
label='其它分成对象'
name='proportionObjName'
rules={[{ required: true, message: '请输入其它分成对象' }]}
>
<Input placeholder="请输入其它分成对象" maxLength={20} />
<Input placeholder='请输入其它分成对象' maxLength={20} />
</Form.Item>
<Form.Item
label="分成方式"
name="proportionMode"
rules={[{ required: true, message: "请选择分成方式" }]}
label='分成方式'
name='proportionMode'
rules={[{ required: true, message: '请选择分成方式' }]}
initialValue={divideMethod}
>
<Radio.Group
options={[
{ label: "分成比例", value: 0 },
{ label: "差价分成", value: 1, disabled: true },
{ label: '分成比例', value: 0 },
{ label: '差价分成', value: 1, disabled: true },
]}
onChange={({ target: { value } }) => setDivideMethod(value)}
/>
......@@ -177,44 +170,39 @@ const DivideAddEditModal: React.FC<propType> = (props: propType) => {
{divideMethod === 0 && (
<>
<Form.Item
label="分成参数"
name="proportionRate"
label='分成参数'
name='proportionRate'
rules={[
{ required: true, message: "请输入分成额度百分比" },
{ required: true, message: '请输入分成额度百分比' },
// 只能输入0.1到100.0的一位小数,不能大于100.0
{
pattern: /^(100(\.0)?|[1-9]?\d(\.\d)?)$/,
message: "只能输入0.1到100.0的一位小数",
message: '只能输入0.1到100.0的一位小数',
},
]}
>
<Input
placeholder="请输入分成额度百分比"
maxLength={20}
type="number"
suffix="%"
/>
<Input placeholder='请输入分成额度百分比' maxLength={20} type='number' suffix='%' />
</Form.Item>
<div style={{ margin: "0 0 10px 60px" }}>
<div style={{ margin: '0 0 10px 60px' }}>
说明:分成比例基数以订单金额减去相关渠道利润的得数为基准
</div>
</>
)}
<Form.Item
label="分成用户"
name="mallUserId"
rules={[{ required: true, message: "请选择分成用户" }]}
label='分成用户'
name='mallUserId'
rules={[{ required: true, message: '请选择分成用户' }]}
wrapperCol={{ span: 14 }}
>
<Select
placeholder="请选择分成用户"
placeholder='请选择分成用户'
options={mallUserList}
allowClear
showSearch
filterOption={(input, option) =>
(option?.label ?? "").toLowerCase().includes(input.toLowerCase())
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
}
optionFilterProp="label"
optionFilterProp='label'
onPopupScroll={handlePopupScroll}
/>
</Form.Item>
......
.divide-setting-modal{
.divide-setting-modal {
.divide-title {
font-size: 14px;
margin-bottom: 10px;
......
import React, { useEffect, useState } from "react";
import {
Button,
Form,
Input,
message,
Modal,
Select,
Switch,
Table,
} from "antd";
import { ColumnsType } from "antd/es/table";
import { PlusOutlined } from "@ant-design/icons";
import DivideAddEditObject from "../divideAddEditObject";
import {
AddAndEditBonusRuleType,
BonusRuleListQueryType,
} from "@/api/interface/pointManageType";
import { PointManageAPI } from "@/api";
import React, { useEffect, useState } from 'react';
import { Button, Form, Input, message, Modal, Select, Switch, Table } from 'antd';
import { ColumnsType } from 'antd/es/table';
import { PlusOutlined } from '@ant-design/icons';
import DivideAddEditObject from '../divideAddEditObject';
import { AddAndEditBonusRuleType, BonusRuleListQueryType } from '@/api/interface/pointManageType';
import { PointManageAPI } from '@/api';
// 编辑的数据类型
type DataType = (ReturnType<BonusRuleListQueryType> extends Promise<infer T>
? T
: never)["result"]["list"][0];
: never)['result']['list'][0];
type ReqType = Parameters<AddAndEditBonusRuleType>[0];
// 传参类型
interface propType {
......@@ -35,22 +23,20 @@ interface propType {
export const DivideAddEditModal: React.FC<propType> = (props: propType) => {
// 组件默认值
DivideAddEditModal.defaultProps = {
data: { bonusSet: [], id: undefined, ruleName: "" },
data: { bonusSet: [], id: undefined, ruleName: '' },
};
// 参数
const { title, open, closed, data, isEdit } = props;
// 表单钩子
const [form] = Form.useForm();
// 表格数据
const [tableData, setTableData] = useState<DataType["bonusSet"]>([]);
const [tableData, setTableData] = useState<DataType['bonusSet']>([]);
// 需要编辑的数据
const [editData, setEditData] = useState<any>();
// 添加编辑弹窗
const [addEditVisible, setAddEditVisible] = useState<boolean>(false);
// 分成对象列表
const [propObjCode, setPropObjCode] = useState<
{ label: string; value: number }[]
>([]);
const [propObjCode, setPropObjCode] = useState<{ label: string; value: number }[]>([]);
// 关闭弹窗
const handleCancel = () => {
form.resetFields();
......@@ -59,28 +45,28 @@ export const DivideAddEditModal: React.FC<propType> = (props: propType) => {
// 删除数据
const handleDelete = (record: any) => {
Modal.confirm({
title: "提示",
content: "删除后此数据将会丢失,确定删除吗?",
title: '提示',
content: '删除后此数据将会丢失,确定删除吗?',
onOk: () => {
// 删除数据
setTableData(tableData.filter((i) => i.id !== record.id));
message.success("操作成功").then();
message.success('操作成功').then();
},
});
};
// 获取分成对象列表
const getListProportionObject = async () => {
const res = await PointManageAPI.ListProportionObject();
if (res && res.code === "200") {
if (res && res.code === '200') {
setPropObjCode(
res.result?.map((i) => {
return { label: i.name, value: i.code };
})
}),
);
}
};
// 追加列表数据
const handlePush = (val: DataType["bonusSet"][0]) => {
const handlePush = (val: DataType['bonusSet'][0]) => {
// 原来列表中没有的数据就追加,有的话就替换
if (tableData.some((i) => val?.id === i.id)) {
setTableData(
......@@ -89,7 +75,7 @@ export const DivideAddEditModal: React.FC<propType> = (props: propType) => {
return val;
}
return i;
})
}),
);
} else {
setTableData([...tableData, val]);
......@@ -120,44 +106,41 @@ export const DivideAddEditModal: React.FC<propType> = (props: propType) => {
// 提交数据
const handleSubmit = async (val: ReqType) => {
const res = await PointManageAPI.AddAndEditBonusRule(val);
if (res && res.code === "200") {
message.success("操作成功").then();
if (res && res.code === '200') {
message.success('操作成功').then();
closed();
}
};
// 通用表格列
const defaultColumns: ColumnsType<DataType["bonusSet"][0]> = [
const defaultColumns: ColumnsType<DataType['bonusSet'][0]> = [
{
title: "分成对象",
dataIndex: "propObjCode",
align: "center",
render: (text) =>
propObjCode.find((i) => i.value === text)?.label || text,
title: '分成对象',
dataIndex: 'propObjCode',
align: 'center',
render: (text) => propObjCode.find((i) => i.value === text)?.label || text,
},
{
title: "分成方式",
dataIndex: "proportionMode",
align: "center",
render: (text) => (text === 0 ? "比例分成" : "差价分成"),
title: '分成方式',
dataIndex: 'proportionMode',
align: 'center',
render: (text) => (text === 0 ? '比例分成' : '差价分成'),
},
{
title: "分成参数",
dataIndex: "proportionParam",
align: "center",
title: '分成参数',
dataIndex: 'proportionParam',
align: 'center',
render: (text, record) =>
record.proportionMode === 0
? `${(Number(text) * 100).toFixed(1)}%` || "/"
: "/",
record.proportionMode === 0 ? `${(Number(text) * 100).toFixed(1)}%` || '/' : '/',
},
{
title: "操作",
dataIndex: "id",
align: "center",
title: '操作',
dataIndex: 'id',
align: 'center',
width: 100,
render: (text, record) => (
<div style={{ display: "flex", justifyContent: "center" }}>
<div style={{ display: 'flex', justifyContent: 'center' }}>
<Button
type="link"
type='link'
onClick={() => {
setEditData(record);
setAddEditVisible(true);
......@@ -165,7 +148,7 @@ export const DivideAddEditModal: React.FC<propType> = (props: propType) => {
>
编辑
</Button>
<Button type="link" onClick={() => handleDelete(record)}>
<Button type='link' onClick={() => handleDelete(record)}>
删除
</Button>
</div>
......@@ -190,12 +173,12 @@ export const DivideAddEditModal: React.FC<propType> = (props: propType) => {
// onOk={handleOk}
destroyOnClose
width={768}
wrapClassName="divide-setting-modal"
wrapClassName='divide-setting-modal'
footer={
!isEdit ? (
<>
<Button onClick={handleCancel}>取消</Button>
<Button type="primary" onClick={handleOk}>
<Button type='primary' onClick={handleOk}>
确定
</Button>
</>
......@@ -203,52 +186,48 @@ export const DivideAddEditModal: React.FC<propType> = (props: propType) => {
}
>
<Form
name="addForm"
name='addForm'
form={form}
labelAlign="right"
labelAlign='right'
disabled={isEdit}
// layout="inline"
>
<div className="divide-title">一、基本信息</div>
<div className='divide-title'>一、基本信息</div>
<Form.Item
label="规则名称"
name="ruleName"
rules={[{ required: true, message: "请输入规则名称" }]}
label='规则名称'
name='ruleName'
rules={[{ required: true, message: '请输入规则名称' }]}
wrapperCol={{ span: 6 }}
>
<Input placeholder="请输入规则名称" maxLength={20} allowClear />
<Input placeholder='请输入规则名称' maxLength={20} allowClear />
</Form.Item>
<div className="divide-title">二、分成设置</div>
<div className='divide-title'>二、分成设置</div>
{!isEdit && (
<Button
icon={<PlusOutlined />}
type="primary"
onClick={() => setAddEditVisible(true)}
>
<Button icon={<PlusOutlined />} type='primary' onClick={() => setAddEditVisible(true)}>
添加分成对象
</Button>
)}
<Table
size="small"
size='small'
dataSource={tableData}
columns={!isEdit ? defaultColumns : defaultColumns.slice(0, -1)}
rowKey="id"
rowKey='id'
bordered
style={{ margin: "10px 0 -40px 0" }}
style={{ margin: '10px 0 -40px 0' }}
/>
<Form.Item
label="是否默认规则"
name="defaultRule"
label='是否默认规则'
name='defaultRule'
wrapperCol={{ span: 6 }}
valuePropName="checked"
valuePropName='checked'
initialValue={false}
>
<Switch checkedChildren="是" unCheckedChildren="否" />
<Switch checkedChildren='是' unCheckedChildren='否' />
</Form.Item>
</Form>
</Modal>
<DivideAddEditObject
title={editData ? "编辑分成对象" : "添加分成对象"}
title={editData ? '编辑分成对象' : '添加分成对象'}
open={addEditVisible}
data={editData}
closed={() => {
......
import { Form, Input, message, Modal, Radio, Select } from "antd";
import React, { useEffect, useState } from "react";
import { BonusRuleListQueryType } from "@/api/interface/pointManageType";
import { Form, Input, message, Modal, Radio, Select } from 'antd';
import React, { useEffect, useState } from 'react';
import { BonusRuleListQueryType } from '@/api/interface/pointManageType';
// 编辑的数据类型
type DataType = (ReturnType<BonusRuleListQueryType> extends Promise<infer T>
? T
: never)["result"]["list"][0];
: never)['result']['list'][0];
// 传参类型
interface propType {
......@@ -15,7 +15,7 @@ interface propType {
push: any;
data?: any;
state?: { propObjCode?: { label: string; value: number }[] };
selected: DataType["bonusSet"];
selected: DataType['bonusSet'];
}
const DivideAddEditObject: React.FC<propType> = (props: propType) => {
......@@ -34,8 +34,8 @@ const DivideAddEditObject: React.FC<propType> = (props: propType) => {
const [proportionModeList, setProportionModeList] = useState<
{ label: string; value: number; disabled?: true }[]
>([
{ label: "分成比例", value: 0 },
{ label: "差价分成", value: 1, disabled: true },
{ label: '分成比例', value: 0 },
{ label: '差价分成', value: 1, disabled: true },
]);
// 关闭弹窗
const handleCancel = () => {
......@@ -44,11 +44,11 @@ const DivideAddEditObject: React.FC<propType> = (props: propType) => {
// 重置分成方式
setDivideMethod(proportionModeList[0].value);
// 重置分成对象
form.setFieldValue("proportionMode", 0);
form.setFieldValue('proportionMode', 0);
// 重置分成方式列表
setProportionModeList([
{ label: "分成比例", value: 0 },
{ label: "差价分成", value: 1, disabled: true },
{ label: '分成比例', value: 0 },
{ label: '差价分成', value: 1, disabled: true },
]);
// 关闭弹窗
closed();
......@@ -80,24 +80,24 @@ const DivideAddEditObject: React.FC<propType> = (props: propType) => {
...data,
...values,
});
message.success(data?.id ? "修改成功" : "添加成功").then();
message.success(data?.id ? '修改成功' : '添加成功').then();
handleCancel();
};
// 分成对象选择渠道监听
const handleChange = (e: number) => {
if (e === 300) {
setProportionModeList([
{ label: "分成比例", value: 0, disabled: true },
{ label: "差价分成", value: 1 },
{ label: '分成比例', value: 0, disabled: true },
{ label: '差价分成', value: 1 },
]);
form.setFieldValue("proportionMode", proportionModeList[1].value);
form.setFieldValue('proportionMode', proportionModeList[1].value);
setDivideMethod(proportionModeList[1].value);
} else {
setProportionModeList([
{ label: "分成比例", value: 0 },
{ label: "差价分成", value: 1, disabled: true },
{ label: '分成比例', value: 0 },
{ label: '差价分成', value: 1, disabled: true },
]);
form.setFieldValue("proportionMode", proportionModeList[0].value);
form.setFieldValue('proportionMode', proportionModeList[0].value);
setDivideMethod(proportionModeList[0].value);
}
};
......@@ -113,27 +113,21 @@ const DivideAddEditObject: React.FC<propType> = (props: propType) => {
setDivideMethod(data.proportionMode);
}, [open]);
return (
<Modal
open={open}
title={title}
onCancel={handleCancel}
onOk={handleOk}
destroyOnClose
>
<Modal open={open} title={title} onCancel={handleCancel} onOk={handleOk} destroyOnClose>
<Form
name="addForm"
name='addForm'
form={form}
labelAlign="right"
labelAlign='right'
labelCol={{ span: 5 }}
wrapperCol={{ span: 10 }}
>
<Form.Item
label="分成对象"
name="propObjCode"
rules={[{ required: true, message: "请选择分成对象" }]}
label='分成对象'
name='propObjCode'
rules={[{ required: true, message: '请选择分成对象' }]}
>
<Select
placeholder="请选择分成对象"
placeholder='请选择分成对象'
options={state?.propObjCode?.map((i) => ({
label: i.label,
value: i.value,
......@@ -143,9 +137,9 @@ const DivideAddEditObject: React.FC<propType> = (props: propType) => {
/>
</Form.Item>
<Form.Item
label="分成方式"
name="proportionMode"
rules={[{ required: true, message: "请选择分成方式" }]}
label='分成方式'
name='proportionMode'
rules={[{ required: true, message: '请选择分成方式' }]}
initialValue={divideMethod}
>
<Radio.Group
......@@ -156,25 +150,20 @@ const DivideAddEditObject: React.FC<propType> = (props: propType) => {
{divideMethod === 0 && (
<>
<Form.Item
label="分成参数"
name="proportionParam"
label='分成参数'
name='proportionParam'
rules={[
{ required: true, message: "请输入分成额度百分比" },
{ required: true, message: '请输入分成额度百分比' },
// 只能输入0.1到100.0的一位小数,不能大于100.0
{
pattern: /^(100(\.0)?|[1-9]?\d(\.\d)?)$/,
message: "只能输入0.1到100.0的一位小数",
message: '只能输入0.1到100.0的一位小数',
},
]}
>
<Input
placeholder="请输入分成额度百分比"
maxLength={10}
type="number"
suffix="%"
/>
<Input placeholder='请输入分成额度百分比' maxLength={10} type='number' suffix='%' />
</Form.Item>
<div style={{ margin: "0 0 10px 60px" }}>
<div style={{ margin: '0 0 10px 60px' }}>
说明:分成比例基数以订单金额减去相关渠道利润的得数为基准
</div>
</>
......
import { Descriptions, Modal } from "antd";
import React from "react";
import { GetScoreListType } from "@/api/interface/pointManageType";
import { Descriptions, Modal } from 'antd';
import React from 'react';
import { GetScoreListType } from '@/api/interface/pointManageType';
// 列表的类型
type TableType = (ReturnType<GetScoreListType> extends Promise<infer T>
? T
: never)["result"]["list"];
: never)['result']['list'];
// 传参类型
interface propType {
title: string;
......@@ -32,17 +32,11 @@ const BankCardModal: React.FC<propType> = (props) => {
footer={null}
destroyOnClose
>
<Descriptions bordered column={1} size="small">
<Descriptions.Item label="银行卡号">
{data?.bankCardNumber}
</Descriptions.Item>
<Descriptions.Item label="开户银行">
{data?.accountBank}
</Descriptions.Item>
<Descriptions.Item label="支行">{data?.branch}</Descriptions.Item>
<Descriptions.Item label="开户姓名">
{data?.accountName}
</Descriptions.Item>
<Descriptions bordered column={1} size='small'>
<Descriptions.Item label='银行卡号'>{data?.bankCardNumber}</Descriptions.Item>
<Descriptions.Item label='开户银行'>{data?.accountBank}</Descriptions.Item>
<Descriptions.Item label='支行'>{data?.branch}</Descriptions.Item>
<Descriptions.Item label='开户姓名'>{data?.accountName}</Descriptions.Item>
</Descriptions>
</Modal>
);
......
import React, { useEffect, useState } from "react";
import {
Descriptions,
Form,
Input,
InputNumber,
message,
Modal,
Select,
Space,
} from "antd";
import {
GetUserScoreDetailsType,
UserScoreDetailsListType,
} from "@/api/interface/pointManageType";
import { PointManageAPI } from "@/api";
import { phoneNumber } from "@/utils/validateUtils";
import React, { useEffect, useState } from 'react';
import { Descriptions, Form, Input, InputNumber, message, Modal, Select, Space } from 'antd';
import { GetUserScoreDetailsType, UserScoreDetailsListType } from '@/api/interface/pointManageType';
import { PointManageAPI } from '@/api';
import { phoneNumber } from '@/utils/validateUtils';
// 列表的类型
type TableType = (ReturnType<UserScoreDetailsListType> extends Promise<infer T>
? T
: never)["result"]["list"]["userScoreList"];
: never)['result']['list']['userScoreList'];
// 传参类型
interface propType {
title: string;
......@@ -29,9 +17,9 @@ interface propType {
}
// 状态类型
const statusList = [
{ value: 0, label: "提现中" },
{ value: 1, label: "提现成功" },
{ value: 2, label: "提现失败" },
{ value: 0, label: '提现中' },
{ value: 1, label: '提现成功' },
{ value: 2, label: '提现失败' },
];
export const ApproveModal: React.FC<propType> = (props) => {
......@@ -68,8 +56,8 @@ export const ApproveModal: React.FC<propType> = (props) => {
withdrawDetailsId: data?.withdrawId,
flag: values.flag,
});
if (res && res.code === "200") {
message.success("操作成功");
if (res && res.code === '200') {
message.success('操作成功');
handleCancel();
} else {
message.warning(res.message);
......@@ -89,25 +77,25 @@ export const ApproveModal: React.FC<propType> = (props) => {
width={400}
>
<Form
name="addForm"
name='addForm'
form={form}
labelAlign="right"
labelAlign='right'
labelCol={{ span: 8 }}
// layout="inline"
>
<Form.Item label="当前状态">
<Form.Item label='当前状态'>
<div>{transStatus(data?.status as number)}</div>
</Form.Item>
<Form.Item
label="审批结果"
name="flag"
rules={[{ required: true, message: "请选择审批结果" }]}
label='审批结果'
name='flag'
rules={[{ required: true, message: '请选择审批结果' }]}
>
<Select
placeholder="请选择审批结果"
placeholder='请选择审批结果'
options={[
{ value: true, label: "通过" },
{ value: false, label: "不通过" },
{ value: true, label: '通过' },
{ value: false, label: '不通过' },
]}
allowClear
/>
......
import React, { useEffect, useState } from "react";
import { Descriptions, Modal } from "antd";
import {
GetUserScoreDetailsType,
UserScoreDetailsListType,
} from "@/api/interface/pointManageType";
import { PointManageAPI } from "@/api";
import React, { useEffect, useState } from 'react';
import { Descriptions, Modal } from 'antd';
import { GetUserScoreDetailsType, UserScoreDetailsListType } from '@/api/interface/pointManageType';
import { PointManageAPI } from '@/api';
// 列表的类型
type TableType = (ReturnType<UserScoreDetailsListType> extends Promise<infer T>
? T
: never)["result"]["list"]["userScoreList"];
: never)['result']['list']['userScoreList'];
type DetailType = (ReturnType<GetUserScoreDetailsType> extends Promise<infer T>
? T
: never)["result"];
: never)['result'];
// 传参类型
interface propType {
title: string;
......@@ -21,12 +18,12 @@ interface propType {
data?: TableType[0];
}
const contentStyle = { width: "180px" };
const contentStyle = { width: '180px' };
// 状态
const statusList = [
{ value: 0, label: "提现中" },
{ value: 1, label: "提现成功" },
{ value: 2, label: "提现失败" },
{ value: 0, label: '提现中' },
{ value: 1, label: '提现成功' },
{ value: 2, label: '提现失败' },
];
export const DetailModal: React.FC<propType> = (props) => {
......@@ -50,31 +47,31 @@ export const DetailModal: React.FC<propType> = (props) => {
const res = await PointManageAPI.GetUserScoreDetails({
id: Number(data?.id),
});
if (res && res.code === "200") {
if (res && res.code === '200') {
setDetailData(res.result);
// console.log(res.result);
}
};
// 获取使用时间
const getUseTime = (record: DetailType) => {
if (detailData?.type === "积分提现" && detailData?.status === 0) {
return "";
if (detailData?.type === '积分提现' && detailData?.status === 0) {
return '';
}
if (detailData?.type === "积分提现" && detailData?.status === 2) {
return "";
if (detailData?.type === '积分提现' && detailData?.status === 2) {
return '';
}
if (detailData?.type === "积分提现" && detailData?.status === 1) {
if (detailData?.type === '积分提现' && detailData?.status === 1) {
return record?.approvalTime;
}
return record?.useTime;
};
// 获取申请提现时间
const getApplyTime = (record: DetailType) => {
if (detailData?.type === "积分提现" && detailData?.status === 0) {
if (detailData?.type === '积分提现' && detailData?.status === 0) {
return record?.useTime;
}
if (["积分转赠", "积分兑换"].includes(detailData?.type || "")) {
return "";
if (['积分转赠', '积分兑换'].includes(detailData?.type || '')) {
return '';
}
return record?.useTime;
};
......@@ -93,38 +90,36 @@ export const DetailModal: React.FC<propType> = (props) => {
destroyOnClose
width={650}
>
<Descriptions column={2} bordered size="small">
<Descriptions.Item contentStyle={contentStyle} label="积分数值">
<Descriptions column={2} bordered size='small'>
<Descriptions.Item contentStyle={contentStyle} label='积分数值'>
{detailData?.scoreNum &&
(detailData?.scoreNum > 0
? `+${detailData?.scoreNum}`
: detailData?.scoreNum)}
(detailData?.scoreNum > 0 ? `+${detailData?.scoreNum}` : detailData?.scoreNum)}
</Descriptions.Item>
<Descriptions.Item contentStyle={contentStyle} label="流通方式">
<Descriptions.Item contentStyle={contentStyle} label='流通方式'>
{detailData?.type}
</Descriptions.Item>
<Descriptions.Item contentStyle={contentStyle} label="订单编号">
<Descriptions.Item contentStyle={contentStyle} label='订单编号'>
{detailData?.orderNo}
</Descriptions.Item>
<Descriptions.Item contentStyle={contentStyle} label="兑换比例">
<Descriptions.Item contentStyle={contentStyle} label='兑换比例'>
{detailData?.convertRatio}
</Descriptions.Item>
<Descriptions.Item contentStyle={contentStyle} label="领取时间">
<Descriptions.Item contentStyle={contentStyle} label='领取时间'>
{detailData?.getTime}
</Descriptions.Item>
<Descriptions.Item contentStyle={contentStyle} label="使用时间">
<Descriptions.Item contentStyle={contentStyle} label='使用时间'>
{detailData && getUseTime(detailData)}
</Descriptions.Item>
<Descriptions.Item contentStyle={contentStyle} label="状态">
<Descriptions.Item contentStyle={contentStyle} label='状态'>
{transStatus(detailData?.status as number)}
</Descriptions.Item>
<Descriptions.Item contentStyle={contentStyle} label="申请提现时间">
<Descriptions.Item contentStyle={contentStyle} label='申请提现时间'>
{detailData && getApplyTime(detailData)}
</Descriptions.Item>
<Descriptions.Item contentStyle={contentStyle} label="获赠方UID">
<Descriptions.Item contentStyle={contentStyle} label='获赠方UID'>
{detailData?.giveAwayToUid}
</Descriptions.Item>
<Descriptions.Item contentStyle={contentStyle} label="转赠方UID">
<Descriptions.Item contentStyle={contentStyle} label='转赠方UID'>
{detailData?.gainFormUid}
</Descriptions.Item>
</Descriptions>
......
import React, { useEffect, useState } from "react";
import {
Descriptions,
Form,
Input,
InputNumber,
message,
Modal,
Select,
Space,
} from "antd";
import { UserScoreDetailsListType } from "@/api/interface/pointManageType";
import { PointManageAPI } from "@/api";
import { maxLength9, noSpaceFront } from "@/utils/validateUtils";
import React, { useEffect, useState } from 'react';
import { Descriptions, Form, Input, InputNumber, message, Modal, Select, Space } from 'antd';
import { UserScoreDetailsListType } from '@/api/interface/pointManageType';
import { PointManageAPI } from '@/api';
import { maxLength9, noSpaceFront } from '@/utils/validateUtils';
// 列表的类型
type DetailType = (ReturnType<UserScoreDetailsListType> extends Promise<infer T>
? T
: never)["result"]["list"];
: never)['result']['list'];
// 传参类型
interface propType {
title: string;
......@@ -36,8 +27,7 @@ export const DistributionModal: React.FC<propType> = (props) => {
// 流通方式选择
const [circulateId, setCirculateId] = useState<number>();
// 流通方式列表
const [circulateIdList, setCirculateIdList] =
useState<{ label: string; value: number }[]>();
const [circulateIdList, setCirculateIdList] = useState<{ label: string; value: number }[]>();
// 关闭弹窗
const handleCancel = () => {
form.resetFields();
......@@ -50,17 +40,17 @@ export const DistributionModal: React.FC<propType> = (props) => {
.validateFields()
.then(async (values) => {
if (Number(values.score) === 0) {
return message.warning("积分数值不能为0");
return message.warning('积分数值不能为0');
}
if (values.orderNo) {
// 从订单列表查询订单
const res = await PointManageAPI.GetOrderInfoByOrderNo({
orderNo: values.orderNo,
});
if (res && res.code === "200") {
if (res && res.code === '200') {
const { id } = res.result;
if (!id) {
return message.warning("订单编号不存在");
return message.warning('订单编号不存在');
}
await handleSubmit({
...values,
......@@ -88,8 +78,8 @@ export const DistributionModal: React.FC<propType> = (props) => {
orderId: values.orderId,
score: Number(`${values.symbol}${values.score}`),
});
if (res && res.code === "200") {
message.success("操作成功");
if (res && res.code === '200') {
message.success('操作成功');
handleCancel();
} else {
message.warning(res.message);
......@@ -98,13 +88,13 @@ export const DistributionModal: React.FC<propType> = (props) => {
// 获取流通数据列表
const getListCirculateInfo = async () => {
const res = await PointManageAPI.ListCirculateInfo({});
if (res && res.code === "200") {
if (res && res.code === '200') {
setCirculateIdList(
res.result
.map((i) => {
return { label: i.type, value: i.id };
})
.filter((i) => [5, 7].includes(i.value))
.filter((i) => [5, 7].includes(i.value)),
);
}
};
......@@ -129,40 +119,40 @@ export const DistributionModal: React.FC<propType> = (props) => {
width={400}
>
<Form
name="addForm"
name='addForm'
form={form}
labelAlign="right"
labelAlign='right'
labelCol={{ span: 8 }}
// layout="inline"
>
<Form.Item label="发放积分数值" required>
<Space.Compact style={{ width: "100%" }}>
<Form.Item name="symbol" noStyle initialValue="+">
<Form.Item label='发放积分数值' required>
<Space.Compact style={{ width: '100%' }}>
<Form.Item name='symbol' noStyle initialValue='+'>
<Select>
<Select.Option value="+">+</Select.Option>
<Select.Option value="-">-</Select.Option>
<Select.Option value='+'>+</Select.Option>
<Select.Option value='-'>-</Select.Option>
</Select>
</Form.Item>
<Form.Item
name="score"
name='score'
noStyle
rules={[{ required: true, message: "请输入发放积分数值" }]}
rules={[{ required: true, message: '请输入发放积分数值' }]}
>
<Input
style={{ width: "250%" }}
placeholder="请输入发放积分数值"
style={{ width: '250%' }}
placeholder='请输入发放积分数值'
onInput={maxLength9}
/>
</Form.Item>
</Space.Compact>
</Form.Item>
<Form.Item
label="流通方式"
name="circulateId"
rules={[{ required: true, message: "请选择流通方式" }]}
label='流通方式'
name='circulateId'
rules={[{ required: true, message: '请选择流通方式' }]}
>
<Select
placeholder="请选择流通方式"
placeholder='请选择流通方式'
options={circulateIdList}
allowClear
value={circulateId}
......@@ -171,16 +161,11 @@ export const DistributionModal: React.FC<propType> = (props) => {
</Form.Item>
{circulateId === 5 && (
<Form.Item
label="订单编号"
name="orderNo"
rules={[{ required: true, message: "请输入订单编号" }]}
label='订单编号'
name='orderNo'
rules={[{ required: true, message: '请输入订单编号' }]}
>
<Input
placeholder="请输入订单编号"
maxLength={20}
allowClear
onInput={noSpaceFront}
/>
<Input placeholder='请输入订单编号' maxLength={20} allowClear onInput={noSpaceFront} />
</Form.Item>
)}
</Form>
......
import React, { useState } from "react";
import { DatePicker, Form, Input, message, Modal, Radio } from "antd";
import moment from "dayjs";
import { PointManageAPI } from "@/api";
import { maxLength8, maxString8 } from "@/utils/validateUtils";
import React, { useState } from 'react';
import { DatePicker, Form, Input, message, Modal, Radio } from 'antd';
import moment from 'dayjs';
import { PointManageAPI } from '@/api';
import { maxLength8, maxString8 } from '@/utils/validateUtils';
// 传参类型
interface propType {
......@@ -50,83 +50,69 @@ export const AddEditModal: React.FC<propType> = (props: propType) => {
coupon: Number(values.coupon),
entryIntoForceTime:
values.ruleSetting === 1
? moment(values.entryIntoForceTime.$d).format("YYYY-MM-DD HH:mm:ss")
? moment(values.entryIntoForceTime.$d).format('YYYY-MM-DD HH:mm:ss')
: undefined,
ruleName: values.ruleName,
score: Number(values.score),
});
if (res && res.code === "200") {
if (res && res.code === '200') {
handleCancel();
}
};
return (
<Modal
open={open}
title={title}
onCancel={handleCancel}
onOk={handleOk}
destroyOnClose
>
<Modal open={open} title={title} onCancel={handleCancel} onOk={handleOk} destroyOnClose>
<Form
name="addForm"
name='addForm'
form={form}
labelAlign="right"
labelAlign='right'
// layout="inline"
>
<Form.Item
label="规则名称"
name="ruleName"
rules={[{ required: true, message: "请输入规则名称" }]}
label='规则名称'
name='ruleName'
rules={[{ required: true, message: '请输入规则名称' }]}
>
<Input placeholder="请输入规则名称" maxLength={15} allowClear />
<Input placeholder='请输入规则名称' maxLength={15} allowClear />
</Form.Item>
<Form.Item label="兑换比例(积分:券额)" required>
<Form.Item label='兑换比例(积分:券额)' required>
<Form.Item
name="score"
rules={[{ required: true, message: "请输入积分比例" }]}
style={{ display: "inline-block", width: "calc(50% - 8px)" }}
name='score'
rules={[{ required: true, message: '请输入积分比例' }]}
style={{ display: 'inline-block', width: 'calc(50% - 8px)' }}
>
<Input
placeholder="请输入积分比例"
type="number"
onInput={maxLength8}
/>
<Input placeholder='请输入积分比例' type='number' onInput={maxLength8} />
</Form.Item>
<Form.Item
name="coupon"
name='coupon'
rules={[
{ required: true, message: "请输入券额比例" },
{ required: true, message: '请输入券额比例' },
{
pattern: /^(\d|[1-9]\d+)(\.\d{1,2})?$/,
message: "只能输入两位小数",
message: '只能输入两位小数',
},
]}
style={{
display: "inline-block",
width: "calc(50% - 8px)",
margin: "0 8px",
display: 'inline-block',
width: 'calc(50% - 8px)',
margin: '0 8px',
}}
>
<Input
placeholder="请输入券额比例"
type="number"
onInput={maxString8}
/>
<Input placeholder='请输入券额比例' type='number' onInput={maxString8} />
</Form.Item>
</Form.Item>
<div style={{ transform: "translateY(-10px)" }}>
<div style={{ transform: 'translateY(-10px)' }}>
说明:若兑换比例为1:20,则1积分可兑20元VIP优惠券,且为无门槛优惠券
</div>
<Form.Item
label="生效时间"
name="ruleSetting"
rules={[{ required: true, message: "请选择生效时间" }]}
label='生效时间'
name='ruleSetting'
rules={[{ required: true, message: '请选择生效时间' }]}
initialValue={0}
>
<Radio.Group
options={[
{ label: "立即生效", value: 0 },
{ label: "手动设置", value: 1 },
{ label: '立即生效', value: 0 },
{ label: '手动设置', value: 1 },
]}
value={radioValue}
onChange={({ target: { value } }) => {
......@@ -136,16 +122,16 @@ export const AddEditModal: React.FC<propType> = (props: propType) => {
</Form.Item>
{radioValue === 1 && (
<Form.Item
label="生效时间"
name="entryIntoForceTime"
rules={[{ required: radioValue === 1, message: "请设置生效时间" }]}
label='生效时间'
name='entryIntoForceTime'
rules={[{ required: radioValue === 1, message: '请设置生效时间' }]}
>
<DatePicker
placeholder="请选择生效时间"
placeholder='请选择生效时间'
allowClear
showTime={{ format: "HH:mm:ss" }}
format="YYYY-MM-DD HH:mm:ss"
style={{ width: "100%" }}
showTime={{ format: 'HH:mm:ss' }}
format='YYYY-MM-DD HH:mm:ss'
style={{ width: '100%' }}
disabledDate={(current) => {
// 限制时间不可早于当日
return current && current <= moment();
......
......@@ -2,15 +2,16 @@ import React from 'react';
import { Navigate, RouteObject } from 'react-router-dom';
import ErrorPage from '~/pages/common/error';
import LayoutView from '~/components/layout';
import {
AccountBookOutlined,
MacCommandOutlined,
GiftOutlined,PayCircleOutlined,
BarsOutlined,
ShoppingOutlined,
ShopOutlined,
CreditCardOutlined
} from '@ant-design/icons';
import {
AccountBookOutlined,
MacCommandOutlined,
GiftOutlined,
PayCircleOutlined,
BarsOutlined,
ShoppingOutlined,
ShopOutlined,
CreditCardOutlined,
} from '@ant-design/icons';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import { AgnosticIndexRouteObject } from '@remix-run/router';
......@@ -23,16 +24,20 @@ import DivideOrder from '~/pages/pointManage/divideOrder';
import DivideRules from '~/pages/pointManage/divideRules';
import LoginView from '~/pages/common/login';
import ProductOrderDetail from '~/pages/orderManage/productOrder/detail';
import ServiceOrderDetail from '~/pages/orderManage/serviceOrder/detail';
import EquipmentOrderDetail from '~/pages/orderManage/equipmentOrder/detail';
const ActivityList = React.lazy(() => import('src/pages/activityManage/activityList'));//活动管理
const ActivityList = React.lazy(() => import('src/pages/activityManage/activityList')); //活动管理
const ProductOrderView = React.lazy(() => import('src/pages/orderManage/productOrder')); //销售订单
const EquipmentOrderView = React.lazy(() => import('src/pages/orderManage/equipmentOrder')); //设备订单
const ServiceOrderView = React.lazy(() => import('src/pages/orderManage/serviceOrder')); //服务订单
const CouponList = React.lazy(() => import('src/pages/couponManage/couponList'));//优惠券管理
const CouponDetail = React.lazy(() => import('src/pages/couponManage/couponList/detail'));//优惠券明细
const SplitCouponList = React.lazy(() => import('src/pages/couponManage/splitCouponList'));//裂变优惠券
const SplitCouponOperate = React.lazy(() => import('src/pages/couponManage/splitCouponList/addOrEditOrDetail'));//裂变优惠券操作
const CouponDetailed = React.lazy(() => import('src/pages/couponManage/couponDetailed'));//优惠券明细
const CouponList = React.lazy(() => import('src/pages/couponManage/couponList')); //优惠券管理
const CouponDetail = React.lazy(() => import('src/pages/couponManage/couponList/detail')); //优惠券明细
const SplitCouponList = React.lazy(() => import('src/pages/couponManage/splitCouponList')); //裂变优惠券
const SplitCouponOperate = React.lazy(
() => import('src/pages/couponManage/splitCouponList/addOrEditOrDetail'),
); //裂变优惠券操作
const CouponDetailed = React.lazy(() => import('src/pages/couponManage/couponDetailed')); //优惠券明细
export interface RouteObjectType {
path: AgnosticIndexRouteObject['path'];
element: any;
......@@ -121,6 +126,16 @@ export const routerList: Array<RouteObjectType> = [
},
},
{
path: '/orderManage/equipmentOrder/detail',
element: withLoadingComponent(<EquipmentOrderDetail />),
meta: {
id: 10020,
title: '租赁订单 / 详情',
icon: <ShopOutlined />,
hidden: true,
},
},
{
path: '/orderManage/serviceOrder',
element: withLoadingComponent(<ServiceOrderView />),
meta: {
......@@ -129,6 +144,16 @@ export const routerList: Array<RouteObjectType> = [
icon: <CreditCardOutlined />,
},
},
{
path: '/orderManage/serviceOrder/detail',
element: withLoadingComponent(<ServiceOrderDetail />),
meta: {
id: 10010,
title: '服务订单 / 详情',
icon: <CreditCardOutlined />,
hidden: true,
},
},
],
},
{
......@@ -152,9 +177,13 @@ export const routerList: Array<RouteObjectType> = [
},
{
path: '/pointManage/pointList/detail',
element: withLoadingComponent(<PointDetail location={{
search: ''
}} />),
element: withLoadingComponent(
<PointDetail
location={{
search: '',
}}
/>,
),
meta: {
id: 25100,
title: '个人积分明细',
......@@ -173,9 +202,13 @@ export const routerList: Array<RouteObjectType> = [
},
{
path: '/pointManage/pointList/list',
element: withLoadingComponent(<PointDetailList location={{
search: ''
}} />),
element: withLoadingComponent(
<PointDetailList
location={{
search: '',
}}
/>,
),
meta: {
id: 25100,
title: '积分明细',
......@@ -225,14 +258,18 @@ export const routerList: Array<RouteObjectType> = [
},
{
path: '/couponManage/couponList/detail',
element: withLoadingComponent(<CouponDetail location={{
search: ''
}} />),
element: withLoadingComponent(
<CouponDetail
location={{
search: '',
}}
/>,
),
meta: {
id: 26100,
title: '活动优惠券操作',
icon: <PayCircleOutlined />,
hidden:true,
hidden: true,
},
},
{
......@@ -251,7 +288,7 @@ export const routerList: Array<RouteObjectType> = [
id: 26200,
title: '裂变优惠券操作',
icon: <PayCircleOutlined />,
hidden:true,
hidden: true,
},
},
{
......
import { useSelector, useDispatch, TypedUseSelectorHook } from "react-redux";
import type { RootState, AppDispatch } from "../index";
import { useSelector, useDispatch, TypedUseSelectorHook } from 'react-redux';
import type { RootState, AppDispatch } from '../index';
export const useAppDispatch = () => useDispatch<AppDispatch>();
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
import { configureStore } from "@reduxjs/toolkit";
import stateSlice from "@/store/slice";
import { configureStore } from '@reduxjs/toolkit';
import stateSlice from '@/store/slice';
const store = configureStore({
reducer: {
......
import { createSlice, createAsyncThunk, PayloadAction } from "@reduxjs/toolkit";
import { createSlice, createAsyncThunk, PayloadAction } from '@reduxjs/toolkit';
const stateSlice = createSlice({
name: "ghj",
name: 'ghj',
initialState: {
num: 1,
},
......
const TOKENKEY = "mmc-token";
const USERKEY = "mmc-custManage";
const TOKENKEY = 'mmc-token';
const USERKEY = 'mmc-custManage';
const getToken = () => {
return localStorage.getItem(TOKENKEY);
......
// 合同状态
export const signStatusList = [
{ val: 0, label: "待用户签署合同" },
{ val: 1, label: "用户签署失败" },
{ val: 2, label: "待平台签署合同" },
{ val: 3, label: "平台签署失败" },
{ val: 4, label: "平台签署成功" },
{ val: 5, label: "合同归档完成" },
{ val: 0, label: '待用户签署合同' },
{ val: 1, label: '用户签署失败' },
{ val: 2, label: '待平台签署合同' },
{ val: 3, label: '平台签署失败' },
{ val: 4, label: '平台签署成功' },
{ val: 5, label: '合同归档完成' },
];
// 裂变优惠券门槛
export const splitCouponType = [
{
val: 1,
label: "有门槛",
label: '有门槛',
},
{
val: 2,
label: "减免券",
label: '减免券',
},
{
val: 3,
label: "无门槛",
label: '无门槛',
},
];
// 裂变优惠券使用类型
export const splitCouponUseType = [
{
val: 2,
label: "品牌券",
label: '品牌券',
},
{
val: 1,
label: "商品券",
label: '商品券',
},
{
val: 3,
label: "店铺券",
label: '店铺券',
},
];
export const base64ToFile = (dataUrl: string, name?: string) => {
const arr: string[] = dataUrl.split(",");
const arr: string[] = dataUrl.split(',');
// const mime = arr[0].match(/:(.*?);/)[1];
const bstr: string = atob(arr[1]);
let n = bstr.length;
......@@ -7,7 +7,7 @@ export const base64ToFile = (dataUrl: string, name?: string) => {
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new File([u8arr], `${name}.png`, { type: "image/png" });
return new File([u8arr], `${name}.png`, { type: 'image/png' });
};
export const urlToBase64 = (url: string) => {
return new Promise((resolve) => {
......@@ -17,17 +17,17 @@ export const urlToBase64 = (url: string) => {
// 处理缓存,fix缓存bug,有缓存,浏览器会报错;
Img.src = `${url}?${timeStamp}`;
// 解决控制台跨域报错的问题
Img.crossOrigin = "Anonymous";
Img.crossOrigin = 'Anonymous';
// 获取后缀
const ext = Img.src.substring(Img.src.lastIndexOf(".") + 1).toLowerCase();
const ext = Img.src.substring(Img.src.lastIndexOf('.') + 1).toLowerCase();
Img.onload = () => {
// 要先确保图片完整获取到,这是个异步事件
const canvas: any = document.createElement("canvas"); // 创建canvas元素
const canvas: any = document.createElement('canvas'); // 创建canvas元素
// 确保canvas的尺寸和图片一样
canvas.width = Img.width;
canvas.height = Img.height;
// 将图片绘制到canvas中
canvas.getContext("2d").drawImage(Img, 0, 0, Img.width, Img.height);
canvas.getContext('2d').drawImage(Img, 0, 0, Img.width, Img.height);
// 转换图片为dataURL
resolve(canvas.toDataURL(`image/${ext}`));
};
......
// 过滤路由
import { limitEntity } from "@/api/modules/role";
import { limitEntity } from '@/api/modules/role';
export const filterRouter = (list: any, routeList: limitEntity[]) => {
return list.reduce((pre: any, cur: any) => {
......@@ -19,6 +19,6 @@ export const isRoute = (list: any, pathname: string) => {
(v: any) =>
v.path === pathname ||
(v.alias && pathname.includes(v.alias)) ||
(v.children && isRoute(v.children, pathname))
(v.children && isRoute(v.children, pathname)),
);
};
// 格式化千分位并补零
export const moneyFormat = (num: number) => {
if (Number(num).toString() !== "NaN") {
if (Number(num).toString() !== 'NaN') {
// 添加千分符
let _n = Number(num).toLocaleString();
if (_n.indexOf(".") !== -1) {
_n += "00";
if (_n.indexOf('.') !== -1) {
_n += '00';
} else {
_n += ".00";
_n += '.00';
}
// 因为有千分符所以,返回数据为字符串格式,无法做运算操作,适合做直接显示使用
return _n.substring(0, _n.indexOf(".") + 3);
return _n.substring(0, _n.indexOf('.') + 3);
}
};
// 是否允许操作
const isAllowOption = (record: any) => {
const userInfo = JSON.parse(localStorage.getItem("user_info") as string);
const userInfo = JSON.parse(localStorage.getItem('user_info') as string);
return (
userInfo.userAccountId === record.operationId ||
(userInfo.roleInfo.pmc &&
(record.statusCode === 710 || record.statusCode === 500))
(userInfo.roleInfo.pmc && (record.statusCode === 710 || record.statusCode === 500))
);
};
// 设置状态
export const setStatus = (record: any, deliverBtn: boolean) => {
if (record.statusCode !== 50 && !isAllowOption(record)) {
return "";
return '';
}
// 新版
if (record.statusCode === 200) {
return record.signStatus === 2 ? "合同签署" : "";
return record.signStatus === 2 ? '合同签署' : '';
}
switch (record.statusCode) {
case 50:
return JSON.parse(localStorage.getItem("user_info") as string).roleInfo
.admin
? "分配订单"
: "";
return JSON.parse(localStorage.getItem('user_info') as string).roleInfo.admin
? '分配订单'
: '';
case 100:
return "确认订单";
return '确认订单';
case 300:
return "确认付款";
return '确认付款';
case 400:
return "确认库存";
return '确认库存';
case 710:
case 500:
return deliverBtn ? "发货" : "";
return deliverBtn ? '发货' : '';
case 660:
return "确认尾款";
return '确认尾款';
default:
return null;
}
......
// 不能输入数字,其他可惜输入
export const exceptNumber = (val: any) => {
val.target.value = val.target.value
.replace(/1?(\d|([1-9]\d+))(.\d+)?$/g, "")
.replace(/\s/g, "");
val.target.value = val.target.value.replace(/1?(\d|([1-9]\d+))(.\d+)?$/g, '').replace(/\s/g, '');
};
// 只能输入正整数
export const onlyNumberPositive = (val: any) => {
// eslint-disable-next-line eqeqeq
if (val.target.value == 0) {
val.target.value = val.target.value.replace(/0/g, "");
val.target.value = val.target.value.replace(/0/g, '');
}
val.target.value = val.target.value.replace(/\D/g, "");
val.target.value = val.target.value.replace(/\D/g, '');
};
// 不能输入汉字,其他可输入
export const exceptChinese = (val: any) => {
val.target.value = val.target.value
.replace(/[\u4E00-\u9FA5]|[\uFE30-\uFFA0]/g, "")
.replace(/\s/g, "");
.replace(/[\u4E00-\u9FA5]|[\uFE30-\uFFA0]/g, '')
.replace(/\s/g, '');
};
// 只能输入字母和中文,不能输入数字和符号
export const onlyCharacter = (val: any) => {
val.target.value = val.target.value
.replace(/[^a-zA-Z\u4E00-\u9FA5]/g, "")
.replace(/\s/g, "");
val.target.value = val.target.value.replace(/[^a-zA-Z\u4E00-\u9FA5]/g, '').replace(/\s/g, '');
};
// 手机号输入,限制11位
......@@ -33,13 +29,13 @@ export const phoneNumber = (val: any) => {
if (val.target.value.length > 11) {
val.target.value = val.target.value.slice(0, 11);
} else {
val.target.value = val.target.value.replace(/\D/g, "");
val.target.value = val.target.value.replace(/\D/g, '');
}
};
// 开头不能输入空格
export const noSpaceFront = (val: any) => {
val.target.value = val.target.value.replace(/^\s/g, "");
val.target.value = val.target.value.replace(/^\s/g, '');
};
// 数字限制长度
......@@ -47,7 +43,7 @@ export const maxLength = (val: any) => {
if (val.target.value.length > 10) {
val.target.value = val.target.value.slice(0, 10);
} else {
val.target.value = val.target.value.replace(/\D/g, "");
val.target.value = val.target.value.replace(/\D/g, '');
}
};
......@@ -63,7 +59,7 @@ export const maxNumber = (val: any) => {
if (val.target.value > 100000) {
val.target.value = 100000;
} else {
val.target.value = val.target.value.replace(/\D/g, "");
val.target.value = val.target.value.replace(/\D/g, '');
}
};
......@@ -79,7 +75,7 @@ export const maxLength8 = (val: any) => {
if (val.target.value.length > 8) {
val.target.value = val.target.value.slice(0, 8);
} else {
val.target.value = val.target.value.replace(/\D/g, "");
val.target.value = val.target.value.replace(/\D/g, '');
}
};
......@@ -88,7 +84,7 @@ export const maxLength9 = (val: any) => {
if (val.target.value.length > 9) {
val.target.value = val.target.value.slice(0, 9);
} else {
val.target.value = val.target.value.replace(/\D/g, "");
val.target.value = val.target.value.replace(/\D/g, '');
}
};
......@@ -97,7 +93,7 @@ export const maxLength7 = (val: any) => {
if (val.target.value.length > 7) {
val.target.value = val.target.value.slice(0, 7);
} else {
val.target.value = val.target.value.replace(/\D/g, "");
val.target.value = val.target.value.replace(/\D/g, '');
}
};
......@@ -106,6 +102,6 @@ export const maxLength6 = (val: any) => {
if (val.target.value.length > 6) {
val.target.value = val.target.value.slice(0, 6);
} else {
val.target.value = val.target.value.replace(/\D/g, "");
val.target.value = val.target.value.replace(/\D/g, '');
}
};
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论