111 lines
4.4 KiB
Plaintext
111 lines
4.4 KiB
Plaintext
<view class="category-manage-page">
|
|
<view class="category-manage-page__summary">
|
|
<view class="category-manage-page__summary-card">
|
|
<text class="category-manage-page__summary-num"
|
|
>{{syncedCount}}</text
|
|
>
|
|
<text class="category-manage-page__summary-label">已同步</text>
|
|
</view>
|
|
<view class="category-manage-page__summary-card">
|
|
<text class="category-manage-page__summary-num"
|
|
>{{missingCount}}</text
|
|
>
|
|
<text class="category-manage-page__summary-label">待新增</text>
|
|
</view>
|
|
<view class="category-manage-page__summary-card">
|
|
<text class="category-manage-page__summary-num"
|
|
>{{outdatedCount}}</text
|
|
>
|
|
<text class="category-manage-page__summary-label">待更新</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="category-manage-page__hint">
|
|
以本地 `CATEGORY_LIST` 为基准,逐项比对云端 `categories` 集合。
|
|
</view>
|
|
|
|
<view wx:if="{{loading}}" class="category-manage-page__loading">
|
|
正在加载分类数据...
|
|
</view>
|
|
|
|
<view wx:else class="category-manage-page__list">
|
|
<view
|
|
wx:for="{{compareItems}}"
|
|
wx:key="id"
|
|
class="category-card category-card--{{item.status}}">
|
|
<view class="category-card__header">
|
|
<view class="category-card__meta">
|
|
<text class="category-card__icon">{{item.icon}}</text>
|
|
<view class="category-card__title-box">
|
|
<view class="category-card__title-box-inner">
|
|
<text class="category-card__title"
|
|
>{{item.name}}</text
|
|
>
|
|
<text class="category-card__id">{{item.id}}</text>
|
|
</view>
|
|
<text class="category-card__subtitle">
|
|
排序 {{item.sortOrder}}
|
|
</text>
|
|
</view>
|
|
</view>
|
|
<view class="category-card__right">
|
|
<text class="category-card__badge"
|
|
>{{item.statusText}}</text
|
|
>
|
|
<toy-button
|
|
wx:if="{{item.actionText}}"
|
|
type="primary"
|
|
size="small"
|
|
data-id="{{item.id}}"
|
|
disabled="{{syncingId === item.id}}"
|
|
bindtap="onTapSync">
|
|
{{syncingId === item.id ? '处理中...' :
|
|
item.actionText}}
|
|
</toy-button>
|
|
</view>
|
|
</view>
|
|
|
|
<text
|
|
wx:if="{{item.status === 'outdated'}}"
|
|
class="category-card__diff">
|
|
{{item.diffText}}
|
|
</text>
|
|
|
|
<view
|
|
wx:if="{{item.status === 'outdated' && item.cloudCategory}}"
|
|
class="category-card__detail">
|
|
<text class="category-card__detail-label">云端</text>
|
|
<text class="category-card__detail-text">
|
|
{{item.cloudCategory.name}} · {{item.cloudCategory.icon}} ·
|
|
排序 {{item.cloudCategory.sortOrder}}
|
|
</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view
|
|
wx:if="{{!loading && cloudOnlyCategories.length}}"
|
|
class="category-manage-page__cloud-only">
|
|
<text class="category-manage-page__section-title"
|
|
>仅云端存在的分类</text
|
|
>
|
|
<view
|
|
wx:for="{{cloudOnlyCategories}}"
|
|
wx:key="_id"
|
|
class="category-card category-card--cloud-only">
|
|
<view class="category-card__header">
|
|
<view class="category-card__meta">
|
|
<text class="category-card__icon">{{item.icon}}</text>
|
|
<view class="category-card__title-box">
|
|
<text class="category-card__title">{{item.name}}</text>
|
|
<text class="category-card__subtitle">
|
|
{{item._id}} · 排序 {{item.sortOrder}}
|
|
</text>
|
|
</view>
|
|
</view>
|
|
<text class="category-card__badge">仅云端</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|