feat: 首页跳转到分类页指定分类优化

This commit is contained in:
R524809
2026-05-09 11:08:29 +08:00
parent c21ac9e935
commit debecd67c6
20 changed files with 1450 additions and 959 deletions
@@ -0,0 +1,133 @@
<nav-bar title="自定义练字贴" />
<view class="cb-page">
<view class="cb-main">
<preview-card
id="previewCard"
showRefresh="{{true}}"
showFavorite="{{true}}"
favorited="{{isPreviewFavorite}}"
bind:canvas-ready="onCanvasReady"
bind:refresh="onPreviewRefresh"
bind:favorite="onPreviewFavorite" />
<view class="cb-section">
<text class="cb-section-title">内容设置</text>
<view class="cb-content-panel">
<view class="cb-field">
<view class="cb-field-header">
<text class="cb-field-label">自定义文字</text>
<text class="cb-field-hint">最多输入11个字</text>
</view>
<view class="cb-input-wrapper">
<input
class="cb-text-input"
type="text"
maxlength="20"
placeholder="输入想要练习的汉字"
value="{{inputValue}}"
bindinput="onInputChange"
bindconfirm="onInputConfirm" />
<view
wx:if="{{inputValue.length > 0}}"
class="cb-input-clear"
bindtap="onClearInput">
<toy-icon
name="close-bold"
size="36rpx"
color="#605b50" />
</view>
</view>
</view>
<view class="cb-field">
<view class="cb-field-header">
<text class="cb-field-label">已选文字</text>
<text class="cb-field-hint">点击文字可删除</text>
</view>
<scroll-view scroll-x class="cb-word-scroll">
<view class="cb-word-list">
<view
wx:for="{{words}}"
wx:key="index"
class="cb-word-chip">
<text class="cb-word-chip__text">{{item}}</text>
<view
class="cb-word-chip__delete-hit"
data-index="{{index}}"
catchtap="deleteWordChip">
<toy-icon
name="close-bold"
size="24rpx"
color="rgba(96,91,80,0.5)" />
</view>
</view>
<view class="cb-word-add">
<view
class="cb-word-add-btn"
bindtap="openSelectWordPopup">
<toy-icon
name="plus"
size="36rpx"
color="rgba(96,91,80,0.4)" />
</view>
</view>
</view>
</scroll-view>
</view>
<scroll-view scroll-x class="cb-category-scroll">
<view class="cb-category-list">
<view
wx:for="{{categoryTags}}"
wx:key="categoryId"
class="cb-category-tag"
data-category-id="{{item.categoryId}}"
bindtap="onCategoryTap">
<text class="cb-category-tag-icon"
>{{item.icon}}</text
>
<text class="cb-category-tag-text"
>{{item.categoryName}}</text
>
</view>
<view
class="cb-category-tag cb-category-tag--more"
bindtap="openSelectWordPopup">
<text class="cb-category-tag-icon">···</text>
<text class="cb-category-tag-text">更多分类</text>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
<preview-footer-actions
disabled="{{!hasContent}}"
bind:primary="exportToPrint"
bind:secondary="onShare" />
<debug-publish-tools
wx:if="{{isDevEnv && hasContent}}"
id="debugPublishTools"
visible="{{debugPublishVisible}}"
loading="{{debugPublishLoading}}"
meta="{{debugPublishMeta}}"
bind:open="onOpenDebugPublish"
bind:close="onCloseDebugPublish"
bind:confirm="onConfirmDebugPublish" />
<word-picker
show="{{showSelectWordPopup}}"
selectedWords="{{selectedWords}}"
currentTab="{{pickerCurrentTab}}"
max="11"
bind:onClose="closeSelectWordPopup"
bind:onChange="onChangeWord" />
<share-guide-popup
show="{{showShareDialog}}"
bind:onClose="onCloseShareDialog"
bind:onShareSuccess="onShareSuccess" />