feat: 分类数据统一
This commit is contained in:
@@ -14,7 +14,6 @@ import {
|
||||
drawClosedFourLineGrid,
|
||||
drawLetterInFourLineGrid,
|
||||
loadLetterFont,
|
||||
type LetterFontSizes,
|
||||
} from '../../shared/draw/drawTools';
|
||||
|
||||
type DailyCheckinData = Extract<
|
||||
@@ -34,7 +33,7 @@ const SECTION_PADDING_TOP = 12;
|
||||
const SECTION_PADDING_BOTTOM = 10;
|
||||
|
||||
// 标题与上一元素的垂直间距(px)
|
||||
const HEADER_TITLE_GAP = 24;
|
||||
const HEADER_TITLE_GAP = 32;
|
||||
// 标题与元信息(如日期、学号等)的间距(px)
|
||||
const HEADER_META_GAP = 22;
|
||||
// 正文内容距标题/元信息顶部的间距(px)
|
||||
@@ -163,6 +162,7 @@ export default class DailyCheckinDraw extends BaseDrawService {
|
||||
const cx = rect.x + rect.w / 2;
|
||||
const titleY = rect.y + SECTION_PADDING_TOP + 12;
|
||||
const metaY = titleY + HEADER_TITLE_GAP;
|
||||
const metaUnderlineY = metaY + 5;
|
||||
|
||||
this.ctx.save();
|
||||
this.ctx.fillStyle = '#322E25';
|
||||
@@ -172,23 +172,21 @@ export default class DailyCheckinDraw extends BaseDrawService {
|
||||
this.ctx.font = '20px serif';
|
||||
this.ctx.fillText('每日打卡', cx, titleY);
|
||||
|
||||
this.ctx.font = '14px serif';
|
||||
this.ctx.fillText('月', rect.x + rect.w * 0.34, metaY);
|
||||
this.ctx.fillText('日', rect.x + rect.w * 0.48, metaY);
|
||||
this.ctx.fillText('姓名:', rect.x + rect.w * 0.7, metaY);
|
||||
this.ctx.font = '12px serif';
|
||||
this.ctx.fillText('月', rect.x + 76, metaY);
|
||||
this.ctx.fillText('日', rect.x + 122, metaY);
|
||||
this.ctx.fillText('姓名:', rect.x + 176, metaY);
|
||||
|
||||
this.ctx.strokeStyle = '#8E897E';
|
||||
this.ctx.lineWidth = 1;
|
||||
this.ctx.setLineDash([]);
|
||||
this.ctx.beginPath();
|
||||
this.ctx.moveTo(rect.x + rect.w * 0.14, metaY + 4);
|
||||
this.ctx.lineTo(rect.x + rect.w * 0.3, metaY + 4);
|
||||
this.ctx.moveTo(rect.x + rect.w * 0.38, metaY + 4);
|
||||
this.ctx.lineTo(rect.x + rect.w * 0.44, metaY + 4);
|
||||
this.ctx.moveTo(rect.x + rect.w * 0.52, metaY + 4);
|
||||
this.ctx.lineTo(rect.x + rect.w * 0.58, metaY + 4);
|
||||
this.ctx.moveTo(rect.x + rect.w * 0.78, metaY + 4);
|
||||
this.ctx.lineTo(rect.x + rect.w * 0.94, metaY + 4);
|
||||
this.ctx.moveTo(rect.x + 40, metaUnderlineY);
|
||||
this.ctx.lineTo(rect.x + 68, metaUnderlineY);
|
||||
this.ctx.moveTo(rect.x + 85, metaUnderlineY);
|
||||
this.ctx.lineTo(rect.x + 113, metaUnderlineY);
|
||||
this.ctx.moveTo(rect.x + 195, metaUnderlineY);
|
||||
this.ctx.lineTo(rect.x + 248, metaUnderlineY);
|
||||
this.ctx.stroke();
|
||||
|
||||
this.ctx.restore();
|
||||
@@ -237,13 +235,13 @@ export default class DailyCheckinDraw extends BaseDrawService {
|
||||
(contentWidth - GRID_COL_GAP * (GRID_COLS - 1)) / GRID_COLS;
|
||||
const cellH =
|
||||
(contentHeight - GRID_ROW_GAP * (GRID_ROWS - 1)) / GRID_ROWS;
|
||||
const pairGap = Math.min(16, cellW * 0.28);
|
||||
const pairGap = 16;
|
||||
const regularSizes = calcLetterFontSizes(
|
||||
cellH * 0.86,
|
||||
cellH * 0.98,
|
||||
PRINT_CLEARLY_REGULAR,
|
||||
);
|
||||
const dashedSizes = calcLetterFontSizes(
|
||||
cellH * 0.86,
|
||||
cellH * 0.98,
|
||||
PRINT_CLEARLY_DASHED,
|
||||
);
|
||||
|
||||
|
||||
@@ -10,29 +10,6 @@
|
||||
bind:canvas-ready="onCanvasReady"
|
||||
bind:favorite="onPreviewFavorite" />
|
||||
|
||||
<!-- 练习类型(2列卡片网格) -->
|
||||
<view class="lt-section">
|
||||
<text class="lt-section-title">练习类型</text>
|
||||
<view class="lt-mode-grid">
|
||||
<view
|
||||
wx:for="{{modeOptions}}"
|
||||
wx:key="id"
|
||||
class="lt-mode-card {{worksheetId === item.id ? 'lt-mode-card--active' : ''}}"
|
||||
data-id="{{item.id}}"
|
||||
hover-class="lt-mode-card--pressed"
|
||||
hover-start-time="0"
|
||||
hover-stay-time="70"
|
||||
bindtap="onSelectMode">
|
||||
<toy-icon
|
||||
name="{{item.icon}}"
|
||||
size="42rpx"
|
||||
color="{{worksheetId === item.id ? '#453900' : '#605b50'}}"
|
||||
custom-class="lt-mode-card__icon" />
|
||||
<text class="lt-mode-card__label">{{item.label}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 选择字母(默认字帖模式) -->
|
||||
<view wx:if="{{showLetterPicker}}" class="lt-section">
|
||||
<text class="lt-section-title">选择字母</text>
|
||||
@@ -123,6 +100,30 @@
|
||||
custom-class="lt-shuffle-btn__icon" />
|
||||
<text class="lt-shuffle-btn__text">换一批</text>
|
||||
</view>
|
||||
|
||||
<!-- 练习类型(2列卡片网格) -->
|
||||
<view class="lt-section">
|
||||
<text class="lt-section-title">练习类型</text>
|
||||
<view class="lt-mode-grid">
|
||||
<view
|
||||
wx:for="{{modeOptions}}"
|
||||
wx:key="id"
|
||||
class="lt-mode-card {{worksheetId === item.id ? 'lt-mode-card--active' : ''}}"
|
||||
data-id="{{item.id}}"
|
||||
hover-class="lt-mode-card--pressed"
|
||||
hover-start-time="0"
|
||||
hover-stay-time="70"
|
||||
bindtap="onSelectMode">
|
||||
<toy-icon
|
||||
name="{{item.icon}}"
|
||||
size="42rpx"
|
||||
color="{{worksheetId === item.id ? '#453900' : '#605b50'}}"
|
||||
custom-class="lt-mode-card__icon" />
|
||||
<text class="lt-mode-card__label">{{item.label}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<draw-ad type="mathDraw"></draw-ad>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user