Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
anyefeiyu
uni-app
提交
e78ca53b
U
uni-app
项目概览
anyefeiyu
/
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,发现更多精彩内容 >>
提交
e78ca53b
编写于
5月 25, 2020
作者:
M
mehaotian
提交者:
qiang
5月 25, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(stat) : 修复 uni 统计首次开启统计,24 小时生效的问题。
上级
1acb5f37
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
51 addition
and
7 deletion
+51
-7
packages/uni-stat/dist/index.js
packages/uni-stat/dist/index.js
+25
-3
packages/uni-stat/src/parameter.js
packages/uni-stat/src/parameter.js
+26
-4
未找到文件。
packages/uni-stat/dist/index.js
浏览文件 @
e78ca53b
...
@@ -306,27 +306,46 @@ const isReportData = () => {
...
@@ -306,27 +306,46 @@ const isReportData = () => {
let
start_time
=
''
;
let
start_time
=
''
;
let
end_time
=
new
Date
().
getTime
();
let
end_time
=
new
Date
().
getTime
();
let
diff_time
=
DIFF_TIME
;
let
diff_time
=
DIFF_TIME
;
let
report_status
=
1
;
try
{
try
{
start_time
=
uni
.
getStorageSync
(
Report_Data_Time
);
start_time
=
uni
.
getStorageSync
(
Report_Data_Time
);
report_status
=
uni
.
getStorageSync
(
Report_Status
);
}
catch
(
e
)
{
}
catch
(
e
)
{
start_time
=
''
;
start_time
=
''
;
report_status
=
1
;
}
if
(
report_status
===
''
)
{
requestData
(({
enable
})
=>
{
uni
.
setStorageSync
(
Report_Data_Time
,
end_time
);
uni
.
setStorageSync
(
Report_Status
,
enable
);
if
(
enable
===
1
)
{
resolve
();
}
});
return
}
if
(
report_status
===
1
)
{
resolve
();
}
}
if
(
!
start_time
)
{
if
(
!
start_time
)
{
uni
.
setStorageSync
(
Report_Data_Time
,
end_time
);
uni
.
setStorageSync
(
Report_Data_Time
,
end_time
);
start_time
=
end_time
;
start_time
=
end_time
;
}
}
if
((
end_time
-
start_time
)
>
diff_time
)
{
if
((
end_time
-
start_time
)
>
diff_time
)
{
requestData
(({
requestData
(({
enable
enable
})
=>
{
})
=>
{
uni
.
setStorageSync
(
Report_Data_Time
,
end_time
);
uni
.
setStorageSync
(
Report_Data_Time
,
end_time
);
uni
.
setStorageSync
(
Report_Status
,
enable
);
uni
.
setStorageSync
(
Report_Status
,
enable
);
if
(
enable
===
1
)
{
resolve
();
}
});
});
}
}
})
})
};
};
...
@@ -358,6 +377,9 @@ const requestData = (done) => {
...
@@ -358,6 +377,9 @@ const requestData = (done) => {
}
catch
(
e
)
{
}
catch
(
e
)
{
report_status_code
=
1
;
report_status_code
=
1
;
}
}
if
(
report_status_code
===
''
)
{
report_status_code
=
1
;
}
if
(
report_status_code
===
1
)
{
if
(
report_status_code
===
1
)
{
typeof
done
===
'
function
'
&&
done
({
typeof
done
===
'
function
'
&&
done
({
enable
:
res
.
enable
enable
:
res
.
enable
...
...
packages/uni-stat/src/parameter.js
浏览文件 @
e78ca53b
...
@@ -306,27 +306,46 @@ export const isReportData = () => {
...
@@ -306,27 +306,46 @@ export const isReportData = () => {
let
start_time
=
''
let
start_time
=
''
let
end_time
=
new
Date
().
getTime
()
let
end_time
=
new
Date
().
getTime
()
let
diff_time
=
DIFF_TIME
let
diff_time
=
DIFF_TIME
let
report_status
=
1
try
{
try
{
start_time
=
uni
.
getStorageSync
(
Report_Data_Time
)
start_time
=
uni
.
getStorageSync
(
Report_Data_Time
)
report_status
=
uni
.
getStorageSync
(
Report_Status
)
}
catch
(
e
)
{
}
catch
(
e
)
{
start_time
=
''
start_time
=
''
report_status
=
1
}
if
(
report_status
===
''
)
{
requestData
(({
enable
})
=>
{
uni
.
setStorageSync
(
Report_Data_Time
,
end_time
);
uni
.
setStorageSync
(
Report_Status
,
enable
);
if
(
enable
===
1
)
{
resolve
();
}
});
return
}
if
(
report_status
===
1
)
{
resolve
();
}
}
if
(
!
start_time
)
{
if
(
!
start_time
)
{
uni
.
setStorageSync
(
Report_Data_Time
,
end_time
)
uni
.
setStorageSync
(
Report_Data_Time
,
end_time
)
start_time
=
end_time
start_time
=
end_time
}
}
if
((
end_time
-
start_time
)
>
diff_time
)
{
if
((
end_time
-
start_time
)
>
diff_time
)
{
requestData
(({
requestData
(({
enable
enable
})
=>
{
})
=>
{
uni
.
setStorageSync
(
Report_Data_Time
,
end_time
)
uni
.
setStorageSync
(
Report_Data_Time
,
end_time
)
uni
.
setStorageSync
(
Report_Status
,
enable
)
uni
.
setStorageSync
(
Report_Status
,
enable
)
if
(
enable
===
1
)
{
resolve
();
}
});
});
}
}
})
})
}
}
...
@@ -358,6 +377,9 @@ const requestData = (done) => {
...
@@ -358,6 +377,9 @@ const requestData = (done) => {
}
catch
(
e
)
{
}
catch
(
e
)
{
report_status_code
=
1
report_status_code
=
1
}
}
if
(
report_status_code
===
''
)
{
report_status_code
=
1
}
if
(
report_status_code
===
1
)
{
if
(
report_status_code
===
1
)
{
typeof
done
===
'
function
'
&&
done
({
typeof
done
===
'
function
'
&&
done
({
enable
:
res
.
enable
enable
:
res
.
enable
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录