Commit 3f2cfa8a authored by GuanHua's avatar GuanHua

feat: 品类装修页面文案提取

parent a6203eee
...@@ -42,7 +42,7 @@ const config: any = { ...@@ -42,7 +42,7 @@ const config: any = {
}, },
// layout: {}, // layout: {},
esbuild: {}, esbuild: {},
// mfsu: {}, mfsu: {},
antd: {}, antd: {},
locale: { locale: {
antd: true, antd: true,
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
'common.text.interal': '积分', 'common.text.interal': '积分',
'common.text.common': '共', 'common.text.common': '共',
'common.text.unit.strip': '条', 'common.text.unit.strip': '条',
'common.text.unit.piece': '件',
'common.text.pleaseSelect': '请选择', 'common.text.pleaseSelect': '请选择',
'common.text.notEmpty': '不可为空', 'common.text.notEmpty': '不可为空',
'common.text.canuse': '元使用', 'common.text.canuse': '元使用',
...@@ -78,6 +79,6 @@ ...@@ -78,6 +79,6 @@
'common.form.activity.startTime.placeholder': '活动开始时间', 'common.form.activity.startTime.placeholder': '活动开始时间',
'common.form.activity.endTime.placeholder': '活动结束时间', 'common.form.activity.endTime.placeholder': '活动结束时间',
'common.form.input.placeholder': '请输入', 'common.form.input.placeholder': '请输入',
'common.form.rule.only.number': '只允许填写数字',
} }
...@@ -173,6 +173,7 @@ export default { ...@@ -173,6 +173,7 @@ export default {
'editor.setting.form.name': '名称', 'editor.setting.form.name': '名称',
'editor.setting.form.picUrl': '图片', 'editor.setting.form.picUrl': '图片',
'editor.setting.form.title': '标题', 'editor.setting.form.title': '标题',
'editor.setting.form.title.required': '请填写标题',
'editor.setting.form.explain': '标题说明', 'editor.setting.form.explain': '标题说明',
'editor.setting.form.viceTitle': '副标题', 'editor.setting.form.viceTitle': '副标题',
'editor.setting.form.link': '链接', 'editor.setting.form.link': '链接',
...@@ -180,6 +181,7 @@ export default { ...@@ -180,6 +181,7 @@ export default {
'editor.form.label.hideOrShow': '是否显示', 'editor.form.label.hideOrShow': '是否显示',
'editor.form.category.required': '请选择品类', 'editor.form.category.required': '请选择品类',
'editor.form.brand.required': '请选择品牌', 'editor.form.brand.required': '请选择品牌',
'editor.form.brand.select': '选择品牌',
'editor.form.radio.show': '显示', 'editor.form.radio.show': '显示',
'editor.form.radio.hide': '隐藏', 'editor.form.radio.hide': '隐藏',
'editor.form.btn.upload.icon': '上传图标', 'editor.form.btn.upload.icon': '上传图标',
...@@ -249,4 +251,20 @@ export default { ...@@ -249,4 +251,20 @@ export default {
'editor.category.title.saleRanking': '销量排行', 'editor.category.title.saleRanking': '销量排行',
'editor.category.title.brand': '品牌精选', 'editor.category.title.brand': '品牌精选',
'editor.category.title.suggestProduct': '精选商品', 'editor.category.title.suggestProduct': '精选商品',
'editor.category.platform.activity': '平台活动',
'editor.category.business.activity': '商家活动',
'editor.category.select.navtype.required': '请先选择一级导航类型',
'editor.category.select.type.required': '请先选择展示类型',
'editor.category.tip.type': '当前商品展示类型为自动排序,不能进行单个商品设置',
'editor.category.select.secondary.type': '请选择二级类型',
'editor.category.select.onelevel.type': '请选择一级类型',
'editor.category.sales.volume': '销量',
'editor.category.sales.volume.required': '请填写销量',
'editor.category.sales.volume.rank': '销量排行榜',
'editor.category.content': '内容',
'editor.category.product.container.title': '精选商品',
'editor.category.month.sales': '月销',
'editor.category.confirm.leave': '确认离开装修页?',
} }
import { ComponentSchemaType, PROPS_SETTING_TYPES, PROPS_TYPES } from '@lingxi-design/core'; import { ComponentSchemaType, PROPS_SETTING_TYPES, PROPS_TYPES } from '@lingxi-design/core';
import { getIntl } from 'umi'
const intl = getIntl()
const HeaderNav: {[key: string]: ComponentSchemaType} = { const HeaderNav: {[key: string]: ComponentSchemaType} = {
HeaderNav: { HeaderNav: {
propsConfig: { propsConfig: {
children: { children: {
label: '内容', label: intl.formatMessage({ id: 'editor.category.content' }),
type: PROPS_TYPES.string, type: PROPS_TYPES.string,
} }
}, },
...@@ -12,7 +14,7 @@ const HeaderNav: {[key: string]: ComponentSchemaType} = { ...@@ -12,7 +14,7 @@ const HeaderNav: {[key: string]: ComponentSchemaType} = {
"HeaderNav.ActionItem": { "HeaderNav.ActionItem": {
propsConfig: { propsConfig: {
children: { children: {
label: '内容', label: intl.formatMessage({ id: 'editor.category.content' }),
type: PROPS_TYPES.string, type: PROPS_TYPES.string,
} }
}, },
...@@ -23,7 +25,7 @@ const CustomizeTabs: {[key: string]: ComponentSchemaType} = { ...@@ -23,7 +25,7 @@ const CustomizeTabs: {[key: string]: ComponentSchemaType} = {
CustomizeTabs: { CustomizeTabs: {
propsConfig: { propsConfig: {
children: { children: {
label: '内容', label: intl.formatMessage({ id: 'editor.category.content' }),
type: PROPS_TYPES.string, type: PROPS_TYPES.string,
} }
}, },
...@@ -31,7 +33,7 @@ const CustomizeTabs: {[key: string]: ComponentSchemaType} = { ...@@ -31,7 +33,7 @@ const CustomizeTabs: {[key: string]: ComponentSchemaType} = {
"CustomizeTabs.TabItem": { "CustomizeTabs.TabItem": {
propsConfig: { propsConfig: {
children: { children: {
label: '内容', label: intl.formatMessage({ id: 'editor.category.content' }),
type: PROPS_TYPES.string, type: PROPS_TYPES.string,
}, },
}, },
...@@ -42,7 +44,7 @@ const SecondaryNavigation: {[key: string]: ComponentSchemaType} = { ...@@ -42,7 +44,7 @@ const SecondaryNavigation: {[key: string]: ComponentSchemaType} = {
SecondaryNavigation: { SecondaryNavigation: {
propsConfig: { propsConfig: {
children: { children: {
label: '内容', label: intl.formatMessage({ id: 'editor.category.content' }),
type: PROPS_TYPES.string, type: PROPS_TYPES.string,
} }
}, },
...@@ -50,7 +52,7 @@ const SecondaryNavigation: {[key: string]: ComponentSchemaType} = { ...@@ -50,7 +52,7 @@ const SecondaryNavigation: {[key: string]: ComponentSchemaType} = {
"SecondaryNavigation.Item": { "SecondaryNavigation.Item": {
propsConfig: { propsConfig: {
children: { children: {
label: '内容', label: intl.formatMessage({ id: 'editor.category.content' }),
type: PROPS_TYPES.string, type: PROPS_TYPES.string,
}, },
}, },
...@@ -60,7 +62,7 @@ const SecondaryNavigation: {[key: string]: ComponentSchemaType} = { ...@@ -60,7 +62,7 @@ const SecondaryNavigation: {[key: string]: ComponentSchemaType} = {
const CustomizeCard: ComponentSchemaType = { const CustomizeCard: ComponentSchemaType = {
propsConfig: { propsConfig: {
children: { children: {
label: '内容', label: intl.formatMessage({ id: 'editor.category.content' }),
type: PROPS_TYPES.string, type: PROPS_TYPES.string,
} }
}, },
...@@ -69,7 +71,7 @@ const CustomizeCard: ComponentSchemaType = { ...@@ -69,7 +71,7 @@ const CustomizeCard: ComponentSchemaType = {
const Container: ComponentSchemaType = { const Container: ComponentSchemaType = {
propsConfig: { propsConfig: {
children: { children: {
label: '内容', label: intl.formatMessage({ id: 'editor.category.content' }),
type: PROPS_TYPES.string, type: PROPS_TYPES.string,
} }
}, },
...@@ -79,7 +81,7 @@ const SimpleCommodity: {[key: string]: ComponentSchemaType} = { ...@@ -79,7 +81,7 @@ const SimpleCommodity: {[key: string]: ComponentSchemaType} = {
SimpleCommodityList: { SimpleCommodityList: {
propsConfig: { propsConfig: {
children: { children: {
label: '内容', label: intl.formatMessage({ id: 'editor.category.content' }),
type: PROPS_TYPES.string, type: PROPS_TYPES.string,
} }
}, },
...@@ -87,7 +89,7 @@ const SimpleCommodity: {[key: string]: ComponentSchemaType} = { ...@@ -87,7 +89,7 @@ const SimpleCommodity: {[key: string]: ComponentSchemaType} = {
"SimpleCommodityList.Item": { "SimpleCommodityList.Item": {
propsConfig: { propsConfig: {
children: { children: {
label: '内容', label: intl.formatMessage({ id: 'editor.category.content' }),
type: PROPS_TYPES.string, type: PROPS_TYPES.string,
}, },
}, },
...@@ -99,7 +101,7 @@ const CategoryList: {[key: string]: ComponentSchemaType} = { ...@@ -99,7 +101,7 @@ const CategoryList: {[key: string]: ComponentSchemaType} = {
CategoryList: { CategoryList: {
propsConfig: { propsConfig: {
children: { children: {
label: '内容', label: intl.formatMessage({ id: 'editor.category.content' }),
type: PROPS_TYPES.string, type: PROPS_TYPES.string,
} }
}, },
...@@ -107,7 +109,7 @@ const CategoryList: {[key: string]: ComponentSchemaType} = { ...@@ -107,7 +109,7 @@ const CategoryList: {[key: string]: ComponentSchemaType} = {
"CategoryList.Item": { "CategoryList.Item": {
propsConfig: { propsConfig: {
children: { children: {
label: '内容', label: intl.formatMessage({ id: 'editor.category.content' }),
type: PROPS_TYPES.string, type: PROPS_TYPES.string,
}, },
}, },
...@@ -117,7 +119,7 @@ const CategoryList: {[key: string]: ComponentSchemaType} = { ...@@ -117,7 +119,7 @@ const CategoryList: {[key: string]: ComponentSchemaType} = {
const Product: ComponentSchemaType = { const Product: ComponentSchemaType = {
propsConfig: { propsConfig: {
children: { children: {
label: '内容', label: intl.formatMessage({ id: 'editor.category.content' }),
type: PROPS_TYPES.string, type: PROPS_TYPES.string,
}, },
......
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { getIntl} from 'umi'
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
const intl = getIntl()
const CommoditySchema: ISchema = { const CommoditySchema: ISchema = {
type: 'object', type: 'object',
properties: { properties: {
...@@ -8,7 +11,7 @@ const CommoditySchema: ISchema = { ...@@ -8,7 +11,7 @@ const CommoditySchema: ISchema = {
type: 'string', type: 'string',
'x-component': 'ModalSearch', 'x-component': 'ModalSearch',
'x-component-props': { 'x-component-props': {
placeholder: '搜索', placeholder: intl.formatMessage({ id: 'common.text.search' }),
allowClear: true, allowClear: true,
align: 'flex-start', align: 'flex-start',
}, },
...@@ -29,14 +32,14 @@ const CommoditySchema: ISchema = { ...@@ -29,14 +32,14 @@ const CommoditySchema: ISchema = {
id: { id: {
type: 'string', type: 'string',
'x-component-props': { 'x-component-props': {
placeholder: '商品ID', placeholder: intl.formatMessage({ id: 'editor.columns.commodityId' }),
allowClear: true, allowClear: true,
}, },
}, },
memberName: { memberName: {
type: 'string', type: 'string',
'x-component-props': { 'x-component-props': {
placeholder: '商家名称', placeholder: intl.formatMessage({ id: 'editor.columns.memberName' }),
allowClear: true, allowClear: true,
}, },
}, },
...@@ -44,7 +47,7 @@ const CommoditySchema: ISchema = { ...@@ -44,7 +47,7 @@ const CommoditySchema: ISchema = {
type: 'string', type: 'string',
'x-component': 'CustomInputSearch', 'x-component': 'CustomInputSearch',
'x-component-props': { 'x-component-props': {
placeholder: '品牌', placeholder: intl.formatMessage({ id: 'editor.columns.brand' }),
showSearch: true, showSearch: true,
showArrow: true, showArrow: true,
defaultActiveFirstOption: false, defaultActiveFirstOption: false,
...@@ -60,7 +63,7 @@ const CommoditySchema: ISchema = { ...@@ -60,7 +63,7 @@ const CommoditySchema: ISchema = {
type: 'string', type: 'string',
'x-component': 'CustomCategorySearch', 'x-component': 'CustomCategorySearch',
'x-component-props': { 'x-component-props': {
placeholder: '品类', placeholder: intl.formatMessage({ id: 'editor.columns.category' }),
showSearch: true, showSearch: true,
notFoundContent: null, notFoundContent: null,
style: { width: '174px' }, style: { width: '174px' },
...@@ -72,7 +75,7 @@ const CommoditySchema: ISchema = { ...@@ -72,7 +75,7 @@ const CommoditySchema: ISchema = {
type: 'array', type: 'array',
'x-component': 'DateRangePickerUnix', 'x-component': 'DateRangePickerUnix',
'x-component-props': { 'x-component-props': {
placeholder: ['开始时间','结束时间'], placeholder: [intl.formatMessage({ id: 'common.form.startTime.placeholder' }), intl.formatMessage({ id: 'common.form.endTime.placeholder' })],
allowClear: true, allowClear: true,
}, },
}, },
...@@ -82,7 +85,7 @@ const CommoditySchema: ISchema = { ...@@ -82,7 +85,7 @@ const CommoditySchema: ISchema = {
span: 1, span: 1,
}, },
'x-component-props': { 'x-component-props': {
children: '查询', children: intl.formatMessage({ id: 'common.button.query' }),
}, },
}, },
}, },
......
...@@ -2,6 +2,7 @@ import React, { useContext, useEffect, useMemo, useState } from 'react'; ...@@ -2,6 +2,7 @@ import React, { useContext, useEffect, useMemo, useState } from 'react';
import { changeProps, clearSelectedStatus, PageConfigType, SelectedInfoType, StateType, STATE_PROPS, } from '@lingxi-design/react'; import { changeProps, clearSelectedStatus, PageConfigType, SelectedInfoType, StateType, STATE_PROPS, } from '@lingxi-design/react';
import { useSelector } from '@lingxi-design/react'; import { useSelector } from '@lingxi-design/react';
import cs from 'classnames'; import cs from 'classnames';
import { useIntl } from 'umi'
import { usePrevious, useToggle } from '@umijs/hooks'; import { usePrevious, useToggle } from '@umijs/hooks';
import { CloseOutlined, PlusCircleOutlined } from '@ant-design/icons'; import { CloseOutlined, PlusCircleOutlined } from '@ant-design/icons';
import { Button, Space, Spin , message } from 'antd'; import { Button, Space, Spin , message } from 'antd';
...@@ -55,6 +56,7 @@ const EditPanel = () => { ...@@ -55,6 +56,7 @@ const EditPanel = () => {
const [formValue, setFormValue] = useState({}); const [formValue, setFormValue] = useState({});
/** 精选商品type */ /** 精选商品type */
const [type, setType] = useState<number>(0); const [type, setType] = useState<number>(0);
const intl = useIntl()
/** /**
* 当每次点击selectInfo 时,都把selectInfo.props 映射到formily 的value 上 * 当每次点击selectInfo 时,都把selectInfo.props 映射到formily 的value 上
* 但当一级类型没有被选择的时候,那么必须选择一级导航类型 * 但当一级类型没有被选择的时候,那么必须选择一级导航类型
...@@ -66,7 +68,7 @@ const EditPanel = () => { ...@@ -66,7 +68,7 @@ const EditPanel = () => {
return; return;
} }
if (activeKey === null && selectedInfo !== null) { if (activeKey === null && selectedInfo !== null) {
message.info("请先选择一级导航类型"); message.info(intl.formatMessage({ id: 'editor.category.select.navtype.required' }));
const primaryTabProps = pageConfig[domKey!].props; const primaryTabProps = pageConfig[domKey!].props;
setFormValue({ setFormValue({
primary: primaryTabProps?.id, primary: primaryTabProps?.id,
...@@ -130,12 +132,12 @@ const EditPanel = () => { ...@@ -130,12 +132,12 @@ const EditPanel = () => {
if (type === 0 && componentType.includes('suggestProduct')) { if (type === 0 && componentType.includes('suggestProduct')) {
setSchema(productListSchema); setSchema(productListSchema);
setVisible(true); setVisible(true);
message.info("请先选择展示类型"); message.info(intl.formatMessage({ id: 'editor.category.select.showtype.required' }));
return; return;
} }
if (type !== 3 && componentType === 'suggestProductItem') { if (type !== 3 && componentType === 'suggestProductItem') {
message.info("当前商品展示类型为自动排序,不能进行单个商品设置"); message.info(intl.formatMessage({ id: 'editor.category.tip.type' }));
return; return;
} }
setFormValue(tempFormValue[componentType]); setFormValue(tempFormValue[componentType]);
...@@ -167,7 +169,7 @@ const EditPanel = () => { ...@@ -167,7 +169,7 @@ const EditPanel = () => {
const target = value[0]; const target = value[0];
return ( return (
<div className={styles.image}> <div className={styles.image}>
<div className={styles.uploadImage}>上传图片</div> <div className={styles.uploadImage}>{intl.formatMessage({ id: 'editor.form.btn.upload.img' })}</div>
<div className={styles.imageIcon}> <div className={styles.imageIcon}>
<Spin spinning={target?.status === 'uploading'}> <Spin spinning={target?.status === 'uploading'}>
{ {
...@@ -338,7 +340,7 @@ const EditPanel = () => { ...@@ -338,7 +340,7 @@ const EditPanel = () => {
<div style={{position: 'relative', width: '400px'}}> <div style={{position: 'relative', width: '400px'}}>
<div className={className}> <div className={className}>
<div className={styles.header}> <div className={styles.header}>
<span className={styles.title}>内容</span> <span className={styles.title}>{intl.formatMessage({ id: 'editor.category.content' })}</span>
<CloseOutlined onClick={handleOnClose} /> <CloseOutlined onClick={handleOnClose} />
</div> </div>
<div className={styles.content}> <div className={styles.content}>
...@@ -346,8 +348,8 @@ const EditPanel = () => { ...@@ -346,8 +348,8 @@ const EditPanel = () => {
</div> </div>
<div className={styles.footer}> <div className={styles.footer}>
<Space> <Space>
<Button onClick={handleOnClose}>取消</Button> <Button onClick={handleOnClose}>{intl.formatMessage({ id: 'common.button.cancel' })}</Button>
<Button type="primary" onClick={() => formActions.submit()}>确认</Button> <Button type="primary" onClick={() => formActions.submit()}>{intl.formatMessage({ id: 'common.button.confirm' })}</Button>
</Space> </Space>
</div> </div>
</div> </div>
......
import { ISchema } from "@formily/antd"; import { ISchema } from "@formily/antd";
import { getIntl } from 'umi'
const intl = getIntl()
/** 一级标签 */ /** 一级标签 */
export const tabTitleSchema: ISchema = { export const tabTitleSchema: ISchema = {
...@@ -13,12 +16,12 @@ export const tabTitleSchema: ISchema = { ...@@ -13,12 +16,12 @@ export const tabTitleSchema: ISchema = {
properties: { properties: {
primary: { primary: {
type: 'string', type: 'string',
title: '类型', title: intl.formatMessage({ id: 'editor.drawer.activity.columns.templateName' }),
enum: [], enum: [],
"x-rules": [ "x-rules": [
{ {
required: true, required: true,
message: '请选择一级品类' message: intl.formatMessage({ id: 'editor.category.select.onelevel.type' })
} }
] ]
}, },
...@@ -44,12 +47,12 @@ export const secondaryTabSchema: ISchema = { ...@@ -44,12 +47,12 @@ export const secondaryTabSchema: ISchema = {
properties: { properties: {
secondary: { secondary: {
type: 'string', type: 'string',
title: '类型', title: intl.formatMessage({ id: 'editor.drawer.activity.columns.templateName' }),
enum: [], enum: [],
"x-rules": [ "x-rules": [
{ {
required: true, required: true,
message: '请选择二级类型' message: intl.formatMessage({ id: 'editor.category.select.secondary.type' })
} }
] ]
}, },
...@@ -59,7 +62,7 @@ export const secondaryTabSchema: ISchema = { ...@@ -59,7 +62,7 @@ export const secondaryTabSchema: ISchema = {
}, },
icon: { icon: {
type: 'string', type: 'string',
title: '图标', title: intl.formatMessage({ id: 'common.form.label.icon' }),
"x-component": 'FormilyUpload', "x-component": 'FormilyUpload',
"x-component-props": { "x-component-props": {
renderUploadChild: '{{renderUploadChild}}', renderUploadChild: '{{renderUploadChild}}',
...@@ -71,7 +74,7 @@ export const secondaryTabSchema: ISchema = { ...@@ -71,7 +74,7 @@ export const secondaryTabSchema: ISchema = {
"x-rules": [ "x-rules": [
{ {
required: true, required: true,
message: '请上传图片' message: intl.formatMessage({ id: 'editor.form.btn.upload.img' })
} }
] ]
} }
...@@ -94,11 +97,11 @@ export const blockSchema: ISchema = { ...@@ -94,11 +97,11 @@ export const blockSchema: ISchema = {
properties: { properties: {
blockTitle: { blockTitle: {
type: 'string', type: 'string',
title: '标题', title: intl.formatMessage({ id: 'editor.setting.form.title' }),
'x-rules': [ 'x-rules': [
{ {
required: true, required: true,
message: '请填写标题' message: intl.formatMessage({ id: 'editor.setting.form.title.required' })
}, },
{ {
limitByte: true, // 自定义校验规则 limitByte: true, // 自定义校验规则
...@@ -157,11 +160,11 @@ export const saleRankSchema: ISchema = { ...@@ -157,11 +160,11 @@ export const saleRankSchema: ISchema = {
}, },
sale: { sale: {
type: 'string', type: 'string',
title: '销量', title: intl.formatMessage({ id: 'editor.category.sales.volume' }),
"x-rules": [ "x-rules": [
{ {
required: true, required: true,
message: '请填写销量', message: intl.formatMessage({ id: 'editor.category.sales.volume.required' }),
}, },
{ {
limitByte: true, // 自定义校验规则 limitByte: true, // 自定义校验规则
...@@ -169,7 +172,7 @@ export const saleRankSchema: ISchema = { ...@@ -169,7 +172,7 @@ export const saleRankSchema: ISchema = {
}, },
{ {
pattern: /^\d+$/, pattern: /^\d+$/,
message: '只允许填写数字' message: intl.formatMessage({ id: 'common.form.rule.only.number' })
} }
] ]
} }
...@@ -217,19 +220,19 @@ export const productListSchema: ISchema = { ...@@ -217,19 +220,19 @@ export const productListSchema: ISchema = {
// }, // },
type: { type: {
type: 'string', type: 'string',
title: '商品展示', title: intl.formatMessage({ id: 'editor.form.label.product.show' }),
"x-component": 'FormilyRadio', "x-component": 'FormilyRadio',
enum: [ enum: [
{ {
label: "自动按销量排行展示 (从高到低)", label: intl.formatMessage({ id: 'editor.form.label.product.type_1' }),
value: 1 value: 1
}, },
{ {
label: '自动按上架时间排序 (从新到旧)', label: intl.formatMessage({ id: 'editor.form.label.product.type_2' }),
value: 2, value: 2,
}, },
{ {
label: '自定义选择', label: intl.formatMessage({ id: 'editor.form.label.product.type_3' }),
value: 3, value: 3,
} }
], ],
...@@ -245,7 +248,7 @@ export const productListSchema: ISchema = { ...@@ -245,7 +248,7 @@ export const productListSchema: ISchema = {
}, },
num: { num: {
type: 'string', type: 'string',
title: '展示数量', title: intl.formatMessage({ id: 'editor.form.label.product.show.count' })
} }
} }
} }
......
import React, { useState, useEffect, useMemo, useContext } from 'react'; import React, { useState, useEffect, useMemo, useContext } from 'react';
import { ISchema, createFormActions } from '@formily/antd'; import { ISchema, createFormActions } from '@formily/antd';
import { useIntl } from 'umi'
import { Drawer, Pagination, Button, Space } from 'antd'; import { Drawer, Pagination, Button, Space } from 'antd';
import { useSelector } from '@lingxi-design/react'; import { useSelector } from '@lingxi-design/react';
import styles from './branchList.less'; import styles from './branchList.less';
...@@ -27,6 +28,7 @@ const BranchList = (props) => { ...@@ -27,6 +28,7 @@ const BranchList = (props) => {
const [pageSize, setPageSize] = useState<number>(10); const [pageSize, setPageSize] = useState<number>(10);
const [total, setTotal] = useState<number>(0); const [total, setTotal] = useState<number>(0);
const [innerCheckedKey, setInnerCheckedKey] = useState<null | { name: string, icon: string, id: number }>(null); const [innerCheckedKey, setInnerCheckedKey] = useState<null | { name: string, icon: string, id: number }>(null);
const intl = useIntl()
useEffect(() => { useEffect(() => {
if (!value || !visible) { if (!value || !visible) {
...@@ -145,14 +147,14 @@ const BranchList = (props) => { ...@@ -145,14 +147,14 @@ const BranchList = (props) => {
return ( return (
<Drawer <Drawer
visible={visible} visible={visible}
title="选择品牌" title={intl.formatMessage({ id: 'editor.form.brand.select' })}
width={520} width={520}
bodyStyle={{display: 'flex', flexDirection: 'column', padding: '12px 0 0 12px'}} bodyStyle={{display: 'flex', flexDirection: 'column', padding: '12px 0 0 12px'}}
footer={ footer={
<div className={styles.footer}> <div className={styles.footer}>
<Space> <Space>
<Button onClick={handleCancel}>取消</Button> <Button onClick={handleCancel}>{intl.formatMessage({ id: 'common.button.cancel' })}</Button>
<Button type="primary" onClick={handleConfirm}>确认</Button> <Button type="primary" onClick={handleConfirm}>{intl.formatMessage({ id: 'common.button.confirm' })}</Button>
</Space> </Space>
</div> </div>
} }
......
import React from 'react'; import React from 'react';
import { Button } from 'antd'; import { Button } from 'antd';
import { useIntl } from 'umi'
import { useToggle } from '@umijs/hooks'; import { useToggle } from '@umijs/hooks';
import BrandItem from './brandItem'; import BrandItem from './brandItem';
import BranchList from './branchList'; import BranchList from './branchList';
...@@ -18,6 +19,7 @@ interface Iprops { ...@@ -18,6 +19,7 @@ interface Iprops {
const FormilyBrand: React.FC<Iprops> & { isFieldComponent: boolean } = (props: Iprops) => { const FormilyBrand: React.FC<Iprops> & { isFieldComponent: boolean } = (props: Iprops) => {
const { value, mutators } = props; const { value, mutators } = props;
const { state: visible, toggle: setVisible } = useToggle(false); const { state: visible, toggle: setVisible } = useToggle(false);
const intl = useIntl()
const onCancel = () => { const onCancel = () => {
setVisible(false); setVisible(false);
}; };
...@@ -29,7 +31,7 @@ const FormilyBrand: React.FC<Iprops> & { isFieldComponent: boolean } = (props: I ...@@ -29,7 +31,7 @@ const FormilyBrand: React.FC<Iprops> & { isFieldComponent: boolean } = (props: I
return ( return (
<div> <div>
<Button onClick={() => setVisible(true)}>选择</Button> <Button onClick={() => setVisible(true)}>{intl.formatMessage({ id: 'common.button.select' })}</Button>
<div style={{marginTop: '12px'}}> <div style={{marginTop: '12px'}}>
{ {
value?.icon && ( value?.icon && (
......
import React from 'react'; import React from 'react';
import Container from '../Container'; import Container from '../Container';
import { useIntl } from 'umi'
const ProductContainer = (props) => { const ProductContainer = (props) => {
const { children, status } = props; const { children, status } = props;
const intl = useIntl()
const listStyle = { const listStyle = {
marginRight: '-8px', marginRight: '-8px',
...@@ -20,7 +22,7 @@ const ProductContainer = (props) => { ...@@ -20,7 +22,7 @@ const ProductContainer = (props) => {
}; };
return ( return (
<Container visible={status} card={false} listStyle={listStyle as any} itemStyle={itemStyle as any} {...divProps} tooltipTitle="精选商品"> <Container visible={status} card={false} listStyle={listStyle as any} itemStyle={itemStyle as any} {...divProps} tooltipTitle={intl.formatMessage({ id: 'editor.category.product.container.title' })}>
{children} {children}
</Container> </Container>
); );
......
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import { SimpleCommodity, CustomizeTag } from '@lingxi-design/ui'; import { SimpleCommodity, CustomizeTag } from '@lingxi-design/ui';
import cs from 'classnames'; import cs from 'classnames';
import { useIntl } from 'umi'
import { PlusOutlined } from '@ant-design/icons'; import { PlusOutlined } from '@ant-design/icons';
import styles from './simple.less'; import styles from './simple.less';
import Container from '../Container'; import Container from '../Container';
...@@ -45,8 +46,9 @@ const scrollNode = (key: string) => { ...@@ -45,8 +46,9 @@ const scrollNode = (key: string) => {
const SimpleCommodityList: React.FC<Iprops> & { Item: typeof SimpleItem } = (props: Iprops) => { const SimpleCommodityList: React.FC<Iprops> & { Item: typeof SimpleItem } = (props: Iprops) => {
// console.log(props); // console.log(props);
const { children, title, status } = props; const { children, title, status } = props;
const intl = useIntl()
const cardProps = { const cardProps = {
title: title || '标题', title: title || intl.formatMessage({ id: 'editor.setting.form.title' }),
headStyle: { headStyle: {
padding: '0 12px' padding: '0 12px'
}, },
...@@ -118,7 +120,8 @@ const SimpleItem: React.FC<IsimpleItemprops> = (props: IsimpleItemprops | Isimpl ...@@ -118,7 +120,8 @@ const SimpleItem: React.FC<IsimpleItemprops> = (props: IsimpleItemprops | Isimpl
const divProps = { const divProps = {
onClick, onDrag, onDragEnd, onDragEnter, onDragStart, onMouseOver onClick, onDrag, onDragEnd, onDragEnter, onDragStart, onMouseOver
}; };
const rest = sale ? { footer: <CustomizeTag mode="doubleColor" background="#FFF0F2" color="#EF3346">月销{sale}</CustomizeTag> } : { originalPrice: price }; const intl = useIntl()
const rest = sale ? { footer: <CustomizeTag mode="doubleColor" background="#FFF0F2" color="#EF3346">{intl.formatMessage({ id: 'editor.category.month.sales' })}{sale}{intl.formatMessage({ id: 'common.text.unit.piece', defaultMessage: '件'})}</CustomizeTag> } : { originalPrice: price };
const wrapClass = cs(className, styles.simple); const wrapClass = cs(className, styles.simple);
......
import React from 'react'; import React from 'react';
import { ArrowLeftOutlined } from '@ant-design/icons'; import { ArrowLeftOutlined } from '@ant-design/icons';
import { history } from 'umi'; import { history, useIntl } from 'umi';
import { Modal } from 'antd' import { Modal } from 'antd'
import styles from './index.less'; import styles from './index.less';
interface Iprops { interface Iprops {
...@@ -10,9 +10,10 @@ interface Iprops { ...@@ -10,9 +10,10 @@ interface Iprops {
const Toolbar: React.FC<Iprops> = (props: Iprops) => { const Toolbar: React.FC<Iprops> = (props: Iprops) => {
const { title, extra } = props; const { title, extra } = props;
const intl = useIntl()
const goback =() => { const goback =() => {
Modal.confirm({ Modal.confirm({
title: '确认离开装修页?', title: intl.formatMessage({ id: 'editor.category.confirm.leave' }),
onOk: () => { onOk: () => {
history.goBack() history.goBack()
}, },
......
...@@ -147,7 +147,7 @@ const CategoryNavigation = () => { ...@@ -147,7 +147,7 @@ const CategoryNavigation = () => {
customReducer={customReducer} customReducer={customReducer}
> >
<div className={styles['wrapper']}> <div className={styles['wrapper']}>
<Toolbar title={intl.formatMessage({ id: 'editor.category.edit.title' })} extra={<ToolbarSubmit loading={loading} dataConfig={['pageConfig', 'hasRequestTabKey']} onSubmit={onSave}>保存</ToolbarSubmit>} /> <Toolbar title={intl.formatMessage({ id: 'editor.category.edit.title' })} extra={<ToolbarSubmit loading={loading} dataConfig={['pageConfig', 'hasRequestTabKey']} onSubmit={onSave}>{intl.formatMessage({ id: 'common.button.save' })}</ToolbarSubmit>} />
<div className={styles['content']}> <div className={styles['content']}>
{ {
!isPreview && ( !isPreview && (
......
...@@ -178,8 +178,8 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = props => { ...@@ -178,8 +178,8 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = props => {
const param: any = { const param: any = {
current: 1, current: 1,
pageSize: 1, pageSize: 1,
sortType: 2, type: 2,
recommendLabel: [2, 3], // recommendLabel: [2, 3],
}; };
const res = await getManageContentInformationPage(param); const res = await getManageContentInformationPage(param);
if (res.code === 1000 && res.data.data) { if (res.code === 1000 && res.data.data) {
......
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