feat: 我的、设置、打印指南页面开发完成
This commit is contained in:
@@ -200,45 +200,7 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
async onBuildTap() {
|
||||
if (this.data.building) return;
|
||||
|
||||
const confirmed = await new Promise<boolean>((resolve) => {
|
||||
wx.showModal({
|
||||
title: '更新分类页数据',
|
||||
content:
|
||||
'将根据当前线上 worksheet 重新生成分类页数据,确认继续?',
|
||||
success: (res) => resolve(!!res.confirm),
|
||||
fail: () => resolve(false),
|
||||
});
|
||||
});
|
||||
if (!confirmed) return;
|
||||
|
||||
this.setData({ building: true });
|
||||
|
||||
try {
|
||||
const result = await callCloudFunction<{
|
||||
version: number;
|
||||
stats: Record<string, number>;
|
||||
}>('pageContentBuild', { page: 'category' });
|
||||
|
||||
if (!result.success) {
|
||||
throw new Error(result.message || '生成失败');
|
||||
}
|
||||
|
||||
const version = result.data?.version || 0;
|
||||
wx.showToast({
|
||||
title: `生成成功 v${version}`,
|
||||
icon: 'success',
|
||||
});
|
||||
} catch (error) {
|
||||
wx.showToast({
|
||||
title:
|
||||
error instanceof Error ? error.message : '生成失败',
|
||||
icon: 'none',
|
||||
});
|
||||
} finally {
|
||||
this.setData({ building: false });
|
||||
}
|
||||
},
|
||||
// [v3.0] 分类页已改为实时接口查询,不再需要手动更新分类数据
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
onBuildTap() {},
|
||||
});
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Build Button -->
|
||||
<!-- [v3.0] 分类页已改为实时接口查询,不再需要手动更新分类数据
|
||||
<view class="ccm-page__build">
|
||||
<toy-button
|
||||
type="primary"
|
||||
@@ -101,4 +101,5 @@
|
||||
{{building ? '生成中...' : '更新分类页数据'}}
|
||||
</toy-button>
|
||||
</view>
|
||||
-->
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user