Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
cca287f8
U
uni-app
项目概览
DCloud
/
uni-app
大约 1 个月 前同步成功
通知
703
Star
38705
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cca287f8
编写于
4月 30, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://github.com/dcloudio/uni-app
into dev
上级
90036f33
187d0f02
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
88 addition
and
77 deletion
+88
-77
packages/uni-stat/dist/index.js
packages/uni-stat/dist/index.js
+42
-37
packages/uni-stat/src/config.js
packages/uni-stat/src/config.js
+1
-0
packages/uni-stat/src/parameter.js
packages/uni-stat/src/parameter.js
+10
-7
packages/uni-stat/src/stat.js
packages/uni-stat/src/stat.js
+34
-32
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
+1
-1
未找到文件。
packages/uni-stat/dist/index.js
浏览文件 @
cca287f8
...
...
@@ -6,6 +6,7 @@ const STAT_H5_URL = 'https://tongji.dcloud.io/uni/stat.gif';
const
PAGE_PVER_TIME
=
1800
;
const
APP_PVER_TIME
=
300
;
const
OPERATING_TIME
=
10
;
const
DIFF_TIME
=
60
*
1000
*
60
*
24
;
const
statConfig
=
require
(
'
uni-stat-config
'
).
default
||
require
(
'
uni-stat-config
'
);
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
...
...
@@ -299,12 +300,12 @@ const calibration = (eventName, options) => {
};
const
Report_Data_Time
=
'
Report_Data_Time
'
;
const
Report_Status
=
'
Report_Status
'
;
const
isReportData
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
start_time
=
''
;
let
end_time
=
new
Date
().
getTime
();
let
diff_time
=
60
*
1000
*
60
*
24
;
let
diff_time
=
DIFF_TIME
;
try
{
start_time
=
uni
.
getStorageSync
(
Report_Data_Time
);
}
catch
(
e
)
{
...
...
@@ -320,6 +321,7 @@ const isReportData = () => {
enable
})
=>
{
uni
.
setStorageSync
(
Report_Data_Time
,
end_time
);
uni
.
setStorageSync
(
Report_Status
,
enable
);
if
(
enable
===
1
)
{
resolve
();
}
...
...
@@ -328,11 +330,10 @@ const isReportData = () => {
})
};
const
Report_Status
=
'
Report_Status
'
;
const
requestData
=
(
done
)
=>
{
let
formData
=
{
usv
:
STAT_VERSION
,
conf
:
encodeURIComponent
({
conf
:
JSON
.
stringify
({
ak
:
statConfig
.
appid
})
};
...
...
@@ -340,8 +341,10 @@ const requestData = (done) => {
url
:
STAT_URL
,
method
:
'
GET
'
,
data
:
formData
,
success
:
(
res
)
=>
{
const
{
data
}
=
res
;
success
:
(
res
)
=>
{
const
{
data
}
=
res
;
if
(
data
.
ret
===
0
)
{
typeof
done
===
'
function
'
&&
done
({
enable
:
data
.
enable
...
...
@@ -420,11 +423,11 @@ class Util {
};
}
getIsReportData
()
{
return
isReportData
()
}
getIsReportData
()
{
return
isReportData
()
}
_applicationShow
()
{
if
(
this
.
__licationHide
)
{
getLastTime
();
...
...
@@ -713,37 +716,39 @@ class Util {
}
this
.
_sendRequest
(
optionsData
);
}
_sendRequest
(
optionsData
)
{
this
.
getIsReportData
().
then
(()
=>
{
uni
.
request
({
url
:
STAT_URL
,
method
:
'
POST
'
,
// header: {
// 'content-type': 'application/json' // 默认值
// },
data
:
optionsData
,
success
:
()
=>
{
// if (process.env.NODE_ENV === 'development') {
// console.log('stat request success');
// }
},
fail
:
(
e
)
=>
{
if
(
++
this
.
_retry
<
3
)
{
setTimeout
(()
=>
{
this
.
_sendRequest
(
optionsData
);
},
1000
);
}
}
});
});
_sendRequest
(
optionsData
)
{
this
.
getIsReportData
().
then
(()
=>
{
uni
.
request
({
url
:
STAT_URL
,
method
:
'
POST
'
,
// header: {
// 'content-type': 'application/json' // 默认值
// },
data
:
optionsData
,
success
:
()
=>
{
// if (process.env.NODE_ENV === 'development') {
// console.log('stat request success');
// }
},
fail
:
(
e
)
=>
{
if
(
++
this
.
_retry
<
3
)
{
setTimeout
(()
=>
{
this
.
_sendRequest
(
optionsData
);
},
1000
);
}
}
});
});
}
/**
* h5 请求
*/
imageRequest
(
data
)
{
let
image
=
new
Image
();
let
options
=
getSgin
(
GetEncodeURIComponentOptions
(
data
)).
options
;
image
.
src
=
STAT_H5_URL
+
'
?
'
+
options
;
this
.
getIsReportData
().
then
(()
=>
{
let
image
=
new
Image
();
let
options
=
getSgin
(
GetEncodeURIComponentOptions
(
data
)).
options
;
image
.
src
=
STAT_H5_URL
+
'
?
'
+
options
;
});
}
sendEvent
(
key
,
value
)
{
...
...
packages/uni-stat/src/config.js
浏览文件 @
cca287f8
...
...
@@ -8,3 +8,4 @@ export const STAT_KEY = 'qkTHEIegZGcL5iy3'
export
const
PAGE_PVER_TIME
=
1800
export
const
APP_PVER_TIME
=
300
export
const
OPERATING_TIME
=
10
export
const
DIFF_TIME
=
60
*
1000
*
60
*
24
packages/uni-stat/src/parameter.js
浏览文件 @
cca287f8
...
...
@@ -2,7 +2,8 @@ import {
PAGE_PVER_TIME
,
APP_PVER_TIME
,
STAT_URL
,
STAT_VERSION
STAT_VERSION
,
DIFF_TIME
}
from
'
./config
'
;
const
statConfig
=
require
(
'
uni-stat-config
'
).
default
||
require
(
'
uni-stat-config
'
);
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
...
...
@@ -299,12 +300,12 @@ export const calibration = (eventName, options) => {
}
const
Report_Data_Time
=
'
Report_Data_Time
'
const
Report_Status
=
'
Report_Status
'
export
const
isReportData
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
start_time
=
''
let
end_time
=
new
Date
().
getTime
()
let
diff_time
=
60
*
1000
*
60
*
24
let
diff_time
=
DIFF_TIME
try
{
start_time
=
uni
.
getStorageSync
(
Report_Data_Time
)
}
catch
(
e
)
{
...
...
@@ -320,6 +321,7 @@ export const isReportData = () => {
enable
})
=>
{
uni
.
setStorageSync
(
Report_Data_Time
,
end_time
)
uni
.
setStorageSync
(
Report_Status
,
enable
)
if
(
enable
===
1
)
{
resolve
();
}
...
...
@@ -328,11 +330,10 @@ export const isReportData = () => {
})
}
const
Report_Status
=
'
Report_Status
'
const
requestData
=
(
done
)
=>
{
let
formData
=
{
usv
:
STAT_VERSION
,
conf
:
encodeURIComponent
({
conf
:
JSON
.
stringify
({
ak
:
statConfig
.
appid
})
}
...
...
@@ -340,8 +341,10 @@ const requestData = (done) => {
url
:
STAT_URL
,
method
:
'
GET
'
,
data
:
formData
,
success
:
(
res
)
=>
{
const
{
data
}
=
res
success
:
(
res
)
=>
{
const
{
data
}
=
res
if
(
data
.
ret
===
0
)
{
typeof
done
===
'
function
'
&&
done
({
enable
:
data
.
enable
...
...
packages/uni-stat/src/stat.js
浏览文件 @
cca287f8
...
...
@@ -22,7 +22,7 @@ import {
getPageRoute
,
getRoute
,
getPageTypes
,
calibration
,
calibration
,
isReportData
}
from
'
./parameter
'
;
...
...
@@ -85,11 +85,11 @@ class Util {
}
}
getIsReportData
()
{
return
isReportData
()
}
getIsReportData
()
{
return
isReportData
()
}
_applicationShow
()
{
if
(
this
.
__licationHide
)
{
getLastTime
();
...
...
@@ -378,37 +378,39 @@ class Util {
}
this
.
_sendRequest
(
optionsData
)
}
_sendRequest
(
optionsData
)
{
this
.
getIsReportData
().
then
(()
=>
{
uni
.
request
({
url
:
STAT_URL
,
method
:
'
POST
'
,
// header: {
// 'content-type': 'application/json' // 默认值
// },
data
:
optionsData
,
success
:
()
=>
{
// if (process.env.NODE_ENV === 'development') {
// console.log('stat request success');
// }
},
fail
:
(
e
)
=>
{
if
(
++
this
.
_retry
<
3
)
{
setTimeout
(()
=>
{
this
.
_sendRequest
(
optionsData
);
},
1000
);
}
}
});
})
_sendRequest
(
optionsData
)
{
this
.
getIsReportData
().
then
(()
=>
{
uni
.
request
({
url
:
STAT_URL
,
method
:
'
POST
'
,
// header: {
// 'content-type': 'application/json' // 默认值
// },
data
:
optionsData
,
success
:
()
=>
{
// if (process.env.NODE_ENV === 'development') {
// console.log('stat request success');
// }
},
fail
:
(
e
)
=>
{
if
(
++
this
.
_retry
<
3
)
{
setTimeout
(()
=>
{
this
.
_sendRequest
(
optionsData
);
},
1000
);
}
}
});
})
}
/**
* h5 请求
*/
imageRequest
(
data
)
{
let
image
=
new
Image
();
let
options
=
getSgin
(
GetEncodeURIComponentOptions
(
data
)).
options
;
image
.
src
=
STAT_H5_URL
+
'
?
'
+
options
this
.
getIsReportData
().
then
(()
=>
{
let
image
=
new
Image
();
let
options
=
getSgin
(
GetEncodeURIComponentOptions
(
data
)).
options
;
image
.
src
=
STAT_H5_URL
+
'
?
'
+
options
})
}
sendEvent
(
key
,
value
)
{
...
...
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
浏览文件 @
cca287f8
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录