Commit bb9f48fe authored by 前端-许佳敏's avatar 前端-许佳敏
parents 76f126bb 17c33ce1
...@@ -52,8 +52,19 @@ export const cardSchema: ISchema = { ...@@ -52,8 +52,19 @@ export const cardSchema: ISchema = {
properties: { properties: {
title: { title: {
type: 'string', type: 'string',
title: '活动名称' title: '活动名称',
} "x-rules": [
{
"required": true,
"message": "最长32个字符,16个汉字"
},
{
limitByte: true, // 自定义校验规则
maxByte: 60,
}
]
},
} }
} }
} }
......
import React, { CSSProperties, useMemo } from 'react'; import React, { CSSProperties, useMemo } from 'react';
import cx from 'classnames'; import cx from 'classnames';
import { Tooltip } from 'antd';
interface Iprops { interface Iprops {
imageUrl: string, imageUrl: string,
...@@ -22,10 +23,18 @@ const Advertisement: React.FC<Iprops> = (props: Iprops) => { ...@@ -22,10 +23,18 @@ const Advertisement: React.FC<Iprops> = (props: Iprops) => {
return ( return (
<div className={classNames} {...divProps}> <div className={classNames} {...divProps}>
<img {
src={imageUrl} imageUrl && (
style={{width: cacheWidth, height: cacheHeight, ...style}} <img
/> src={imageUrl}
style={{width: cacheWidth, height: cacheHeight, ...style}}
/>
) || (
<Tooltip placement="topLeft" title="活动图片" arrowPointAtCenter>
<div style={{width: cacheWidth, height: cacheHeight, ...style}}></div>
</Tooltip>
)
}
</div> </div>
); );
}; };
......
.recommand { .recommand {
padding: 0 8px; padding: 0 8px;
margin-top: 24px; margin-top: 24px;
}
.title { .title {
color: #fff; color: #fff;
font-size: 20px; font-size: 20px;
margin-bottom: 12px; margin-bottom: 12px;
display: block; display: block;
} line-height: 28px;
margin-bottom: 8px;
} }
.hide { .hide {
......
...@@ -2,6 +2,7 @@ import React, { useMemo } from 'react'; ...@@ -2,6 +2,7 @@ import React, { useMemo } from 'react';
import { MarketingCard } from '@lingxi-disign/ui'; import { MarketingCard } from '@lingxi-disign/ui';
import cx from 'classnames'; import cx from 'classnames';
import styles from './index.less'; import styles from './index.less';
import { Tooltip } from 'antd';
const { CouponsItem } = MarketingCard; const { CouponsItem } = MarketingCard;
...@@ -33,9 +34,11 @@ const Coupon: React.FC<Iprops> & { Item: typeof CouponItem } = (props: Iprops) = ...@@ -33,9 +34,11 @@ const Coupon: React.FC<Iprops> & { Item: typeof CouponItem } = (props: Iprops) =
<> <>
{ {
!!visible && ( !!visible && (
<div {...divProps} className={classNameStr}> <Tooltip placement="topLeft" title="优惠券" arrowPointAtCenter>
{children} <div {...divProps} className={classNameStr}>
</div> {children}
</div>
</Tooltip>
) || 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