Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
genary
uni-app
提交
1dbe5dfc
U
uni-app
项目概览
genary
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1dbe5dfc
编写于
5月 23, 2022
作者:
M
mehaotian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(stat): create session type ==> cst
上级
71080cf1
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
111 addition
and
68 deletion
+111
-68
packages/uni-stat/dist/uni-cloud-stat.cjs.js
packages/uni-stat/dist/uni-cloud-stat.cjs.js
+29
-18
packages/uni-stat/dist/uni-cloud-stat.es.js
packages/uni-stat/dist/uni-cloud-stat.es.js
+29
-18
packages/uni-stat/dist/uni-stat.cjs.js
packages/uni-stat/dist/uni-stat.cjs.js
+8
-3
packages/uni-stat/dist/uni-stat.es.js
packages/uni-stat/dist/uni-stat.es.js
+8
-3
packages/uni-stat/src/core/report.js
packages/uni-stat/src/core/report.js
+35
-26
packages/uni-stat/src/core/stat.js
packages/uni-stat/src/core/stat.js
+2
-0
未找到文件。
packages/uni-stat/dist/uni-cloud-stat.cjs.js
浏览文件 @
1dbe5dfc
...
@@ -814,6 +814,7 @@ class Report {
...
@@ -814,6 +814,7 @@ class Report {
let
options
=
{
let
options
=
{
path
:
lastPageRoute
,
path
:
lastPageRoute
,
scene
:
this
.
statData
.
sc
,
scene
:
this
.
statData
.
sc
,
cst
:
2
,
};
};
this
.
sendReportRequest
(
options
);
this
.
sendReportRequest
(
options
);
}
}
...
@@ -880,6 +881,7 @@ class Report {
...
@@ -880,6 +881,7 @@ class Report {
let
options
=
{
let
options
=
{
path
:
route
,
path
:
route
,
scene
:
this
.
statData
.
sc
,
scene
:
this
.
statData
.
sc
,
cst
:
3
,
};
};
this
.
sendReportRequest
(
options
);
this
.
sendReportRequest
(
options
);
}
}
...
@@ -926,6 +928,8 @@ class Report {
...
@@ -926,6 +928,8 @@ class Report {
fvts
:
get_first_visit_time
(),
fvts
:
get_first_visit_time
(),
lvts
:
get_last_visit_time
(),
lvts
:
get_last_visit_time
(),
tvc
:
get_total_visit_count
(),
tvc
:
get_total_visit_count
(),
// create session type 上报类型 ,1 应用进入 2.后台30min进入 3.页面30min进入
cst
:
options
.
cst
||
1
,
});
});
if
(
get_platform_name
()
===
'
n
'
)
{
if
(
get_platform_name
()
===
'
n
'
)
{
this
.
getProperty
();
this
.
getProperty
();
...
@@ -984,7 +988,6 @@ class Report {
...
@@ -984,7 +988,6 @@ class Report {
* 自定义事件上报
* 自定义事件上报
*/
*/
sendEventRequest
({
key
=
''
,
value
=
''
}
=
{})
{
sendEventRequest
({
key
=
''
,
value
=
''
}
=
{})
{
let
routepath
=
''
;
let
routepath
=
''
;
try
{
try
{
...
@@ -1129,16 +1132,22 @@ class Report {
...
@@ -1129,16 +1132,22 @@ class Report {
return
return
}
}
const
uniCloudObj
=
uni
.
__stat_uniCloud_space
.
importObject
(
'
uni-stat-receiver
'
,
{
const
uniCloudObj
=
uni
.
__stat_uniCloud_space
.
importObject
(
customUI
:
true
'
uni-stat-receiver
'
,
});
{
uniCloudObj
.
report
(
optionsData
).
then
(()
=>
{
customUI
:
true
,
}
);
uniCloudObj
.
report
(
optionsData
)
.
then
(()
=>
{
if
(
is_debug
)
{
if
(
is_debug
)
{
console
.
log
(
`=== 统计队列数据上报 ===`
);
console
.
log
(
`=== 统计队列数据上报 ===`
);
console
.
log
(
optionsData
);
console
.
log
(
optionsData
);
console
.
log
(
`=== 上报结束 ===`
);
console
.
log
(
`=== 上报结束 ===`
);
}
}
}).
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
if
(
is_debug
)
{
if
(
is_debug
)
{
console
.
warn
(
'
=== 统计上报错误
'
);
console
.
warn
(
'
=== 统计上报错误
'
);
console
.
error
(
err
);
console
.
error
(
err
);
...
@@ -1228,6 +1237,8 @@ class Stat extends Report {
...
@@ -1228,6 +1237,8 @@ class Stat extends Report {
set_page_residence_time
();
set_page_residence_time
();
this
.
__licationShow
=
true
;
this
.
__licationShow
=
true
;
dbSet
(
'
__launch_options
'
,
options
);
dbSet
(
'
__launch_options
'
,
options
);
// 应用初始上报参数为1
options
.
cst
=
1
;
this
.
sendReportRequest
(
options
,
true
);
this
.
sendReportRequest
(
options
,
true
);
}
}
load
(
options
,
self
)
{
load
(
options
,
self
)
{
...
...
packages/uni-stat/dist/uni-cloud-stat.es.js
浏览文件 @
1dbe5dfc
...
@@ -812,6 +812,7 @@ class Report {
...
@@ -812,6 +812,7 @@ class Report {
let
options
=
{
let
options
=
{
path
:
lastPageRoute
,
path
:
lastPageRoute
,
scene
:
this
.
statData
.
sc
,
scene
:
this
.
statData
.
sc
,
cst
:
2
,
};
};
this
.
sendReportRequest
(
options
);
this
.
sendReportRequest
(
options
);
}
}
...
@@ -878,6 +879,7 @@ class Report {
...
@@ -878,6 +879,7 @@ class Report {
let
options
=
{
let
options
=
{
path
:
route
,
path
:
route
,
scene
:
this
.
statData
.
sc
,
scene
:
this
.
statData
.
sc
,
cst
:
3
,
};
};
this
.
sendReportRequest
(
options
);
this
.
sendReportRequest
(
options
);
}
}
...
@@ -924,6 +926,8 @@ class Report {
...
@@ -924,6 +926,8 @@ class Report {
fvts
:
get_first_visit_time
(),
fvts
:
get_first_visit_time
(),
lvts
:
get_last_visit_time
(),
lvts
:
get_last_visit_time
(),
tvc
:
get_total_visit_count
(),
tvc
:
get_total_visit_count
(),
// create session type 上报类型 ,1 应用进入 2.后台30min进入 3.页面30min进入
cst
:
options
.
cst
||
1
,
});
});
if
(
get_platform_name
()
===
'
n
'
)
{
if
(
get_platform_name
()
===
'
n
'
)
{
this
.
getProperty
();
this
.
getProperty
();
...
@@ -982,7 +986,6 @@ class Report {
...
@@ -982,7 +986,6 @@ class Report {
* 自定义事件上报
* 自定义事件上报
*/
*/
sendEventRequest
({
key
=
''
,
value
=
''
}
=
{})
{
sendEventRequest
({
key
=
''
,
value
=
''
}
=
{})
{
let
routepath
=
''
;
let
routepath
=
''
;
try
{
try
{
...
@@ -1127,16 +1130,22 @@ class Report {
...
@@ -1127,16 +1130,22 @@ class Report {
return
return
}
}
const
uniCloudObj
=
uni
.
__stat_uniCloud_space
.
importObject
(
'
uni-stat-receiver
'
,
{
const
uniCloudObj
=
uni
.
__stat_uniCloud_space
.
importObject
(
customUI
:
true
'
uni-stat-receiver
'
,
});
{
uniCloudObj
.
report
(
optionsData
).
then
(()
=>
{
customUI
:
true
,
}
);
uniCloudObj
.
report
(
optionsData
)
.
then
(()
=>
{
if
(
is_debug
)
{
if
(
is_debug
)
{
console
.
log
(
`=== 统计队列数据上报 ===`
);
console
.
log
(
`=== 统计队列数据上报 ===`
);
console
.
log
(
optionsData
);
console
.
log
(
optionsData
);
console
.
log
(
`=== 上报结束 ===`
);
console
.
log
(
`=== 上报结束 ===`
);
}
}
}).
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
if
(
is_debug
)
{
if
(
is_debug
)
{
console
.
warn
(
'
=== 统计上报错误
'
);
console
.
warn
(
'
=== 统计上报错误
'
);
console
.
error
(
err
);
console
.
error
(
err
);
...
@@ -1226,6 +1235,8 @@ class Stat extends Report {
...
@@ -1226,6 +1235,8 @@ class Stat extends Report {
set_page_residence_time
();
set_page_residence_time
();
this
.
__licationShow
=
true
;
this
.
__licationShow
=
true
;
dbSet
(
'
__launch_options
'
,
options
);
dbSet
(
'
__launch_options
'
,
options
);
// 应用初始上报参数为1
options
.
cst
=
1
;
this
.
sendReportRequest
(
options
,
true
);
this
.
sendReportRequest
(
options
,
true
);
}
}
load
(
options
,
self
)
{
load
(
options
,
self
)
{
...
...
packages/uni-stat/dist/uni-stat.cjs.js
浏览文件 @
1dbe5dfc
...
@@ -793,6 +793,7 @@ class Report {
...
@@ -793,6 +793,7 @@ class Report {
let
options
=
{
let
options
=
{
path
:
lastPageRoute
,
path
:
lastPageRoute
,
scene
:
this
.
statData
.
sc
,
scene
:
this
.
statData
.
sc
,
cst
:
2
,
};
};
this
.
sendReportRequest
(
options
);
this
.
sendReportRequest
(
options
);
}
}
...
@@ -859,6 +860,7 @@ class Report {
...
@@ -859,6 +860,7 @@ class Report {
let
options
=
{
let
options
=
{
path
:
route
,
path
:
route
,
scene
:
this
.
statData
.
sc
,
scene
:
this
.
statData
.
sc
,
cst
:
3
,
};
};
this
.
sendReportRequest
(
options
);
this
.
sendReportRequest
(
options
);
}
}
...
@@ -905,6 +907,8 @@ class Report {
...
@@ -905,6 +907,8 @@ class Report {
fvts
:
get_first_visit_time
(),
fvts
:
get_first_visit_time
(),
lvts
:
get_last_visit_time
(),
lvts
:
get_last_visit_time
(),
tvc
:
get_total_visit_count
(),
tvc
:
get_total_visit_count
(),
// create session type 上报类型 ,1 应用进入 2.后台30min进入 3.页面30min进入
cst
:
options
.
cst
||
1
,
});
});
if
(
get_platform_name
()
===
'
n
'
)
{
if
(
get_platform_name
()
===
'
n
'
)
{
this
.
getProperty
();
this
.
getProperty
();
...
@@ -963,7 +967,6 @@ class Report {
...
@@ -963,7 +967,6 @@ class Report {
* 自定义事件上报
* 自定义事件上报
*/
*/
sendEventRequest
({
key
=
''
,
value
=
''
}
=
{})
{
sendEventRequest
({
key
=
''
,
value
=
''
}
=
{})
{
let
routepath
=
''
;
let
routepath
=
''
;
try
{
try
{
...
@@ -1195,6 +1198,8 @@ class Stat extends Report {
...
@@ -1195,6 +1198,8 @@ class Stat extends Report {
set_page_residence_time
();
set_page_residence_time
();
this
.
__licationShow
=
true
;
this
.
__licationShow
=
true
;
dbSet
(
'
__launch_options
'
,
options
);
dbSet
(
'
__launch_options
'
,
options
);
// 应用初始上报参数为1
options
.
cst
=
1
;
this
.
sendReportRequest
(
options
,
true
);
this
.
sendReportRequest
(
options
,
true
);
}
}
load
(
options
,
self
)
{
load
(
options
,
self
)
{
...
...
packages/uni-stat/dist/uni-stat.es.js
浏览文件 @
1dbe5dfc
...
@@ -791,6 +791,7 @@ class Report {
...
@@ -791,6 +791,7 @@ class Report {
let
options
=
{
let
options
=
{
path
:
lastPageRoute
,
path
:
lastPageRoute
,
scene
:
this
.
statData
.
sc
,
scene
:
this
.
statData
.
sc
,
cst
:
2
,
};
};
this
.
sendReportRequest
(
options
);
this
.
sendReportRequest
(
options
);
}
}
...
@@ -857,6 +858,7 @@ class Report {
...
@@ -857,6 +858,7 @@ class Report {
let
options
=
{
let
options
=
{
path
:
route
,
path
:
route
,
scene
:
this
.
statData
.
sc
,
scene
:
this
.
statData
.
sc
,
cst
:
3
,
};
};
this
.
sendReportRequest
(
options
);
this
.
sendReportRequest
(
options
);
}
}
...
@@ -903,6 +905,8 @@ class Report {
...
@@ -903,6 +905,8 @@ class Report {
fvts
:
get_first_visit_time
(),
fvts
:
get_first_visit_time
(),
lvts
:
get_last_visit_time
(),
lvts
:
get_last_visit_time
(),
tvc
:
get_total_visit_count
(),
tvc
:
get_total_visit_count
(),
// create session type 上报类型 ,1 应用进入 2.后台30min进入 3.页面30min进入
cst
:
options
.
cst
||
1
,
});
});
if
(
get_platform_name
()
===
'
n
'
)
{
if
(
get_platform_name
()
===
'
n
'
)
{
this
.
getProperty
();
this
.
getProperty
();
...
@@ -961,7 +965,6 @@ class Report {
...
@@ -961,7 +965,6 @@ class Report {
* 自定义事件上报
* 自定义事件上报
*/
*/
sendEventRequest
({
key
=
''
,
value
=
''
}
=
{})
{
sendEventRequest
({
key
=
''
,
value
=
''
}
=
{})
{
let
routepath
=
''
;
let
routepath
=
''
;
try
{
try
{
...
@@ -1193,6 +1196,8 @@ class Stat extends Report {
...
@@ -1193,6 +1196,8 @@ class Stat extends Report {
set_page_residence_time
();
set_page_residence_time
();
this
.
__licationShow
=
true
;
this
.
__licationShow
=
true
;
dbSet
(
'
__launch_options
'
,
options
);
dbSet
(
'
__launch_options
'
,
options
);
// 应用初始上报参数为1
options
.
cst
=
1
;
this
.
sendReportRequest
(
options
,
true
);
this
.
sendReportRequest
(
options
,
true
);
}
}
load
(
options
,
self
)
{
load
(
options
,
self
)
{
...
...
packages/uni-stat/src/core/report.js
浏览文件 @
1dbe5dfc
...
@@ -187,6 +187,7 @@ export default class Report {
...
@@ -187,6 +187,7 @@ export default class Report {
let
options
=
{
let
options
=
{
path
:
lastPageRoute
,
path
:
lastPageRoute
,
scene
:
this
.
statData
.
sc
,
scene
:
this
.
statData
.
sc
,
cst
:
2
,
}
}
this
.
sendReportRequest
(
options
)
this
.
sendReportRequest
(
options
)
}
}
...
@@ -253,6 +254,7 @@ export default class Report {
...
@@ -253,6 +254,7 @@ export default class Report {
let
options
=
{
let
options
=
{
path
:
route
,
path
:
route
,
scene
:
this
.
statData
.
sc
,
scene
:
this
.
statData
.
sc
,
cst
:
3
,
}
}
this
.
sendReportRequest
(
options
)
this
.
sendReportRequest
(
options
)
}
}
...
@@ -299,6 +301,8 @@ export default class Report {
...
@@ -299,6 +301,8 @@ export default class Report {
fvts
:
get_first_visit_time
(),
fvts
:
get_first_visit_time
(),
lvts
:
get_last_visit_time
(),
lvts
:
get_last_visit_time
(),
tvc
:
get_total_visit_count
(),
tvc
:
get_total_visit_count
(),
// create session type 上报类型 ,1 应用进入 2.后台30min进入 3.页面30min进入
cst
:
options
.
cst
||
1
,
})
})
if
(
get_platform_name
()
===
'
n
'
)
{
if
(
get_platform_name
()
===
'
n
'
)
{
this
.
getProperty
()
this
.
getProperty
()
...
@@ -357,7 +361,6 @@ export default class Report {
...
@@ -357,7 +361,6 @@ export default class Report {
* 自定义事件上报
* 自定义事件上报
*/
*/
sendEventRequest
({
key
=
''
,
value
=
''
}
=
{})
{
sendEventRequest
({
key
=
''
,
value
=
''
}
=
{})
{
let
routepath
=
''
let
routepath
=
''
try
{
try
{
...
@@ -509,19 +512,25 @@ export default class Report {
...
@@ -509,19 +512,25 @@ export default class Report {
return
return
}
}
const
uniCloudObj
=
uni
.
__stat_uniCloud_space
.
importObject
(
'
uni-stat-receiver
'
,
{
const
uniCloudObj
=
uni
.
__stat_uniCloud_space
.
importObject
(
customUI
:
true
'
uni-stat-receiver
'
,
})
{
uniCloudObj
.
report
(
optionsData
).
then
(()
=>
{
customUI
:
true
,
}
)
uniCloudObj
.
report
(
optionsData
)
.
then
(()
=>
{
if
(
is_debug
)
{
if
(
is_debug
)
{
console
.
log
(
`=== 统计队列数据上报 ===`
);
console
.
log
(
`=== 统计队列数据上报 ===`
)
console
.
log
(
optionsData
);
console
.
log
(
optionsData
)
console
.
log
(
`=== 上报结束 ===`
);
console
.
log
(
`=== 上报结束 ===`
)
}
}
}).
catch
((
err
)
=>
{
})
.
catch
((
err
)
=>
{
if
(
is_debug
)
{
if
(
is_debug
)
{
console
.
warn
(
'
=== 统计上报错误
'
);
console
.
warn
(
'
=== 统计上报错误
'
)
console
.
error
(
err
);
console
.
error
(
err
)
}
}
})
})
}
}
...
@@ -534,16 +543,16 @@ export default class Report {
...
@@ -534,16 +543,16 @@ export default class Report {
data
:
optionsData
,
data
:
optionsData
,
success
:
()
=>
{
success
:
()
=>
{
if
(
is_debug
)
{
if
(
is_debug
)
{
console
.
log
(
`=== 统计队列数据上报 ===`
)
;
console
.
log
(
`=== 统计队列数据上报 ===`
)
console
.
log
(
optionsData
)
;
console
.
log
(
optionsData
)
console
.
log
(
`=== 上报结束 ===`
)
;
console
.
log
(
`=== 上报结束 ===`
)
}
}
},
},
fail
:
(
e
)
=>
{
fail
:
(
e
)
=>
{
if
(
++
this
.
_retry
<
3
)
{
if
(
++
this
.
_retry
<
3
)
{
if
(
is_debug
)
{
if
(
is_debug
)
{
console
.
warn
(
'
=== 统计上报错误,尝试重新上报!
'
)
;
console
.
warn
(
'
=== 统计上报错误,尝试重新上报!
'
)
console
.
error
(
e
)
;
console
.
error
(
e
)
}
}
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
sendRequest
(
optionsData
)
this
.
sendRequest
(
optionsData
)
...
@@ -564,9 +573,9 @@ export default class Report {
...
@@ -564,9 +573,9 @@ export default class Report {
let
options
=
get_sgin
(
get_encodeURIComponent_options
(
data
)).
options
let
options
=
get_sgin
(
get_encodeURIComponent_options
(
data
)).
options
image
.
src
=
STAT_H5_URL
+
'
?
'
+
options
image
.
src
=
STAT_H5_URL
+
'
?
'
+
options
if
(
is_debug
)
{
if
(
is_debug
)
{
console
.
log
(
`=== 统计队列数据上报 ===`
)
;
console
.
log
(
`=== 统计队列数据上报 ===`
)
console
.
log
(
data
)
;
console
.
log
(
data
)
console
.
log
(
`=== 上报结束 ===`
)
;
console
.
log
(
`=== 上报结束 ===`
)
}
}
})
})
}
}
...
...
packages/uni-stat/src/core/stat.js
浏览文件 @
1dbe5dfc
...
@@ -55,6 +55,8 @@ class Stat extends Report {
...
@@ -55,6 +55,8 @@ class Stat extends Report {
let
residence_time
=
set_page_residence_time
()
let
residence_time
=
set_page_residence_time
()
this
.
__licationShow
=
true
this
.
__licationShow
=
true
dbSet
(
'
__launch_options
'
,
options
)
dbSet
(
'
__launch_options
'
,
options
)
// 应用初始上报参数为1
options
.
cst
=
1
this
.
sendReportRequest
(
options
,
true
)
this
.
sendReportRequest
(
options
,
true
)
}
}
load
(
options
,
self
)
{
load
(
options
,
self
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录