Files
dukang/apps/mini-user/src/components/BenefitIntroCard.tsx
T
jacy 9c8d5f2cad feat(assoc): v4.0.1 合伙人关联码、分佣账单与 H5 用户管理
订单佣金只认关联用户;合伙人备注写入独立表;H5 增加用户管理与首页统计。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-30 14:35:39 +08:00

54 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { View, Text } from '@tarojs/components';
import Taro from '@tarojs/taro';
import {
BENEFIT_INTRO,
BENEFIT_INTRO_EMPHASIS,
BENEFIT_RULES_PATH,
BENEFIT_SLOGAN,
} from '../lib/benefit-copy';
type BenefitIntroCardProps = {
showLink?: boolean;
className?: string;
/** 左侧金色粗条(门店详情等强调卡) */
accent?: boolean;
};
export default function BenefitIntroCard({
showLink = false,
className,
accent = false,
}: BenefitIntroCardProps) {
const prefix = BENEFIT_INTRO.endsWith(BENEFIT_INTRO_EMPHASIS)
? BENEFIT_INTRO.slice(0, -BENEFIT_INTRO_EMPHASIS.length)
: BENEFIT_INTRO;
function goRules() {
Taro.navigateTo({ url: BENEFIT_RULES_PATH });
}
const inner = (
<>
<Text className="benefit-intro-card-title">{BENEFIT_SLOGAN}</Text>
<Text className="benefit-intro-card-body">
{prefix}
<Text className="benefit-intro-card-em">{BENEFIT_INTRO_EMPHASIS}</Text>
</Text>
{showLink ? (
<Text className="benefit-intro-card-link" onClick={goRules}>
查看完整说明
</Text>
) : null}
</>
);
return (
<View
className={`benefit-intro-card${accent ? ' benefit-intro-card--accent' : ''}${className ? ` ${className}` : ''}`}
>
{accent ? <View className="benefit-intro-card-bar" /> : null}
{accent ? <View className="benefit-intro-card-main">{inner}</View> : inner}
</View>
);
}