Commit 7eb772a6 authored by tanjiaying's avatar tanjiaying

更新代码

parent 49c9b2e4
......@@ -20,22 +20,33 @@ const MemberRoute = {
{
path: '/memberAbility/manage/import',
name: 'memberImport',
key: 'memberImport',
component: '@/pages/member/memberImport/index',
},
{
path: '/memberAbility/manage/maintian',
name: 'memberMaintain',
key: 'memberMaintain',
component: '@/pages/member/memberMaintain/index',
},
{
path: '/memberAbility/manage/upgradeRule',
name: 'memberUpgradeRule',
key: 'memberUpgradeRule',
component: '@/pages/member/memberUpgradeRule/index',
},
{
path: '/memberAbility/manage/level',
name: 'memberLevel',
component: '@/pages/member/memberLevel/index',
key: 'memberLevel',
component: '@/pages/member/memberLevel/index'
},
{
path: '/memberAbility/manage/level/addEquity',
name: 'addEquity',
key: 'addEquity',
hideInMenu: true,
component: '@/pages/member/memberLevel/addEquity',
}
]
}
......
......@@ -23,10 +23,12 @@
"dependencies": {
"@ant-design/icons": "^4.2.1",
"@ant-design/pro-layout": "^5.0.16",
"@formily/antd": "^1.2.7",
"@formily/antd-components": "^1.2.7",
"@umijs/preset-react": "1.x",
"@umijs/test": "^3.2.0",
"bizcharts": "^4.0.7",
"god": "0.0.36",
"god": "0.1.3",
"lint-staged": "^10.0.7",
"mobx": "^5.15.4",
"mobx-react": "^6.2.2",
......
......@@ -44,6 +44,7 @@ export default {
'menu.memberAbility.memberManage.memberMaintain': '会员维护',
'menu.memberAbility.memberManage.memberUpgradeRule': '会员升级规则',
'menu.memberAbility.memberManage.memberLevel': '会员等级',
'menu.memberAbility.memberManage.addEquity': '会员权益设置',
// 店铺能力
'menu.shopAbility': '店铺',
......
......@@ -12,18 +12,6 @@ import { ColumnType } from 'antd/lib/table/interface'
import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController'
import './index.less'
interface Item {
key: string;
id: string;
level: string;
name: string;
type: string;
role: string;
applyTime: string;
status: string;
externalStatus: string;
}
const data = [
{
key: '1',
......@@ -59,7 +47,9 @@ const data = [
externalStatus: '待提交',
}
]
const handleSubmit = (record: any) => {
console.log(record)
}
const memberImport: React.FC<{}> = () => {
const ref = useRef({})
......@@ -70,7 +60,7 @@ const memberImport: React.FC<{}> = () => {
title: 'ID',
dataIndex: 'id',
align: 'center',
key: 'id',
key: 'id'
},
{
title: '会员名称',
......
import React, { ReactNode, useState, useRef } from 'react'
import { history } from 'umi'
import { Button, Popconfirm, Card, Input, Slider, Row, Col } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PlayCircleOutlined, ContainerOutlined } from '@ant-design/icons'
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
import './index.less'
const data = [
{
key: '1',
id: '1',
name: '价格权益',
explain: '交易一方能获得另一方的价格折扣',
type: '交易获取',
setting: '按交易金额比例设置',
params: '1',
status: 2
},
{
key: '2',
id: '2',
name: '返现权益',
explain: '交易一方能获得另一方的交易返现',
type: '交易获取',
setting: '按交易金额比例设置',
params: '1',
status: 1
}
]
const addEquity: React.FC<[]> = () => {
const ref = useRef({})
const [thresholdValue, setThresholdValue] = useState(10000)
const marks = {
0: '0',
5000: '5000',
10000: '10000',
15000: '15000',
20000: '20000',
50000: '50000',
};
const columns: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'id',
align: 'center',
key: 'id',
},
{
title: '会员权益名称',
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '会员权益说明',
dataIndex: 'explain',
align: 'center',
key: 'explain',
},
{
title: '权益获取方式',
dataIndex: 'type',
align: 'center',
key: 'type',
},
{
title: '参数设置方式',
dataIndex: 'setting',
align: 'center',
key: 'setting',
},
{
title: '参数',
dataIndex: 'params',
align: 'center',
key: 'params',
},
{
title: '状态',
dataIndex: 'status',
align: 'center',
key: 'status',
render: (text: any, record: any) => {
let component: ReactNode = null
component = (
<Popconfirm
title="确定要执行这个操作?"
onConfirm={confirm}
onCancel={cancel}
okText="是"
cancelText="否"
>
<Button type="link" onClick={() => handleModify(record)} style={record.status === 1 ? { color: '#00B37A' } : { color: 'red' }}>{record.status === 1 ? '有效' : '无效'} <PlayCircleOutlined /></Button>
</Popconfirm>
)
return component
}
}
];
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
const queryResult = data.find(v => v.key === params.keywords)
setTimeout(() => {
resolve({
code: 200,
message: '',
data: queryResult ? [queryResult] : data
})
}, 1000)
})
}
const handleSee = (record: any) => {
}
const confirm = () => {
console.log('confirm')
}
const cancel = () => {
console.log('cancel')
}
const handleModify = (record: object) => {
// 通过传入的params字符串判断是修改那种类型的数据
console.log('执行状态修改', record)
}
const handleInput = (e: any) => {
console.log(e)
}
return (
<PageHeaderWrapper
onBack={() => window.history.back()}
title={[
<>
<div className='headerTop'>
<div className='headerTop-icon'></div>
<div className='headerTop-level'>钻石会员</div>
<div className='headerTop-identity'>商户会员</div>
</div>
</>
]}
content={[
<div className='headerMain'>
<div className='headerMain-left'>
<div className='headerMain-left-option'>
<div>会员等级:</div>
<div>1</div>
</div>
<div className='headerMain-left-option'>
<div>升级分值标签:</div>
<div>交易分</div>
</div>
<div className='headerMain-left-option'>
<div>角色类型:</div>
<div>服务消费</div>
</div>
<div className='headerMain-left-option'>
<div>会员等级说明:</div>
<div>商户所属钻石会员</div>
</div>
<div className='headerMain-left-option'>
<div>会员角色名称:</div>
<div>采购商</div>
</div>
<div className='headerMain-left-option'>
<div>会员类型:</div>
<div>企业会员</div>
</div>
</div>
<div className='headerMain-right'>
<Button className='saveBtn' icon={<ContainerOutlined />}>保存</Button>
</div>
</div>
]}
>
<Card>
<StandardTable
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<>
<div className='extra'>
<h3>升级阀值</h3>
<div className='extra-main'>
<div className='extra-main-content left'>
<div className='icon'>当前阀值</div>
<div className='input'>
<div className='input-main'>
<Input className='input-main-com'
value={thresholdValue}
onChange={(e: any) => { e.persist(); setThresholdValue(e.target.value) }}
/>
</div>
</div>
</div>
<div className='extra-main-content right'>
<Slider
marks={marks}
max={50000}
value={thresholdValue}
onChange={(val: number) => setThresholdValue(val)}
/>
</div>
</div>
</div>
<h3>会员权益</h3>
</>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default addEquity
\ No newline at end of file
.row {
display : flex;
justify-content: flex-end;
box-sizing : border-box;
.col {
padding-left : 6px;
padding-right: 6px;
padding : 0 8px;
margin-bottom: 12px;
}
}
.headerMain {
display: flex;
&-left {
flex : 6;
display : flex;
flex-wrap : wrap;
padding-left: 90px;
&-option {
display : flex;
width : calc(100% / 3);
margin-bottom: 17px;
font-size : 14px;
font-family : PingFangSC-Regular, PingFang SC;
font-weight : 400;
color : #6B778C;
padding-right: 20px;
&:nth-of-type(n + 4) {
margin: 0;
}
div {
flex: 1;
&:nth-last-of-type(1) {
flex: 2;
}
}
}
}
&-right {
flex : 1;
text-align: right;
.saveBtn {
color : #fff;
background: @main-color
}
}
}
.levelIcon1 {
width : 100%;
......@@ -36,4 +84,118 @@
height : 20px;
background : url("../../../assets/imgs/vip4@2x.png") no-repeat center;
background-size: 24px 20px;
}
.headerTop {
display : flex;
align-items: center;
font-size : 20px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
&-icon {
width : 48px;
height : 48px;
line-height : 48px;
border-radius : 4px;
border : 1px solid #DFE1E6;
color : #fff;
text-align : center;
background-color: #8777D9;
}
&-level {
color : #172B4D;
margin: 0 8px 0 12px;
}
&-identity {
width : 72px;
height : 24px;
line-height : 24px;
background-color: #FFEBE6;
border-radius : 4px;
color : #E63F3B;
font-size : 14px;
font-weight : 400;
text-align : center;
}
}
h3 {
margin-bottom: 20px;
}
.extra {
margin-bottom: 48px;
&-main {
display: flex;
&-content {
position: relative;
flex : 1;
height : 104px;
&:nth-last-of-type(1) {
flex: 2.5;
}
}
.left {
display : flex;
justify-content: center;
align-items : center;
.icon {
position : absolute;
left : 0;
top : 0;
width : 72px;
height : 24px;
color : #fff;
background-color: #42526E;
border-radius : 4px 0px 4px 0px;
text-align : center;
}
.input {
display : flex;
justify-content: center;
&-main {
position : relative;
width : 128px;
height : 38px;
padding-bottom: 8px;
&::after {
content : '';
position : absolute;
left : 0;
bottom : 0;
width : 100%;
height : 1px;
background-color: #DFE1E6;
}
&-com {
width : 100%;
height : 100%;
border : 0;
outline : none;
background-color: rgba(0, 0, 0, 0);
font-size : 32px;
font-family : PingFangSC-Medium, PingFang SC;
font-weight : 500;
color : #172B4D;
}
}
}
}
.right {
padding: 27px 40px;
}
}
}
\ No newline at end of file
......@@ -3,7 +3,6 @@ import { history } from 'umi'
import { Row, Col, Button, Popconfirm, Card, Input } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import {
PlusOutlined,
UpOutlined,
DownOutlined,
PlayCircleOutlined,
......@@ -11,7 +10,6 @@ import {
} from '@ant-design/icons'
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController'
import './index.less'
interface Item {
......@@ -169,7 +167,7 @@ const memberLevel: React.FC<[]> = () => {
title: '操作',
dataIndex: 'option',
align: 'center',
render: (record: any) => <Button type='link'>设置</Button>
render: (record: any) => <Button type='link' onClick={(record) => handleSet(record)}>设置</Button>
}
];
......@@ -212,6 +210,10 @@ const memberLevel: React.FC<[]> = () => {
}
const handleSet = (record: any) => {
history.push('/memberAbility/manage/level/addEquity')
}
return (
<PageHeaderWrapper>
<Card>
......@@ -222,7 +224,7 @@ const memberLevel: React.FC<[]> = () => {
controlRender={
<Row className='row'>
<Col className='col' span={4}>
<Input.Search onSearch={(val) => handleSearch(val)} />
<Input.Search placeholder="搜索" onSearch={(val) => handleSearch(val)} />
</Col>
<Col className='col'>
<Button onClick={() => setIsSearch(isSearch = !isSearch)}>高级筛选{isSearch ? <UpOutlined /> : <DownOutlined />}</Button>
......@@ -232,7 +234,14 @@ const memberLevel: React.FC<[]> = () => {
</Col>
{
isSearch ?
<Col span={24} className='col'>132</Col>
<Col span={24} className='row'>
<Col className='col' span={4}>
<Input placeholder="会员等级标签"></Input>
</Col>
<Col className='col' span={4}>
<Input placeholder="会员角色名称"></Input>
</Col>
</Col>
:
''
}
......
......@@ -8,6 +8,8 @@ import { ColumnType } from 'antd/lib/table/interface'
import { IFormFilter, IButtonFilter } from 'god/dist/src/standard-table/TableController'
import './index.less'
import { getUpgradeRuleList } from '@/services/memberAbility/memberUpgrade'
interface Item {
}
......@@ -94,6 +96,8 @@ const memberUpgradeRule: React.FC<[]> = () => {
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
// getUpgradeRuleList(params).then(res => {
// })
const queryResult = data.find(v => v.key === params.keywords)
setTimeout(() => {
resolve({
......@@ -105,6 +109,8 @@ const memberUpgradeRule: React.FC<[]> = () => {
})
}
return (
<PageHeaderWrapper extra={[<Button className='saveBtn' icon={<ContainerOutlined />}>保存</Button>]}>
<Card>
......
declare namespace UpgradeRuleApi {
interface UpgradeRuleItem {
page: number;
rows: number;
}
}
\ No newline at end of file
import request from '@/utils/request';
const prefix = '/member/promotion'
/**
* @description 会员升级规则-列表
*
*/
export async function getUpgradeRuleList(params: any) {
return request('/rule/list', {
prefix,
params
})
}
\ No newline at end of file
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