Commit cc81759d authored by XieZhiXiong's avatar XieZhiXiong

chore: 抽离 会员等级标签 组件

parent b8b9383d
.brand {
display: inline-block;
width: 54px;
height: 16px;
line-height: 16px;
font-size: 0;
> img {
width: 100%;
height: 100%;
}
}
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:35
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-18 17:14:54
* @Description: 会员等级标签
*/
import React from 'react';
import IMG_LEVEL1 from '@/assets/imgs/level1.png';
import IMG_LEVEL2 from '@/assets/imgs/level2.png';
import IMG_LEVEL3 from '@/assets/imgs/level3.png';
import IMG_LEVEL4 from '@/assets/imgs/level4.png';
import styles from './index.less';
enum levelEnum {
'青铜会员' = 1,
'白银会员' = 2,
'黄金会员' = 3,
'钻石会员' = 4,
}
export interface LevelBrandProps {
/**
* 等级
*/
level: levelEnum;
};
const PIC_MAP = {
1: IMG_LEVEL1,
2: IMG_LEVEL2,
3: IMG_LEVEL3,
4: IMG_LEVEL4,
};
const LevelBrand: React.FC<LevelBrandProps> = ({ level }) => {
const current = PIC_MAP[level] || '';
return (
<div className={styles.brand}>
{current && <img src={current} />}
</div>
);
};
export default LevelBrand;
\ No newline at end of file
......@@ -15,7 +15,7 @@ import { DatePicker } from '@formily/antd-components'
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect'
import StatusTag from '@/components/StatusTag'
import { accountMemberType, accountStatusMap, memberStatusMap } from '../../constant'
import LevelBrand from '@/pages/member/components/LevelBrand'
import LevelBrand from '@/components/LevelBrand'
import { validatorByte } from '@/utils/regExp'
import { GetPayMemberAssetAccountGetMemberAssetAccountListResponseDetail } from '@/services/PayApi'
......
......@@ -13,7 +13,7 @@ import EyePreview from '@/components/EyePreview'
import { DatePicker } from '@formily/antd-components'
import StatusTag from '@/components/StatusTag'
import { accountStatusMap, memberStatusMap, memberLevelTypeMap, accountMemberType } from '../../constant'
import LevelBrand from '@/pages/member/components/LevelBrand'
import LevelBrand from '@/components/LevelBrand'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
const formActions = createFormActions();
......
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