@tmsfe/tms-core 0.0.52 → 0.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmsfe/tms-core",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "description": "tms运行时框架",
5
5
  "repository": {
6
6
  "type": "git",
@@ -56,7 +56,9 @@ function getBaseData(deviceData: IDeviceData): { arr: DataItem[], nextIndex: num
56
56
  arr[24] = JSON.stringify(page?.options);
57
57
  // 25: f25,当前页面深度
58
58
  arr[25] = pageDepth.toString();
59
- // 26 ~ 30: 预留字段给后续扩展使用
59
+ // 26: f26,一次小程序生命周期中的埋点统一标记
60
+ arr[26] = helper.getLifeReportKey();
61
+ // 27 ~ 30: 预留字段给后续扩展使用
60
62
  // 31 ~ 40: 提供给开发自定义
61
63
  // --------------------------字段列表--------------------------
62
64
  return { arr, nextIndex: 31 };
@@ -102,6 +102,18 @@ function getNowString(): string {
102
102
  return `${year}${month}${day}${hours}${minutes}${seconds}${ms}`;
103
103
  }
104
104
 
105
+ let lifeReportKey = '';
106
+
107
+ /**
108
+ * 一次小程序生命周期中的埋点统一标记
109
+ */
110
+ function getLifeReportKey(): string {
111
+ if (lifeReportKey === '') {
112
+ lifeReportKey = getNowString();
113
+ }
114
+ return lifeReportKey;
115
+ }
116
+
105
117
  /**
106
118
  * 获取当前页面信息
107
119
  */
@@ -228,6 +240,7 @@ export default {
228
240
  getSystemInfoString,
229
241
  convert2String,
230
242
  getNowString,
243
+ getLifeReportKey,
231
244
  getPageInfo,
232
245
  getLaunchOptionsString,
233
246
  getLaunchFrom,