diff --git a/App.uvue b/App.uvue index 3e3bdc421fd378c56f42838e4c185def6d2256e9..e5f89232a02c9ddb71af6a5a147366efe0d5a9ad 100644 --- a/App.uvue +++ b/App.uvue @@ -49,15 +49,15 @@ // 统计上报 - 应用启动 // #ifdef APP-ANDROID || APP-IOS || WEB - uni.report({ - name: 'uni-app-launch', - options: res, - success(res_data) { - console.log(res_data); - }, fail(err) { - console.log(err); - } - }) + // uni.report({ + // name: 'uni-app-launch', + // options: res, + // success(res_data) { + // console.log(res_data); + // }, fail(err) { + // console.log(err); + // } + // }) // #endif // #ifdef APP if (process.env.NODE_ENV !== 'development') { //真机运行可以注释此条件 @@ -90,14 +90,14 @@ // #ifdef APP-ANDROID || APP-IOS || WEB // 统计上报 - 应用显示 - uni.report({ - name: 'uni-app-show', - success(res_data) { - console.log(res_data); - }, fail(err) { - console.log(err); - } - }) + // uni.report({ + // name: 'uni-app-show', + // success(res_data) { + // console.log(res_data); + // }, fail(err) { + // console.log(err); + // } + // }) // #endif }, onHide: function () { @@ -107,14 +107,14 @@ // #ifdef APP-ANDROID || APP-IOS || WEB // 统计上报 - 应用进入后台 - uni.report({ - name: 'uni-app-hide', - success(res) { - console.log(res); - }, fail(err) { - console.log(err); - } - }) + // uni.report({ + // name: 'uni-app-hide', + // success(res) { + // console.log(res); + // }, fail(err) { + // console.log(err); + // } + // }) // #endif }, // #ifdef APP-ANDROID @@ -141,18 +141,18 @@ }, // #endif onError(err : any) { - console.log('App onError', err) + // console.log('App onError', err) // #ifdef APP-ANDROID || APP-IOS || WEB // 统计上报 - 应用发生错误 - uni.report({ - name: 'uni-app-error', - options: err, - success(res) { - console.log(res); - }, fail(err) { - console.log(err); - } - }) + // uni.report({ + // name: 'uni-app-error', + // options: err, + // success(res) { + // console.log(res); + // }, fail(err) { + // console.log(err); + // } + // }) // #endif }, methods: { diff --git a/main.uts b/main.uts index 3c691bc481984d2e598243c4cf3fcd632135c6c9..03df6e0b73bb05d359994e40e40a579b81d12cdd 100644 --- a/main.uts +++ b/main.uts @@ -1,27 +1,27 @@ // 仅测试 console.log 时机问题 import './test-main-console.uts' -// #ifdef APP-ANDROID || APP-IOS || WEB -import { uniStat } from '@/uni_modules/uni-stat/plugin.uts' -// #endif +// // #ifdef APP-ANDROID || APP-IOS || WEB +// import { uniStat } from '@/uni_modules/uni-stat/plugin.uts' +// // #endif import App from './App.uvue' import { createSSRApp } from 'vue' -// 统计配置 -const uniStatcollectItems = { - uniStatPageLog: true -} +// // 统计配置 +// const uniStatcollectItems = { +// uniStatPageLog: true +// } -const uniStatOptions = { - debug: true, - collectItems: uniStatcollectItems, -} +// const uniStatOptions = { +// debug: true, +// collectItems: uniStatcollectItems, +// } export function createApp() { const app = createSSRApp(App) - // #ifdef APP-ANDROID || APP-IOS || WEB - app.use(uniStat, uniStatOptions) - // #endif + // // #ifdef APP-ANDROID || APP-IOS || WEB + // app.use(uniStat, uniStatOptions) + // // #endif // app.mixin({ // onReady() { // setTimeout(() => { diff --git a/uni_modules/uni-stat/plugin.uts b/uni_modules/uni-stat/plugin.uts index b856d2f670ec33dd842f46bfed9dcc276b628934..809870c25248aa52994334cfc98f287cf1a9c3fc 100644 --- a/uni_modules/uni-stat/plugin.uts +++ b/uni_modules/uni-stat/plugin.uts @@ -8,27 +8,19 @@ const lifecycle = defineMixin({ // onLaunch(options : OnLaunchOptions) { stat_instance.onLaunch(options, this) }, // @ts-ignore onLoad() { - if (this instanceof Page) { - stat_instance.onLoad(this) - } + stat_instance.onLoad(this) }, // @ts-ignore - onShow() { - if (this instanceof Page) { - stat_instance.onShow(this) - } + onPageShow() { + stat_instance.onShow(this) }, // @ts-ignore - onHide() { - if (this instanceof Page) { - stat_instance.onHide(this) - } + onPageHide() { + stat_instance.onHide(this) }, // @ts-ignore onUnload() { - if (this instanceof Page) { - stat_instance.onUnload(this) - } + stat_instance.onUnload(this) }, // onError(error : string) { stat_instance.onError(error) } }) diff --git a/uni_modules/uni-stat/utssdk/common/utils/pageInfo.uts b/uni_modules/uni-stat/utssdk/common/utils/pageInfo.uts index 02d926e040ea1cd6e2b9d2b21b32c8adc38aa4c5..365a2afc34d9d3c3ab6dfdf6fb4d9c4dc84bc4cb 100644 --- a/uni_modules/uni-stat/utssdk/common/utils/pageInfo.uts +++ b/uni_modules/uni-stat/utssdk/common/utils/pageInfo.uts @@ -414,7 +414,6 @@ export const uni_cloud_config = () : UniCloudInitOptions | null => { export const get_space = (config : UniCloudInitOptions) : UniCloudInitOptions | null => { const uniCloudConfig = uni_cloud_config() if (uniCloudConfig == null) { - console.log(config); // #ifdef APP-ANDROID if (config.spaceId != '') { return config