feat: 预加载优化、nav-bar 箭头居中优化
This commit is contained in:
@@ -158,6 +158,8 @@ function formatDateKey(date: Date): string {
|
||||
}
|
||||
|
||||
Page({
|
||||
_navigating: false,
|
||||
|
||||
data: {
|
||||
favScrollHeight: 0,
|
||||
activeTab: 'favorites' as FavoritesTab,
|
||||
@@ -240,12 +242,23 @@ Page({
|
||||
},
|
||||
|
||||
onCardTap(e: WechatMiniprogram.TouchEvent) {
|
||||
if (this._navigating) return;
|
||||
|
||||
const path = e.currentTarget.dataset.path as string | undefined;
|
||||
if (!path) {
|
||||
wx.showToast({ title: '该练习已下架', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
wx.navigateTo({ url: path });
|
||||
this._navigating = true;
|
||||
wx.navigateTo({
|
||||
url: path,
|
||||
complete: () => {
|
||||
this._navigating = false;
|
||||
},
|
||||
fail: () => {
|
||||
this._navigating = false;
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
onSearchTap() {
|
||||
|
||||
Reference in New Issue
Block a user