Commit a1c5130f authored by 前端-黄佳鑫's avatar 前端-黄佳鑫
parents fa1aad70 c6f89914
......@@ -9,6 +9,7 @@ import classAndProperty from './zh-CN/classAndProperty'
import member from './zh-CN/member'
import purchase from './zh-CN/purchase'
import editor from './zh-CN/editor'
import content from './zh-CN/content'
export default {
'global.siteName': '瓴犀',
......@@ -23,4 +24,6 @@ export default {
...member,
...purchase,
...editor,
...content,
}
......@@ -21,11 +21,15 @@
'common.button.query': '查询',
'common.button.reset': '重置',
'common.button.copay': '复制',
'common.button.advanced.filter': '高级筛选',
'common.button.submit': '提交',
/** tips */
'common.tip.save.confirm': '您还有未保存的内容,是否确定要离开?',
'common.tip.option.confirm': '确定要执行这个操作?',
'common.tip.select.required': '请选择一条记录',
'common.tip.designpage.leave.confirm': '是否确认离开模板装修页面?',
'common.tip.save.success': '保存成功',
/** tabel */
'common.table.action': "操作",
......@@ -42,12 +46,21 @@
'common.unit.individual.character': '个字符',
/** text */
'common.text.to': '至',
'common.text.longest': '最长',
'common.text.select': '选择',
'common.text.most': '最多',
'common.text.platform': '平台',
'common.text.business': '商家',
'common.text.platform.activity': '平台活动',
'common.text.business.activity': '商家活动',
'common.text.search': '搜索',
'common.text.validity.date': '有效期',
'common.text.interal': '积分',
'common.text.common': '共',
'common.text.unit.strip': '条',
'common.text.pleaseSelect': '请选择',
'common.text.notEmpty': '不可为空',
/** form */
'common.form.name.placeholder': '请输入姓名',
......
/**
* 内容能力
*/
export default {
'content.columns.name': '栏目名称',
'content.columns.category': '栏目分类',
'content.columns.sort': '栏目排序',
'content.columns.market': '市场行情',
'content.columns.information': '资讯',
'content.columns.add': '新建栏目',
'content.columns.edit': '编辑栏目',
}
......@@ -2,13 +2,21 @@
* 装修相关
*/
export default {
'editor.menu.home': '首页',
'editor.menu.commodity': '商品',
'editor.menu.integral': '积分兑换',
'editor.menu.infomation': '行情资讯',
'editor.menu.about': '关于我们',
'editor.channel.menu.home': '首页',
'editor.channel.menu.commodity': '商品',
'editor.channel.menu.integral': '积分兑换',
'editor.channel.menu.infomation': '行情资讯',
'editor.channel.menu.about': '关于我们',
'editor.own.menu.home': '商城首页',
'editor.own.menu.commodity': '现货商品',
'editor.own.menu.inquery': '询价商品',
'editor.own.menu.integral': '积分兑换',
'editor.own.menu.infomation': '行情资讯',
'editor.own.menu.about': '关于我们',
'editor.left.components.mymodule': '我的模块',
'editor.left.components.allmodule': '全部模块',
'editor.left.components.added': '已添加',
'editor.loading.text': '正在加载页面数据',
'editor.drawer.activity.columns.name': '活动信息',
'editor.drawer.activity.columns.activityName': '活动名称',
'editor.drawer.activity.columns.activityType': '活动类型',
......@@ -16,13 +24,138 @@ export default {
'editor.drawer.activity.columns.startTime': '有效期',
'editor.drawer.activity.columns.memberName': '所属',
'editor.drawer.activity.title': '选择活动',
'editor.drawer.commodity.title': '选择商品',
'editor.drawer.coupons.title': '选择优惠券',
'editor.drawer.activity.product.title': '选择活动商品',
'editor.drawer.activity.product.search.id': '输入活动ID进行搜索',
'editor.drawer.activity.columns.productInfo': '商品信息',
'editor.columns.category': '品类',
'editor.columns.brand': '品牌',
'editor.columns.commodityId': '商品ID',
'editor.columns.memberName': '商家名称',
'editor.columns.unit': '单价',
'editor.columns.unitName': '价格',
'editor.columns.activityPrice': '活动价',
'editor.drawer.coupons.columns.name': '优惠劵名称',
'editor.drawer.coupons.columns.typeName': '类型',
'editor.drawer.coupons.columns.getWayName': '领劵方式',
'editor.drawer.coupons.columns.denomination': '面额',
'editor.drawer.coupons.columns.useConditionMoney': '使用条件',
'editor.drawer.coupons.columns.releaseTimeEnd': '有效期',
'editor.drawer.coupons.columns.belongName': '所属',
'editor.drawer.mix.title.map_1': '选择商城',
'editor.drawer.mix.title.map_2': '选择积分商品',
'editor.drawer.mix.title.map_3': '选择店铺',
'editor.drawer.mix.title.map_4': '选择资讯',
'editor.toolbar.title.edit': '正在编辑:',
'editor.toolbar.title.preview': '正在预览:',
'editor.marketing.type_title_1': '特价促销',
'editor.marketing.type_title_2': '直降促销',
'editor.marketing.type_title_3': '满量减',
'editor.marketing.type_title_4': '折扣促销',
'editor.marketing.type_title_5': '满量折',
'editor.marketing.type_title_6': '满额减',
'editor.marketing.type_title_7': '满额折',
'editor.marketing.type_title_8': '赠商品',
'editor.marketing.type_title_9': '赠优惠券',
'editor.marketing.type_title_10': '多件促销',
'editor.marketing.type_title_11': '组合促销',
'editor.marketing.type_title_12': '秒杀',
'editor.marketing.type_title_13': '拼团',
'editor.marketing.type_title_14': '满额换购',
'editor.marketing.type_title_15': '买商品换购',
'editor.marketing.type_title_16': '预售',
'editor.marketing.type_title_17': '试用',
'editor.marketing.type_title_18': '套餐',
'editor.marketing.type_title_19': '砍价',
'editor.marketing.type_explain_1': '爆款限时特价',
'editor.marketing.type_explain_2': '大牌商品最高直降$元',
'editor.marketing.type_explain_3': '大牌商品最高减$元',
'editor.marketing.type_explain_4': '大牌商品低至$折',
'editor.marketing.type_explain_8': '满$元即有机会获赠商品',
'editor.marketing.type_explain_9': '价值$元优惠券免费领取',
'editor.marketing.type_explain_10': '任选$件商品,$折起!',
'editor.marketing.type_explain_11': '任选$件商品,仅需$元!',
'editor.marketing.type_explain_12': '今日大牌秒杀',
'editor.marketing.type_explain_13': '大牌拼团直降$元',
'editor.marketing.type_explain_14': '满$元即可换购以下商品',
'editor.marketing.type_explain_15': '购买指定商品即可换购以下商品',
'editor.marketing.type_explain_16': '大牌新品火爆预售',
'editor.marketing.type_explain_17': '新品抢先试用',
'editor.marketing.type_explain_18': '超级搭配套餐',
'editor.marketing.type_explain_19': '砍一砍,免费拿',
'editor.setting.advert.required.tip': '请至少添加一个广告',
'editor.setting.advert.name.required': '请输入广告名称',
'editor.setting.advert.picUrl.required': '请上传广告图片',
'editor.setting.advert.form.name': '名称',
'editor.setting.advert.form.picUrl': '图片',
'editor.setting.advert.form.link': '链接',
'editor.setting.advert.add.btn': '添加广告',
'editor.setting.category.categoryAdvertPicUrl.required': '请上传品类广告图片',
'editor.setting.category.categoryAdvertPicUrl.most': '最多推荐4个二级品类',
'editor.setting.category.first.title': '一级品类广告图片设置',
'editor.setting.category.second.title': '二级推荐分类设置',
'editor.setting.goods.inquiry.price': '在线询价',
'editor.setting.goods.most': '最多只能推荐9件商品',
'editor.setting.goods.select.btn': '选择商品',
'editor.setting.goods.checkt.btn': '查看已选择商品',
'editor.setting.goods.goodsName': '商品名称',
'editor.setting.nav.name': '栏目名称',
'editor.setting.nav.link': '链接地址',
'editor.setting.nav.status': '显示在导航上',
'editor.setting.nav.sort': '位置排序',
'editor.template.channel.header.data.mine': '我的',
'editor.template.channel.header.title': '头部导航栏',
'editor.template.channel.banner.title': '广告图',
'editor.template.channel.nav.title': '分类导航',
'editor.template.channel.product.title': '推荐商品',
'editor.template.own.brand.title': '推荐品牌',
'editor.template.own.brand.header.title': '精选品牌',
'editor.template.own.brand.header.explain': '享专属优惠',
'editor.template.own.brand.list': '品牌列表',
'editor.template.channel.information.title': '资讯',
'editor.template.channel.coupons.title': '优惠券弹窗',
'editor.template.channel.bottom.title': '底部标签栏',
'editor.template.shop.backdrop': '背景图',
'editor.template.goods.container': '商品容器',
'editor.template.meal.container': '套餐容器',
'editor.template.meal.subcontainer': '套餐子容器',
'editor.template.goods.main': '主购商品',
'editor.template.activity.goods.container': '活动商品容器',
'editor.template.add.advert': '添加广告',
'editor.template.add.product': '添加商品',
'editor.template.add.nav': '添加导航',
'editor.template.add.information': '添加资讯',
'editor.template.add.label': '添加标签',
'editor.template.add.category': '添加分类',
'editor.template.add.coupons': '添加优惠券',
'editor.own.edit.title': '自营商城装修-首页',
'editor.own.preview.title': '自营商城预览-首页',
'editor.channel.edit.title': '渠道装修-渠道主页',
'editor.channel.preview.title': '渠道装修-渠道主页',
'editor.shop.edit.title': '店铺装修-店铺主页',
'editor.shop.preview.title': '店铺预览-店铺主页',
'editor.marketing.meal': '套餐',
'editor.marketing.activity': '活动',
'editor.marketing.activity_title': '标题栏',
'editor.marketing.buy.product': '购买商品',
'editor.marketing.label.plummet': '直降60元',
'editor.marketing.label.fullQuantitySub': '满3件减50',
'editor.marketing.label.discount': '5折起',
'editor.marketing.label.fullQuantityDiscount': '满3件8折',
'editor.marketing.label.fullMoneySub': '满100减10',
'editor.marketing.label.fullMoneyDiscount': '满100打5折',
'editor.marketing.label.morePiece': '第2件5折',
'editor.marketing.label.combination': '99元4件',
'editor.marketing.label.fullSwap': '加20元换购',
'editor.marketing.label.preSale': '10元抵100',
'editor.marketing.label.attempt': '已送出 186 件',
}
......@@ -5,7 +5,7 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout';
import ReutrnEle from '@/components/ReturnEle';
import { usePageStatus } from '@/hooks/usePageStatus';
import { validatorAllTrim } from '@/utils/regExp';
import { history, Prompt } from 'umi';
import { history, Prompt, useIntl } from 'umi';
import useCustomValidator from '../hooks/useValidator'
import { getManageMemberColumnGet, postManageMemberColumnAdd, postManageMemberColumnUpdate } from '@/services/ManageV2Api';
......@@ -26,74 +26,6 @@ const sortedList = (() => {
return res
})()
const schema = {
type: 'object',
properties: {
layout: {
name: 'layout',
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
"labelCol": 3,
"wrapperCol": 10,
"labelAlign": "left"
},
properties: {
name: {
name: 'name',
title: '栏目名称',
'x-component': 'Input',
"required": true,
"x-rules": [
{
"required": true,
"message": "最长20个字符,10个汉字"
},
{
limitByte: true, // 自定义校验规则
maxByte: 20,
},
{
validator: value => value.trim().length === 0,
message: '栏目名称不可为空',
}
]
},
type: {
title: '栏目分类',
'x-component': 'Select',
"x-component-props": {
options: [
{ label: '市场行情', value: 1 },
{ label: '资讯', value: 2 },
]
},
"required": true,
"x-rules": [
{
"required": true,
"message": "请选择栏目分类"
},
]
},
sort: {
name: 'sort',
title: '栏目排序',
'x-component': 'Select',
"required": true,
"x-rules": {
"required": true,
"message": "请选择栏目排序"
},
"x-component-props": {
options: sortedList
}
},
}
}
}
}
const useInitialValues = (id) => {
const [state, setState] = useState({})
useEffect(() => {
......@@ -109,6 +41,7 @@ const useInitialValues = (id) => {
}
const ColumnInfo = () => {
const intl = useIntl()
useCustomValidator();
const { id, preview } = usePageStatus();
const [ submitLoading, setSubmitLoading ] = useState(false);
......@@ -117,6 +50,74 @@ const ColumnInfo = () => {
const isEdit = id && !preview;
const isAdd = !id && !preview;
const schema = {
type: 'object',
properties: {
layout: {
name: 'layout',
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
"labelCol": 3,
"wrapperCol": 10,
"labelAlign": "left"
},
properties: {
name: {
name: 'name',
title: intl.formatMessage({ id: 'content.columns.name' }),
'x-component': 'Input',
"required": true,
"x-rules": [
{
"required": true,
"message": `20${intl.formatMessage({ id: 'common.unit.individual.character' })}, 10${intl.formatMessage({ id: 'common.unit.individual.chinese' })}`
},
{
limitByte: true, // 自定义校验规则
maxByte: 20,
},
{
validator: value => value.trim().length === 0,
message: `${intl.formatMessage({ id: 'content.columns.name' })}${intl.formatMessage({ id: 'common.text.notEmpty' })}`,
}
]
},
type: {
title: intl.formatMessage({ id: 'content.columns.category' }),
'x-component': 'Select',
"x-component-props": {
options: [
{ label: intl.formatMessage({ id: 'content.columns.market' }), value: 1 },
{ label: intl.formatMessage({ id: 'content.columns.information' }), value: 2 },
]
},
"required": true,
"x-rules": [
{
"required": true,
"message": `${intl.formatMessage({ id: 'common.text.pleaseSelect' })}${intl.formatMessage({ id: 'content.columns.category' })}`,
},
]
},
sort: {
name: 'sort',
title: intl.formatMessage({ id: 'content.columns.sort' }),
'x-component': 'Select',
"required": true,
"x-rules": {
"required": true,
"message": `${intl.formatMessage({ id: 'common.text.pleaseSelect' })}${intl.formatMessage({ id: 'content.columns.sort' })}`,
},
"x-component-props": {
options: sortedList
}
},
}
}
}
}
const handleSubmit = async (value: { name: string, sort: number, type: number }) => {
const { name, sort, type} = value;
const serviceActions = isAdd
......@@ -146,8 +147,8 @@ const ColumnInfo = () => {
<div>
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title={!id ? '新建栏目' : '编辑栏目'}
backIcon={<ReutrnEle description={intl.formatMessage({ id: 'common.button.back' })} />}
title={intl.formatMessage({ id: id ? 'content.columns.edit' : 'content.columns.add' })}
>
<Card>
<SchemaForm
......@@ -161,8 +162,8 @@ const ColumnInfo = () => {
isAdd || isEdit
? (
<FormButtonGroup offset={3}>
<Submit loading={submitLoading}>提交</Submit>
<Button onClick={handleCancel}>取消</Button>
<Submit loading={submitLoading}>{intl.formatMessage({ id: 'common.button.submit' })}</Submit>
<Button onClick={handleCancel}>{intl.formatMessage({ id: 'common.button.cancel' })}</Button>
</FormButtonGroup>
)
: <></>
......@@ -171,7 +172,7 @@ const ColumnInfo = () => {
</SchemaForm>
</Card>
</PageHeaderWrapper>
<Prompt when={unsaved && (isAdd || isEdit)} message="您还有未保存的内容,是否确定要离开?" />
<Prompt when={unsaved && (isAdd || isEdit)} message={intl.formatMessage({ id: 'common.tip.save.confirm' })} />
</div>
)
}
......
import React, { useEffect, useState, useRef } from 'react';
import { Card, Button, Popconfirm, Row, Col } from 'antd';
import { createFormActions } from '@formily/antd';
import { history, Link } from 'umi';
import { createFormActions, ISchema } from '@formily/antd';
import { history, useIntl } from 'umi';
import StatusSwitch from '@/components/StatusSwitch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PlusOutlined } from '@ant-design/icons'
......@@ -10,7 +10,6 @@ import { getTableDataSource } from '../utils/utils';
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import NiceForm from '@/components/NiceForm';
import EyePreview from '@/components/EyePreview'
import { ISchema } from '@formily/antd';
import { StandardTable } from 'god'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { getManageMemberColumnPage, postManageMemberColumnDelete, postManageMemberColumnUpdateStatus } from '@/services/ManageV2Api';
......@@ -23,54 +22,43 @@ const getData = async (params) => {
return res.data
}
const schema: ISchema = {
type: 'object',
properties: {
megalayout: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
grid: true
},
properties: {
ctl: {
type: 'object',
"x-component": "Children",
"x-component-props": {
children: "{{controllerBtns}}"
}
},
name: {
type: 'string',
"x-component": "Search",
"x-mega-props": {
const columnList: React.FC<{}> = () => {
const intl = useIntl()
const ref = useRef<any>({})
const schema: ISchema = {
type: 'object',
properties: {
megalayout: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
grid: true
},
properties: {
ctl: {
type: 'object',
"x-component": "Children",
"x-component-props": {
children: "{{controllerBtns}}"
}
},
"x-component-props": {
placeholder: '栏目名称',
advanced: false
name: {
type: 'string',
"x-component": "Search",
"x-mega-props": {
},
"x-component-props": {
placeholder: intl.formatMessage({ id: 'content.columns.name' }),
advanced: false
}
}
}
}
}
}
}
const controllerBtns = <Row>
<Col span={6}>
<Button
onClick={() => history.push('/memberCenter/contentAbility/columnsManagement/add')}
type="primary"
icon={<PlusOutlined />}
>
新建
</Button>
</Col>
</Row>
const columnList: React.FC<{}> = () => {
const ref = useRef<any>({})
// 停用/启用
const handleModify = async (record: any) => {
......@@ -106,7 +94,7 @@ const columnList: React.FC<{}> = () => {
key: 'id',
},
{
title: '栏目名称',
title: intl.formatMessage({ id: 'content.columns.name' }),
dataIndex: 'name',
key: 'name',
render: (text: any, record: any) => (
......@@ -116,20 +104,20 @@ const columnList: React.FC<{}> = () => {
)
},
{
title: '栏目分类',
title: intl.formatMessage({ id: 'content.columns.category' }),
align: 'center',
dataIndex: 'type',
key: 'type',
render: (text) => text === 1 ? '市场行情' : '资讯'
render: (text) => text === 1 ? intl.formatMessage({ id: 'content.columns.market' }) : intl.formatMessage({ id: 'content.columns.information' })
},
{
title: '栏目排序',
title: intl.formatMessage({ id: 'content.columns.sort' }),
align: 'center',
dataIndex: 'sort',
key: 'sort',
},
{
title: '状态',
title: intl.formatMessage({ id: 'common.table.status' }),
align: 'center',
dataIndex: 'status',
key: 'status',
......@@ -142,25 +130,35 @@ const columnList: React.FC<{}> = () => {
)
},
{
title: '操作',
title: intl.formatMessage({ id: 'common.table.action' }),
align: 'center',
key: 'operate',
dataIndex: 'operate',
render: (_, record) => !record.status && (
<>
<Button type='link' onClick={() => history.push(`/memberCenter/contentAbility/columnsManagement/detail?id=${record.id}`)}>修改</Button>
<Button type='link' onClick={() => history.push(`/memberCenter/contentAbility/columnsManagement/detail?id=${record.id}`)}>{intl.formatMessage({ id: 'common.button.modify' })}</Button>
<Popconfirm
title="确定要执行这个操作?"
title={intl.formatMessage({ id: 'common.tip.option.confirm' })}
onConfirm={() => handleRemove(record.id)}
>
<Button type='link'>删除</Button>
<Button type='link'>{intl.formatMessage({ id: 'common.button.delete' })}</Button>
</Popconfirm>
</>
)
}
]
const controllerBtns = <Row>
<Col span={6}>
<Button
onClick={() => history.push('/memberCenter/contentAbility/columnsManagement/add')}
type="primary"
icon={<PlusOutlined />}
>
{intl.formatMessage({ id: 'common.button.add' })}
</Button>
</Col>
</Row>
return (
<PageHeaderWrapper>
......
import { FormattedMessage } from 'umi'
import { getIntl } from 'umi'
const intl = getIntl()
export const menuData = [
{
"path": "/shop",
"name": <FormattedMessage id='editor.menu.home' />,
"name": intl.formatMessage({ id: 'editor.channel.menu.home' }),
"key": "shopHome",
},
{
"path": "/shop/commodity",
"name": <FormattedMessage id='editor.menu.commodity' />,
"name": intl.formatMessage({ id: 'editor.channel.menu.commodity' }),
"key": "shopCommodity",
},
{
"path": "/shop/pointsMall",
"name": <FormattedMessage id='editor.menu.integral' />,
"name": intl.formatMessage({ id: 'editor.channel.menu.integral' }),
"key": "shopPointsMall",
},
{
"path": "/shop/infomation",
"name": <FormattedMessage id='editor.menu.infomation' />,
"name": intl.formatMessage({ id: 'editor.channel.menu.infomation' }),
"key": "shopInfomation",
},
{
"path": "/shop/about",
"name": <FormattedMessage id='editor.menu.about' />,
"name": intl.formatMessage({ id: 'editor.channel.menu.about' }),
"key": "shopAbout",
},
]
import React from 'react'
import { Spin } from 'antd'
import { useIntl } from 'umi'
import styles from './index.less'
const Loading: React.FC = () => {
const intl = useIntl()
return (
<div className={styles.loading_wrap}>
<Spin size="large" />
<p className={styles.loading_text}>正在加载页面数据...</p>
<p className={styles.loading_text}>{intl.formatMessage({ id: 'editor.loading.text' })}...</p>
</div>
)
}
......
import React from 'react'
import { Button } from 'antd'
import { useIntl } from 'umi'
import { clearSelectedStatus} from '@lingxi-design/core';
import styles from './index.less'
......@@ -13,6 +14,7 @@ interface SettingPanelPropsType {
const SettingPanel: React.FC<SettingPanelPropsType> = (props) => {
const { children, footer, onOK = () => {console.log()}, onCancel, confirmLoading = false } = props
const intl = useIntl()
return (
<div className={styles.setting_panel}>
......@@ -27,8 +29,8 @@ const SettingPanel: React.FC<SettingPanelPropsType> = (props) => {
) : (
<div className={styles.setting_panel_footer}>
<div style={{ textAlign: 'right' }}>
<Button style={{ marginRight: 8 }} onClick={() => onCancel ? onCancel() : clearSelectedStatus()}>取消</Button>
<Button type="primary" onClick={(e) => onOK(e)} loading={confirmLoading}>确定</Button>
<Button style={{ marginRight: 8 }} onClick={() => onCancel ? onCancel() : clearSelectedStatus()}>{intl.formatMessage({ id: 'common.button.cancel' })}</Button>
<Button type="primary" onClick={(e) => onOK(e)} loading={confirmLoading}>{intl.formatMessage({ id: 'common.button.confirm' })}</Button>
</div>
</div>
)
......
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { FormattedMessage } from 'umi'
import { getIntl } from 'umi'
const intl = getIntl()
export const ActivitySchema1: ISchema = {
type: 'object',
......@@ -9,7 +11,7 @@ export const ActivitySchema1: ISchema = {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: <FormattedMessage id='common.text.search' />,
placeholder: intl.formatMessage({ id: 'common.text.search' }),
allowClear: true,
align: 'flex-start',
},
......@@ -31,7 +33,7 @@ export const ActivitySchema1: ISchema = {
type: 'array',
'x-component': 'DateRangePickerUnix',
'x-component-props': {
placeholder: [<FormattedMessage id='common.form.startTime.placeholder' />, <FormattedMessage id='common.form.endTime.placeholder' />],
placeholder: [intl.formatMessage({ id: 'common.form.startTime.placeholder' }), intl.formatMessage({ id: 'common.form.endTime.placeholder' })],
allowClear: true,
},
},
......@@ -41,7 +43,7 @@ export const ActivitySchema1: ISchema = {
span: 1,
},
'x-component-props': {
children: <FormattedMessage id='common.button.query' />,
children: intl.formatMessage({ id: 'common.button.query' }),
},
},
},
......@@ -56,7 +58,7 @@ export const ActivitySchema2: ISchema = {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: <FormattedMessage id='common.text.search' />,
placeholder: intl.formatMessage({ id: 'common.text.search' }),
allowClear: true,
align: 'flex-start',
},
......@@ -77,7 +79,7 @@ export const ActivitySchema2: ISchema = {
memberName: {
type: 'string',
'x-component-props': {
placeholder: <FormattedMessage id='common.table.columns.memberName' />,
placeholder: intl.formatMessage({ id: 'common.table.columns.memberName' }),
allowClear: true,
},
},
......@@ -85,7 +87,7 @@ export const ActivitySchema2: ISchema = {
type: 'array',
'x-component': 'DateRangePickerUnix',
'x-component-props': {
placeholder: [<FormattedMessage id='common.form.startTime.placeholder' />, <FormattedMessage id='common.form.endTime.placeholder' />],
placeholder: [intl.formatMessage({ id: 'common.form.startTime.placeholder' }), intl.formatMessage({ id: 'common.form.endTime.placeholder' })],
allowClear: true,
},
},
......@@ -95,7 +97,7 @@ export const ActivitySchema2: ISchema = {
span: 1,
},
'x-component-props': {
children: <FormattedMessage id='common.button.query' />,
children: intl.formatMessage({ id: 'common.button.query' }),
},
},
},
......
......@@ -47,22 +47,22 @@ const columns: ColumnsType<GetMarketingAdornMerchantActivityListAdornResponseDet
},
{
title: <FormattedMessage id='editor.drawer.activity.columns.category' />,
title: <FormattedMessage id='editor.columns.category' />,
dataIndex:'category',
render: (_text) => {
return <StatusTag title={_text} type="default" />;
}
},
{
title: <FormattedMessage id='editor.drawer.activity.columns.brand' />,
title: <FormattedMessage id='editor.columns.brand' />,
dataIndex: 'brand'
},
{
title: <FormattedMessage id='editor.drawer.activity.columns.memberName' />,
title: <FormattedMessage id='editor.columns.memberName' />,
dataIndex: 'memberName',
},
{
title: <FormattedMessage id='editor.drawer.activity.columns.unit' />,
title: <FormattedMessage id='editor.columns.unit' />,
dataIndex: 'unit',
render: (_text, _record) => {
return (
......@@ -74,7 +74,7 @@ const columns: ColumnsType<GetMarketingAdornMerchantActivityListAdornResponseDet
}
},
{
title: <FormattedMessage id='editor.drawer.activity.columns.activityPrice' />,
title: <FormattedMessage id='editor.columns.activityPrice' />,
dataIndex: 'activityPrice',
render: (_text, _record) => {
return (
......
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ISchema } from '@formily/antd';
import { FormattedMessage } from 'umi'
import { getIntl } from 'umi'
const intl = getIntl()
const schema: ISchema = {
type: 'object',
......@@ -13,9 +15,9 @@ const schema: ISchema = {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: <FormattedMessage id='common.text.search' />,
placeholder: intl.formatMessage({ id: 'common.text.search' }),
align: 'flex-left',
tip: <FormattedMessage id='editor.drawer.activity.product.search.id' />,
tip: intl.formatMessage({ id: 'editor.drawer.activity.product.search.id' }),
},
},
[FORM_FILTER_PATH]: {
......@@ -30,14 +32,14 @@ const schema: ISchema = {
activityName: {
type: 'string',
"x-component-props": {
placeholder: <FormattedMessage id='editor.drawer.activity.columns.activityName' />
placeholder: intl.formatMessage({ id: 'editor.drawer.activity.columns.activityName' })
}
},
activityType: {
type: 'string',
enum: [],
"x-component-props": {
placeholder: <FormattedMessage id='editor.drawer.activity.columns.activityType' />
placeholder: intl.formatMessage({ id: 'editor.drawer.activity.columns.activityType' })
}
},
'[startTime, endTime]': {
......@@ -46,19 +48,19 @@ const schema: ISchema = {
},
type: 'daterange',
'x-component-props': {
placeholder: [<FormattedMessage id='common.form.activity.startTime.placeholder' />, <FormattedMessage id='common.form.activity.endTime.placeholder' />]
placeholder: [intl.formatMessage({ id: 'common.form.activity.startTime.placeholder' }), intl.formatMessage({ id: 'common.form.activity.endTime.placeholder' })]
}
},
product: {
type: 'string',
"x-component-props": {
placeholder: <FormattedMessage id='editor.drawer.activity.columns.activityName' />
placeholder: intl.formatMessage({ id: 'editor.drawer.activity.columns.activityName' })
}
},
merchantName: {
type: 'string',
"x-component-props": {
placeholder: <FormattedMessage id='common.table.columns.memberName' />
placeholder: intl.formatMessage({ id: 'common.table.columns.memberName' })
}
},
submit: {
......@@ -67,7 +69,7 @@ const schema: ISchema = {
span: 1,
},
'x-component-props': {
children: <FormattedMessage id='common.text.query' />,
children: intl.formatMessage({ id: 'common.text.query' }),
},
},
},
......
import React, { useState, useRef, useEffect } from 'react';
import { history } from 'umi';
import { history, useIntl } from 'umi';
import { Drawer, Button, message, Space, Tooltip } from 'antd';
import { FormEffectHooks } from '@formily/antd'
import { StandardTable } from 'god';
......@@ -47,6 +47,7 @@ const CommodityDrawer: React.FC<CommodityDrawerProps> = (props: CommodityDrawerP
const [expandedRowKeys, setExpandedRowKeys] = useState<any>([]);
const ref = useRef<any>({});
const { memberId, memberRoleId } = getAuth() || {}
const intl = useIntl()
useEffect(() => {
setSelectedRowKeys(selectId ? [selectId] : []);
......@@ -62,8 +63,8 @@ const CommodityDrawer: React.FC<CommodityDrawerProps> = (props: CommodityDrawerP
<img src={ActivityImage} style={{ width: 24, height: 24, borderRadius: 4 }} />
<span>{item?.name}</span>
<div className={styles['defaultTag']}>{item?.type}</div>
<StatusTag title={item?.belongType === 1 ? '平台活动' : '商家活动'} type={item?.belongType === 1 ? 'primary' : 'success'} />
<div style={{color: '#301333'}}>有效期:{item.startTime && moment(item.startTime).format('YYYY-MM-DD HH:mm:ss')} {item.endTime && moment(item.endTime).format('YYYY-MM-DD HH:mm:ss')} </div>
<StatusTag title={item?.belongType === 1 ? intl.formatMessage({ id: 'common.text.platform.activity' }) : intl.formatMessage({ id: 'common.text.business.activity' })} type={item?.belongType === 1 ? 'primary' : 'success'} />
<div style={{color: '#301333'}}>{intl.formatMessage({ id: 'common.text.validity.date' })}{item.startTime && moment(item.startTime).format('YYYY-MM-DD HH:mm:ss')} {intl.formatMessage({ id: 'common.text.to' })} {item.endTime && moment(item.endTime).format('YYYY-MM-DD HH:mm:ss')} </div>
</Space>
</a>
);
......@@ -74,7 +75,7 @@ const CommodityDrawer: React.FC<CommodityDrawerProps> = (props: CommodityDrawerP
const columns = [
{
title: '商品信息',
title: intl.formatMessage({ id: 'editor.drawer.activity.columns.productInfo' }),
dataIndex: 'name',
key: 'name',
render: (text: any, record: any) => (
......@@ -87,7 +88,7 @@ const CommodityDrawer: React.FC<CommodityDrawerProps> = (props: CommodityDrawerP
)
},
{
title: '品类',
title: intl.formatMessage({ id: 'editor.columns.category' }),
dataIndex: 'customerCategory',
render: (_, _record) => {
let _list = [];
......@@ -100,12 +101,12 @@ const CommodityDrawer: React.FC<CommodityDrawerProps> = (props: CommodityDrawerP
}
},
{
title: '品牌',
title: intl.formatMessage({ id: 'editor.columns.brand' }),
dataIndex: 'brand',
render: (_, _record) => <span>{_record?.brand?.name}</span>
},
{
title: '价格',
title: intl.formatMessage({ id: 'editor.columns.unitName' }),
dataIndex: 'unitName',
render: (_text, _record) => {
return (
......@@ -126,7 +127,7 @@ const CommodityDrawer: React.FC<CommodityDrawerProps> = (props: CommodityDrawerP
onConfirm?.(selectedRows);
}
} else {
message.warning('请选择一条记录')
message.warning(intl.formatMessage({ id: 'common.tip.select.required' }))
}
}
......@@ -183,14 +184,14 @@ const CommodityDrawer: React.FC<CommodityDrawerProps> = (props: CommodityDrawerP
bodyStyle={drawerStyle}
footerStyle={drawerStyle}
width={1200}
title={'选择商品'}
title={intl.formatMessage({ id: 'editor.drawer.commodity.title' })}
visible={visible}
onClose={onClose}
destroyOnClose
footer={
<div style={{ textAlign: 'right', }}>
<Button onClick={onClose} style={{ marginRight: 8 }}>取消</Button>
<Button onClick={_onConfirm} type="primary">确定</Button>
<Button onClick={onClose} style={{ marginRight: 8 }}>{intl.formatMessage({ id: 'common.button.cancel' })}</Button>
<Button onClick={_onConfirm} type="primary">{intl.formatMessage({ id: 'common.button.confirm' })}</Button>
</div>
}
>
......
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getIntl } from 'umi'
const intl = getIntl()
const CommoditySchema: ISchema = {
type: 'object',
......@@ -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 = {
idInList: {
type: 'string',
'x-component-props': {
placeholder: '商品ID',
placeholder: intl.formatMessage({ id: 'common.text.commodityId' }),
allowClear: true,
},
},
memberName: {
type: 'string',
'x-component-props': {
placeholder: '商家名称',
placeholder: intl.formatMessage({ id: 'common.text.memberName' }),
allowClear: true,
},
},
......@@ -44,7 +47,7 @@ const CommoditySchema: ISchema = {
type: 'string',
'x-component': 'CustomInputSearch',
'x-component-props': {
placeholder: '品牌',
placeholder: intl.formatMessage({ id: 'common.text.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: 'common.text.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' }),
},
},
},
......
import React, { useState, useRef, useMemo, useEffect } from 'react';
import { history } from 'umi';
import { history, useIntl } from 'umi';
import { Drawer, Button, message, Space, Typography } from 'antd';
import { PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons';
import { StandardTable } from 'god';
......@@ -15,11 +15,6 @@ import CouponPlatformIcon from '@/assets/couponIcons/coupon_platform.png';
import CouponShopIcon from '@/assets/couponIcons/coupon_shop.png';
import * as tableSchemas from './schema';
const options = [
{ label: '平台', value: 1 },
{ label: '商家', value: 2 },
];
interface CouponsDrawerProps {
visible: boolean,
onClose: () => void,
......@@ -37,6 +32,7 @@ const CouponsDrawer: React.FC<CouponsDrawerProps> = (props: CouponsDrawerProps)
const [selectedRowKeys, setSelectedRowKeys] = useState<any>(selectId ? [selectId] : []);
const [selectedRows, setSelectedRows] = useState<any>([]);
const ref = useRef<any>({});
const intl = useIntl()
const _schema = useMemo(() => {
return tableSchemas[`CouponSchema${type}`]
}, [type])
......@@ -51,7 +47,7 @@ const CouponsDrawer: React.FC<CouponsDrawerProps> = (props: CouponsDrawerProps)
const columns = [
{
title: '优惠券信息',
title: intl.formatMessage({ id: 'editor.drawer.coupons.columns.name' }),
dataIndex: 'name',
key: 'name',
render: (text: any, record: any) => (
......@@ -65,17 +61,17 @@ const CouponsDrawer: React.FC<CouponsDrawerProps> = (props: CouponsDrawerProps)
)
},
{
title: '类型',
title: intl.formatMessage({ id: 'editor.drawer.coupons.columns.typeName' }),
dataIndex: 'typeName',
key: 'typeName'
},
{
title: '领劵方式',
title: intl.formatMessage({ id: 'editor.drawer.coupons.columns.getWayName' }),
dataIndex: 'getWayName',
key: 'getWayName'
},
{
title: '面额',
title: intl.formatMessage({ id: 'editor.drawer.coupons.columns.denomination' }),
dataIndex: 'denomination',
key: 'denomination',
render: (text: any) => (
......@@ -83,7 +79,7 @@ const CouponsDrawer: React.FC<CouponsDrawerProps> = (props: CouponsDrawerProps)
)
},
{
title: '使用条件',
title: intl.formatMessage({ id: 'editor.drawer.coupons.columns.useConditionMoney' }),
dataIndex: 'useConditionMoney',
key: 'useConditionMoney',
render: (text: any) => (
......@@ -91,7 +87,7 @@ const CouponsDrawer: React.FC<CouponsDrawerProps> = (props: CouponsDrawerProps)
)
},
{
title: '有效期',
title: intl.formatMessage({ id: 'editor.drawer.coupons.columns.releaseTimeEnd' }),
dataIndex: 'releaseTimeEnd',
key: 'releaseTimeEnd',
render: (_: any, record: any) => <>
......@@ -100,12 +96,12 @@ const CouponsDrawer: React.FC<CouponsDrawerProps> = (props: CouponsDrawerProps)
</>
},
{
title: '所属',
title: intl.formatMessage({ id: 'editor.drawer.coupons.columns.belongName' }),
dataIndex: 'belongName',
key: 'belongName',
render: (text: any, record: any) => (
<Space direction='vertical'>
<StatusTag title={record.belongType === 1 ? '平台' : '商家'} type={record.belongType === 1 ? 'success' : 'primary'} />
<StatusTag title={record.belongType === 1 ? intl.formatMessage({ id: 'common.text.platform' }) : intl.formatMessage({ id: 'common.text.business' })} type={record.belongType === 1 ? 'success' : 'primary'} />
{record.belongType === 2 && <Typography.Text type='secondary'>{text}</Typography.Text>}
</Space>
)
......@@ -116,15 +112,10 @@ const CouponsDrawer: React.FC<CouponsDrawerProps> = (props: CouponsDrawerProps)
if (selectedRows.length > 0) {
onConfirm?.({ ...selectedRows[0] });
} else {
message.warning('请选择一条记录')
message.warning(intl.formatMessage({ id: 'common.tip.select.required' }))
}
}
const _onRadioChange = (e: any) => {
setType(e.target.value);
ref?.current?.reload();
}
const fetchTableData = async (params: any) => {
const _params = { ...params, shopId };
const { data } = await getMarketingCouponActivityPageSelectPage(_params);
......@@ -147,7 +138,7 @@ const CouponsDrawer: React.FC<CouponsDrawerProps> = (props: CouponsDrawerProps)
return (
<Drawer
width={1200}
title={'选择优惠券'}
title={intl.formatMessage({ id: 'editor.drawer.coupons.title' })}
visible={visible}
onClose={onClose}
headerStyle={drawerStyle}
......@@ -155,8 +146,8 @@ const CouponsDrawer: React.FC<CouponsDrawerProps> = (props: CouponsDrawerProps)
footerStyle={drawerStyle}
footer={
<div style={{ textAlign: 'right', }}>
<Button onClick={onClose} style={{ marginRight: 8 }}>取消</Button>
<Button onClick={_onConfirm} type="primary">确定</Button>
<Button onClick={onClose} style={{ marginRight: 8 }}>{intl.formatMessage({ id: 'common.button.cancel' })}</Button>
<Button onClick={_onConfirm} type="primary">{intl.formatMessage({ id: 'common.button.confirm' })}</Button>
</div>
}
>
......
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getIntl } from 'umi'
const intl = getIntl()
export const CouponSchema1: ISchema = {
type: 'object',
......@@ -8,7 +11,7 @@ export const CouponSchema1: ISchema = {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '搜索',
placeholder: intl.formatMessage({ id: 'common.text.search' }),
allowClear: true,
align: 'flex-start',
},
......@@ -29,7 +32,7 @@ export const CouponSchema1: ISchema = {
name: {
type: 'string',
'x-component-props': {
placeholder: '优惠劵名称',
placeholder: intl.formatMessage({ id: 'editor.drawer.coupons.columns.name' }),
allowClear: true,
},
},
......@@ -39,7 +42,7 @@ export const CouponSchema1: ISchema = {
span: 1,
},
'x-component-props': {
children: '查询',
children: intl.formatMessage({ id: 'common.button.query' }),
},
},
},
......@@ -54,7 +57,7 @@ export const CouponSchema2: ISchema = {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '搜索',
placeholder: intl.formatMessage({ id: 'common.text.search' }),
allowClear: true,
align: 'flex-start',
},
......@@ -75,7 +78,7 @@ export const CouponSchema2: ISchema = {
name: {
type: 'string',
'x-component-props': {
placeholder: '优惠劵名称',
placeholder: intl.formatMessage({ id: 'editor.drawer.coupons.columns.name' }),
allowClear: true,
},
},
......@@ -85,7 +88,7 @@ export const CouponSchema2: ISchema = {
span: 1,
},
'x-component-props': {
children: '查询',
children: intl.formatMessage({ id: 'common.button.query' }),
},
},
},
......
import React, { useState, useEffect, useMemo } from 'react';
import { Drawer, Input, Table, Button, Row, Col, message } from 'antd';
import { SearchOutlined } from '@ant-design/icons';
import { useIntl, FormattedMessage } from 'umi'
import moment from 'moment';
import { LAYOUT_TYPE } from '@/constants'
import { priceFormat } from '@/utils/numberFomat';
......@@ -30,22 +31,22 @@ interface MixDrawerProps {
const Environment_MAPS = {
1: 'web',
2: 'H5',
3: '小程序',
3: <FormattedMessage id='shop.template.environment.status_3' />,
4: 'APP'
}
const Property_MAPS = {
1: 'B端商城',
2: 'C端商城',
3: 'B端自营商城',
4: 'C端自营商城',
1: <FormattedMessage id='own.mall.property_1' />,
2: <FormattedMessage id='own.mall.property_2' />,
3: <FormattedMessage id='own.mall.property_3' />,
4: <FormattedMessage id='own.mall.property_4' />,
}
const Title_MAPS = {
1: '选择商城',
3: '选择积分商品',
4: '选择店铺',
5: '选择资讯'
1: <FormattedMessage id='editor.drawer.mix.title.map_1' />,
3: <FormattedMessage id='editor.drawer.mix.title.map_2' />,
4: <FormattedMessage id='editor.drawer.mix.title.map_3' />,
5: <FormattedMessage id='editor.drawer.mix.title.map_4' />,
}
const MixDrawer: React.FC<MixDrawerProps> = (props: MixDrawerProps) => {
......@@ -58,6 +59,7 @@ const MixDrawer: React.FC<MixDrawerProps> = (props: MixDrawerProps) => {
const [current, setCurrent] = useState<number>(1);
const [pageSize, setPageSize] = useState<number>(10);
const { memberId, memberRoleId } = getAuth() || {}
const intl = useIntl()
useEffect(() => {
console.log(environment, 'environment')
......@@ -182,7 +184,7 @@ const MixDrawer: React.FC<MixDrawerProps> = (props: MixDrawerProps) => {
onConfirm(selectedRows);
}
} else {
message.warning('请选择一条记录')
message.warning(intl.formatMessage({ id: 'common.tip.select.required' }))
}
}
......@@ -250,7 +252,7 @@ const MixDrawer: React.FC<MixDrawerProps> = (props: MixDrawerProps) => {
dataIndex: 'min',
render: (_: any, record: any) => {
return (
<span style={{ color: '#EA8000' }}>{priceFormat(record?.min)} 积分</span>
<span style={{ color: '#EA8000' }}>{priceFormat(record?.min)} {intl.formatMessage({ id: 'common.text.interal' })}</span>
)
},
},
......@@ -349,7 +351,7 @@ const MixDrawer: React.FC<MixDrawerProps> = (props: MixDrawerProps) => {
}, [visible])
const _showTotal = (total) => {
return `${total}`
return `${intl.formatMessage({ id: 'common.text.common' })} ${total} ${intl.formatMessage({ id: 'common.text.unit.strip' })}`
}
const drawerStyle = { background: '#FAFBFC' };
......@@ -365,8 +367,8 @@ const MixDrawer: React.FC<MixDrawerProps> = (props: MixDrawerProps) => {
onClose={onClose}
footer={
<div style={{ textAlign: 'right', }}>
<Button onClick={onClose} style={{ marginRight: 8 }}>取消</Button>
<Button onClick={_onConfirm} type="primary">确定</Button>
<Button onClick={onClose} style={{ marginRight: 8 }}>{intl.formatMessage({ id: 'common.button.cancel' })}</Button>
<Button onClick={_onConfirm} type="primary">{intl.formatMessage({ id: 'common.button.confirm' })}</Button>
</div>
}
>
......@@ -375,7 +377,7 @@ const MixDrawer: React.FC<MixDrawerProps> = (props: MixDrawerProps) => {
<Col span={8}>
<Input
onChange={_onInputChange}
placeholder="搜索"
placeholder={intl.formatMessage({ id: 'common.text.search' })}
suffix={<SearchOutlined onClick={() => { _search(1, pageSize, keyWord) }} />}
allowClear={true}
onPressEnter={() => { _search(1, pageSize, keyWord) }}
......
......@@ -9,7 +9,7 @@ import styles from './index.less';
interface MarketingSwitchProps {
type: number,
title: string,
title: string | React.ReactNode,
icon: any,
marketConfigs: any,
layoutType: LAYOUT_TYPE
......
import { getIntl } from 'umi'
import icon1 from '@/assets/couponIcons/marketing-1.svg';
import icon2 from '@/assets/couponIcons/marketing-2.svg';
import icon3 from '@/assets/couponIcons/marketing-3.svg';
......@@ -18,26 +19,28 @@ import icon17 from '@/assets/couponIcons/marketing-17.svg';
import icon18 from '@/assets/couponIcons/marketing-18.svg';
import icon19 from '@/assets/couponIcons/marketing-19.svg';
const intl = getIntl()
const ICON_CONFIGS = [
{type : 1, title: '特价促销',explain: '爆款限时特价',icon: icon1},
{type : 2, title: '直降促销',explain: '大牌商品最高直降$元',icon: icon2},
{type : 3, title: '满量减',explain: '大牌商品最高减$元',icon: icon3},
{type : 4, title: '折扣促销',explain: '大牌商品低至$折',icon: icon4},
{type : 5, title: '满量折',explain: '大牌商品低至$折',icon: icon5},
{type : 6, title: '满额减',explain: '大牌商品最高减$元',icon: icon6},
{type : 7, title: '满额折',explain: '大牌商品低至$折',icon: icon7},
{type : 8, title: '赠商品',explain: '满$元即有机会获赠商品',icon: icon8},
{type : 9, title: '赠优惠券',explain: '价值$元优惠券免费领取',icon: icon9},
{type : 10, title: '多件促销',explain: '任选$件商品,$折起!',icon: icon10},
{type : 11, title: '组合促销',explain: '任选$件商品,仅需$元!',icon: icon11},
{type : 12, title: '秒杀',explain: '今日大牌秒杀',icon: icon12},
{type : 13, title: '拼团',explain: '大牌拼团直降$元',icon: icon13},
{type : 14, title: '满额换购',explain: '满$元即可换购以下商品',icon: icon14},
{type : 15, title: '买商品换购',explain: '购买指定商品即可换购以下商品',icon: icon15},
{type : 16, title: '预售',explain: '大牌新品火爆预售',icon: icon16},
{type : 17, title: '试用',explain: '新品抢先试用',icon: icon17},
{type : 18, title: '套餐',explain: '超级搭配套餐',icon: icon18},
{type : 19, title: '砍价',explain: '砍一砍,免费拿',icon: icon19},
{type : 1, title: intl.formatMessage({ id: 'editor.marketing.type_title_1' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_1' }),icon: icon1},
{type : 2, title: intl.formatMessage({ id: 'editor.marketing.type_title_2' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_2' }),icon: icon2},
{type : 3, title: intl.formatMessage({ id: 'editor.marketing.type_title_3' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_3' }),icon: icon3},
{type : 4, title: intl.formatMessage({ id: 'editor.marketing.type_title_4' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_4' }),icon: icon4},
{type : 5, title: intl.formatMessage({ id: 'editor.marketing.type_title_5' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_5' }),icon: icon5},
{type : 6, title: intl.formatMessage({ id: 'editor.marketing.type_title_6' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_6' }),icon: icon6},
{type : 7, title: intl.formatMessage({ id: 'editor.marketing.type_title_7' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_7' }),icon: icon7},
{type : 8, title: intl.formatMessage({ id: 'editor.marketing.type_title_8' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_8' }),icon: icon8},
{type : 9, title: intl.formatMessage({ id: 'editor.marketing.type_title_9' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_9' }),icon: icon9},
{type : 10, title: intl.formatMessage({ id: 'editor.marketing.type_title_10' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_10' }),icon: icon10},
{type : 11, title: intl.formatMessage({ id: 'editor.marketing.type_title_11' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_11' }),icon: icon11},
{type : 12, title: intl.formatMessage({ id: 'editor.marketing.type_title_12' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_12' }),icon: icon12},
{type : 13, title: intl.formatMessage({ id: 'editor.marketing.type_title_13' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_13' }),icon: icon13},
{type : 14, title: intl.formatMessage({ id: 'editor.marketing.type_title_14' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_14' }),icon: icon14},
{type : 15, title: intl.formatMessage({ id: 'editor.marketing.type_title_15' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_15' }),icon: icon15},
{type : 16, title: intl.formatMessage({ id: 'editor.marketing.type_title_16' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_16' }),icon: icon16},
{type : 17, title: intl.formatMessage({ id: 'editor.marketing.type_title_17' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_17' }),icon: icon17},
{type : 18, title: intl.formatMessage({ id: 'editor.marketing.type_title_18' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_18' }),icon: icon18},
{type : 19, title: intl.formatMessage({ id: 'editor.marketing.type_title_19' }),explain: intl.formatMessage({ id: 'editor.marketing.type_explain_19' }),icon: icon19},
]
export default ICON_CONFIGS;
import React from 'react';
import { Tabs, Row, Col } from 'antd';
import { useIntl } from 'umi'
import { PropsType, ChildNodesType } from '@lingxi-design/core';
import { ModuleTree } from '@lingxi-design/react';
import { LAYOUT_TYPE } from '@/constants'
......@@ -33,13 +34,15 @@ interface MobileClientEditLeftProps {
const MobileClientEditLeft: React.FC<MobileClientEditLeftProps> = (props: MobileClientEditLeftProps) => {
const { marketConfigs, layoutType } = props
const intl = useIntl()
return (
<div className={styles.edit_container}>
<Tabs type="card">
<TabPane tab="已添加" key="1">
<TabPane tab={intl.formatMessage({ id: 'editor.left.components.added' })} key="1">
<ModuleTree />
</TabPane>
<TabPane tab="全部模块" key="2">
<TabPane tab={intl.formatMessage({ id: 'editor.left.components.allmodule' })} key="2">
<Row gutter={16}>
{ICONS_CONFIG.map((item, index) => <Col key={index} span={12} style={{ marginBottom: 16 }}><MarketingSwitch layoutType={layoutType} marketConfigs={marketConfigs} {...item} /></Col>)}
</Row>
......
.template_item {
// width: 386px;
background-color: #ffffff;
border-radius: 8px;
overflow: hidden;
height: 100%;
padding-bottom: 24px;
.img_box {
position: relative;
// height: 218px;
height: 0;
padding-bottom: 67%;
overflow: hidden;
background-size: auto 100%;
background-position: center center;
background-repeat: no-repeat;
&:hover {
.img_box_mask {
opacity: 1;
}
}
.img_box_mask {
position: absolute;
width: 100%;
opacity: 0;
transition: all .5s;
height: 100%;
background: rgba(255, 255, 255, 0.45);
z-index: 8;
.detail_btn {
position: relative;
display: block;
left: 0;
right: 0;
top: 50%;
margin: 0 auto;
margin-top: -20px;
width: 240px;
height: 40px;
background: rgba(0, 0, 0, 0.85);
color: #ffffff;
text-align: center;
line-height: 40px;
font-weight: 500;
cursor: pointer;
&:hover {
opacity: .9;
}
}
}
.type_tag {
position: absolute;
top: 0;
width: 72px;
height: 24px;
color: #ffffff;
text-align: center;
line-height: 24px;
font-size: 12px;
background: #4279DF;
border-radius: 8px 0px 8px 0px;
z-index: 3;
&.h5 {
background: #6554C0;
}
}
&>img {
// height: 100%;
width: 100%;
}
}
.template_info {
padding: 0 24px;
.template_info_name {
display: flex;
align-items: center;
color: #303133;
font-weight: bold;
line-height: 24px;
padding: 16px 0;
.tag {
padding: 0 8px;
height: 24px;
background: rgba(244, 245, 247, 1);
border-radius: 4px;
margin-left: 8px;
color: #606266;
font-weight: 400;
}
}
.template_info_content {
display: flex;
align-items: flex-end;
height: 52px;
&.goods {
height: 32px;
}
.template_info_content_text_wrap {
flex: 1;
font-size: 12px;
line-height: 22px;
.template_info_content_text_line {
&:not(:last-child) {
margin-bottom: 8px;
}
&>label {
color: #909399;
margin-right: 8px;
}
&>span {
color: #303133;
}
}
}
.template_item_btn {
width: 88px;
height: 32px;
display: flex;
justify-content: center;
align-items: center;
background: rgba(250, 251, 252, 1);
border: 1px solid rgba(235, 236, 240, 1);
cursor: pointer;
color: #606266;
font-size: 12px;
// margin-top: auto;
margin-left: auto;
&.active {
background: #00B37A;
border: 1px solid #00B37A;
color: #ffffff;
}
&>label {
margin-left: 8px;
cursor: pointer;
}
&:hover {
opacity: .8;
}
}
}
}
}
\ No newline at end of file
import React from 'react'
import { PlayCircleOutlined } from '@ant-design/icons'
import cx from 'classnames'
import { Link } from 'umi'
import { TEMPLATE_TYPE_TEXT } from '@/constants'
import styles from './index.less'
interface TemplateItemPropsType {
templateInfo: any;
type: string;
}
const TemplateItem: React.FC<TemplateItemPropsType> = (props) => {
const { templateInfo, type } = props
const Environment_Status = {
0: {
name: "所有"
},
1: {
name: "PC "
},
2: {
name: "H5 "
},
3: {
name: "APP "
}
}
return (
<div className={styles.template_item}>
<div className={styles.img_box} style={{ backgroundImage: `url(${templateInfo?.templatePicUrl})` }}>
<div className={styles.img_box_mask}>
<Link to={`/pageCustomized/template/detail?type=${type}&id=${templateInfo.id}`} className={styles.detail_btn}>查看详情</Link>
</div>
<div className={cx(styles.type_tag, templateInfo.environment === 2 ? styles.h5 : '')}>{Environment_Status[templateInfo.environment].name}</div>
</div>
<div className={styles.template_info}>
<div className={styles.template_info_name}>
<span>{templateInfo.templateName}</span>
{
templateInfo.isDefault && <div className={styles.tag}>默认模板</div>
}
</div>
<div className={cx(styles.template_info_content, type === TEMPLATE_TYPE_TEXT.goods ? styles.goods : '')}>
<div className={styles.template_info_content_text_wrap}>
<div className={styles.template_info_content_text_line}>
<label>使用站点:</label>
<span>{templateInfo.siteName}</span>
</div>
{
type !== TEMPLATE_TYPE_TEXT.goods && (
<div className={styles.template_info_content_text_line}>
<label>使用商城:</label>
<span>{templateInfo.shopName}</span>
</div>
)
}
</div>
{
type === TEMPLATE_TYPE_TEXT.mall ? (
<div className={cx(styles.template_item_btn, templateInfo.use === 1 ? styles.active : '')}>
<PlayCircleOutlined />
<label>{templateInfo.use === 1 ? '启用中' : '启用'}</label>
</div>
) : (
<div className={cx(styles.template_item_btn, templateInfo.shelf === 1 ? styles.active : '')}>
<PlayCircleOutlined />
<label>{templateInfo.shelf === 1 ? '启用中' : '启用'}</label>
</div>
)
}
</div>
</div>
</div>
)
}
export default TemplateItem
......@@ -2,10 +2,10 @@ import React, { useCallback, useState } from 'react'
import { Modal, Button, message } from 'antd'
import { ArrowLeftOutlined } from '@ant-design/icons'
import { LAYOUT_TYPE } from '@/constants'
import { STATE_PROPS, PageConfigType, PROPS_SETTING_TYPES } from '@lingxi-design/core'
import { STATE_PROPS, PageConfigType } from '@lingxi-design/core'
import { useSelector } from '@lingxi-design/react'
import { paramsShop, paramsChannel, paramsOwnMall } from './returnSaveParams'
import { history } from 'umi'
import { history, useIntl } from 'umi'
import styles from './index.less'
import { postTemplateAdornAppChannelSave, postTemplateAdornAppSelfSave, postTemplateAdornAppStoreSave } from '@/services/TemplateV2Api'
......@@ -19,17 +19,18 @@ interface ToolBarPropsType {
}
const ToolBar: React.FC<ToolBarPropsType> = (props) => {
const { type = 1, title = "首页", showActions, templateId, templateInfo, layoutType } = props
const intl = useIntl()
const { type = 1, title = intl.formatMessage({ id: 'editor.channel.menu.home', defaultMessage: '首页'}), showActions, templateId, templateInfo, layoutType } = props
const [saveLoading, setSaveLoading] = useState<boolean>(false)
const { pageConfig } = useSelector<{ pageConfig: PageConfigType }, STATE_PROPS>(['pageConfig'])
const handleGoBack = () => {
if (type === 1) {
Modal.confirm({
content: "是否确认离开模板装修页面?",
okText: "确认",
content: intl.formatMessage({ id: 'common.tip.designpage.leave.confirm' }),
okText: intl.formatMessage({ id: 'common.button.confirm' }),
className: styles.modal_confirm,
cancelText: "取消",
cancelText: intl.formatMessage({ id: 'common.button.cancel' }),
onOk: () => {
history.goBack()
}
......@@ -59,11 +60,15 @@ const ToolBar: React.FC<ToolBarPropsType> = (props) => {
postFn = postTemplateAdornAppSelfSave
}
if(postFn) {
setSaveLoading(true)
postFn(param).then(res => {
setSaveLoading(false)
if(res.code === 1000) {
message.destroy()
message.success("保存成功")
message.success(intl.formatMessage({ id: 'common.tip.save.success' }))
}
}).catch(() => {
setSaveLoading(false)
})
}
}
......@@ -74,13 +79,13 @@ const ToolBar: React.FC<ToolBarPropsType> = (props) => {
<ArrowLeftOutlined />
</div>
<div className={styles.toolbar_title}>
<span>{type === 1 ? '正在编辑:' : '正在预览:'}</span>
<span>{type === 1 ? intl.formatMessage({ id: 'editor.toolbar.title.edit' }) : intl.formatMessage({ id: 'editor.toolbar.title.preview' })}</span>
<label>{title}</label>
</div>
{
showActions && <div className={styles.toolbar_actions}>
<Button type="link" onClick={() => handleGoBack()}>取消</Button>
<Button loading={saveLoading} type="primary" onClick={() => handleSave()}>保存</Button>
<Button type="link" onClick={() => handleGoBack()}>{intl.formatMessage({ id: 'common.button.cancel' })}</Button>
<Button loading={saveLoading} type="primary" onClick={() => handleSave()}>{intl.formatMessage({ id: 'common.button.save' })}</Button>
</div>
}
</div>
......@@ -89,7 +94,6 @@ const ToolBar: React.FC<ToolBarPropsType> = (props) => {
ToolBar.defaultProps = {
type: 1,
title: "首页",
showActions: false,
}
......
import { getIntl } from 'umi'
const intl = getIntl()
export const getDefaultMenuData = (mallPath: string, memberId: number) => {
return [
{
"link": `${mallPath}/${memberId}`,
"name": "商城首页",
"name": intl.formatMessage({ id: 'editor.own.menu.home' }),
"key": "Home",
type: 1,
status: true,
},
{
"link": `${mallPath}/${memberId}/commodity`,
"name": "现货商品",
"name": intl.formatMessage({ id: 'editor.own.menu.commodity' }),
"key": "commodity",
type: 2,
status: true,
},
{
"link": `${mallPath}/${memberId}/inquery`,
"name": "询价商品",
"name": intl.formatMessage({ id: 'editor.own.menu.inquery' }),
"key": "inquery",
type: 3,
status: true,
},
{
"link": `${mallPath}/${memberId}/points`,
"name": "积分兑换",
"name": intl.formatMessage({ id: 'editor.own.menu.integral' }),
"key": "points",
type: 4,
status: true,
},
{
"link": `${mallPath}/${memberId}/infomation`,
"name": "行情资讯",
"name": intl.formatMessage({ id: 'editor.own.menu.infomation' }),
"key": "infomation",
type: 6,
status: true,
},
{
"link": `${mallPath}/${memberId}/about`,
"name": "关于我们",
"name": intl.formatMessage({ id: 'editor.own.menu.about' }),
"key": "about",
type: 5,
status: true,
......@@ -45,48 +49,3 @@ export const getDefaultMenuData = (mallPath: string, memberId: number) => {
]
}
export const menuData = [
{
"link": "/",
"name": "商城首页",
"key": "Home",
type: 1,
status: true,
},
{
"link": "/commodity",
"name": "现货商品",
"key": "commodity",
type: 2,
status: true,
},
{
"link": "/inquery",
"name": "询价商品",
"key": "inquery",
type: 3,
status: true,
},
{
"link": "/points",
"name": "积分兑换",
"key": "points",
type: 4,
status: true,
},
{
"link": "/infomation",
"name": "行情资讯",
"key": "infomation",
type: 6,
status: true,
},
{
"link": "/about",
"name": "关于我们",
"key": "about",
type: 5,
status: true,
},
]
......@@ -21,7 +21,7 @@ import {
InformationConfig,
FooterConfig,
} from './defaultData'
import { menuData, getDefaultMenuData } from './defaultMenu'
import { getDefaultMenuData } from './defaultMenu'
import Loading from '../components/Loading'
import { GlobalConfig } from '@/global/config'
import { getAuth } from '@/utils/auth'
......
......@@ -5,7 +5,7 @@ import ToolBar from '../components/toolBar'
import PreviewPanel from '../components/PreviewPanel'
import config from '../configs'
import { isEmpty } from 'lodash'
import { LAYOUT_TYPE } from '@/constants'
import { LAYOUT_TYPE, REQUEST_HEADER, TOP_DOMAIN } from '@/constants'
import {
topBarConfig,
topAdvertConfig,
......@@ -21,7 +21,7 @@ import {
InformationConfig,
FooterConfig,
} from './defaultData'
import { menuData } from './defaultMenu'
import { getDefaultMenuData } from './defaultMenu'
import Loading from '../components/Loading'
import { GlobalConfig } from '@/global/config'
import { getAuth } from '@/utils/auth'
......@@ -177,10 +177,15 @@ const OwnMallEdit: React.FC<ShopEditPropsType> = (props) => {
const getComponentsConfig = async () => {
// 导航栏
const navData = await getOwnMallNavData();
//商城信息
const shopList = GlobalConfig.web.shopInfo
const webMallInfo = shopList.filter(item => item.id === Number(shopId))[0]
if(!isEmpty(navData)) {
mainNavConfig[mainNavConfig.key].props.menuData = navData;
} else {
mainNavConfig[mainNavConfig.key].props.menuData = menuData;
const mallPath = `${REQUEST_HEADER}${webMallInfo?.url}.${TOP_DOMAIN}`
mainNavConfig[mainNavConfig.key].props.menuData = mainNavConfig[mainNavConfig.key].props.menuData = getDefaultMenuData(mallPath, memberId);;
}
mainNavConfig[mainNavConfig.key].props.type = LAYOUT_TYPE.shop
mainNavConfig[mainNavConfig.key].props.categoryList = await getCategoryTree()
......@@ -193,9 +198,7 @@ const OwnMallEdit: React.FC<ShopEditPropsType> = (props) => {
threeBannerConfig[threeBannerConfig.key].props.advertList = await findAdvertsByType(3)
// 四号位广告
fourBannerConfig[fourBannerConfig.key].props.advertList = await findAdvertsByType(4)
//商城信息
const shopList = GlobalConfig.web.shopInfo
const webMallInfo = shopList.filter(item => item.id === Number(shopId))[0]
topBarConfig[topBarConfig.key].props.shopname = webMallInfo.name
headerConfig[headerConfig.key].props.logoUrl = webMallInfo.logoUrl
......@@ -285,7 +288,7 @@ const OwnMallEdit: React.FC<ShopEditPropsType> = (props) => {
}}
>
<div className={styles['wrapper']}>
<ToolBar type={2} title="首页" />
<ToolBar type={2} />
<div className={styles['content']}>
<div className={styles['canvas-container']}>
<PreviewPanel onlyEidt theme={theme} pageConfig={componentConfigs} />
......
import React, { forwardRef, useState, useCallback } from 'react'
import { Button, Input, Select } from 'antd'
import UploadImage from '@/components/UploadImage'
import { useIntl } from 'umi'
import { filterPropsFunction, getAdvertType } from '../../../../utils'
import SettingPanel from '../../../../components/SettingPanel'
import { message, Modal } from 'antd'
......@@ -69,6 +70,7 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref)
const [list, setList] = useState<AdvertItemType[]>(advertList)
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
const [newProps, setNewProps] = useState(props)
const intl = useIntl()
const getImgSize = () => {
switch (type) {
......@@ -187,9 +189,9 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref)
const handleCancel = useCallback(() => {
if (!isEqual(props, newProps )) {
Modal.confirm({
content: "您还没有保存修改的内容,是否确认关闭?",
okText: "确认",
cancelText: "取消",
content: intl.formatMessage({ id: 'common.tip.save.confirm' }),
okText: intl.formatMessage({ id: 'common.button.confirm' }),
cancelText: intl.formatMessage({ id: 'common.button.cancel' }),
onOk: () => {
clearSelectedStatus()
}
......@@ -234,17 +236,17 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref)
const checkAdvertList = (dataList: any) => {
if (isEmpty(dataList)) {
message.destroy()
message.error('请至少添加一个广告')
message.error(intl.formatMessage({ id: 'editor.setting.advert.required.tip' }))
return false
}
return dataList.every(item => {
message.destroy()
if (!item.name) {
message.error('请输入广告名称')
message.error(intl.formatMessage({ id: 'editor.setting.advert.name.required' }))
return false
} else if (!item.picUrl) {
message.error('请上传广告图片')
message.error(intl.formatMessage({ id: 'editor.setting.advert.picUrl.required' }))
return false
} else {
return true
......@@ -319,13 +321,13 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref)
!!item.expand && (
<div className={styles.advert_setting_line_addItem}>
<div className={styles.advert_setting_line_addItem_line}>
<div className={styles.advert_setting_line_addItem_line_label}>名称</div>
<div className={styles.advert_setting_line_addItem_line_label}>{intl.formatMessage({ id: 'editor.setting.advert.form.name' })}</div>
<div className={styles.advert_setting_line_addItem_line_brief}>
<Input className={styles.advert_setting_line_addItem_input} value={item.name} onChange={(e) => handleKeyChange(e.target.value, item.sort, 'name')} maxLength={15} />
</div>
</div>
<div className={styles.advert_setting_line_addItem_line}>
<div className={styles.advert_setting_line_addItem_line_label}>图片</div>
<div className={styles.advert_setting_line_addItem_line_label}>{intl.formatMessage({ id: 'editor.setting.advert.form.picUrl' })}</div>
<div className={styles.advert_setting_line_addItem_line_brief}>
<UploadImage
imgUrl={item.picUrl}
......@@ -336,7 +338,7 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref)
</div>
</div>
<div className={styles.advert_setting_line_addItem_line}>
<div className={styles.advert_setting_line_addItem_line_label}>链接</div>
<div className={styles.advert_setting_line_addItem_line_label}>{intl.formatMessage({ id: 'editor.setting.advert.form.link' })}</div>
<div className={styles.advert_setting_line_addItem_line_brief}>
<Input
className={styles.advert_setting_line_addItem_input}
......@@ -357,7 +359,7 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref)
</div>
))
}
<Button onClick={addSliderItem} className={styles.add_btn} icon={<PlusOutlined />}>添加广告</Button>
<Button onClick={addSliderItem} className={styles.add_btn} icon={<PlusOutlined />}>{intl.formatMessage({ id: 'editor.setting.advert.add.btn' })}</Button>
</div>
</SettingPanel>
)
......
import React, { useState, useEffect, useCallback } from 'react'
import { Checkbox, Row, Col, message, Modal } from 'antd'
import { useIntl } from 'umi'
import UploadImage from '@/components/UploadImage'
import SettingPanel from '../../../../components/SettingPanel'
import { clearSelectedStatus, changeProps } from '@lingxi-design/core'
......@@ -28,6 +29,7 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
const [categoryResponseList, setCategoryResponseList] = useState<any>([])
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
const [newProps, setNewProps] = useState(props)
const intl = useIntl()
const changeNewProps = (key: string, data: any) => {
const result = { ...newProps }
......@@ -104,12 +106,12 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
return new Promise((resolve, reject) => {
const { categoryAdvertPicUrl } = data
if (!categoryAdvertPicUrl) {
message.error('请上传品类广告图片')
message.error(intl.formatMessage({ id: 'editor.setting.category.categoryAdvertPicUrl.required' }))
reject()
return
}
if (selectKeys.length > 4) {
message.error('最多推荐4个二级品类')
message.error(intl.formatMessage({ id: 'editor.setting.category.categoryAdvertPicUrl.most' }))
reject()
return
}
......@@ -143,9 +145,9 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
const handleCancel = useCallback(() => {
if (JSON.stringify(props) !== JSON.stringify(newProps)) {
Modal.confirm({
content: "您还没有保存修改的内容,是否确认关闭?",
okText: "确认",
cancelText: "取消",
content: intl.formatMessage({ id: 'common.tip.save.confirm' }),
okText: intl.formatMessage({ id: 'common.button.confirm' }),
cancelText: intl.formatMessage({ id: 'common.button.cancel' }),
onOk: () => {
clearSelectedStatus()
}
......@@ -163,7 +165,7 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
>
<div className={styles.category_recommend}>
<div className={styles.category_recommend_title}>
<span>一级品类广告图片设置</span>
<span>{intl.formatMessage({ id: 'editor.setting.category.first.title' })}</span>
</div>
<div className={styles.category_recommend_body}>
<UploadImage
......@@ -173,7 +175,7 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
/>
</div>
<div className={styles.category_recommend_title}>
<span>二级推荐分类设置</span>
<span>{intl.formatMessage({ id: 'editor.setting.category.second.title' })}</span>
</div>
<div className={styles.category_recommend_body}>
<Checkbox.Group value={selectKeys} style={{ width: '100%' }} onChange={handleSecondCategoryChange}>
......
import React from 'react'
import { useIntl } from 'umi'
import styles from './index.less'
interface GoodsItemPropsType {
......@@ -8,6 +9,7 @@ interface GoodsItemPropsType {
const GoodsItem: React.FC<GoodsItemPropsType> = (props) => {
const { dataInfo = {} } = props
const intl = useIntl()
const renderPriceByType = (info: any) => {
switch (info.priceType) {
......@@ -21,7 +23,7 @@ const GoodsItem: React.FC<GoodsItemPropsType> = (props) => {
case 2:
return (
<div className={styles.inquiry_price}>
<label>在线询价</label>
<label>{intl.formatMessage({ id: 'editor.setting.goods.inquiry.price' })}</label>
</div>
)
default:
......@@ -38,11 +40,11 @@ const GoodsItem: React.FC<GoodsItemPropsType> = (props) => {
<div className={styles.goods_item_info_name}>{dataInfo.goodsName}</div>
{ renderPriceByType(dataInfo) }
<div className={styles.goods_item_info_brief}>
<span>品类</span>
<span>{intl.formatMessage({ id: 'editor.columns.category' })}</span>
<span>{dataInfo.categoryName}</span>
</div>
<div className={styles.goods_item_info_brief}>
<span>品牌</span>
<span>{intl.formatMessage({ id: 'editor.columns.brand' })}</span>
<span>{dataInfo.brandName}</span>
</div>
</div>
......
import React, { useState, useEffect } from 'react'
import { clearSelectedStatus, changeProps } from '@lingxi-design/core'
import { useIntl } from 'umi'
import { Row, Col, Button, Input, Pagination, Select, Form, message, Modal } from 'antd'
import SettingList from '../../../../components/SettingList'
import GoodsItem from './GoodsItem'
......@@ -47,6 +48,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const [categoryResponseList, setCategoryResponseList] = useState<any>([])
const [noSelectBrands, setNoSelectBrands] = useState<any[]>([])
const intl = useIntl()
useEffect(() => {
fetchBrandsList()
......@@ -187,9 +189,9 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
const handleCancel = () => {
if (JSON.stringify(goodsList) !== JSON.stringify(selectGoodsList)) {
Modal.confirm({
content: "您还没有保存修改的内容,是否确认关闭?",
okText: "确认",
cancelText: "取消",
content: intl.formatMessage({ id: 'common.tip.save.confirm' }),
okText: intl.formatMessage({ id: 'common.button.confirm' }),
cancelText: intl.formatMessage({ id: 'common.button.cancel' }),
onOk: () => {
clearSelectedStatus()
}
......@@ -204,13 +206,9 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
clearSelectedStatus()
return
}
// console.log('handleConfirmSave2')
// if (selectGoodsList.length <= 0) {
// message.error("请选择要推荐的商品")
// return
// } else
if (selectGoodsList.length > 9) {
message.error("最多只能推荐9件商品")
message.error(intl.formatMessage({ id: 'editor.setting.goods.most' }))
return
}
setConfirmLoading(true)
......@@ -302,7 +300,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
type='primary'
onClick={() => handleChangeOprationType('select')}
>
选择商品
{intl.formatMessage({ id: 'editor.setting.goods.select.btn' })}
</Button>
) : (
<Button
......@@ -311,7 +309,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
setIsHighSearch(false)
}}
>
查看已选择商品({selectGoodsList.length})
{intl.formatMessage({ id: 'editor.setting.goods.checkt.btn' })}({selectGoodsList.length})
</Button>
)
}
......@@ -326,7 +324,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
>
<Input.Search
style={{ width: 240 }}
placeholder="商品名称"
placeholder={intl.formatMessage({ id: 'editor.setting.goods.goodsName' })}
allowClear
onSearch={handleSearch}
/>
......@@ -334,10 +332,10 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
</Col>
<Col>
<Button onClick={() => setIsHighSearch(!isHighSearch)}>高级筛选{isHighSearch ? <CaretUpOutlined /> : <CaretDownOutlined />}</Button>
<Button onClick={() => setIsHighSearch(!isHighSearch)}>{intl.formatMessage({ id: 'common.button.advanced.filter' })}{isHighSearch ? <CaretUpOutlined /> : <CaretDownOutlined />}</Button>
</Col>
<Col>
<Button onClick={() => handleReset()}>重置</Button>
<Button onClick={() => handleReset()}>{intl.formatMessage({ id: 'common.button.reset' })}</Button>
</Col>
</Col>
)
......@@ -354,7 +352,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
name="twoCategoryId"
className={styles.mar_bot_0}
>
<Select allowClear placeholder="品类" style={{ width: 180 }} onChange={handleSearch}>
<Select allowClear placeholder={intl.formatMessage({ id: 'editor.columns.category' })} style={{ width: 180 }} onChange={handleSearch}>
{
categoryResponseList.map((item, index) => <Select.Option key={`select_category_item_${index}`} value={item.categoryId}>{item.categoryName}</Select.Option>)
}
......@@ -366,7 +364,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
name="brandId"
className={styles.mar_bot_0}
>
<Select allowClear placeholder="品牌" style={{ width: 180 }} onChange={handleSearch}>
<Select allowClear placeholder={intl.formatMessage({ id: 'editor.columns.brand' })} style={{ width: 180 }} onChange={handleSearch}>
{
noSelectBrands.map((item, index) => (<Select.Option key={`select_brand_item_${index}`} value={item.brandId}>{item.brandName}</Select.Option>))
}
......@@ -413,7 +411,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
showSizeChanger
showQuickJumper
onChange={handlePageChange}
showTotal={total => `共 ${totalCount} 条`}
showTotal={total => `${intl.formatMessage({ id: 'common.text.common' })} ${totalCount} ${intl.formatMessage({ id: 'common.text.unit.strip' })}`}
/>
</div>
</>
......
......@@ -2,11 +2,13 @@ import React, { useState , useEffect } from 'react';
import { Modal, Checkbox, Button } from 'antd';
import { clearSelectedStatus, changeProps, produce } from '@lingxi-design/core';
import { ReactSortable } from "react-sortablejs"
import { isEmpty } from 'lodash';
import { useIntl } from 'umi'
import isEmpty from 'lodash/isEmpty';
import { LAYOUT_TYPE } from '@/constants';
import cx from 'classnames';
import { postTemplateAdornWebSelfSaveColumn } from '@/services/TemplateV2Api';
import { cloneDeep, isEqual } from 'lodash';
import cloneDeep from 'lodash/cloneDeep'
import isEqual from 'lodash/isEqual'
import upIcon from '@/assets/icons/up_icon.png';
import downIcon from '@/assets/icons/down_icon.png';
import sortIcon from '@/assets/icons/sort_icon.png';
......@@ -31,6 +33,7 @@ const MallNav: React.FC<MallNavProps> = (props) => {
const [list, setList] = useState<MenuItemType[]>([]);
const [confirmLoading, setConfirmLoading] = useState<boolean>(false);
const [newProps, setNewProps] = useState(props);
const intl = useIntl()
useEffect(() => {
if (!isEmpty(menuData)) {
......@@ -132,9 +135,9 @@ const MallNav: React.FC<MallNavProps> = (props) => {
const handleCancel = () => {
if (!isEqual(props, newProps)) {
Modal.confirm({
content: "您还没有保存修改的内容,是否确认关闭?",
okText: "确认",
cancelText: "取消",
content: intl.formatMessage({ id: 'common.tip.save.confirm' }),
okText: intl.formatMessage({ id: 'common.button.confirm' }),
cancelText: intl.formatMessage({ id: 'common.button.cancel' }),
onOk: () => {
clearSelectedStatus();
}
......@@ -167,10 +170,10 @@ const MallNav: React.FC<MallNavProps> = (props) => {
<div className={styles.mall_nav}>
<div className={styles.mall_nav_title}>
<ul>
<li className={styles.width160}>栏目名称</li>
<li className={styles.width392}>链接地址</li>
<li className={styles.width96}>显示在导航上</li>
<li className={styles.width120}>位置排序</li>
<li className={styles.width160}>{intl.formatMessage({ id: 'editor.setting.nav.name' })}</li>
<li className={styles.width392}>{intl.formatMessage({ id: 'editor.setting.nav.link' })}</li>
<li className={styles.width96}>{intl.formatMessage({ id: 'editor.setting.nav.status' })}</li>
<li className={styles.width120}>{intl.formatMessage({ id: 'editor.setting.nav.sort' })}</li>
</ul>
</div>
<div className={styles.mall_nav_body}>
......
import { getIntl } from 'umi'
const intl = getIntl()
export const menuData = [
{
"path": "/shop",
"name": "首页",
"name": intl.formatMessage({ id: 'editor.channel.menu.home' }),
"key": "shopHome",
},
{
"path": "/shop/commodity",
"name": "现货商品",
"name": intl.formatMessage({ id: 'editor.own.menu.commodity' }),
"key": "shopCommodity",
},
{
"path": "/shop/pointsMall",
"name": "询价商品",
"name": intl.formatMessage({ id: 'editor.own.menu.inquery' }),
"key": "shopPointsMall",
},
{
"path": "/shop/infomation",
"name": "积分兑换",
"name": intl.formatMessage({ id: 'editor.own.menu.integral' }),
"key": "shopInfomation",
},
{
"path": "/shop/about",
"name": "关于我们",
"name": intl.formatMessage({ id: 'editor.own.menu.about' }),
"key": "shopAbout",
},
]
......@@ -7,12 +7,15 @@
* @FilePath: /lingxi-business-paltform/src/pages/mobileTemplate/channelTemplateEdit/config.ts
*/
import { PageConfigType } from '@lingxi-design/core'
import { getIntl } from 'umi'
import categoryNavTemplateDefault from '../shopTemplateEdit/img/category_template_default.png'
import RED_PACKAGE from '../shopTemplateEdit/img/red_package.png';
const intl = getIntl()
export const defaultHeaderNavData = [
{
name: "我的",
name: intl.formatMessage({ id: 'editor.template.channel.header.data.mine' }),
content: "",
status: true,
type: 1
......@@ -34,7 +37,7 @@ export const channelLayoutConfig : PageConfigType = {
childNodes: ['1', '3', '5', '7']
},
'1': {
title: '头部导航栏',
title: intl.formatMessage({ id: 'editor.template.channel.header.title' }),
canDelete: false,
componentName: 'ChannelHeaderNav',
canEdit: false,
......@@ -56,7 +59,7 @@ export const channelLayoutConfig : PageConfigType = {
},
},
'3': {
title: '广告图',
title: intl.formatMessage({ id: 'editor.template.channel.banner.title' }),
canDelete: false,
componentName: 'Banner',
props: {
......@@ -66,7 +69,7 @@ export const channelLayoutConfig : PageConfigType = {
},
childNodes: ['4'],
childComponentName: 'Banner.Items',
addBtnText: '添加广告',
addBtnText: intl.formatMessage({ id: 'editor.template.add.advert' }),
},
'4': {
loop: '${advert}',
......@@ -81,7 +84,7 @@ export const channelLayoutConfig : PageConfigType = {
},
},
'5': {
title: '分类导航',
title: intl.formatMessage({ id: 'editor.template.channel.nav.title' }),
canDelete: false,
hideAction: true,
componentName: 'MobileNavCard',
......@@ -101,7 +104,7 @@ export const channelLayoutConfig : PageConfigType = {
},
childNodes: ['6'],
childComponentName: 'MobileNavCard.NavItem',
addBtnText: '添加导航',
addBtnText: intl.formatMessage({ id: 'editor.template.add.nav' }),
},
'6': {
loop: '${navList}',
......@@ -117,7 +120,7 @@ export const channelLayoutConfig : PageConfigType = {
},
},
'7': {
title: '资讯',
title: intl.formatMessage({ id: 'editor.template.channel.information.title' }),
canDelete: false,
componentName: 'InformationCard',
props: {
......@@ -125,19 +128,19 @@ export const channelLayoutConfig : PageConfigType = {
},
childNodes: [],
canEdit: false,
addBtnText: '添加资讯',
addBtnText: intl.formatMessage({ id: 'editor.template.add.information' }),
},
}
export const defaultConfig: PageConfigType = {
'14': {
title: '底部标签栏',
title: intl.formatMessage({ id: 'editor.template.channel.bottom.title' }),
canDelete: false,
componentName: 'BottomNavigation',
props: {},
childNodes: ['15'],
childComponentName: 'BottomNavigation.Items',
addBtnText: '添加标签',
addBtnText: intl.formatMessage({ id: 'editor.template.add.label' }),
maxLength: 5,
},
'15': {
......@@ -156,18 +159,18 @@ export const defaultConfig: PageConfigType = {
export const suggestProductConfig = {
'12': {
title: '推荐商品',
title: intl.formatMessage({ id: 'editor.template.channel.product.title' }),
canDelete: false,
componentName: 'SuggestProduct',
props: {},
childNodes: [],
childComponentName: 'SuggestProduct.Items',
addBtnText: '添加分类',
addBtnText: intl.formatMessage({ id: 'editor.template.add.category' }),
canEdit: true,
canHide: false,
maxLength: 4,
childProps: {
title: '商品容器',
title: intl.formatMessage({ id: 'editor.template.goods.container' }),
canEdit: true,
canHide: false,
componentName: 'SuggestProduct.Items',
......@@ -182,7 +185,7 @@ export const suggestProductConfig = {
export const couponsModalConfig = {
'13': {
title: '优惠券弹窗',
title: intl.formatMessage({ id: 'editor.template.channel.coupons.title' }),
componentName: 'CouponsModal',
props: {
style: {
......@@ -201,7 +204,7 @@ export const couponsModalConfig = {
},
childNodes: [],
childComponentName: 'CouponsModal.CouponsItem',
addBtnText: '添加优惠券',
addBtnText: intl.formatMessage({ id: 'editor.template.add.coupons' }),
canEdit: true,
canHide: false,
canDelete: false,
......
......@@ -7,17 +7,11 @@
* @FilePath: /lingxi-business-paltform/src/pages/mobileTemplate/channelTemplateEdit/config.ts
*/
import { PageConfigType } from '@lingxi-design/core'
import { getIntl } from 'umi'
import categoryNavTemplateDefault from '../shopTemplateEdit/img/category_template_default.png'
import RED_PACKAGE from '../shopTemplateEdit/img/red_package.png';
export const defaultHeaderNavData = [
{
name: "我的",
content: "",
status: true,
type: 1
},
]
const intl = getIntl()
export const channelLayoutConfig : PageConfigType = {
'0': {
......@@ -34,7 +28,7 @@ export const channelLayoutConfig : PageConfigType = {
childNodes: ['1', '3', '5', '7']
},
'1': {
title: '头部导航栏',
title: intl.formatMessage({ id: 'editor.template.channel.header.title' }),
canDelete: false,
componentName: 'ChannelHeaderNav',
canEdit: false,
......@@ -46,7 +40,7 @@ export const channelLayoutConfig : PageConfigType = {
childComponentName: 'ChannelHeaderNav.ActionItem',
},
'3': {
title: '广告图',
title: intl.formatMessage({ id: 'editor.template.channel.banner.title' }),
canDelete: false,
componentName: 'Banner',
props: {
......@@ -56,7 +50,7 @@ export const channelLayoutConfig : PageConfigType = {
},
childNodes: ['4'],
childComponentName: 'Banner.Items',
addBtnText: '添加广告',
addBtnText: intl.formatMessage({ id: 'editor.template.add.advert' }),
},
'4': {
loop: '${advert}',
......@@ -71,7 +65,7 @@ export const channelLayoutConfig : PageConfigType = {
},
},
'5': {
title: '分类导航',
title: intl.formatMessage({ id: 'editor.template.channel.nav.title' }),
canDelete: false,
hideAction: true,
componentName: 'MobileNavCard',
......@@ -91,7 +85,7 @@ export const channelLayoutConfig : PageConfigType = {
},
childNodes: ['6'],
childComponentName: 'MobileNavCard.NavItem',
addBtnText: '添加导航',
addBtnText: intl.formatMessage({ id: 'editor.template.add.nav' }),
},
'6': {
loop: '${navList}',
......@@ -107,7 +101,7 @@ export const channelLayoutConfig : PageConfigType = {
},
},
'7': {
title: '资讯',
title: intl.formatMessage({ id: 'editor.template.channel.information.title' }),
canDelete: false,
componentName: 'InformationCard',
props: {
......@@ -115,19 +109,19 @@ export const channelLayoutConfig : PageConfigType = {
},
childNodes: [],
canEdit: false,
addBtnText: '添加资讯',
addBtnText: intl.formatMessage({ id: 'editor.template.add.information' }),
},
}
export const defaultConfig: PageConfigType = {
'14': {
title: '底部标签栏',
title: intl.formatMessage({ id: 'editor.template.channel.bottom.title' }),
canDelete: false,
componentName: 'BottomNavigation',
props: {},
childNodes: ['15'],
childComponentName: 'BottomNavigation.Items',
addBtnText: '添加标签',
addBtnText: intl.formatMessage({ id: 'editor.template.add.label' }),
maxLength: 5,
},
'15': {
......@@ -146,7 +140,7 @@ export const defaultConfig: PageConfigType = {
export const brandListConfig = {
'16': {
title: '推荐品牌',
title: intl.formatMessage({ id: 'editor.template.own.brand.title' }),
componentName: 'MobileBrand',
hideAction: true,
props: {
......@@ -158,16 +152,16 @@ export const brandListConfig = {
childNodes: ['17', '18'],
},
'17': {
title: '标题',
title: intl.formatMessage({ id: 'editor.marketing.activity_title' }),
componentName: 'MobileBrand.Header',
props: {
title: '精选品牌',
explain: '享专属优惠',
title: intl.formatMessage({ id: 'editor.template.own.brand.header.title' }),
explain: intl.formatMessage({ id: 'editor.template.own.brand.header.explain' }),
},
childNodes: [],
},
'18': {
title: '品牌列表',
title: intl.formatMessage({ id: 'editor.template.own.brand.list' }),
componentName: 'MobileBrand.List',
props: {
brandIds: [],
......@@ -182,18 +176,18 @@ export const brandListConfig = {
export const suggestProductConfig = {
'12': {
title: '推荐商品',
title: intl.formatMessage({ id: 'editor.template.channel.product.title' }),
canDelete: false,
componentName: 'SuggestProduct',
props: {},
childNodes: [],
childComponentName: 'SuggestProduct.Items',
addBtnText: '添加分类',
addBtnText: intl.formatMessage({ id: 'editor.template.add.category' }),
canEdit: true,
canHide: false,
maxLength: 4,
childProps: {
title: '商品容器',
title: intl.formatMessage({ id: 'editor.template.goods.container' }),
canEdit: true,
canHide: false,
componentName: 'SuggestProduct.Items',
......@@ -208,7 +202,7 @@ export const suggestProductConfig = {
export const couponsModalConfig = {
'13': {
title: '优惠券弹窗',
title: intl.formatMessage({ id: 'editor.template.channel.coupons.title' }),
componentName: 'CouponsModal',
props: {
style: {
......@@ -227,7 +221,7 @@ export const couponsModalConfig = {
},
childNodes: [],
childComponentName: 'CouponsModal.CouponsItem',
addBtnText: '添加优惠券',
addBtnText: intl.formatMessage({ id: 'editor.template.add.coupons' }),
canEdit: true,
canHide: false,
canDelete: false,
......
import { PROPS_SETTING_TYPES, PageConfigType } from '@lingxi-design/core'
import { PageConfigType } from '@lingxi-design/core'
import { getIntl } from 'umi'
import categoryNavTemplateDefault from './img/category_template_default.png'
import RED_PACKAGE from './img/red_package.png';
const intl = getIntl()
export const shopLayoutConfig : PageConfigType = {
'0': {
componentName: 'MallLayout',
......@@ -23,10 +26,10 @@ export const shopLayoutConfig : PageConfigType = {
shopInfo: '${shopInfo}',
backdrop: '${backdrop}',
},
title: '背景图'
title: intl.formatMessage({ id: 'editor.template.shop.backdrop' }),
},
'2': {
title: '分类导航',
title: intl.formatMessage({ id: 'editor.template.channel.nav.title' }),
canDelete: false,
hideAction: true,
componentName: 'MobileNavCard',
......@@ -46,7 +49,7 @@ export const shopLayoutConfig : PageConfigType = {
},
childNodes: ['3'],
childComponentName: 'MobileNavCard.NavItem',
addBtnText: '添加导航',
addBtnText: intl.formatMessage({ id: 'editor.template.add.nav' }),
},
'3': {
loop: '${navList}',
......@@ -62,7 +65,7 @@ export const shopLayoutConfig : PageConfigType = {
},
},
'4': {
title: '广告图',
title: intl.formatMessage({ id: 'editor.template.channel.banner.title' }),
canDelete: false,
componentName: 'Banner',
props: {
......@@ -72,7 +75,7 @@ export const shopLayoutConfig : PageConfigType = {
},
childNodes: ['5'],
childComponentName: 'Banner.Items',
addBtnText: '添加广告',
addBtnText: intl.formatMessage({ id: 'editor.template.add.advert' }),
},
'5': {
loop: '${advert}',
......@@ -91,12 +94,12 @@ export const shopLayoutConfig : PageConfigType = {
export const defaultConfig: PageConfigType = {
'6': {
componentName: 'MobileShopCommodity',
title: '推荐商品',
title: intl.formatMessage({ id: 'editor.template.channel.product.title' }),
canDelete: false,
props: {},
childNodes: ['7'],
childComponentName: 'MobileShopCommodity.Item',
addBtnText: '添加商品区',
addBtnText: intl.formatMessage({ id: 'editor.template.add.product' }),
},
'7': {
loop: '${commodityList}',
......@@ -111,39 +114,14 @@ export const defaultConfig: PageConfigType = {
num: '${item.num}',
},
},
// '8': {
// title: '优惠券弹窗',
// componentName: 'CouponsModal',
// canDelete: false,
// props: {
// style: {
// display: "none",
// position: 'absolute',
// backgroundImage: `url(${RED_PACKAGE})`,
// width: 312,
// height: 425,
// top: 0,
// left: 0,
// bottom: 0,
// right: 0,
// margin: 'auto',
// zIndex: 1,
// },
// },
// childNodes: [],
// childComponentName: 'CouponsModal.CouponsItem',
// addBtnText: '添加优惠券',
// canEdit: true,
// canHide: false,
// },
'9': {
title: '底部标签栏',
title: intl.formatMessage({ id: 'editor.template.channel.bottom.title' }),
canDelete: false,
componentName: 'BottomNavigation',
props: {},
childNodes: ['10'],
childComponentName: 'BottomNavigation.Items',
addBtnText: '添加标签',
addBtnText: intl.formatMessage({ id: 'editor.template.add.label' }),
maxLength: 5,
},
'10': {
......@@ -163,7 +141,7 @@ export const defaultConfig: PageConfigType = {
export const couponsModalConfig = {
'13': {
title: '优惠券弹窗',
title: intl.formatMessage({ id: 'editor.template.channel.coupons.title' }),
componentName: 'CouponsModal',
props: {
style: {
......@@ -182,7 +160,7 @@ export const couponsModalConfig = {
},
childNodes: [],
childComponentName: 'CouponsModal.CouponsItem',
addBtnText: '添加优惠券',
addBtnText: intl.formatMessage({ id: 'editor.template.add.coupons' }),
canEdit: true,
canHide: false,
canDelete: false,
......
import React, { useState, useEffect } from 'react'
import { useIntl } from 'umi'
import { useIntl, getLocale } from 'umi'
import { LayoutOutlined, EyeOutlined, PushpinOutlined } from '@ant-design/icons'
import cx from 'classnames'
import { message } from 'antd'
......@@ -27,7 +27,6 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
useEffect(() => {
fetchDetail()
}, [])
const fetchDetail = () => {
......
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