|
|
@@ -18,6 +18,7 @@ import { |
|
|
|
CreateMemberInfo |
|
|
|
} from './service'; |
|
|
|
import { get, set } from 'lodash-es'; |
|
|
|
import { encode, decode } from 'js-base64'; |
|
|
|
|
|
|
|
|
|
|
|
const CheckboxGroup = Checkbox.Group; |
|
|
@@ -26,6 +27,30 @@ const plainOptions = ['Apple', 'Pear', 'Orange']; |
|
|
|
const defaultCheckedList = ['Apple', 'Orange']; |
|
|
|
|
|
|
|
const key = 'message'; |
|
|
|
|
|
|
|
/** |
|
|
|
* 判断会员名称是否被小程序加密 |
|
|
|
* @param {*} str |
|
|
|
* @returns |
|
|
|
*/ |
|
|
|
const isBase64 = (str) => { |
|
|
|
const result = decode(str); |
|
|
|
if (result.includes('BPA_BASE64')) { |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 对小程序加密的昵称进行解密 |
|
|
|
* @param {*} str |
|
|
|
* @returns |
|
|
|
*/ |
|
|
|
const decodeBPABase64 = (str) => { |
|
|
|
return decode(str).replace('BPA_BASE64', ''); |
|
|
|
} |
|
|
|
|
|
|
|
const MemberManage = () => { |
|
|
|
const actionRef = useRef(); |
|
|
|
const actionRef2 = useRef(); |
|
|
@@ -50,8 +75,8 @@ const MemberManage = () => { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
//添加会员信息 |
|
|
|
const AddMemberInfo = async (fields) => { |
|
|
|
//添加会员信息 |
|
|
|
const AddMemberInfo = async (fields) => { |
|
|
|
message.loading('正在添加...', key); |
|
|
|
try { |
|
|
|
await CreateMemberInfo(JSON.stringify(fields)).then((r) => { |
|
|
@@ -185,6 +210,9 @@ const MemberManage = () => { |
|
|
|
dataIndex: 'nickName', |
|
|
|
valueType: 'textarea', |
|
|
|
hideInForm: true, |
|
|
|
render: (_, record) => ( |
|
|
|
<a>{isBase64(record.nickName) ? decodeBPABase64(record.nickName) : record.nickName}</a> |
|
|
|
) |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '电话', |
|
|
@@ -244,19 +272,19 @@ const MemberManage = () => { |
|
|
|
render: (_, record) => { |
|
|
|
let template = [ |
|
|
|
<a |
|
|
|
key="primary" |
|
|
|
type="primary" |
|
|
|
onClick={() => { |
|
|
|
SetCreateModalVisible(true); |
|
|
|
setCurrentRow(() => { |
|
|
|
record.birthday = moment(record.birthday); |
|
|
|
setIsLook(true); |
|
|
|
return record; |
|
|
|
}); |
|
|
|
}} |
|
|
|
> |
|
|
|
详情 |
|
|
|
</a>, |
|
|
|
key="primary" |
|
|
|
type="primary" |
|
|
|
onClick={() => { |
|
|
|
SetCreateModalVisible(true); |
|
|
|
setCurrentRow(() => { |
|
|
|
record.birthday = moment(record.birthday); |
|
|
|
setIsLook(true); |
|
|
|
return record; |
|
|
|
}); |
|
|
|
}} |
|
|
|
> |
|
|
|
详情 |
|
|
|
</a>, |
|
|
|
<a |
|
|
|
key="primary" |
|
|
|
type="primary" |
|
|
@@ -543,10 +571,10 @@ const MemberManage = () => { |
|
|
|
</> |
|
|
|
</Modal> |
|
|
|
{/* 积分记录 */} |
|
|
|
<IntegralRecord |
|
|
|
onClose={()=>{SetIntegralRecordVisible(false);}} |
|
|
|
memberId={currentRow?.id} |
|
|
|
integralRecordVisible={integralRecordVisible} |
|
|
|
<IntegralRecord |
|
|
|
onClose={() => { SetIntegralRecordVisible(false); }} |
|
|
|
memberId={currentRow?.id} |
|
|
|
integralRecordVisible={integralRecordVisible} |
|
|
|
/> |
|
|
|
</PageContainer> |
|
|
|
); |
|
|
|