Commit c3a6e1cd authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents f77a49f5 4bc9066f
......@@ -75,7 +75,7 @@ module.exports = {
SITE_ID: '1',
BACK_GATEWAY: 'http://10.0.0.17:8100',
USE_ROUTE_CONFIG: true,
SOCKET_URL: 'ws://10.0.0.17:8100',
SOCKET_URL: 'ws://10.0.0.17:9880',
YAPI_URL: 'http://10.0.0.25:4000/',
// 注 交付中心同事可不使用下面的ssh配置
ssh: JSON.stringify({
......@@ -194,9 +194,9 @@ module.exports = {
// 阿里云demo站更新
"v2-ali-demo": {
SITE_ID: '1',
BACK_GATEWAY: 'http://lingxi-scm-gateway.shushangyun.com:13880',
BACK_GATEWAY: 'http://lingxi-scm-gateway.shushangyun.com',
USE_ROUTE_CONFIG: true,
SOCKET_URL: 'ws://lingxi-scm-gateway.shushangyun.com:13880',
SOCKET_URL: 'ws://lingxi-scm-gateway.shushangyun.com',
YAPI_URL: 'http://10.0.0.25:4000/'
}
}
......@@ -60,7 +60,7 @@ export default {
'logistics.pingtaiwuliufuwushang': 'Platform logistics service provider',
'logistics.shanghuhezuowuliugongsi': 'Merchant cooperative logistics company',
'logistics.qingxuanzehezuoleixing': 'Please select the type of cooperation',
'logistics.wuliugongsidaimaping': 'logistics company code/platform member ID',
'logistics.wuliugongsidaimaping': 'company code/member ID',
'logistics.wuliugongsidaima': 'logistics company code',
'logistics.qingshuruwuliugongsidai': 'Please enter the logistics company code',
'logistics.pingtaihuiyuanID': 'Platform member ID',
......@@ -75,9 +75,9 @@ export default {
'logistics.huiyuanID': 'Member ID',
'logistics.huiyuanjuese': 'Member Role',
'logistics.huiyuandengji': 'Membership level',
'logistics.xinzengwuliucompany': 'New logistics company',
'logistics.bianjiwuliucompany': 'Edit logistics company',
'logistics.zhakanwuliucompany': 'View logistics company',
'logistics.xinzengwuliugongsi': 'New logistics company',
'logistics.bianjiwuliugongsi': 'Edit logistics company',
'logistics.zhakanwuliugongsi': 'View logistics company',
'logistics.xuanze': 'Select',
'logistics.xuanzepingtaiwuliufuwu': 'Choose platform logistics service provider',
'logistics.shouhuorenxingming': 'Consignee Name',
......
......@@ -61,7 +61,7 @@ const RealnameLayout = () => {
if (info?.frontUrl && info?.backUrl && term) {
postMemberSecurityUploadIdCard({ frontUrl: info?.frontUrl, backUrl: info?.backUrl }).then((res) => {
if (res.code !== 1000) {
message.error(res.message)
message.error(intl.formatMessage({ id: `${res.code}` }))
return
}
const data = {
......@@ -77,7 +77,7 @@ const RealnameLayout = () => {
useEffect(() => {
getMemberSecurityGetUserInfo().then((res: any) => {
if (res.code !== 1000) {
message.error(res.message)
message.error(intl.formatMessage({ id: `${res.code}` }))
return
}
const { data } = res
......@@ -89,7 +89,7 @@ const RealnameLayout = () => {
setLoading(true)
postMemberSecuritySaveAuthInfo({ ...info } as any).then((res: any) => {
if (res.code !== 1000) {
message.error(res.message)
message.error(intl.formatMessage({ id: `${res.code}` }))
setLoading(false)
return
}
......
......@@ -672,6 +672,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
purchasePrice: item.price,
purchaseCount: item.quantity,
purchaseAmount: +(item.price * item.quantity).toFixed(2),
type: item.spec,
replaceCount: '',
replaceReason: '',
extraData: {
......
......@@ -536,7 +536,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
brand: item.brand,
unit: item.unit,
purchaseCount: item.quantity,
type: item.type,
type: item.spec,
repairReason: '',
extraData: {
id: item.id,
......
......@@ -697,7 +697,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
purchaseCount: item.quantity,
purchaseAmount: +(item.price * item.quantity).toFixed(2),
payAmount: item.paidAmount,
type: item.type,
type: item.spec,
returnCount: '',
refundAmount: undefined,
extraData: {
......
......@@ -220,7 +220,7 @@ const SettlementList = () => {
id: itemInfo.id.toString()
})
if (res.code !== 1000) {
message.error(res.message);
message.error(intl.formatMessage({ id: `${res.code}` }));
return;
}
setRandomCode(res.data);
......
......@@ -119,7 +119,7 @@ const MemberSettleAdd: React.FC = () => {
if (code !== 1000) {
return config
}
}
const codeToMap = ["", "days", "month"]
data.forEach((_item) => {
config[codeToMap[_item.methodCode]] = true
......@@ -252,7 +252,7 @@ const MemberSettleAdd: React.FC = () => {
memberRowCtl.setSelectRow(list);
memberRowCtl.setSelectedRowKeys(res.data.memberList.map((item) => item.memberId + "_" + item.roleId))
} else {
message.error({ content: res.message })
message.error({ content: intl.formatMessage({ id: `${res.code}` }) })
}
}
getInfo();
......
......@@ -75,7 +75,7 @@ const UserCenter: React.FC<Iprops> = (props) => {
{`Hi, ${userAuth?.company}! ${intl.formatMessage({ id: 'home.userCenter.wellcome' })}${GlobalConfig.global.siteInfo.name}`}
</div>
<div className={styles.date}>
{today.format(`YYYY[${intl.formatMessage({ id: 'home.userCenter.year' })}]MM[${intl.formatMessage({ id: 'home.userCenter.month' })}]DD[${intl.formatMessage({ id: 'home.userCenter.day' })}]`)} {intl.formatMessage({ id: `home.userCenter.day${today.day()}` })}
{today.format(`YYYY-MM-DD`)} {intl.formatMessage({ id: `home.userCenter.day${today.day()}` })}
</div>
</div>
<div className={styles.images}>
......
......@@ -112,7 +112,7 @@ const AccountDetail: React.FC<{}> = () => {
getAccountInfo()
}
} else {
message.error(res.message)
message.error(intl.formatMessage({ id: `${res.code}` }))
}
})
}
......
......@@ -147,7 +147,7 @@ const EAccountDetail: React.FC<{}> = () => {
getAccountInfo()
}
} else {
message.error(res.message)
message.error(intl.formatMessage({ id: `${res.code}` }))
}
})
}
......
......@@ -187,13 +187,13 @@ const ConfirmOfferDetail = () => {
title: intl.formatMessage({id: 'dealAbility.baojiadanjia'}),
key: 'price',
dataIndex: 'price',
render: price => <>{price ? `¥${price.toFixed(2)}` : '¥0.00'}</>
render: price => <>{price ? `${intl.formatMessage({id: 'common.money'})}${price.toFixed(2)}` : `${intl.formatMessage({id: 'common.money'})}0.00`}</>
},
{
title: intl.formatMessage({id: 'dealAbility.jine'}),
key: 'money',
dataIndex: 'money',
render: money => <>{money ? `¥${money.toFixed(2)}` : '¥0.00'}</>
render: money => <>{money ? `${intl.formatMessage({id: 'common.money'})}${money.toFixed(2)}` : `${intl.formatMessage({id: 'common.money'})}0.00`}</>
},
]
......
import React, { useRef } from 'react';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { getIntl, history } from 'umi';
import { Tag, Badge, Button } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
......
import React, { useRef, useState } from 'react';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { getIntl, history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
......
import React, { useRef, useState } from 'react';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { getIntl, history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
......
import React, { useRef, useState } from 'react';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { getIntl, history } from 'umi';
import { Tag, Badge, Button, Row, Col } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
......
import React, { useRef, useState } from 'react';
import { getIntl, history } from 'umi';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { Tag, Badge, Button, Row, Col } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
......
......@@ -190,13 +190,13 @@ const InquiryOfferDetail = () => {
title: intl.formatMessage({id: 'dealAbility.baojiadanjia'}),
key: 'price',
dataIndex: 'price',
render: price => <>{price ? `¥${price.toFixed(2)}` : '¥0.00'}</>
render: price => <>{price ? `${intl.formatMessage({id: 'common.money'})}${price.toFixed(2)}` : `${intl.formatMessage({id: 'common.money'})}0.00`}</>
},
{
title: intl.formatMessage({id: 'dealAbility.jine'}),
key: 'money',
dataIndex: 'money',
render: money => <>{money ? `¥${money.toFixed(2)}` : '¥0.00'}</>
render: money => <>{money ? `${intl.formatMessage({id: 'common.money'})}${money.toFixed(2)}` : `${intl.formatMessage({id: 'common.money'})}0.00`}</>
},
{
title: intl.formatMessage({ id: 'dealAbility.caozuo' }),
......@@ -253,7 +253,7 @@ const InquiryOfferDetail = () => {
title: intl.formatMessage({id: 'dealAbility.baojiadanjia'}),
key: 'price',
dataIndex: 'price',
render: price => <>{price ? `¥${price.toFixed(2)}` : '¥0.00'}</>
render: price => <>{price ? `${intl.formatMessage({id: 'common.money'})}${price.toFixed(2)}` : `${intl.formatMessage({id: 'common.money'})}0.00`}</>
},
{
title: intl.formatMessage({id: 'dealAbility.xunjiahuiyuan'}),
......
import React, { useRef, useState, useEffect } from 'react';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { getIntl, history } from 'umi';
import { Tag, Button, Modal, Form, Select, Typography } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
......
import React, { useRef } from 'react';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { getIntl, history } from 'umi';
import { Tag, Badge } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
......
......@@ -94,7 +94,7 @@ const ProductQuoteLayout: React.FC<ProductQuoteLayoutProps> = (props: any) => {
<Form.Item initialValue={record.price} name={`purchaseCount${index}`} rules={[{ required: true, message: intl.formatMessage({id: 'dealAbility.qingshurubaojiadanjia'}) }]} style={{ marginBottom: '0px' }}>
<Input
onBlur={(e) => handleChange(record.productId, e)}
addonBefore="¥"
addonBefore={intl.formatMessage({id: 'common.money'})}
min={1}
type="number" />
</Form.Item>
......
import React, { useRef, useState } from 'react';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { getIntl, history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
......
import React, { useRef, useState } from 'react';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { getIntl, history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
......
import React, { useRef, useState } from 'react';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { getIntl, history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
......
import React, { useRef, useState } from 'react';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import moment from 'moment'
......
import React, { useRef } from 'react';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { Tag, Badge } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
......
import React, { useRef, useState } from 'react';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { getIntl, history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
......
import React, { useRef, useState } from 'react';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { getIntl, history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
......
import React, { useRef, useState } from 'react';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { getIntl, history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
......
import React, { useRef, useState } from 'react';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import moment from 'moment'
......
import React, { useRef } from 'react';
import { getIntl, history } from 'umi';
import { Button, Row, Col, Space, Popconfirm, Switch } from 'antd';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { ColumnType } from 'antd/lib/table/interface';
import { LOGISTICSADMINISTERSCHEMA } from '../schema';
import { PlusOutlined } from '@ant-design/icons';
......
import React, { useRef } from 'react';
import { getIntl, history } from 'umi';
import { Button, Row, Col, Space, Popconfirm } from 'antd';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { ColumnType } from 'antd/lib/table/interface';
import { LOGISTICSADMINISTERSCHEMA } from '../schema';
import { PlusOutlined } from '@ant-design/icons';
......
import React, { useRef } from 'react';
import { getIntl, history } from 'umi';
import { Button, Row, Col, Space, Popconfirm, Switch } from 'antd';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { ColumnType } from 'antd/lib/table/interface';
import { LOGISTICSADMINISTERSCHEMA } from '../schema';
import { PlusOutlined } from '@ant-design/icons';
......
import React, { useRef } from 'react';
import { getIntl, history } from 'umi';
import { Button, Row, Col, Space, Popconfirm, Switch } from 'antd';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { ColumnType } from 'antd/lib/table/interface';
import { LOGISTICSADMINISTERSCHEMA } from '../schema';
import { PlusOutlined } from '@ant-design/icons';
......
import React from 'react';
import { Tag } from 'antd';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { ColumnType } from 'antd/lib/table/interface';
import { LOGISTICSBILLQUERYSCHEMA, EXTERNALSTATE_COLOR } from '../schema';
import moment from 'moment';
......
import React from 'react';
import { Tag, Button } from 'antd';
import { getIntl, history } from 'umi';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { ColumnType } from 'antd/lib/table/interface';
import { LOGISTICSBILLQUERYSCHEMA, EXTERNALSTATE_COLOR } from '../schema';
import moment from 'moment';
......
import React from 'react';
import { Tag } from 'antd';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { ColumnType } from 'antd/lib/table/interface';
import { LOGISTICSBILLQUERYSCHEMA, EXTERNALSTATE_COLOR } from '../schema';
import moment from 'moment';
......
import React, { useRef } from 'react';
import { Tag, Row, Col, Button, Space, Popconfirm } from 'antd';
import { getIntl, history } from 'umi';
import Table from '@/pages/transaction/components/tableLayout';
import Table from '@/components/TableLayout';
import { ColumnType } from 'antd/lib/table/interface';
import { WAITSBUMITLOGISTICSBILLSCHEMA, EXTERNALSTATE_COLOR } from '../schema';
import moment from 'moment';
......
......@@ -80,10 +80,26 @@ const useGetSameKeys = () => {
result[dataIndex] = [];
}
if (dataIndex === 'combination') {
/** combination 单独处理, 这里不使用递归了 */
childNodes?.forEach((_son, _index) => {
const sonElement = pageConfig[_son];
result[`combination_${_index}`] = [];
sonElement?.childNodes?.forEach((_row) => {
const rowData = pageConfig[_row];
result[`combination_${_index}`].push(
`${rowData?.props?.id}_${rowData?.props?.activityId}`
);
});
});
return;
}
if (dataIndex !== 'suggestProduct') {
childNodes?.forEach((_son) => {
const sonElement = pageConfig[_son];
const formatedData = formatProps[dataIndex]?.(sonElement.props);
const formatedData = formatProps[dataIndex]?.(sonElement?.props || {});
if (formatProps) {
result[dataIndex].push(formatedData);
}
......
import { ACTIVITY_LIST } from '@/constants/activity';
import { postTemplateWebActivityPageAdorn } from '@/services/TemplateV2Api';
import { CodeSandboxCircleFilled } from '@ant-design/icons';
import { message } from 'antd';
import { omit, pick } from 'lodash';
import { useState } from 'react';
import { history } from 'umi';
......@@ -101,7 +102,7 @@ function useSaveData(options: Options) {
childrenData: childrenData
}
});
} else if (ACTIVITY_LIST.includes( dataIndex as ACTIVITY_KEYS )) {
} else if (ACTIVITY_LIST.includes( dataIndex as ACTIVITY_KEYS ) && dataIndex !== 'combination') {
const { ...otherProps } = props || {};
const childrenData = childNodes.map((_record) => {
const childTargetProps = pageConfig[_record].props;
......@@ -116,31 +117,36 @@ function useSaveData(options: Options) {
childrenData: childrenData
}
});
} else if (dataIndex === 'suggestProduct') {
} else if (dataIndex === 'suggestProduct' || dataIndex === 'combination') {
const { ...otherProps } = props || {};
const { childNodes } = target;
const temp = {
sort: sort,
props: {
visible: otherProps.status ?? true,
title: otherProps.title,
childrenData: childNodes?.filter((_record) => /\d+-\d+/.test(_record)).map((_row) => {
const childrenNodeTarget = pageConfig[_row];
const { ...childRestProps } = childrenNodeTarget?.props;
const childrenData = childrenNodeTarget.childNodes?.map((_listItem) => {
const sonNodeTarget = pageConfig[_listItem];
if (dataIndex === 'suggestProduct') {
return {
id: sonNodeTarget?.props.id,
label: sonNodeTarget?.props?.label || []
};
}
return sonNodeTarget?.props.id
})
return {
title: childRestProps.title,
theme: childRestProps.theme || 0,
childrenData: childrenNodeTarget.childNodes?.map((_listItem) => {
const sonNodeTarget = pageConfig[_listItem];
return {
id: sonNodeTarget?.props.id,
label: sonNodeTarget?.props?.label || []
};
})
childrenData: childrenData
};
})
}
};
result = generaterData(result, 'suggestProduct', temp);
result = generaterData(result, dataIndex, temp);
}
});
const withThemeStyle = {
......@@ -152,14 +158,17 @@ function useSaveData(options: Options) {
}
}
}
const { data, code } = await postTemplateWebActivityPageAdorn({
// console.log(withThemeStyle);
// return;
const { data, code, message: msg } = await postTemplateWebActivityPageAdorn({
id: +id,
adornContent: withThemeStyle
} as any);
setSaving(false);
if (code === 1000) {
history.goBack();
}
// if (code !== 1000) {
// // history.goBack();
// message.error(msg)
// }
}
return { saving, onSave };
......
......@@ -350,6 +350,38 @@ const WebComponentModule: React.FC<Iprops> = (props: Iprops) => {
const newKey = childNodes[childNodes.length - 1] + 1
if (platform === 'mobile' && _item === 'combination') {
addChildComponent({
newKey: `${newKey}`,
componentName: COMPONENT_NAME[_item][platform]['container'],
parentPropName: '',
parentKey: '0',
childProps: {
addBtnText: "添加子节点",
canDelete: true,
childComponentName: COMPONENT_NAME[_item][platform]['childContainer'],
childNodes: [],
childProps: {
addBtnText: "添加组合促销节点",
canDelete: true,
childComponentName: 'Combination.Item',
otherProps: {
type: `combinationItemProduct`
},
childProps: {
otherProps: {
type: `combinationItem`
},
}
},
otherProps: { type: _item },
props: {visible: true, theme: 0, title: ACTIVITYS_MAP[_item].title},
title: ACTIVITYS_MAP[_item].title,
}
})
return;
}
addChildComponent({
newKey: `${newKey}`,
componentName: COMPONENT_NAME[_item][platform]['container'],
......
......@@ -116,7 +116,11 @@ const EditPanelForm = () => {
},
};
/** 如果是活动子集, 那么现实选择活动商品 */
if(activityListItem.includes(componentType) || componentType === 'hotItem' || componentType === 'suggestProductItem') {
if(
activityListItem.includes(componentType) ||
componentType === 'hotItem' ||
componentType === 'suggestProductItem'
) {
setFormValue({
product: {
...selectedInfo.props,
......@@ -146,10 +150,15 @@ const EditPanelForm = () => {
// console.log(hotItem".substring(0, 1));
formActions.setFieldState('product', (fieldState) => {
const [, parentKey] = selectedInfo.parentKey.split('-');
const disabledKeys = componentType === 'suggestProductItem'
? sameKeys[`suggestProduct_${parseInt(parentKey) - 1}`]
: componentType === 'combinationItem'
? sameKeys[`combination_${parseInt(parentKey) - 1}`]
: sameKeys[`${componentType?.substring(0, componentType.length - 4)}`] || [];
FormPath.setIn(fieldState, 'props.x-component-props', {
activityImage: activityImage,
...activityType,
disabledKeys: componentType === 'suggestProductItem' ? sameKeys[`suggestProduct_${parseInt(parentKey) - 1}`] : sameKeys[`${componentType?.substring(0, componentType.length - 4)}`] || [],
disabledKeys: disabledKeys,
...isWithLabels,
minType: isWithMinType,
// fetchOptions: fetchMemberOptions,
......
.combiantion {
margin-top: 24px;
padding: 0 8px;
margin-bottom: 12px;
padding: 0 0px;
.title {
font-size: 20px;
color: #fff;
......
......@@ -17,6 +17,11 @@ interface Iprops {
const Combination: React.FC<Iprops> & { Item: typeof CombinationItem } = (props: Iprops) => {
const { children, className, title, theme, status = true, ...other } = props;
const visible = status
const { onClick, onMouseOver, getOperateState } = props as any;
const divProps = {
onClick, onMouseOver
};
const classNameStr = cx(styles.combiantion, className, { [styles.hide]: !visible });
const omitGetOperateState = omit(other, 'getOperateState')
......@@ -38,8 +43,8 @@ const Combination: React.FC<Iprops> & { Item: typeof CombinationItem } = (props:
};
return (
<div className={classNameStr} {...omitGetOperateState}>
<p className={styles.title}>{title}</p>
<div className={classNameStr} {...divProps}>
{/* <p className={styles.title}>{title}</p> */}
<div className={styles.container}>
<div className={styles['container-title']}>以下商品认选2件,只需800元</div>
{renderChildren()}
......
......@@ -125,7 +125,10 @@ const CommodityItem: React.FC<Iprops> = (props: Iprops) => {
...otherRestProps
} = rest as any;
const activityLabel = activityList?.find((_item) => _item.id === activityId);
const withLabel = activityLabel && activityLabel.label ? {tags: [activityLabel.label]} : {};
const tags = {
tags: otherRestProps?.label || []
}
const withLabel = activityLabel && activityLabel.label ? {tags: [activityLabel.label, ...tags.tags]} : tags;
const horizontalData = {
name,
image,
......
import { useIntl } from 'umi';
import React, { useRef, useState } from 'react';
import { history } from 'umi';
import TableLayout from '../../../components/tableLayout';
import TableLayout from '../../../../../components/TableLayout';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ColumnType } from 'antd/lib/table/interface';
import StatusTag from '@/components/StatusTag';
......
import { useIntl } from 'umi';
import React, { useRef, useState } from 'react';
import { history } from 'umi';
import TableLayout from '../../../components/tableLayout';
import TableLayout from '../../../../../components/TableLayout';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ColumnType } from 'antd/lib/table/interface';
import StatusTag from '@/components/StatusTag';
......
import { useIntl } from 'umi';
import React, { useState, useRef } from 'react';
import TableLayout from '../../../components/tableLayout';
import TableLayout from '../../../../../components/TableLayout';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ColumnType } from 'antd/lib/table/interface';
import StatusTag from '@/components/StatusTag';
......
import { useIntl } from 'umi';
import React, { useRef, useState } from 'react';
import { history } from 'umi';
import TableLayout from '../../../components/tableLayout';
import TableLayout from '../../../../../components/TableLayout';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ColumnType } from 'antd/lib/table/interface';
import StatusTag from '@/components/StatusTag';
......
import { useIntl } from 'umi';
import React from 'react';
import TableLayout from '../../../components/tableLayout';
import TableLayout from '../../../../../components/TableLayout';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
......
......@@ -5,7 +5,7 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import { format } from '@/pages/transaction/common/dateFormat';
import { ColumnType } from 'antd/lib/table/interface';
import { getMarketingAbilityActivityExecutePlatformPage, getMarketingPlatformActivitySignupGetActivityTypeList, getMarketingPlatformActivitySignupGetOuterStatusList } from '@/services/MarketingV2Api';
import TableLayout from '../../../components/tableLayout';
import TableLayout from '../../../../../components/TableLayout';
import { OuterStatusColor } from '../../common/tagColor';
import { PATTERN_MAPS } from '@/constants/regExp';
import { useLinkageUtils } from '@/utils/formEffectUtils';
......
......@@ -3,7 +3,7 @@ import { useIntl } from 'umi';
import React, { useRef, useState } from 'react';
import { history } from 'umi';
import { Button, Row, Col, Tag, Badge } from 'antd'
import TableLayout from '@/pages/transaction/components/tableLayout'
import TableLayout from '@/components/TableLayout'
import { ColumnType } from 'antd/lib/table';
import EyePreview from '@/components/EyePreview';
import { format } from '@/pages/transaction/common/dateFormat';
......
......@@ -2,7 +2,7 @@ import { useIntl } from 'umi';
import React, { useRef, useState } from 'react';
import { Button, Row, Col, Tag, Badge } from 'antd'
import { history } from 'umi';
import TableLayout from '@/pages/transaction/components/tableLayout'
import TableLayout from '@/components/TableLayout'
import { ColumnType } from 'antd/lib/table';
import EyePreview from '@/components/EyePreview';
import { format } from '@/pages/transaction/common/dateFormat';
......
import { useIntl } from 'umi';
import React, { Fragment, useRef, useState } from 'react';
import { Button, Row, Col, Popconfirm, Tag, Badge } from 'antd'
import TableLayout from '@/pages/transaction/components/tableLayout'
import TableLayout from '@/components/TableLayout'
import { ColumnType } from 'antd/lib/table';
import EyePreview from '@/components/EyePreview';
import { format } from '@/pages/transaction/common/dateFormat';
......
import { useIntl } from 'umi';
import React, { Fragment, useRef, useState } from 'react';
import { Button, Row, Col, Popconfirm, Tag, Badge } from 'antd'
import TableLayout from '@/pages/transaction/components/tableLayout'
import TableLayout from '@/components/TableLayout'
import { ColumnType } from 'antd/lib/table';
import EyePreview from '@/components/EyePreview';
import { format } from '@/pages/transaction/common/dateFormat';
......
......@@ -3,7 +3,7 @@ import { useIntl } from 'umi';
import React, { Fragment, useRef, useState } from 'react';
import { history } from 'umi';
import { Button, Row, Col, Space, Popconfirm, Tag, Badge } from 'antd';
import TableLayout from '@/pages/transaction/components/tableLayout'
import TableLayout from '@/components/TableLayout'
import { ColumnType } from 'antd/lib/table';
import EyePreview from '@/components/EyePreview';
import { format } from '@/pages/transaction/common/dateFormat';
......
......@@ -2,7 +2,7 @@ import { useIntl } from 'umi';
import React, { Fragment, useRef, useState } from 'react';
import { Badge, Button, Tag } from 'antd';
import { history } from 'umi';
import TableLayout from '@/pages/transaction/components/tableLayout'
import TableLayout from '@/components/TableLayout'
import { ColumnType } from 'antd/lib/table';
import EyePreview from '@/components/EyePreview';
import { format } from '@/pages/transaction/common/dateFormat';
......
......@@ -5,7 +5,7 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ColumnType } from 'antd/lib/table/interface';
import { format } from '@/pages/transaction/common/dateFormat';
import { getMarketingAbilityActivityExecuteMerchantPage, getMarketingMerchantActivityGetActivityTypeList, getMarketingMerchantActivityGetInnerStatusList } from '@/services/MarketingV2Api';
import TableLayout from '../../../components/tableLayout';
import TableLayout from '../../../../../components/TableLayout';
import { InnerStatusColor } from '../../common/tagColor';
import { PATTERN_MAPS } from '@/constants/regExp';
import { useLinkageUtils } from '@/utils/formEffectUtils';
......
......@@ -117,7 +117,7 @@ const AddInquiry = () => {
const addFn = async () => {
await getTemplateWebMemberPurchaseWebFindCurrMemberPurchase().then(res => {
if (res.code !== 1000) {
message.error(res.message);
message.error(intl.formatMessage({ id: `${res.code}` }));
return
}
if (!res.data) {
......
......@@ -27,7 +27,6 @@ type httpStatus = {
[key: number]: string
}
const intl = getIntl()
const errorMessage: httpStatus = {
400: "发出的请求有错误,服务器没有进行新建或修改数据的操作。",
401: "用户没有权限(令牌、用户名、密码错误)。",
......@@ -129,6 +128,8 @@ class ApiRequest {
createRequest<T>(url: string, options: IApiRequest = { ctlType: 'none' }): Promise<IRequestSuccess<T>> {
return new Promise((resolve, reject) => {
const intl = getIntl()
baseRequest<IRequestSuccess<T>>(url, options).then(res => {
// 登录验证
if (res.code === 1101) {
......@@ -144,7 +145,7 @@ class ApiRequest {
if (options.ctlType === 'message') {
message.destroy()
}
options.ctlType === 'message' && message.success(res.message)
options.ctlType === 'message' && message.success(intl.formatMessage({ id: `${res.code}`, defaultMessage: res.message}))
resolve(res)
} else {
// 使用resolve将数据返回, 请求时需手动处理data为null的情况
......@@ -152,7 +153,7 @@ class ApiRequest {
if (url != '/member/loginInfo') {
// 这是展示接口错误信息,任何 ctlType 都可以,不然一些 get 请求出错了
// 错误信息无法展示给用户
res.message && options.ctlType === 'message' && message.info(intl.formatMessage({ id: res.code, defaultMessage: res.message}))
res.message && options.ctlType === 'message' && message.info(intl.formatMessage({ id: `${res.code}`, defaultMessage: res.message}))
}
}
......
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