Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MuGuiLin
uni-app
提交
d29aafef
U
uni-app
项目概览
MuGuiLin
/
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,发现更多精彩内容 >>
提交
d29aafef
编写于
3月 31, 2022
作者:
M
mehaotian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore(uni-stat): update package.json
上级
19c93125
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
161 addition
and
231 deletion
+161
-231
packages/uni-stat/dist/uni-cloud-stat.cjs.js
packages/uni-stat/dist/uni-cloud-stat.cjs.js
+31
-48
packages/uni-stat/dist/uni-cloud-stat.es.js
packages/uni-stat/dist/uni-cloud-stat.es.js
+31
-44
packages/uni-stat/dist/uni-stat.cjs.js
packages/uni-stat/dist/uni-stat.cjs.js
+31
-48
packages/uni-stat/dist/uni-stat.es.js
packages/uni-stat/dist/uni-stat.es.js
+31
-44
packages/uni-stat/package.json
packages/uni-stat/package.json
+2
-2
packages/uni-stat/src/core/stat.js
packages/uni-stat/src/core/stat.js
+4
-6
packages/uni-stat/src/index.js
packages/uni-stat/src/index.js
+31
-39
未找到文件。
packages/uni-stat/dist/uni-cloud-stat.cjs.js
浏览文件 @
d29aafef
'
use strict
'
;
'
use strict
'
;
var
Vue
=
require
(
'
vue
'
);
function
_interopDefaultLegacy
(
e
)
{
return
e
&&
typeof
e
===
'
object
'
&&
'
default
'
in
e
?
e
:
{
'
default
'
:
e
};
}
var
Vue__default
=
/*#__PURE__*/
_interopDefaultLegacy
(
Vue
);
/**
/**
* 获取系统信息
* 获取系统信息
*/
*/
...
@@ -1078,18 +1072,15 @@ class Report {
...
@@ -1078,18 +1072,15 @@ class Report {
}
}
}
}
let
vue
=
(
Vue__default
[
"
default
"
].
default
||
Vue__default
[
"
default
"
]);
class
Stat
extends
Report
{
class
Stat
extends
Report
{
static
getInstance
()
{
static
getInstance
()
{
if
(
!
vue
.
instance
)
{
if
(
!
uni
.
__stat_
instance
)
{
vue
.
instance
=
new
Stat
();
uni
.
__stat_
instance
=
new
Stat
();
}
}
return
vue
.
instance
return
uni
.
__stat_
instance
}
}
constructor
()
{
constructor
()
{
super
();
super
();
this
.
instance
=
null
;
}
}
/**
/**
...
@@ -1235,45 +1226,37 @@ const lifecycle = {
...
@@ -1235,45 +1226,37 @@ const lifecycle = {
};
};
function
main
()
{
function
main
()
{
// console.log('--- 统计开启')
// console.log('--- 统计开启')
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
uni
.
report
=
function
(
type
,
options
)
{};
uni
.
report
=
function
(
type
,
options
)
{};
}
else
{
}
else
{
// #ifdef VUE3
// #ifdef VUE3
uni
.
onCreateVueApp
((
app
)
=>
{
uni
.
onCreateVueApp
((
app
)
=>
{
app
.
mixin
(
lifecycle
);
app
.
mixin
(
lifecycle
);
uni
.
report
=
function
(
type
,
options
)
{
uni
.
report
=
function
(
type
,
options
)
{
stat
.
sendEvent
(
type
,
options
);
stat
.
sendEvent
(
type
,
options
);
};
};
});
});
uni
.
onAppLaunch
((
options
)
=>
{
stat
.
launch
(
options
);
if
(
get_platform_name
()
!==
'
h5
'
&&
get_platform_name
()
!==
'
n
'
)
{
// 小程序平台此时也无法获取getApp,统一在options中传递一个app mixin对象
uni
.
onAppHide
(()
=>
{
options
.
app
.
mixin
(
lifecycle
);
stat
.
appHide
(
get_page_vm
());
uni
.
report
=
function
(
type
,
options
)
{
});
stat
.
sendEvent
(
type
,
options
);
uni
.
onAppShow
(()
=>
{
};
stat
.
appShow
(
get_page_vm
());
});
});
}
if
(
get_platform_name
()
!==
'
h5
'
&&
get_platform_name
()
!==
'
n
'
)
{
// #endif
uni
.
onAppHide
(()
=>
{
stat
.
appHide
(
get_page_vm
());
// #ifndef VUE3
});
const
Vue
=
require
(
'
vue
'
);
uni
.
onAppShow
(()
=>
{
(
Vue
.
default
||
Vue
).
mixin
(
lifecycle
);
stat
.
appShow
(
get_page_vm
());
uni
.
report
=
function
(
type
,
options
)
{
});
stat
.
sendEvent
(
type
,
options
);
}
};
// #endif
// #endif
}
// #ifndef VUE3
const
Vue
=
require
(
'
vue
'
);
(
Vue
.
default
||
Vue
).
mixin
(
lifecycle
);
uni
.
report
=
function
(
type
,
options
)
{
stat
.
sendEvent
(
type
,
options
);
};
// #endif
}
}
}
main
();
main
();
packages/uni-stat/dist/uni-cloud-stat.es.js
浏览文件 @
d29aafef
import
Vue
from
'
vue
'
;
/**
/**
* 获取系统信息
* 获取系统信息
*/
*/
...
@@ -1072,18 +1070,15 @@ class Report {
...
@@ -1072,18 +1070,15 @@ class Report {
}
}
}
}
let
vue
=
(
Vue
.
default
||
Vue
);
class
Stat
extends
Report
{
class
Stat
extends
Report
{
static
getInstance
()
{
static
getInstance
()
{
if
(
!
vue
.
instance
)
{
if
(
!
uni
.
__stat_
instance
)
{
vue
.
instance
=
new
Stat
();
uni
.
__stat_
instance
=
new
Stat
();
}
}
return
vue
.
instance
return
uni
.
__stat_
instance
}
}
constructor
()
{
constructor
()
{
super
();
super
();
this
.
instance
=
null
;
}
}
/**
/**
...
@@ -1229,45 +1224,37 @@ const lifecycle = {
...
@@ -1229,45 +1224,37 @@ const lifecycle = {
};
};
function
main
()
{
function
main
()
{
// console.log('--- 统计开启')
// console.log('--- 统计开启')
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
uni
.
report
=
function
(
type
,
options
)
{};
uni
.
report
=
function
(
type
,
options
)
{};
}
else
{
}
else
{
// #ifdef VUE3
// #ifdef VUE3
uni
.
onCreateVueApp
((
app
)
=>
{
uni
.
onCreateVueApp
((
app
)
=>
{
app
.
mixin
(
lifecycle
);
app
.
mixin
(
lifecycle
);
uni
.
report
=
function
(
type
,
options
)
{
uni
.
report
=
function
(
type
,
options
)
{
stat
.
sendEvent
(
type
,
options
);
stat
.
sendEvent
(
type
,
options
);
};
};
});
});
uni
.
onAppLaunch
((
options
)
=>
{
stat
.
launch
(
options
);
if
(
get_platform_name
()
!==
'
h5
'
&&
get_platform_name
()
!==
'
n
'
)
{
// 小程序平台此时也无法获取getApp,统一在options中传递一个app mixin对象
uni
.
onAppHide
(()
=>
{
options
.
app
.
mixin
(
lifecycle
);
stat
.
appHide
(
get_page_vm
());
uni
.
report
=
function
(
type
,
options
)
{
});
stat
.
sendEvent
(
type
,
options
);
uni
.
onAppShow
(()
=>
{
};
stat
.
appShow
(
get_page_vm
());
});
});
}
if
(
get_platform_name
()
!==
'
h5
'
&&
get_platform_name
()
!==
'
n
'
)
{
// #endif
uni
.
onAppHide
(()
=>
{
stat
.
appHide
(
get_page_vm
());
// #ifndef VUE3
});
const
Vue
=
require
(
'
vue
'
);
uni
.
onAppShow
(()
=>
{
(
Vue
.
default
||
Vue
).
mixin
(
lifecycle
);
stat
.
appShow
(
get_page_vm
());
uni
.
report
=
function
(
type
,
options
)
{
});
stat
.
sendEvent
(
type
,
options
);
}
};
// #endif
// #endif
}
// #ifndef VUE3
const
Vue
=
require
(
'
vue
'
);
(
Vue
.
default
||
Vue
).
mixin
(
lifecycle
);
uni
.
report
=
function
(
type
,
options
)
{
stat
.
sendEvent
(
type
,
options
);
};
// #endif
}
}
}
main
();
main
();
packages/uni-stat/dist/uni-stat.cjs.js
浏览文件 @
d29aafef
'
use strict
'
;
'
use strict
'
;
var
Vue
=
require
(
'
vue
'
);
function
_interopDefaultLegacy
(
e
)
{
return
e
&&
typeof
e
===
'
object
'
&&
'
default
'
in
e
?
e
:
{
'
default
'
:
e
};
}
var
Vue__default
=
/*#__PURE__*/
_interopDefaultLegacy
(
Vue
);
/**
/**
* 获取系统信息
* 获取系统信息
*/
*/
...
@@ -1093,18 +1087,15 @@ class Report {
...
@@ -1093,18 +1087,15 @@ class Report {
}
}
}
}
let
vue
=
(
Vue__default
[
"
default
"
].
default
||
Vue__default
[
"
default
"
]);
class
Stat
extends
Report
{
class
Stat
extends
Report
{
static
getInstance
()
{
static
getInstance
()
{
if
(
!
vue
.
instance
)
{
if
(
!
uni
.
__stat_
instance
)
{
vue
.
instance
=
new
Stat
();
uni
.
__stat_
instance
=
new
Stat
();
}
}
return
vue
.
instance
return
uni
.
__stat_
instance
}
}
constructor
()
{
constructor
()
{
super
();
super
();
this
.
instance
=
null
;
}
}
/**
/**
...
@@ -1250,45 +1241,37 @@ const lifecycle = {
...
@@ -1250,45 +1241,37 @@ const lifecycle = {
};
};
function
main
()
{
function
main
()
{
// console.log('--- 统计开启')
// console.log('--- 统计开启')
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
uni
.
report
=
function
(
type
,
options
)
{};
uni
.
report
=
function
(
type
,
options
)
{};
}
else
{
}
else
{
// #ifdef VUE3
// #ifdef VUE3
uni
.
onCreateVueApp
((
app
)
=>
{
uni
.
onCreateVueApp
((
app
)
=>
{
app
.
mixin
(
lifecycle
);
app
.
mixin
(
lifecycle
);
uni
.
report
=
function
(
type
,
options
)
{
uni
.
report
=
function
(
type
,
options
)
{
stat
.
sendEvent
(
type
,
options
);
stat
.
sendEvent
(
type
,
options
);
};
};
});
});
uni
.
onAppLaunch
((
options
)
=>
{
stat
.
launch
(
options
);
if
(
get_platform_name
()
!==
'
h5
'
&&
get_platform_name
()
!==
'
n
'
)
{
// 小程序平台此时也无法获取getApp,统一在options中传递一个app mixin对象
uni
.
onAppHide
(()
=>
{
options
.
app
.
mixin
(
lifecycle
);
stat
.
appHide
(
get_page_vm
());
uni
.
report
=
function
(
type
,
options
)
{
});
stat
.
sendEvent
(
type
,
options
);
uni
.
onAppShow
(()
=>
{
};
stat
.
appShow
(
get_page_vm
());
});
});
}
if
(
get_platform_name
()
!==
'
h5
'
&&
get_platform_name
()
!==
'
n
'
)
{
// #endif
uni
.
onAppHide
(()
=>
{
stat
.
appHide
(
get_page_vm
());
// #ifndef VUE3
});
const
Vue
=
require
(
'
vue
'
);
uni
.
onAppShow
(()
=>
{
(
Vue
.
default
||
Vue
).
mixin
(
lifecycle
);
stat
.
appShow
(
get_page_vm
());
uni
.
report
=
function
(
type
,
options
)
{
});
stat
.
sendEvent
(
type
,
options
);
}
};
// #endif
// #endif
}
// #ifndef VUE3
const
Vue
=
require
(
'
vue
'
);
(
Vue
.
default
||
Vue
).
mixin
(
lifecycle
);
uni
.
report
=
function
(
type
,
options
)
{
stat
.
sendEvent
(
type
,
options
);
};
// #endif
}
}
}
main
();
main
();
packages/uni-stat/dist/uni-stat.es.js
浏览文件 @
d29aafef
import
Vue
from
'
vue
'
;
/**
/**
* 获取系统信息
* 获取系统信息
*/
*/
...
@@ -1087,18 +1085,15 @@ class Report {
...
@@ -1087,18 +1085,15 @@ class Report {
}
}
}
}
let
vue
=
(
Vue
.
default
||
Vue
);
class
Stat
extends
Report
{
class
Stat
extends
Report
{
static
getInstance
()
{
static
getInstance
()
{
if
(
!
vue
.
instance
)
{
if
(
!
uni
.
__stat_
instance
)
{
vue
.
instance
=
new
Stat
();
uni
.
__stat_
instance
=
new
Stat
();
}
}
return
vue
.
instance
return
uni
.
__stat_
instance
}
}
constructor
()
{
constructor
()
{
super
();
super
();
this
.
instance
=
null
;
}
}
/**
/**
...
@@ -1244,45 +1239,37 @@ const lifecycle = {
...
@@ -1244,45 +1239,37 @@ const lifecycle = {
};
};
function
main
()
{
function
main
()
{
// console.log('--- 统计开启')
// console.log('--- 统计开启')
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
uni
.
report
=
function
(
type
,
options
)
{};
uni
.
report
=
function
(
type
,
options
)
{};
}
else
{
}
else
{
// #ifdef VUE3
// #ifdef VUE3
uni
.
onCreateVueApp
((
app
)
=>
{
uni
.
onCreateVueApp
((
app
)
=>
{
app
.
mixin
(
lifecycle
);
app
.
mixin
(
lifecycle
);
uni
.
report
=
function
(
type
,
options
)
{
uni
.
report
=
function
(
type
,
options
)
{
stat
.
sendEvent
(
type
,
options
);
stat
.
sendEvent
(
type
,
options
);
};
};
});
});
uni
.
onAppLaunch
((
options
)
=>
{
stat
.
launch
(
options
);
if
(
get_platform_name
()
!==
'
h5
'
&&
get_platform_name
()
!==
'
n
'
)
{
// 小程序平台此时也无法获取getApp,统一在options中传递一个app mixin对象
uni
.
onAppHide
(()
=>
{
options
.
app
.
mixin
(
lifecycle
);
stat
.
appHide
(
get_page_vm
());
uni
.
report
=
function
(
type
,
options
)
{
});
stat
.
sendEvent
(
type
,
options
);
uni
.
onAppShow
(()
=>
{
};
stat
.
appShow
(
get_page_vm
());
});
});
}
if
(
get_platform_name
()
!==
'
h5
'
&&
get_platform_name
()
!==
'
n
'
)
{
// #endif
uni
.
onAppHide
(()
=>
{
stat
.
appHide
(
get_page_vm
());
// #ifndef VUE3
});
const
Vue
=
require
(
'
vue
'
);
uni
.
onAppShow
(()
=>
{
(
Vue
.
default
||
Vue
).
mixin
(
lifecycle
);
stat
.
appShow
(
get_page_vm
());
uni
.
report
=
function
(
type
,
options
)
{
});
stat
.
sendEvent
(
type
,
options
);
}
};
// #endif
// #endif
}
// #ifndef VUE3
const
Vue
=
require
(
'
vue
'
);
(
Vue
.
default
||
Vue
).
mixin
(
lifecycle
);
uni
.
report
=
function
(
type
,
options
)
{
stat
.
sendEvent
(
type
,
options
);
};
// #endif
}
}
}
main
();
main
();
packages/uni-stat/package.json
浏览文件 @
d29aafef
{
{
"name"
:
"@dcloudio/uni-stat"
,
"name"
:
"@dcloudio/uni-stat"
,
"version"
:
"3.0.0-alpha-3040
020220301001
"
,
"version"
:
"3.0.0-alpha-3040
320220325006
"
,
"description"
:
"@dcloudio/uni-stat"
,
"description"
:
"@dcloudio/uni-stat"
,
"main"
:
"dist/uni-stat.es.js"
,
"main"
:
"dist/uni-stat.es.js"
,
"module"
:
"dist/uni-stat.es.js"
,
"module"
:
"dist/uni-stat.es.js"
,
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
},
},
"gitHead"
:
"33e807d66e1fe47e2ee08ad9c59247e37b8884da"
,
"gitHead"
:
"33e807d66e1fe47e2ee08ad9c59247e37b8884da"
,
"dependencies"
:
{
"dependencies"
:
{
"@dcloudio/uni-cli-shared"
:
"3.0.0-alpha-3040
020220301001
"
,
"@dcloudio/uni-cli-shared"
:
"3.0.0-alpha-3040
320220325006
"
,
"debug"
:
"^4.3.3"
"debug"
:
"^4.3.3"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
...
...
packages/uni-stat/src/core/stat.js
浏览文件 @
d29aafef
import
Report
from
'
./report.js
'
import
Report
from
'
./report.js
'
import
Vue
from
'
vue
'
let
vue
=
(
Vue
.
default
||
Vue
)
import
{
import
{
set_page_residence_time
set_page_residence_time
}
from
'
../utils/pageTime.js
'
}
from
'
../utils/pageTime.js
'
...
@@ -11,14 +10,13 @@ import {
...
@@ -11,14 +10,13 @@ import {
class
Stat
extends
Report
{
class
Stat
extends
Report
{
static
getInstance
()
{
static
getInstance
()
{
if
(
!
vue
.
instance
)
{
if
(
!
uni
.
__stat_
instance
)
{
vue
.
instance
=
new
Stat
()
uni
.
__stat_
instance
=
new
Stat
()
}
}
return
vue
.
instance
return
uni
.
__stat_
instance
}
}
constructor
()
{
constructor
()
{
super
()
super
()
this
.
instance
=
null
}
}
/**
/**
...
...
packages/uni-stat/src/index.js
浏览文件 @
d29aafef
import
{
import
{
get_platform_name
,
get_platform_name
,
get_page_vm
get_page_vm
}
from
'
./utils/pageInfo.js
'
}
from
'
./utils/pageInfo.js
'
import
Stat
from
'
./core/stat.js
'
import
Stat
from
'
./core/stat.js
'
const
stat
=
Stat
.
getInstance
()
const
stat
=
Stat
.
getInstance
()
...
@@ -45,45 +45,37 @@ const lifecycle = {
...
@@ -45,45 +45,37 @@ const lifecycle = {
}
}
function
main
()
{
function
main
()
{
// console.log('--- 统计开启')
// console.log('--- 统计开启')
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
uni
.
report
=
function
(
type
,
options
)
{}
uni
.
report
=
function
(
type
,
options
)
{}
}
else
{
}
else
{
// #ifdef VUE3
// #ifdef VUE3
uni
.
onCreateVueApp
((
app
)
=>
{
uni
.
onCreateVueApp
((
app
)
=>
{
app
.
mixin
(
lifecycle
)
app
.
mixin
(
lifecycle
)
uni
.
report
=
function
(
type
,
options
)
{
uni
.
report
=
function
(
type
,
options
)
{
stat
.
sendEvent
(
type
,
options
)
stat
.
sendEvent
(
type
,
options
)
}
}
})
})
uni
.
onAppLaunch
((
options
)
=>
{
stat
.
launch
(
options
)
if
(
get_platform_name
()
!==
'
h5
'
&&
get_platform_name
()
!==
'
n
'
)
{
// 小程序平台此时也无法获取getApp,统一在options中传递一个app mixin对象
uni
.
onAppHide
(()
=>
{
options
.
app
.
mixin
(
lifecycle
)
stat
.
appHide
(
get_page_vm
());
uni
.
report
=
function
(
type
,
options
)
{
})
stat
.
sendEvent
(
type
,
options
)
uni
.
onAppShow
(()
=>
{
}
stat
.
appShow
(
get_page_vm
());
})
})
}
if
(
get_platform_name
()
!==
'
h5
'
&&
get_platform_name
()
!==
'
n
'
)
{
// #endif
uni
.
onAppHide
(()
=>
{
stat
.
appHide
(
get_page_vm
());
// #ifndef VUE3
})
const
Vue
=
require
(
'
vue
'
);
uni
.
onAppShow
(()
=>
{
(
Vue
.
default
||
Vue
).
mixin
(
lifecycle
);
stat
.
appShow
(
get_page_vm
());
uni
.
report
=
function
(
type
,
options
)
{
})
stat
.
sendEvent
(
type
,
options
);
}
};
// #endif
// #endif
}
// #ifndef VUE3
const
Vue
=
require
(
'
vue
'
);
(
Vue
.
default
||
Vue
).
mixin
(
lifecycle
);
uni
.
report
=
function
(
type
,
options
)
{
stat
.
sendEvent
(
type
,
options
);
};
// #endif
}
}
}
main
()
main
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录