Commit 3d5fddbe authored by Bill's avatar Bill

fix: 处理装修页翻译

parent c8d86494
...@@ -153,5 +153,14 @@ export default { ...@@ -153,5 +153,14 @@ export default {
"activePage.Submit": "Submit", "activePage.Submit": "Submit",
"activePage.Pleaseuploadpictures": "Please upload pictures", "activePage.Pleaseuploadpictures": "Please upload pictures",
"activePage.Pleasefillintheactivityname": "Please fill in the activity name", "activePage.Pleasefillintheactivityname": "Please fill in the activity name",
"activePage.save": "Save" "activePage.save": "Save",
"activePage.loading": 'loading',
'activityPage.combination': 'N pieces of the following products are available for M yuan only',
"activityPage.surplus": 'surplus',
"activityPage.surplus.percent": 'surplus{data}%',
"activityPage.hasSold": 'hasSold',
"activityPage.pickNow": 'pickNow',
"activityPage.coupon.conditions": 'full {data} to use',
"activityPage.coupon.startAndEnd": '{start} to {end}',
"activityPage.coupon.pickToEnd": 'Invalid after {day} collection',
} }
...@@ -153,5 +153,14 @@ export default { ...@@ -153,5 +153,14 @@ export default {
"activePage.Submit": '커밋', "activePage.Submit": '커밋',
"activePage.Pleaseuploadpictures": '사진 올려주세요.', "activePage.Pleaseuploadpictures": '사진 올려주세요.',
"activePage.Pleasefillintheactivityname": '활동 이름을 입력하십시오.', "activePage.Pleasefillintheactivityname": '활동 이름을 입력하십시오.',
"activePage.save": '보존' "activePage.save": '보존',
"activePage.loading": '로드 중',
'activityPage.combination': '아래 상품 n개 선택 가능, m원',
"activityPage.surplus": '잉여',
"activityPage.surplus.percent": '잉여{data}%',
"activityPage.hasSold": '강탈',
"activityPage.pickNow": '즉시 수령하다',
"activityPage.coupon.conditions": '만{data} 입감',
"activityPage.coupon.startAndEnd": '{start}-{end}',
"activityPage.coupon.pickToEnd": '수령 후 {day}실효',
} }
...@@ -153,5 +153,14 @@ export default { ...@@ -153,5 +153,14 @@ export default {
"activePage.Submit": "提交", "activePage.Submit": "提交",
"activePage.Pleaseuploadpictures": "请上传图片", "activePage.Pleaseuploadpictures": "请上传图片",
"activePage.Pleasefillintheactivityname": "请填写活动名称", "activePage.Pleasefillintheactivityname": "请填写活动名称",
"activePage.save": "保存" "activePage.save": "保存",
"activePage.loading": '正在加载中',
'activityPage.combination': '以下商品认选n件,只需m元',
"activityPage.surplus": '剩余',
"activityPage.surplus.percent": '剩余{data}%',
"activityPage.hasSold": '已抢',
"activityPage.pickNow": '立即领取',
"activityPage.coupon.conditions": '满{data}立减',
"activityPage.coupon.startAndEnd": '{start}至{end}',
"activityPage.coupon.pickToEnd": '领取后{day}失效',
} }
\ No newline at end of file
...@@ -121,7 +121,7 @@ const ActiveItem: React.FC<Iprops> = (props: Iprops) => { ...@@ -121,7 +121,7 @@ const ActiveItem: React.FC<Iprops> = (props: Iprops) => {
{/* <Button icon={<EditOutlined />}></Button> */} {/* <Button icon={<EditOutlined />}></Button> */}
<div className={styles.fixture}> <div className={styles.fixture}>
<img src={fixture}/> <img src={fixture}/>
<div>活动页装修</div> <div>{intl.formatMessage({id: 'activityPage.activityPageDecorate'}, { default: '活动页装修'})}</div>
</div> </div>
</Link> </Link>
) || null ) || null
......
...@@ -188,7 +188,7 @@ const createComponent = ( ...@@ -188,7 +188,7 @@ const createComponent = (
parentChildConfig = sonConfig.config parentChildConfig = sonConfig.config
configRest = { configRest = {
childComponentName: componentName[floor], childComponentName: componentName[floor],
addBtnText: '添加子节点', addBtnText: intl.formatMessage({ id: 'marketingAbility.tianjiazijiedian', defaultMessage: '添加子节点'}),
childProps: { childProps: {
otherProps: otherProps[floor], otherProps: otherProps[floor],
} }
...@@ -200,7 +200,7 @@ const createComponent = ( ...@@ -200,7 +200,7 @@ const createComponent = (
const [startString, ...rest] = keyNum.split("-"); const [startString, ...rest] = keyNum.split("-");
const config = createComponentConfig({ const config = createComponentConfig({
componentName: componentName[floor - 1], componentName: componentName[floor - 1],
title: childProps?.name || childProps?.productName || `子集${keyNum}`, title: childProps?.name || childProps?.productName || `${keyNum}`,
props: isDept props: isDept
? omit(current, ['childrenData']) ? omit(current, ['childrenData'])
: specialKey && specialKey === otherProps[floor - 1].type : specialKey && specialKey === otherProps[floor - 1].type
...@@ -222,17 +222,17 @@ const createComponent = ( ...@@ -222,17 +222,17 @@ const createComponent = (
function useGetLayout() { function useGetLayout() {
const { id } = usePageStatus(); const { id } = usePageStatus();
const [detail, setDetail] = useState<DetailType | null>(null); const [detail, setDetail] = useState<DetailType | null>(null);
const [loading, setLoading] = useState<boolean>(false); const [loading, setLoading] = useState<boolean>(true);
useEffect(() => { useEffect(() => {
let isValid = true; let isValid = true;
async function fetchData() { async function fetchData() {
setLoading(true); // setLoading(true);
const { code, data } = await getTemplateWebActivityPageGet({id: id}); const { code, data } = await getTemplateWebActivityPageGet({id: id});
if (!isValid) { if (!isValid) {
return; return;
} }
setLoading(false); // setLoading(false);
if (code === 1000) { if (code === 1000) {
const isEmptyObject = Object.keys(data.adornContent).length === 0; const isEmptyObject = Object.keys(data.adornContent).length === 0;
const tempData = { const tempData = {
......
...@@ -10,6 +10,10 @@ import { getTemplateWebActivityPageGet } from '@/services/TemplateV2Api'; ...@@ -10,6 +10,10 @@ import { getTemplateWebActivityPageGet } from '@/services/TemplateV2Api';
import { getIntl} from 'umi' import { getIntl} from 'umi'
const intl = getIntl(); const intl = getIntl();
/**
* TODO 往后会修改改 useGetLayout 一样,因为pc组合促销没搞,先这样
*/
type DataSourceItemType = { type DataSourceItemType = {
sort: number, sort: number,
dataIndex: string, dataIndex: string,
......
import React from 'react'; import React from 'react';
import styles from './index.less'; import styles from './index.less';
import { SimpleCommodity, CustomizeTag } from '@linkseeks/design-ui'; import { SimpleCommodity, CustomizeTag } from '@linkseeks/design-ui';
import cx from 'classnames'; import cx from 'classnames';
import { PlusOutlined } from '@ant-design/icons'; import { PlusOutlined } from '@ant-design/icons';
import omit from 'lodash/omit' import omit from 'lodash/omit'
import { getIntl } from 'umi' import { getIntl } from 'umi'
const intl = getIntl();
interface Iprops { interface Iprops {
children: React.ReactNode, children: React.ReactNode,
...@@ -40,7 +40,7 @@ const Combination: React.FC<Iprops> & { Item: typeof CombinationItem } = (props: ...@@ -40,7 +40,7 @@ const Combination: React.FC<Iprops> & { Item: typeof CombinationItem } = (props:
}; };
const childrenList = parseChildrenList(children); const childrenList = parseChildrenList(children);
const containerTitle = childrenList.length === 0 const containerTitle = childrenList.length === 0
? `以下商品认选n件,只需m元` ? intl.formatMessage({ id: 'activityPage.combination', defaultMessage: '以下商品认选n件,只需m元' })
: childrenList[0]?.activityList?.find((_item) => _item.id === childrenList[0]?.activityId)?.label; : childrenList[0]?.activityList?.find((_item) => _item.id === childrenList[0]?.activityId)?.label;
const classNameStr = cx(styles.combiantion, className, { [styles.hide]: !visible }); const classNameStr = cx(styles.combiantion, className, { [styles.hide]: !visible });
...@@ -70,7 +70,7 @@ const Combination: React.FC<Iprops> & { Item: typeof CombinationItem } = (props: ...@@ -70,7 +70,7 @@ const Combination: React.FC<Iprops> & { Item: typeof CombinationItem } = (props:
count > 0 && ( count > 0 && (
<div className={styles.footer}> <div className={styles.footer}>
<div className={styles['footer-price']}>{getIntl().formatMessage({ id: 'common.money' })}99</div> <div className={styles['footer-price']}>{getIntl().formatMessage({ id: 'common.money' })}99</div>
<div className={styles['footer-btn']}>立即购买</div> <div className={styles['footer-btn']}>{intl.formatMessage({ id: 'activityPage.buyNow', defaultMessage: '立即购买'}, )}</div>
</div> </div>
) )
} }
......
...@@ -133,6 +133,7 @@ const CommodityItem: React.FC<Iprops> = (props: Iprops) => { ...@@ -133,6 +133,7 @@ const CommodityItem: React.FC<Iprops> = (props: Iprops) => {
name, name,
image, image,
mode, mode,
buyBtnText: intl.formatMessage({id: 'activityPage.buyNow'}),
...withLabel, ...withLabel,
originalPrice: originalPrice, originalPrice: originalPrice,
discountPrice: activityPrice || plummetPrice || deductionPrice || originalPrice discountPrice: activityPrice || plummetPrice || deductionPrice || originalPrice
...@@ -154,6 +155,7 @@ const CommodityItem: React.FC<Iprops> = (props: Iprops) => { ...@@ -154,6 +155,7 @@ const CommodityItem: React.FC<Iprops> = (props: Iprops) => {
<div className={classNameStr} > <div className={classNameStr} >
<div {...divProps} className={className}> <div {...divProps} className={className}>
<Commodity <Commodity
{...commodityProps} {...commodityProps}
/> />
</div> </div>
......
...@@ -48,7 +48,7 @@ const SwapCoupon = (props) => { ...@@ -48,7 +48,7 @@ const SwapCoupon = (props) => {
mode="horizontal" mode="horizontal"
discountPrice={price} discountPrice={price}
tags={[intl.formatMessage({ id: 'activityPage.giveCoupon' })]} tags={[intl.formatMessage({ id: 'activityPage.giveCoupon' })]}
buyBtn={true} buyBtn={false}
/> />
</div> </div>
<div className={styles.tab}> <div className={styles.tab}>
......
...@@ -2,7 +2,8 @@ import React from 'react'; ...@@ -2,7 +2,8 @@ import React from 'react';
import { Commodity, Progress } from '@linkseeks/design-ui'; import { Commodity, Progress } from '@linkseeks/design-ui';
import styles from './index.less'; import styles from './index.less';
import classNames from 'classnames'; import classNames from 'classnames';
import { getIntl } from 'umi';
const intl = getIntl();
interface IChildprops { interface IChildprops {
className: string, className: string,
onClick: () => void, onClick: () => void,
...@@ -15,6 +16,10 @@ interface IChildprops { ...@@ -15,6 +16,10 @@ interface IChildprops {
id?: number, id?: number,
price?: number, price?: number,
activityPrice?: number, activityPrice?: number,
/** 活动限购数 */
restrictTotalNum: number,
/** 单位 */
unit: string
} }
...@@ -72,6 +77,7 @@ const Item: React.FC<IChildprops> = (props: IChildprops) => { ...@@ -72,6 +77,7 @@ const Item: React.FC<IChildprops> = (props: IChildprops) => {
const divProps = { const divProps = {
onClick, onMouseOver, onClick, onMouseOver,
}; };
console.log(other, "other");
return ( return (
<div className={styles.item}> <div className={styles.item}>
...@@ -82,13 +88,15 @@ const Item: React.FC<IChildprops> = (props: IChildprops) => { ...@@ -82,13 +88,15 @@ const Item: React.FC<IChildprops> = (props: IChildprops) => {
mode="horizontal" mode="horizontal"
discountPrice={other.activityPrice} discountPrice={other.activityPrice}
price={other.price} price={other.price}
buyBtnText={intl.formatMessage({id: 'activityPage.buyNow'})}
progress={ progress={
<Progress <Progress
percent={50} percent={50}
progressTips={"剩余50%"} progressTips={intl.formatMessage({ id: 'activityPage.surplus', defaultMessage: '剩余0%' }, { data: 50})}
extra={ extra={
<div style={{fontSize: '10px', color: '#919598', marginLeft: '12px', minWidth: '80px'}}> <div style={{fontSize: '10px', color: '#919598', marginLeft: '12px', minWidth: '80px'}}>
剩余<span style={{color: '#ef3346' }}>{other.restrictTotalNum}</span> {intl.formatMessage({id: 'activityPage.surplus', defaultMessage: "剩余"})}
<span style={{color: '#ef3346' }}>{other.restrictTotalNum}</span>{other.unit}
</div> </div>
} }
/> />
......
...@@ -54,10 +54,10 @@ interface ItemIprops { ...@@ -54,10 +54,10 @@ interface ItemIprops {
children: React.ReactNode, children: React.ReactNode,
className: string, className: string,
onClick: () => void, onClick: () => void,
onDrag: () => void, // onDrag: () => void,
onDragEnd: () => void, // onDragEnd: () => void,
onDragEnter: () => void, // onDragEnter: () => void,
onDragStart: () => void, // onDragStart: () => void,
onMouseOver: () => void, onMouseOver: () => void,
draggable?: false draggable?: false
getOperateState: any, getOperateState: any,
...@@ -77,10 +77,10 @@ interface ItemIprops { ...@@ -77,10 +77,10 @@ interface ItemIprops {
const Item: React.FC<ItemIprops> = (props: ItemIprops) => { const Item: React.FC<ItemIprops> = (props: ItemIprops) => {
// const intl = useIntl(); // const intl = useIntl();
const { children, className, ...other} = props; const { children, className, ...other} = props;
const { onClick, onDrag, onDragEnd, onDragEnter, onDragStart, onMouseOver, getOperateState, ...rest} = other; const { onClick, onMouseOver, getOperateState, ...rest} = other;
const { denomination, tag, useConditionMoney, typeName } = rest as any; const { denomination, tag, useConditionMoney, typeName } = rest as any;
const divProps = { const divProps = {
onClick, onDrag, onDragEnd, onDragEnter, onDragStart, onMouseOver, onClick, onMouseOver,
}; };
const isNotNull = useMemo(() => rest?.id && true, [rest]); const isNotNull = useMemo(() => rest?.id && true, [rest]);
return ( return (
......
...@@ -6,6 +6,9 @@ import classNames from 'classnames' ...@@ -6,6 +6,9 @@ import classNames from 'classnames'
import Price from '../../Price'; import Price from '../../Price';
import { GetMarketingAdornMerchantActivityListAdornResponseDetail } from '@/services/MarketingV2Api'; import { GetMarketingAdornMerchantActivityListAdornResponseDetail } from '@/services/MarketingV2Api';
// import Label from '../Label'; // import Label from '../Label';
import { getIntl } from 'umi';
const intl = getIntl();
type ActivityListType = { type ActivityListType = {
/** 活动类型 */ /** 活动类型 */
...@@ -87,7 +90,8 @@ const WebCommodity: React.FC<Iprops> = (props: Iprops) => { ...@@ -87,7 +90,8 @@ const WebCommodity: React.FC<Iprops> = (props: Iprops) => {
/> />
</div> */} </div> */}
<div className={styles['commodity-info-hasBuy']}> <div className={styles['commodity-info-hasBuy']}>
{`已抢 ${productData?.hasSold || 0} ${productData.unit}`} { intl.formatMessage({ id: 'activityPage.hasSold', defaultMessage: '已抢'})}
{`${productData?.hasSold || 0} ${productData.unit}`}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -4,6 +4,7 @@ import classNames from 'classnames'; ...@@ -4,6 +4,7 @@ import classNames from 'classnames';
import { GetMarketingCouponActivityPageSelectPageResponseDetail } from '@/services/MarketingV2Api'; import { GetMarketingCouponActivityPageSelectPageResponseDetail } from '@/services/MarketingV2Api';
import { getIntl } from 'umi'; import { getIntl } from 'umi';
const intl = getIntl();
interface Iprops extends GetMarketingCouponActivityPageSelectPageResponseDetail { interface Iprops extends GetMarketingCouponActivityPageSelectPageResponseDetail {
/** 以下是装修容器提供的属性 */ /** 以下是装修容器提供的属性 */
className: string, className: string,
...@@ -34,18 +35,23 @@ const WebCoupon: React.FC<Iprops> = (props: Iprops) => { ...@@ -34,18 +35,23 @@ const WebCoupon: React.FC<Iprops> = (props: Iprops) => {
<span className={styles['coupon-currency']}>{getIntl().formatMessage({ id: 'common.money' })}</span> <span className={styles['coupon-currency']}>{getIntl().formatMessage({ id: 'common.money' })}</span>
{couponData.denomination} {couponData.denomination}
</span> </span>
<span className={styles['coupon-condition']}>满${couponData.useConditionMoney}立减</span> <span className={styles['coupon-condition']}>
{intl.formatMessage({ id: 'activityPage.coupon.conditions', defaultMessage: `满${couponData.useConditionMoney}立减`}, { data: couponData.useConditionMoney })}
</span>
</div> </div>
<div className={styles['coupon-info']}> <div className={styles['coupon-info']}>
<span className={styles['coupon-info-typeName']}>{couponData.typeName}</span> <span className={styles['coupon-info-typeName']}>{couponData.typeName}</span>
<span className={styles['coupon-info-date']}> <span className={styles['coupon-info-date']}>
{ {
couponData.effectiveType === IS_STABLE couponData.effectiveType === IS_STABLE
? `${couponData.effectiveTimeStart}至${couponData.effectiveTimeEnd}` ? intl.formatMessage({ id: 'activityPage.coupon.startAndEnd', defaultMessage: `${couponData.effectiveTimeStart}至${couponData.effectiveTimeEnd}`}, { start: couponData.effectiveTimeStart, end: couponData.effectiveTimeEnd })
: `领取后${couponData.invalidDay}天失效` : intl.formatMessage({id: 'activityPage.coupon.pickToEnd', defaultMessage: `领取后${couponData.invalidDay}天失效`}, { day: couponData.invalidDay })
} }
</span> </span>
<div className={styles['coupon-info-btn']}>立即领取</div> <div className={styles['coupon-info-btn']}>
{intl.formatMessage({id: 'activityPage.pickNow', defaultMessage: '立即领取'})}
</div>
</div> </div>
</div> </div>
) )
......
...@@ -18,10 +18,10 @@ const WebCustomCommodity: React.FC<Iprops> = (props: Iprops) => { ...@@ -18,10 +18,10 @@ const WebCustomCommodity: React.FC<Iprops> = (props: Iprops) => {
const { children, className, ...other } = props; const { children, className, ...other } = props;
const classNameStr = cx(className); const classNameStr = cx(className);
const { onClick, onDrag, onDragEnd, onDragEnter, onDragStart, onMouseOver, getOperateState } = other as any; const { onClick, onMouseOver, getOperateState } = other as any;
const divProps = { const divProps = {
onClick, onDrag, onDragEnd, onDragEnter, onDragStart, onMouseOver, onClick, onMouseOver,
}; };
const renderComponent = () => { const renderComponent = () => {
return ( return (
......
...@@ -4,6 +4,9 @@ import styles from './index.less'; ...@@ -4,6 +4,9 @@ import styles from './index.less';
import classNames from 'classnames' import classNames from 'classnames'
import Price from '../../Price'; import Price from '../../Price';
import { GetMarketingAdornMerchantActivityListAdornResponseDetail } from '@/services/MarketingV2Api'; import { GetMarketingAdornMerchantActivityListAdornResponseDetail } from '@/services/MarketingV2Api';
import { getIntl } from 'umi'
const intl = getIntl();
type ActivityListType = { type ActivityListType = {
/** 活动类型 */ /** 活动类型 */
...@@ -77,7 +80,8 @@ const HotCommodityItem: React.FC<Iprops> = (props: Iprops) => { ...@@ -77,7 +80,8 @@ const HotCommodityItem: React.FC<Iprops> = (props: Iprops) => {
<Price originalPrice={productData.price} discountPrice={productData.activityPrice} unit={productData.unit} /> <Price originalPrice={productData.price} discountPrice={productData.activityPrice} unit={productData.unit} />
</div> </div>
<div className={styles['commodity-info-hasSold']}> <div className={styles['commodity-info-hasSold']}>
{`已抢 ${productData?.hasSold || 0} ${productData.unit}`} { intl.formatMessage({ id: 'activityPage.hasSold', defaultMessage: '已抢'})}
{`${productData?.hasSold || 0} ${productData.unit}`}
</div> </div>
</div> </div>
</div> </div>
......
@content-height: calc(100vh - 120px); @content-height: calc(100vh - 120px);
.loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
margin-top: 40px;
font-size: 20px;
font-weight: 600;
}
.page { .page {
position: relative; position: relative;
...@@ -16,16 +27,6 @@ ...@@ -16,16 +27,6 @@
opacity: 0; opacity: 0;
} }
} }
.loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
margin-top: 40px;
font-size: 20px;
font-weight: 600;
}
} }
......
...@@ -72,7 +72,7 @@ const Fixtures = () => { ...@@ -72,7 +72,7 @@ const Fixtures = () => {
{ {
loading && ( loading && (
<div className={styles.loading}> <div className={styles.loading}>
正在加载中 { intl.formatMessage({ id: 'activePage.loading'}, { default: '正在加载中' }) }
</div> </div>
) || null ) || null
} }
......
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