Commit 3f2cfa8a authored by GuanHua's avatar GuanHua

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

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