@tmsfe/tms-core 0.0.56 → 0.0.59

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.56",
3
+ "version": "0.0.59",
4
4
  "description": "tms运行时框架",
5
5
  "repository": {
6
6
  "type": "git",
@@ -134,6 +134,10 @@ function getPageInfo(): IPage {
134
134
  options = page?.options;
135
135
  depth = pages.length;
136
136
  }
137
+ // wx_navigate_before埋点上报时可能route是一个很大的对象而不是字符串,原因不详
138
+ if (typeof route as any !== 'string') {
139
+ route = '';
140
+ }
137
141
  return { route, options, depth };
138
142
  }
139
143
 
@@ -21,9 +21,9 @@ function proxyBindEvent(componentName: string, methods: any, methodName: string)
21
21
  return helper.executeFunc(this, original, args, () => {
22
22
  const extra = clone.getEventExtra(args[0]) ; // 把触发事件附加数据也带上
23
23
  const data = clone.deepClone(this.data);
24
- const eventName = `Component_${componentName}`;
25
- helper.setLastBindEvent({ eventName, methodName, data, extra });
26
- helper.reportData(eventName, methodName, data, extra);
24
+ const eventName = `Component_${componentName}_${methodName}`;
25
+ helper.setLastBindEvent({ eventName, data, extra });
26
+ helper.reportData(eventName, data, extra);
27
27
  });
28
28
  };
29
29
  }
@@ -93,7 +93,7 @@ function proxyBindEvent(pageOptions: any, methodName: string): void {
93
93
  return helper.executeFunc(this, original, args, () => {
94
94
  const data = clone.deepClone(this.data);
95
95
  const eventName = `Page_${methodName}`;
96
- helper.setLastBindEvent({ eventName, methodName, data, extra });
96
+ helper.setLastBindEvent({ eventName, data, extra });
97
97
  helper.reportData(eventName, data, extra);
98
98
  });
99
99
  };
@@ -9,13 +9,9 @@ interface IBindEvent {
9
9
  */
10
10
  pageUrl?: string,
11
11
  /**
12
- * 事件名,如 `Page_${methodName}`、`Component_${componentName}`
12
+ * 事件名,如 `Page_${methodName}`、`Component_${componentName}_${methodName}`
13
13
  */
14
14
  eventName: string,
15
- /**
16
- * 触发的函数名
17
- */
18
- methodName: string,
19
15
  /**
20
16
  * Page或者Component的data
21
17
  */
package/src/timeUtils.js CHANGED
@@ -153,8 +153,8 @@ const formatDateTime = (date, fmt = 'yyyy-MM-dd hh:mm:ss') => {
153
153
  */
154
154
  const dateToString = (date, withTime = false, withSeconds = false, join = '-') => {
155
155
  let fmt = `yyyy${join}MM${join}dd`;
156
- if (withTime) fmt += withSeconds ? 'hh:mm:ss' : 'hh:mm';
157
- return formatDateTime(date, fmt);
156
+ if (withTime) fmt += withSeconds ? ' hh:mm:ss' : ' hh:mm';
157
+ return formatDateTime(date || new Date(), fmt);
158
158
  };
159
159
 
160
160
  export {