- 8 个页面 exercise-card 由 bind:tap 改为 catch:tap,拦截原生 tap 冒泡 避免一次点击被『自定义事件 + 原生冒泡』触发两次, 第二次 e.detail 无 id → navigateTo detail?id=undefined → 404 - 所有 onExercise 顶部加 id 守卫,无 id 直接 return - exercise-card 点击前校验 exercise.id,缺失不触发 - detail onLoad 的 id 为空时直接显示空态,不再发起错误请求
29 lines
1.0 KiB
Plaintext
29 lines
1.0 KiB
Plaintext
<view class="page">
|
|
<navbar title="我的收藏" show-back />
|
|
|
|
<view class="bar">
|
|
<view class="bar__count">{{list.length}} 个收藏动作</view>
|
|
<view wx:if="{{list.length}}" class="bar__manage" bindtap="onManage">{{managing ? '完成' : '管理'}}</view>
|
|
</view>
|
|
|
|
<view class="section" style="padding-top: 8rpx;">
|
|
<view class="grid" wx:if="{{list.length}}">
|
|
<view class="grid__item" wx:for="{{list}}" wx:key="id">
|
|
<view class="item">
|
|
<exercise-card exercise="{{item}}" catch:tap="onExercise" />
|
|
<view wx:if="{{managing}}" class="remove" data-id="{{item.id}}" catchtap="onRemove">移除</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view wx:elif="{{!loading}}" class="empty-box">
|
|
<view class="empty-box__emoji">🔍</view>
|
|
<view class="empty-box__t">还没有收藏,去发现喜欢的动作吧</view>
|
|
<view class="empty-box__btn" bindtap="goRecommend">去推荐</view>
|
|
</view>
|
|
<view wx:else class="empty">加载中…</view>
|
|
</view>
|
|
|
|
<view style="height: 80rpx;"></view>
|
|
</view>
|