Commit 9dff496a authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

feat(平台营销活动管理): 接口接入

parent 403283b3
......@@ -107,7 +107,7 @@ const router = [
// },
// ...routeList,
// merchantMarketingRoute,
// marketingRoutes,
marketingRoutes,
...asyncRoutes,
// purchaseBidRoute,
{
......
src/asserts/level1.png

5.06 KB | W: | H:

src/asserts/level1.png

7.02 KB | W: | H:

src/asserts/level1.png
src/asserts/level1.png
src/asserts/level1.png
src/asserts/level1.png
  • 2-up
  • Swipe
  • Onion skin
src/asserts/level2.png

5.08 KB | W: | H:

src/asserts/level2.png

7.22 KB | W: | H:

src/asserts/level2.png
src/asserts/level2.png
src/asserts/level2.png
src/asserts/level2.png
  • 2-up
  • Swipe
  • Onion skin
src/asserts/level3.png

5.16 KB | W: | H:

src/asserts/level3.png

6.53 KB | W: | H:

src/asserts/level3.png
src/asserts/level3.png
src/asserts/level3.png
src/asserts/level3.png
  • 2-up
  • Swipe
  • Onion skin
src/asserts/level4.png

5.02 KB | W: | H:

src/asserts/level4.png

6.46 KB | W: | H:

src/asserts/level4.png
src/asserts/level4.png
src/asserts/level4.png
src/asserts/level4.png
  • 2-up
  • Swipe
  • Onion skin
import { ISchema } from '@formily/antd';
import React, { useEffect, useRef, useState } from 'react';
import { Modal, Row, Col, Drawer, Button } from 'antd';
import { createFormActions } from '@formily/antd';
import { StandardTable } from 'god';
import { ColumnsType } from 'antd/es/table';
import NiceForm from '@/components/NiceForm';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
const formActions = createFormActions();
interface Iprops {
modalType?: "Modal" | "Drawer"
/**
* 是否显示
*/
visible: boolean,
/**
* Modal 标题
*/
title: string,
/**
* 搜索schema
*/
schema: ISchema,
/**
* table Ccolumn
*/
columns: ColumnsType,
footer?: React.ReactNode,
tableProps?: {
rowKey: string | ((record) => any)
},
mode: 'checkbox' | 'radio',
customizeRadio?: boolean,
/**
* rowSelection
*/
value?: { [key: string]: any }[],
/**
* onChange
*/
expressionScope?: { [key: string]: any }
/**
* format话参数
*/
format?: ((value) => any) | null,
effects?: ($, actions) => void,
fetchData: (params: any) => any,
onClose: () => void,
onOk: (selectRow: number[] | string[], selectedRows: { [key: string]: any }[]) => void,
/** customKey */
customKey?: string
}
const TableModal: React.FC<Iprops> = (props: Iprops) => {
const { title, visible, schema, columns, effects, tableProps, mode, expressionScope, fetchData, onClose, onOk, value, format, customizeRadio, modalType, footer, customKey } = props;
const ref = useRef<any>({});
const [rowSelection, RowCtl] = useRowSelectionTable({ type: customizeRadio && mode === 'radio' ? 'checkbox' : mode, customKey: customKey });
const isFirstLoad = useRef<boolean>(true);
useEffect(() => {
if (!visible) {
return;
}
RowCtl.setSelectRow(value)
RowCtl.setSelectedRowKeys(value.map(v => v[customKey]))
}, [visible])
const handleEffects = ($: any, actions: any) => {
effects?.($, actions);
}
const handleOnClose = () => {
onClose?.()
}
const handleOk = () => {
onOk?.(RowCtl.selectedRowKeys, RowCtl.selectRow)
}
useEffect(() => {
if (!visible) {
return;
}
if (!isFirstLoad.current) {
ref.current?.reload?.();
}
isFirstLoad.current = false;
}, [visible])
const handleSearch = (params: any) => {
const res = (format && format(params)) || params;
ref.current.reload(res)
}
const Component = modalType === 'Modal' ? Modal : Drawer;
const renderFooter = () => {
return (
<div style={{ textAlign: 'right' }}>
<Button onClick={handleOnClose} style={{ marginRight: 8 }}>
取消
</Button>
<Button onClick={handleOk} type="primary">
提交
</Button>
</div>
)
}
const otherProps = modalType === 'Drawer' ? { footer: renderFooter() } : { onOk: handleOk }
return (
<Component
title={title}
visible={visible}
onClose={handleOnClose}
onCancel={handleOnClose}
// onOk={handleOk}
width={900}
{...otherProps}
>
<StandardTable
keepAlive={false}
columns={columns}
tableProps={{
...tableProps,
pagination: false
}}
tableType="small"
fetchTableData={fetchData}
currentRef={ref}
rowSelection={{
...rowSelection,
hideSelectAll: customizeRadio,
}}
formRender={(child, ps) => <Row justify='space-between' style={{ marginBottom: 16 }}>
<Col span={18} style={{ zIndex: 99 }}>{child}</Col>
<Col style={{ marginTop: 4 }}>{ps}</Col>
</Row >}
controlRender={
<NiceForm
schema={schema}
actions={formActions}
onSubmit={handleSearch}
expressionScope={expressionScope}
effects={($, actions) => handleEffects($, actions)}
/>
}
>
</StandardTable>
</Component>
)
}
TableModal.defaultProps = {
// rowSelection: null,
mode: 'radio',
tableProps: {
rowKey: 'memberId'
},
value: [],
expressionScope: {},
format: null,
customizeRadio: false,
modalType: "Modal",
footer: null
}
export default TableModal;
......@@ -41,7 +41,7 @@ export interface ShopInfo {
describe: string;
state: number;
url: string;
isDefault: number;
isDefault?: any;
}
export interface OrderMode {
......@@ -60,7 +60,7 @@ export interface SiteInfo {
name: string;
logo: string;
siteUrl: string;
symbol: string;
symbol?: any;
}
export interface Site {
......
......@@ -24,9 +24,13 @@ const AddedMarketing = (props: any) => {
const [loading, setLoading] = useState<boolean>(false)
const [unsaved, setUnsaved] = useState<boolean>(false);
const [shopList, setShopList] = useState<any[]>([]);
const [dataView, setDataView] = useState<any>({});
const [memberLevelList, setMemberLevelList] = useState<any[]>([]);
/** 活动类型 */
const [option, setOption] = useState<any>({});
const [memberType, setMemberType] = useState<any[]>([]);
const handleGetAcType = (_e?: number, option?: any) => {
form.resetFields(['activityDefinedBO']);
setOption(option)
}
......@@ -34,11 +38,12 @@ const AddedMarketing = (props: any) => {
const handleSubmit = () => {
form.validateFields().then(res => {
setLoading(true)
console.log(memberLevelList, [...memberLevelList])
const params: any = {
newUser: (res.allUser.includes(2) || res.allUser.includes(1)) ? 1 : 0,
oldUser: (res.allUser.includes(3) || res.allUser.includes(1)) ? 1 : 0,
newMember: (res.allMember.includes(2) || res.allMember.includes(1)) ? 1 : 0,
oldMember: (res.allMember.includes(3) || res.allMember.includes(1)) ? 1 : 0,
newMember: (res.allUser.includes(1)) ? 1 : 0,
oldMember: (res.allUser.includes(2)) ? 1 : 0,
enterpriseMember: (res.allMemberType.includes(1)) ? 1 : 0,
personalMember: (res.allMemberType.includes(2)) ? 1 : 0,
activityDefinedBO: res.activityDefinedBO,
activityName: res.activityName,
activitySignUpType: res.activitySignUpType,
......@@ -49,6 +54,8 @@ const AddedMarketing = (props: any) => {
signUpStartTime: Number(moment(res.signUpStartTime).format('x')),
signUpEndTime: Number(moment(res.signUpEndTime).format('x')),
inviteType: res.inviteType,
inviteList: res.inviteList,
memberLevelList,
}
id && (params.id = Number(id));
PublicApi.postMarketingPlatformActivitySave(params).then(resolve => {
......@@ -87,32 +94,69 @@ const AddedMarketing = (props: any) => {
if (res.code !== 1000) {
return
}
const { data } = res;
form.setFieldsValue({
allUser: (data.newUser && data.oldUser) ? [1] : [data.newUser && 2, data.oldUser && 3],
allMember: (data.newMember && data.oldMember) ? [1] : [data.newMember && 2, data.oldMember && 3],
activityDefinedBO: data.activityDefinedBO,
activityName: data.activityName,
activitySignUpType: data.activitySignUpType,
activityType: data.activityType,
shopList: data.shopList,
startTime: moment(data.startTime),
endTime: moment(data.endTime),
signUpStartTime: moment(data.signUpStartTime),
signUpEndTime: moment(data.signUpEndTime),
inviteType: data.inviteType,
})
setShopList(data.shopList)
setOption(ACTIVITYTYPEARRAY.filter(item => item.value === data.activityType).map(v => {
return {
value: v.value,
children: v.lable,
}
})[0])
}).catch(_e => {})
const { data } = res;
form.setFieldsValue({
allUser: [data.newMember && 1, data.oldMember && 2],
allMemberType: [data.enterpriseMember && 1, data.personalMember && 2],
activityDefinedBO: data.activityDefinedBO,
activityName: data.activityName,
activitySignUpType: data.activitySignUpType,
activityType: data.activityType,
shopList: data.shopList,
startTime: moment(data.startTime),
endTime: moment(data.endTime),
signUpStartTime: moment(data.signUpStartTime),
signUpEndTime: moment(data.signUpEndTime),
inviteType: data.inviteType,
inviteList: data.inviteList,
memberLevelList: data.memberLevelList.map(item => { return item.memberLevelId })
})
setMemberLevelList(data.memberLevelList)
setShopList(data.shopList)
setMemberType([data.enterpriseMember && 1, data.personalMember && 2])
setDataView({
inviteType: data.inviteType,
inviteList: data.inviteList,
})
setOption(ACTIVITYTYPEARRAY.filter(item => item.value === data.activityType).map(v => {
return {
value: v.value,
children: v.lable,
}
})[0])
}).catch(_e => { })
} else {
form.setFieldsValue({
'inviteType': true
})
}
}, [id])
const getInviteList = (record) => {
form.setFieldsValue({
'inviteList': record
})
}
const handleGetLevel = (levels) => {
const list = levels.map(item => {
return {
id: item.id,
memberLevelId: item.id,
memberType: item.memberType,
memberTypeName: item.memberTypeName,
roleType: item.roleId,
roleTypeName: item.roleName,
level: item.level,
levelTypeName: item.levelTypeName,
levelTag: item.levelTag,
}
})
console.log(list, 10086)
setMemberLevelList([...list])
}
return (
<Fragment>
<PeripheralLayout
......@@ -140,11 +184,11 @@ const AddedMarketing = (props: any) => {
form={form}
{...layout}
>
<BasicInfoLayout onChange={handleGetAcType} />
<BasicInfoLayout form={form} onChange={handleGetAcType} />
<RulesLayout option={option} />
<PartakeUserLayout />
<PartakeUserLayout onGetLevel={handleGetLevel} onSetLevel={memberLevelList} setMemberType={memberType} />
<ShopLayout onGetShopList={handleGetShopList} onSetShopList={shopList} />
<ApplyMemberLayout />
<ApplyMemberLayout dataView={dataView} getInviteList={getInviteList} />
</Form>
}
/>
......
import React, { useState } from 'react';
import React, { useState, useCallback, useEffect } from 'react';
import { Form, Radio, Button, Table } from 'antd'
import CardLayout from '../card';
import { PlusSquareOutlined } from '@ant-design/icons';
import { ColumnType } from 'antd/lib/table';
import TableModal from '@/components/TableModal';
import { PublicApi } from '@/services/api';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { isEmpty } from '@/components/NiceForm/components/AntUpload/shared';
const ApplyMemberLayout = () => {
const [inviteType, setInviteType] = useState<boolean>(true)
interface ApplyMemberLayoutProps {
/** getInviteList */
getInviteList?: (e: any) => void,
/** 数据回显 */
dataView?: {
/** 会员列表数据 */
inviteList?: any[],
/** 选择会员 */
inviteType?: boolean
}
}
const ApplyMemberLayout: React.FC<ApplyMemberLayoutProps> = (props: any) => {
const { getInviteList, dataView } = props;
const [inviteType, setInviteType] = useState<boolean>(true);
const [visible, setVisible] = useState<boolean>(false);
const [dataSource, SetDataSource] = useState<any>([]);
/** 删除 */
const handleDelect = (key) => {
const newData = [...dataSource]
const data = newData.filter(item => item.memberId !== key);
SetDataSource(data);
getInviteList(data);
}
const columns: ColumnType<any>[] = [
{
title: "会员ID",
key: "",
dataIndex: "",
key: "memberId",
dataIndex: "memberId",
},
{
title: "会员名称",
key: "",
dataIndex: "",
key: "memberName",
dataIndex: "memberName",
},
{
title: "会员类型",
key: "",
dataIndex: "",
key: "memberTypeName",
dataIndex: "memberTypeName",
},
{
title: "会员角色",
key: "",
dataIndex: "",
key: "roleName",
dataIndex: "roleName",
},
{
title: "会员等级",
key: "",
dataIndex: "",
key: "levelName",
dataIndex: "levelName",
},
{
title: "操作",
key: "",
dataIndex: "",
key: "operate",
dataIndex: "operate",
render: (_text, record) => <Button type='link' onClick={() => handleDelect(record.memberId)}>删除</Button>
},
]
......@@ -43,6 +71,51 @@ const ApplyMemberLayout = () => {
setInviteType(e.target.value)
}
const toggle = (flag: boolean) => {
setVisible(flag)
}
const handleFetchData = useCallback((params: any) => {
return new Promise(resolve => {
PublicApi.postMemberManagePlatformMarketingInvitePage({ ...params }, { ctlType: 'none' }).then(res => {
if (res.code !== 1000) {
return
}
const { data } = res;
resolve({
totalCount: data.totalCount,
data: data.data.map(item => {
return {
id: item.id,
memberId: item.memberId,
memberName: item.name,
memberTypeName: item.memberTypeName,
roleId: item.roleId,
roleName: item.roleName,
level: item.level,
levelName: item.levelTag,
}
})
})
}).catch(error => {
console.warn(error)
})
})
}, [])
const handleOk = (selectRowKeys: string[] | number[], selectRowRecord: any) => {
SetDataSource(selectRowRecord)
getInviteList(selectRowRecord)
toggle(false)
}
useEffect(() => {
if (!isEmpty(dataView)) {
setInviteType(dataView.inviteType);
SetDataSource(dataView.inviteList);
}
}, [dataView])
return (
<CardLayout
id="applyMemberLayout"
......@@ -53,7 +126,6 @@ const ApplyMemberLayout = () => {
name="inviteType"
label="选择会员"
rules={[{ required: true, message: "请选择适用会员" }]}
initialValue={true}
>
<Radio.Group onChange={handleOnChange}>
<Radio value={true}>所有会员共享(默认)</Radio>
......@@ -70,14 +142,147 @@ const ApplyMemberLayout = () => {
block
icon={<PlusSquareOutlined />}
style={{ marginBottom: '24px' }}
onClick={() => toggle(true)}
>
选择
</Button>
<Table
rowKey={(record) => record.memberId}
columns={columns}
dataSource={dataSource}
/>
</Form.Item>
)}
<TableModal
modalType="Drawer"
visible={visible}
title="选择会员"
fetchData={handleFetchData}
columns={[
{
title: "会员ID",
key: "memberId",
dataIndex: "memberId",
},
{
title: "会员名称",
key: "memberName",
dataIndex: "memberName",
},
{
title: "会员类型",
key: "memberTypeName",
dataIndex: "memberTypeName",
},
{
title: "会员角色",
key: "roleName",
dataIndex: "roleName",
},
{
title: "会员等级",
key: "levelName",
dataIndex: "levelName",
},
]}
mode="checkbox"
tableProps={{
rowKey: 'memberId',
}}
customKey="memberId"
onClose={() => toggle(false)}
onOk={handleOk}
effects={($, actions) => {
actions.reset()
useStateFilterSearchLinkageEffect($, actions, "name", FORM_FILTER_PATH)
}}
schema={{
type: "object",
properties: {
megalayout: {
type: "object",
"x-component": "mega-layout",
properties: {
name: {
type: "string",
"x-component": "Search",
"x-mega-props": {},
"x-component-props": {
placeholder: "会员名称",
align: "flex-left",
}
}
}
},
[FORM_FILTER_PATH]: {
type: "object",
"x-component": "flex-layout",
"x-component-props": {
rowStyle: {
justifyContent: "flex-start",
flexWrap: "nowrap"
},
colStyle: {//改变间隔
marginRight: 20
}
},
properties: {
PRO_LAYOUT: {
type: "object",
"x-component": "mega-layout",
"x-mega-props": {
span: 5
},
"x-component-props": {
inline: true
},
properties: {
memberType: {
type: "string",
"x-component-props": {
placeholder: "会员类型",
style: {
width: 160
}
},
enum: []
},
roleId: {
type: "string",
"x-component-props": {
placeholder: "会员角色",
style: {
width: 160
}
},
enum: []
},
level: {
type: "string",
"x-component-props": {
placeholder: "会员等级",
style: {
width: 160
}
},
enum: []
},
}
},
sumbit: {
"x-component": "Submit",
"x-mega-props": {
span: 1
},
"x-component-props": {
children: "查询"
}
}
}
}
}
}}
/>
</CardLayout>
)
}
......
import React from 'react';
import React, { useState } from 'react';
import CardLayout from '../card';
import { ACTIVITYTYPEARRAY } from '../constants';
import { Form, Row, Col, Input, Select, Radio, Tooltip, Space, DatePicker } from 'antd';
......@@ -11,11 +11,13 @@ const text = "商家报名活动指由平台建立的,商家参与的营销活
interface BasicInfoProps {
/** 选择事件 */
onChange?: (e: any) => void,
/** form */
form?: any,
}
const BasicInfoLayout: React.FC<BasicInfoProps> = (props: any) => {
const { onChange } = props;
const [form] = Form.useForm();
const { onChange, form } = props;
const [activitySignUpType, setActivitySignUpType] = useState<Number>(0)
return (
<CardLayout
......@@ -47,7 +49,7 @@ const BasicInfoLayout: React.FC<BasicInfoProps> = (props: any) => {
label={<Tooltip placement="top" title={text}>活动参与类型<QuestionCircleOutlined style={{ marginLeft: '5px' }} /></Tooltip>}
rules={[{ required: true, message: '请输入活动名称' }]}
>
<Radio.Group>
<Radio.Group onChange={(e) => setActivitySignUpType(e.target.value)}>
<Radio value={1}>商家报名活动</Radio>
<Radio value={2}>平台自建活动</Radio>
</Radio.Group>
......@@ -115,12 +117,13 @@ const BasicInfoLayout: React.FC<BasicInfoProps> = (props: any) => {
<Form.Item
label="要求报名时间"
style={{ margin: 0 }}
required>
required={activitySignUpType === 1 ? true : false}
>
<Space style={{ display: 'flex' }} align='baseline'>
<Form.Item
name='signUpStartTime'
rules={[
{ required: true, message: '请选择要求报名时间!' }, () => ({
{ required: activitySignUpType === 1 ? true : false, message: '请选择要求报名时间!' }, () => ({
async validator(_, value) {
let _exVal = await form.getFieldValue('signUpEndTime');
if (_exVal && moment(value).isAfter(_exVal)) {
......@@ -146,7 +149,7 @@ const BasicInfoLayout: React.FC<BasicInfoProps> = (props: any) => {
<Form.Item
name='signUpEndTime'
rules={[
{ required: true, message: '请选择活动结束时间!' }, () => ({
{ required: activitySignUpType === 1 ? true : false,message: '请选择活动结束时间!' }, () => ({
async validator(_, value) {
let _exVal = await form.getFieldValue('signUpStartTime');
if (_exVal && moment(value).isBefore(_exVal)) {
......
......@@ -23,7 +23,6 @@ export const ACTIVITYTYPEARRAY: activityType = [
{ lable: '套餐', value: 15 },
{ lable: '试用', value: 16 },
]
/** 叠加活动类型 */
export const OVERLAYACTIVITYTYPE = (int) => {
switch (Number(int)) {
......@@ -93,8 +92,8 @@ export const OVERRUNRULETYPE = (int) => {
case 7:
case 13:
return [
{ label: '不可购买', value: 1 },
{ label: '按个人限购最高级享受优惠', value: 2 },
{ label: '不可购买', value: 2 },
{ label: '按个人限购最高级享受优惠', value: 1 },
]
}
}
......
......@@ -19,3 +19,59 @@
}
}
}
.cell {
display: flex;
align-items: center;
h5 { margin-bottom: 2em; }
.label {
flex: 0 0 25%;
color: #909399;
}
.content {
flex: 0 0 70%;
display: flex;
.selector {
width: 68px;
height: 32px;
color: #252D37;
background: #FAFBFC;
text-align: center;
line-height: 32px;
}
}
}
.colStyle {
position: relative;
padding: 10px 16px;
border-color: transparent;
background-color: #FAFBFC;
cursor: pointer;
.cell {
h5 { margin-bottom: 0px; }
.label,
.content {
flex: 1;
}
}
:global {
.ant-checkbox-wrapper {
width: 100%;
height: 100%;
display: block;
position: absolute;
left: 0;
top: 0;
.ant-checkbox {
display: none;
}
}
.ant-checkbox-wrapper-checked {
border: 1px solid @main-color;
}
}
}
.shopLevelConfigChecked {
border: 1px solid;
border-color: @main-color;
box-sizing: border-box;
}
import React from 'react';
import { Form, Checkbox } from 'antd';
import React, { useCallback, useState, useEffect } from 'react';
import { Form, Checkbox, Row, Col, Image } from 'antd';
import CardLayout from '../card';
import cx from 'classnames';
import style from './index.less';
import { PublicApi } from '@/services/api';
import { isEmpty } from '@/components/NiceForm/components/AntUpload/shared';
import IMG_LEVEL1 from '@/asserts/level1.png';
import IMG_LEVEL2 from '@/asserts/level2.png';
import IMG_LEVEL3 from '@/asserts/level3.png';
import IMG_LEVEL4 from '@/asserts/level4.png';
const PIC_MAP = {
1: IMG_LEVEL1,
2: IMG_LEVEL2,
3: IMG_LEVEL3,
4: IMG_LEVEL4,
};
interface PartakeUserLayoutProps {
/** 返回等级 */
onGetLevel?: (e: any) => void,
/** 回显数据 */
onSetLevel?: any[],
/** 会员类型 */
setMemberType?: any[]
}
const PartakeUserLayout: React.FC<PartakeUserLayoutProps> = (props: any) => {
const { onGetLevel, onSetLevel, setMemberType } = props
const [allUser, setAllUser] = useState<any[]>([]);
const [allMemberType, setAllMemberType] = useState<any[]>([]);
const [roleIds, setRoleIds] = useState<Number[]>([]);
const [levelConfig, setLevelConfig] = useState<any[]>([]);
const suitableMemberTypeList = useCallback(async () => {
await PublicApi.getMarketingCouponPlatformSuitableMemberTypeList().then(res => {
if (res.code !== 1000) {
return
}
setAllUser(res.data)
})
await PublicApi.getMarketingCouponPlatformMemberTypeList().then(res => {
if (res.code !== 1000) {
return
}
setAllMemberType(res.data)
})
}, [])
const handleChange = (e) => {
setRoleIds(e)
}
useEffect(() => {
suitableMemberTypeList()
}, [])
useEffect(() => {
if (!isEmpty(roleIds)) {
PublicApi.getMemberManageMarketingSuitableLevelConfigPage({ levelConfigIds: '', roleIds: roleIds.join(','), current: '1', pageSize: '999' }).then(res => {
if (res.code !== 1000) {
return
}
setLevelConfig(res.data.data)
})
}
}, [roleIds])
const handleLevelConfig = (e) => {
const data = [...levelConfig]
onGetLevel(data.filter(item => e.includes(item.id)))
}
// useEffect(() => {
// if (!isEmpty(onSetLevel)) {
// levelConfig.forEach(item => {
// onSetLevel.filter(_item => _item.id === item.id).forEach(v => {
// if (v.id === item.id) {
// item.checked = true
// }
// })
// })
// setLevelConfig([...levelConfig]);
// onGetLevel([...levelConfig])
// }
// }, [onSetLevel])
useEffect(() => {
if (!isEmpty(setMemberType)) {
setRoleIds(setMemberType)
}
}, [setMemberType])
const PartakeUserLayout = () => {
return (
<CardLayout
id="partakeUserLayout"
......@@ -14,27 +100,71 @@ const PartakeUserLayout = () => {
name="allUser"
label="适用新老会员"
tooltip="当天平台审核通过的平台会员为新会员,非当天审核通过的平台会员为老会员"
rules={[{required: true, message: '请选择适用新老会员'}]}
rules={[{ required: true, message: '请选择适用新老会员' }]}
className={style.rulesLayout}
>
<Checkbox.Group>
<Checkbox value={1}>全部</Checkbox>
<Checkbox value={2}>新会员(平台会员)</Checkbox>
<Checkbox value={3}>老会员(平台会员)</Checkbox>
{allUser.map(item => (
<Checkbox key={`allUser${item.value}`} value={item.value}>{item.name}</Checkbox>
))}
</Checkbox.Group>
</Form.Item>
<Form.Item
name="allMember"
name="allMemberType"
label="适用会员类型"
rules={[{required: true, message: '请选择适用会员类型'}]}
rules={[{ required: true, message: '请选择适用会员类型' }]}
className={style.rulesLayout}
>
<Checkbox.Group>
<Checkbox value={1}>全部</Checkbox>
<Checkbox value={2}>企业会员</Checkbox>
<Checkbox value={3}>个人会员</Checkbox>
<Checkbox.Group onChange={handleChange}>
{allMemberType.map(item => (
<Checkbox key={`allMemberType${item.value}`} value={item.value}>{item.name}</Checkbox>
))}
</Checkbox.Group>
</Form.Item>
{!isEmpty(roleIds) && (
<Form.Item
name="memberLevelList"
rules={[{ required: true, message: '请选择' }]}
>
<Checkbox.Group onChange={handleLevelConfig}>
<Row gutter={[24, 24]}>
{levelConfig.map(item => (
<Col span={12} key={item.id}>
<div className={style.colStyle}>
<Row>
<Col span={6}>
<div className={style.cell}>
<h5 className={style.label}>会员类型: </h5>
<h5 className={style.content}>{item.memberTypeName}</h5>
</div>
</Col>
<Col span={6}>
<div className={style.cell}>
<h5 className={style.label}>会员角色: </h5>
<h5 className={style.content}>{item.roleName}</h5>
</div>
</Col>
<Col span={6}>
<div className={style.cell}>
<h5 className={style.label}>等级类型: </h5>
<h5 className={style.content}>{item.levelTypeName}</h5>
</div>
</Col>
<Col span={6}>
<div className={style.cell}>
<h5 className={style.label}>等级标签: </h5>
<h5 className={style.content}><Image width={56} height={16} preview={false} src={PIC_MAP[item.level]} /></h5>
</div>
</Col>
</Row>
<Checkbox value={item.id} />
</div>
</Col>
))}
</Row>
</Checkbox.Group>
</Form.Item>
)}
</CardLayout>
)
......
......@@ -222,8 +222,8 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => {
<Form.Item
{...restField}
style={{ margin: 0 }}
name={[name, 'key']}
fieldKey={[fieldKey, 'key']}
name={[name, `${int === 7 ? 'num' : 'key'}`]}
fieldKey={[fieldKey, `${int === 7 ? 'num' : 'key'}`]}
rules={[{ required: true, message: '请输入' }]}
>
<Input addonAfter="个" />
......@@ -232,8 +232,8 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => {
<Form.Item
{...restField}
style={{ margin: 0 }}
name={[name, 'value']}
fieldKey={[fieldKey, 'value']}
name={[name, `${int === 7 ? 'discount' : 'value'}`]}
fieldKey={[fieldKey, `${int === 7 ? 'discount' : 'value'}`]}
rules={[{ required: true, message: '请输入' }]}
>
<Input addonAfter="个" />
......@@ -335,10 +335,10 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => {
同一用户限制
<Form.Item
style={{ margin: 0 }}
name={['activityDefinedBO', 'restrictPrice']}
name={['activityDefinedBO', 'restrictNum']}
rules={[{ required: true, message: '请输入' }]}
>
<Input style={{ width: '160px' }} addonAfter="" />
<Input style={{ width: '160px' }} addonAfter="" />
</Form.Item>
</Space>
</Form.Item>
......
......@@ -52,7 +52,6 @@ const ShopLayout: React.FC<shopListProps> = (props: any) => {
}
})
})
console.log(mallList, 962039)
setMallList([...mallList]);
onGetShopList([...mallList])
}
......
......@@ -17,7 +17,7 @@ const tokenList = [
{ name: 'enhance', token: '594a7e7ff17f6f40fb9fb726c1da9a3f282a926a8d386eb6cbfd668a3f75f251', categoryIds: [0] }, // 加工服务
{ name: 'AfterService', token: 'bac1c7ca2c63869ec87085b0b33e830fea19f707dea5763f1bf8f2dc5996bde8', categoryIds: [0] }, // 售后服务
{ name: 'Platform', token: 'cadc3b13452c3ec67b5ef0c57063f12142e857a9eaa64669e80165adf42f5861', categoryIds: [0] }, // 平台后台v2
{ name: 'MemberV2', token: '87f86a297246fbf1c0dff7d34f13729cb194935a95db077a5009ac4ea48cea6f', categoryIds: [0] }, //会员服务 V2
{ name: 'MemberV2', token: 'be87c2732cb1253f82fe6c27d6cca9982c7dca9b384e46cc2e797b5835846834', categoryIds: [0] }, //会员服务 V2
{ name: 'ReportV2', token: 'dab50c384c27f1c981a03f2c44ad76d1e7e1f60b4520bd279cea67f5cf146cee', categoryIds: [0] }, // 报表服务v2
{ name: 'SettleV2', token: 'fed8d45aa92e7f0e382a3dcc5e0ef63f13f0badeabab76d6a6e2db49aa403346', categoryIds: [0] }, //结算服务v2
{ name: 'MessageV2', token: '69a667ec9861e8bdc25b89238d0b908a2123d9fce26e72fec3cdf6cd0b1f2681', categoryIds: [0] }, // 消息服务v2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment