- 新增 4 个 UI 组件: PointsCard/ProductCard/CheckinCalendar/CheckinModal - 商城首页 V2: 积分卡 + 快捷操作 + 分类标签 + 商品网格 - 商品详情 V2: 大图 + 信息卡 + 库存/余额状态 + 底部操作栏 - TabBar 新增商城入口(5 Tab: 首页/健康/商城/助手/我的) - 设计原型 docs/design/mp-05-mall-v2.html + SPEC.md 交付包 - CLAUDE.md 安全规范加固: 新增 §3.7 安全规范 6 条 + Feature DoD 安全清单扩展
54 lines
1.6 KiB
TypeScript
54 lines
1.6 KiB
TypeScript
import React from 'react';
|
||
import { View, Text } from '@tarojs/components';
|
||
import './index.scss';
|
||
|
||
interface CheckinCalendarProps {
|
||
consecutiveDays: number;
|
||
earnedPoints?: number;
|
||
onClose?: () => void;
|
||
}
|
||
|
||
const DAYS = ['一', '二', '三', '四', '五', '六', '日'];
|
||
|
||
const CheckinCalendar: React.FC<CheckinCalendarProps> = ({
|
||
consecutiveDays,
|
||
}) => {
|
||
const daysUntilReward = 7 - consecutiveDays;
|
||
|
||
return (
|
||
<View className='checkin-calendar'>
|
||
{DAYS.map((d, i) => {
|
||
const isChecked = i < consecutiveDays;
|
||
const isToday = i === consecutiveDays - 1;
|
||
return (
|
||
<View key={i} className='checkin-calendar__day'>
|
||
<View
|
||
className={`checkin-calendar__dot ${
|
||
isChecked
|
||
? isToday
|
||
? 'checkin-calendar__dot--today'
|
||
: 'checkin-calendar__dot--checked'
|
||
: 'checkin-calendar__dot--empty'
|
||
}`}
|
||
>
|
||
{isChecked && <Text className='checkin-calendar__check'>✓</Text>}
|
||
</View>
|
||
<Text className={`checkin-calendar__label ${isToday ? 'checkin-calendar__label--today' : ''}`}>
|
||
周{d}
|
||
</Text>
|
||
</View>
|
||
);
|
||
})}
|
||
{daysUntilReward > 0 && (
|
||
<View className='checkin-calendar__tip'>
|
||
<Text className='checkin-calendar__tip-text'>
|
||
再坚持 {daysUntilReward} 天,连续 7 天签到额外奖励 50 积分
|
||
</Text>
|
||
</View>
|
||
)}
|
||
</View>
|
||
);
|
||
};
|
||
|
||
export default React.memo(CheckinCalendar);
|