feat: 3.5版本规划
This commit is contained in:
@@ -443,7 +443,7 @@ const CATEGORY_ITEMS_BY_ID: Record<string, CategoryItem[]> = {
|
||||
previewImg: '/assets/entrancePicture/focus/shape-recognition.png',
|
||||
ageBand: age(3, 5),
|
||||
difficulty: 1,
|
||||
path: '/focusPages/focusDraw/focusDraw?id=shape-recognition',
|
||||
path: '/focusPages/shape/shape',
|
||||
available: true,
|
||||
}),
|
||||
item({
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { appSharePageMethods } from '../../base/pageMixin';
|
||||
import { CATEGORY_LIST_WITH_ALL } from '../../core/data/categories';
|
||||
import { takePendingCategoryTabId } from '../../utils/index';
|
||||
import { parseMiniProgramUrl, takePendingCategoryTabId } from '../../utils/index';
|
||||
import tracker from '../../utils/tracker';
|
||||
import { CATEGORY_DATA, type CategoryItem } from './category.data';
|
||||
|
||||
type CategoryTab = {
|
||||
@@ -224,6 +225,7 @@ Page({
|
||||
_defaultCategoryId: 'all',
|
||||
|
||||
onLoad(options: Record<string, string>) {
|
||||
tracker.reportPageView('pages/category/category');
|
||||
if (options.id && options.id !== 'all') {
|
||||
this._defaultCategoryId = options.id;
|
||||
this.setData({ activeCategoryId: options.id });
|
||||
@@ -285,6 +287,9 @@ Page({
|
||||
displayItems: filtered,
|
||||
scrollIntoViewId: '',
|
||||
});
|
||||
tracker.report('category_select', 'pages/category/category', {
|
||||
category_id: id,
|
||||
});
|
||||
},
|
||||
|
||||
onSearchInput(e: WechatMiniprogram.Input) {
|
||||
@@ -319,6 +324,13 @@ Page({
|
||||
return;
|
||||
}
|
||||
|
||||
tracker.reportWorksheetClick('pages/category/category', {
|
||||
worksheet_id: String(parseMiniProgramUrl(path).query.id || ''),
|
||||
worksheet_title: title || '',
|
||||
category_id: this.data.activeCategoryId,
|
||||
source: 'category_list',
|
||||
});
|
||||
|
||||
if (TAB_BAR_PATHS.has(path)) {
|
||||
wx.switchTab({ url: path });
|
||||
return;
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
parseMiniProgramUrl,
|
||||
stashPendingCategoryTabId,
|
||||
} from '../../utils/index';
|
||||
import tracker from '../../utils/tracker';
|
||||
import {
|
||||
HOME_DAILY_CHECKIN_ITEMS,
|
||||
HOME_NOTICES,
|
||||
@@ -124,6 +125,23 @@ function navigateByPath(path?: string, fallbackTitle?: string) {
|
||||
});
|
||||
}
|
||||
|
||||
function worksheetIdFromPath(path?: string): string {
|
||||
if (!path) return '';
|
||||
return String(parseMiniProgramUrl(path).query.id || '');
|
||||
}
|
||||
|
||||
function trackWorksheetClick(
|
||||
path: string | undefined,
|
||||
title: string | undefined,
|
||||
source: string,
|
||||
) {
|
||||
tracker.reportWorksheetClick('pages/home/home', {
|
||||
worksheet_id: worksheetIdFromPath(path),
|
||||
worksheet_title: title || '',
|
||||
source,
|
||||
});
|
||||
}
|
||||
|
||||
// ── Skeleton data ──
|
||||
|
||||
function skeletonItem(id: string): HomeDisplayItemView {
|
||||
@@ -196,6 +214,7 @@ Page({
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
tracker.reportPageView('pages/home/home');
|
||||
void this.initData();
|
||||
},
|
||||
|
||||
@@ -274,12 +293,14 @@ Page({
|
||||
onTapFeatured(e: WechatMiniprogram.TouchEvent) {
|
||||
const path = e.currentTarget.dataset.path as string | undefined;
|
||||
const title = e.currentTarget.dataset.title as string | undefined;
|
||||
trackWorksheetClick(path, title, 'home_featured');
|
||||
navigateByPath(path, title);
|
||||
},
|
||||
|
||||
onTapHotRecommend(e: WechatMiniprogram.TouchEvent) {
|
||||
const path = e.currentTarget.dataset.path as string | undefined;
|
||||
const title = e.currentTarget.dataset.title as string | undefined;
|
||||
trackWorksheetClick(path, title, 'home_hot');
|
||||
navigateByPath(path, title);
|
||||
},
|
||||
|
||||
@@ -310,6 +331,7 @@ Page({
|
||||
const title =
|
||||
detail.title ||
|
||||
(e.currentTarget.dataset.title as string | undefined);
|
||||
trackWorksheetClick(path, title, 'home_section');
|
||||
navigateByPath(path, title);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user