提交 d29aafef 编写于 作者: M mehaotian

chore(uni-stat): update package.json

上级 19c93125
'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 {
}
}
let vue = (Vue__default["default"].default || Vue__default["default"]);
class Stat extends Report {
static getInstance() {
if (!vue.instance) {
vue.instance = new Stat();
if (!uni.__stat_instance) {
uni.__stat_instance = new Stat();
}
return vue.instance
return uni.__stat_instance
}
constructor() {
super();
this.instance = null;
}
/**
......@@ -1235,45 +1226,37 @@ const lifecycle = {
};
function main() {
// console.log('--- 统计开启')
function main() {
// console.log('--- 统计开启')
if (process.env.NODE_ENV === 'development') {
uni.report = function(type, options) {};
} else {
// #ifdef VUE3
uni.onCreateVueApp((app) => {
app.mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
});
uni.onAppLaunch((options) => {
stat.launch(options);
// 小程序平台此时也无法获取getApp,统一在options中传递一个app mixin对象
options.app.mixin(lifecycle);
uni.report = function (type, options) {
stat.sendEvent(type, options);
};
});
if (get_platform_name() !== 'h5' && get_platform_name() !== 'n') {
uni.onAppHide(() => {
stat.appHide(get_page_vm());
});
uni.onAppShow(() => {
stat.appShow(get_page_vm());
});
}
// #endif
// #ifndef VUE3
const Vue = require('vue');
(Vue.default || Vue).mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
// #endif
}
// #ifdef VUE3
uni.onCreateVueApp((app) => {
app.mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
});
if (get_platform_name() !== 'h5' && get_platform_name() !== 'n') {
uni.onAppHide(() => {
stat.appHide(get_page_vm());
});
uni.onAppShow(() => {
stat.appShow(get_page_vm());
});
}
// #endif
// #ifndef VUE3
const Vue = require('vue');
(Vue.default || Vue).mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
// #endif
}
}
main();
import Vue from 'vue';
/**
* 获取系统信息
*/
......@@ -1072,18 +1070,15 @@ class Report {
}
}
let vue = (Vue.default || Vue);
class Stat extends Report {
static getInstance() {
if (!vue.instance) {
vue.instance = new Stat();
if (!uni.__stat_instance) {
uni.__stat_instance = new Stat();
}
return vue.instance
return uni.__stat_instance
}
constructor() {
super();
this.instance = null;
}
/**
......@@ -1229,45 +1224,37 @@ const lifecycle = {
};
function main() {
// console.log('--- 统计开启')
function main() {
// console.log('--- 统计开启')
if (process.env.NODE_ENV === 'development') {
uni.report = function(type, options) {};
} else {
// #ifdef VUE3
uni.onCreateVueApp((app) => {
app.mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
});
uni.onAppLaunch((options) => {
stat.launch(options);
// 小程序平台此时也无法获取getApp,统一在options中传递一个app mixin对象
options.app.mixin(lifecycle);
uni.report = function (type, options) {
stat.sendEvent(type, options);
};
});
if (get_platform_name() !== 'h5' && get_platform_name() !== 'n') {
uni.onAppHide(() => {
stat.appHide(get_page_vm());
});
uni.onAppShow(() => {
stat.appShow(get_page_vm());
});
}
// #endif
// #ifndef VUE3
const Vue = require('vue');
(Vue.default || Vue).mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
// #endif
}
// #ifdef VUE3
uni.onCreateVueApp((app) => {
app.mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
});
if (get_platform_name() !== 'h5' && get_platform_name() !== 'n') {
uni.onAppHide(() => {
stat.appHide(get_page_vm());
});
uni.onAppShow(() => {
stat.appShow(get_page_vm());
});
}
// #endif
// #ifndef VUE3
const Vue = require('vue');
(Vue.default || Vue).mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
// #endif
}
}
main();
'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 {
}
}
let vue = (Vue__default["default"].default || Vue__default["default"]);
class Stat extends Report {
static getInstance() {
if (!vue.instance) {
vue.instance = new Stat();
if (!uni.__stat_instance) {
uni.__stat_instance = new Stat();
}
return vue.instance
return uni.__stat_instance
}
constructor() {
super();
this.instance = null;
}
/**
......@@ -1250,45 +1241,37 @@ const lifecycle = {
};
function main() {
// console.log('--- 统计开启')
function main() {
// console.log('--- 统计开启')
if (process.env.NODE_ENV === 'development') {
uni.report = function(type, options) {};
} else {
// #ifdef VUE3
uni.onCreateVueApp((app) => {
app.mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
});
uni.onAppLaunch((options) => {
stat.launch(options);
// 小程序平台此时也无法获取getApp,统一在options中传递一个app mixin对象
options.app.mixin(lifecycle);
uni.report = function (type, options) {
stat.sendEvent(type, options);
};
});
if (get_platform_name() !== 'h5' && get_platform_name() !== 'n') {
uni.onAppHide(() => {
stat.appHide(get_page_vm());
});
uni.onAppShow(() => {
stat.appShow(get_page_vm());
});
}
// #endif
// #ifndef VUE3
const Vue = require('vue');
(Vue.default || Vue).mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
// #endif
}
// #ifdef VUE3
uni.onCreateVueApp((app) => {
app.mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
});
if (get_platform_name() !== 'h5' && get_platform_name() !== 'n') {
uni.onAppHide(() => {
stat.appHide(get_page_vm());
});
uni.onAppShow(() => {
stat.appShow(get_page_vm());
});
}
// #endif
// #ifndef VUE3
const Vue = require('vue');
(Vue.default || Vue).mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
// #endif
}
}
main();
import Vue from 'vue';
/**
* 获取系统信息
*/
......@@ -1087,18 +1085,15 @@ class Report {
}
}
let vue = (Vue.default || Vue);
class Stat extends Report {
static getInstance() {
if (!vue.instance) {
vue.instance = new Stat();
if (!uni.__stat_instance) {
uni.__stat_instance = new Stat();
}
return vue.instance
return uni.__stat_instance
}
constructor() {
super();
this.instance = null;
}
/**
......@@ -1244,45 +1239,37 @@ const lifecycle = {
};
function main() {
// console.log('--- 统计开启')
function main() {
// console.log('--- 统计开启')
if (process.env.NODE_ENV === 'development') {
uni.report = function(type, options) {};
} else {
// #ifdef VUE3
uni.onCreateVueApp((app) => {
app.mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
});
uni.onAppLaunch((options) => {
stat.launch(options);
// 小程序平台此时也无法获取getApp,统一在options中传递一个app mixin对象
options.app.mixin(lifecycle);
uni.report = function (type, options) {
stat.sendEvent(type, options);
};
});
if (get_platform_name() !== 'h5' && get_platform_name() !== 'n') {
uni.onAppHide(() => {
stat.appHide(get_page_vm());
});
uni.onAppShow(() => {
stat.appShow(get_page_vm());
});
}
// #endif
// #ifndef VUE3
const Vue = require('vue');
(Vue.default || Vue).mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
// #endif
}
// #ifdef VUE3
uni.onCreateVueApp((app) => {
app.mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
});
if (get_platform_name() !== 'h5' && get_platform_name() !== 'n') {
uni.onAppHide(() => {
stat.appHide(get_page_vm());
});
uni.onAppShow(() => {
stat.appShow(get_page_vm());
});
}
// #endif
// #ifndef VUE3
const Vue = require('vue');
(Vue.default || Vue).mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
// #endif
}
}
main();
{
"name": "@dcloudio/uni-stat",
"version": "3.0.0-alpha-3040020220301001",
"version": "3.0.0-alpha-3040320220325006",
"description": "@dcloudio/uni-stat",
"main": "dist/uni-stat.es.js",
"module": "dist/uni-stat.es.js",
......@@ -20,7 +20,7 @@
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040020220301001",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040320220325006",
"debug": "^4.3.3"
},
"devDependencies": {
......
import Report from './report.js'
import Vue from 'vue'
let vue = (Vue.default || Vue)
import {
set_page_residence_time
} from '../utils/pageTime.js'
......@@ -11,14 +10,13 @@ import {
class Stat extends Report {
static getInstance() {
if (!vue.instance) {
vue.instance = new Stat()
if (!uni.__stat_instance) {
uni.__stat_instance = new Stat()
}
return vue.instance
return uni.__stat_instance
}
constructor() {
super()
this.instance = null
}
/**
......
import {
get_platform_name,
get_platform_name,
get_page_vm
} from './utils/pageInfo.js'
} from './utils/pageInfo.js'
import Stat from './core/stat.js'
const stat = Stat.getInstance()
......@@ -45,45 +45,37 @@ const lifecycle = {
}
function main() {
// console.log('--- 统计开启')
function main() {
// console.log('--- 统计开启')
if (process.env.NODE_ENV === 'development') {
uni.report = function(type, options) {}
} else {
// #ifdef VUE3
uni.onCreateVueApp((app) => {
app.mixin(lifecycle)
uni.report = function(type, options) {
stat.sendEvent(type, options)
}
})
uni.onAppLaunch((options) => {
stat.launch(options)
// 小程序平台此时也无法获取getApp,统一在options中传递一个app mixin对象
options.app.mixin(lifecycle)
uni.report = function (type, options) {
stat.sendEvent(type, options)
}
})
if (get_platform_name() !== 'h5' && get_platform_name() !== 'n') {
uni.onAppHide(() => {
stat.appHide(get_page_vm());
})
uni.onAppShow(() => {
stat.appShow(get_page_vm());
})
}
// #endif
// #ifndef VUE3
const Vue = require('vue');
(Vue.default || Vue).mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
};
// #endif
}
// #ifdef VUE3
uni.onCreateVueApp((app) => {
app.mixin(lifecycle)
uni.report = function(type, options) {
stat.sendEvent(type, options)
}
})
if (get_platform_name() !== 'h5' && get_platform_name() !== 'n') {
uni.onAppHide(() => {
stat.appHide(get_page_vm());
})
uni.onAppShow(() => {
stat.appShow(get_page_vm());
})
}
// #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.
先完成此消息的编辑!
想要评论请 注册