diff --git a/packages/uni-stat/dist/uni-cloud-stat.cjs.js b/packages/uni-stat/dist/uni-cloud-stat.cjs.js index 783063ad888365d1f4573b9a7790f51526d72b28..0cdd2579549c0119327e4369cfb2f611ca0a44f1 100644 --- a/packages/uni-stat/dist/uni-cloud-stat.cjs.js +++ b/packages/uni-stat/dist/uni-cloud-stat.cjs.js @@ -814,6 +814,7 @@ class Report { let options = { path: lastPageRoute, scene: this.statData.sc, + cst: 2, }; this.sendReportRequest(options); } @@ -880,6 +881,7 @@ class Report { let options = { path: route, scene: this.statData.sc, + cst: 3, }; this.sendReportRequest(options); } @@ -926,6 +928,8 @@ class Report { fvts: get_first_visit_time(), lvts: get_last_visit_time(), tvc: get_total_visit_count(), + // create session type 上报类型 ,1 应用进入 2.后台30min进入 3.页面30min进入 + cst: options.cst || 1, }); if (get_platform_name() === 'n') { this.getProperty(); @@ -984,16 +988,15 @@ class Report { * 自定义事件上报 */ sendEventRequest({ key = '', value = '' } = {}) { - let routepath = ''; try { routepath = get_route$1(); } catch (error) { const launch_options = dbGet('__launch_options'); - routepath = launch_options.path; + routepath = launch_options.path; } - + this._navigationBarTitle.config = get_page_name(routepath); this._navigationBarTitle.lt = '21'; let options = { @@ -1129,21 +1132,27 @@ class Report { return } - const uniCloudObj = uni.__stat_uniCloud_space.importObject('uni-stat-receiver', { - customUI: true - }); - uniCloudObj.report(optionsData).then(() => { - if (is_debug) { - console.log(`=== 统计队列数据上报 ===`); - console.log(optionsData); - console.log(`=== 上报结束 ===`); - } - }).catch((err) => { - if (is_debug) { - console.warn('=== 统计上报错误'); - console.error(err); - } - }); + const uniCloudObj = uni.__stat_uniCloud_space.importObject( + 'uni-stat-receiver', + { + customUI: true, + } + ); + uniCloudObj + .report(optionsData) + .then(() => { + if (is_debug) { + console.log(`=== 统计队列数据上报 ===`); + console.log(optionsData); + console.log(`=== 上报结束 ===`); + } + }) + .catch((err) => { + if (is_debug) { + console.warn('=== 统计上报错误'); + console.error(err); + } + }); } } @@ -1228,6 +1237,8 @@ class Stat extends Report { set_page_residence_time(); this.__licationShow = true; dbSet('__launch_options', options); + // 应用初始上报参数为1 + options.cst = 1; this.sendReportRequest(options, true); } load(options, self) { diff --git a/packages/uni-stat/dist/uni-cloud-stat.es.js b/packages/uni-stat/dist/uni-cloud-stat.es.js index 7d9fbdcdcdd194cc2763734e22935b0ec48598a4..7da4867d1801b0ff16288f6b0b022ad6901294ea 100644 --- a/packages/uni-stat/dist/uni-cloud-stat.es.js +++ b/packages/uni-stat/dist/uni-cloud-stat.es.js @@ -812,6 +812,7 @@ class Report { let options = { path: lastPageRoute, scene: this.statData.sc, + cst: 2, }; this.sendReportRequest(options); } @@ -878,6 +879,7 @@ class Report { let options = { path: route, scene: this.statData.sc, + cst: 3, }; this.sendReportRequest(options); } @@ -924,6 +926,8 @@ class Report { fvts: get_first_visit_time(), lvts: get_last_visit_time(), tvc: get_total_visit_count(), + // create session type 上报类型 ,1 应用进入 2.后台30min进入 3.页面30min进入 + cst: options.cst || 1, }); if (get_platform_name() === 'n') { this.getProperty(); @@ -982,16 +986,15 @@ class Report { * 自定义事件上报 */ sendEventRequest({ key = '', value = '' } = {}) { - let routepath = ''; try { routepath = get_route$1(); } catch (error) { const launch_options = dbGet('__launch_options'); - routepath = launch_options.path; + routepath = launch_options.path; } - + this._navigationBarTitle.config = get_page_name(routepath); this._navigationBarTitle.lt = '21'; let options = { @@ -1127,21 +1130,27 @@ class Report { return } - const uniCloudObj = uni.__stat_uniCloud_space.importObject('uni-stat-receiver', { - customUI: true - }); - uniCloudObj.report(optionsData).then(() => { - if (is_debug) { - console.log(`=== 统计队列数据上报 ===`); - console.log(optionsData); - console.log(`=== 上报结束 ===`); - } - }).catch((err) => { - if (is_debug) { - console.warn('=== 统计上报错误'); - console.error(err); - } - }); + const uniCloudObj = uni.__stat_uniCloud_space.importObject( + 'uni-stat-receiver', + { + customUI: true, + } + ); + uniCloudObj + .report(optionsData) + .then(() => { + if (is_debug) { + console.log(`=== 统计队列数据上报 ===`); + console.log(optionsData); + console.log(`=== 上报结束 ===`); + } + }) + .catch((err) => { + if (is_debug) { + console.warn('=== 统计上报错误'); + console.error(err); + } + }); } } @@ -1226,6 +1235,8 @@ class Stat extends Report { set_page_residence_time(); this.__licationShow = true; dbSet('__launch_options', options); + // 应用初始上报参数为1 + options.cst = 1; this.sendReportRequest(options, true); } load(options, self) { diff --git a/packages/uni-stat/dist/uni-stat.cjs.js b/packages/uni-stat/dist/uni-stat.cjs.js index 164375e93654fe413c3a917e01eca75d21ab01bd..94863d14e30d3ff2b34cc21ab4d593064d01526d 100644 --- a/packages/uni-stat/dist/uni-stat.cjs.js +++ b/packages/uni-stat/dist/uni-stat.cjs.js @@ -793,6 +793,7 @@ class Report { let options = { path: lastPageRoute, scene: this.statData.sc, + cst: 2, }; this.sendReportRequest(options); } @@ -859,6 +860,7 @@ class Report { let options = { path: route, scene: this.statData.sc, + cst: 3, }; this.sendReportRequest(options); } @@ -905,6 +907,8 @@ class Report { fvts: get_first_visit_time(), lvts: get_last_visit_time(), tvc: get_total_visit_count(), + // create session type 上报类型 ,1 应用进入 2.后台30min进入 3.页面30min进入 + cst: options.cst || 1, }); if (get_platform_name() === 'n') { this.getProperty(); @@ -963,16 +967,15 @@ class Report { * 自定义事件上报 */ sendEventRequest({ key = '', value = '' } = {}) { - let routepath = ''; try { routepath = get_route$1(); } catch (error) { const launch_options = dbGet('__launch_options'); - routepath = launch_options.path; + routepath = launch_options.path; } - + this._navigationBarTitle.config = get_page_name(routepath); this._navigationBarTitle.lt = '21'; let options = { @@ -1195,6 +1198,8 @@ class Stat extends Report { set_page_residence_time(); this.__licationShow = true; dbSet('__launch_options', options); + // 应用初始上报参数为1 + options.cst = 1; this.sendReportRequest(options, true); } load(options, self) { diff --git a/packages/uni-stat/dist/uni-stat.es.js b/packages/uni-stat/dist/uni-stat.es.js index c71b286a369d68930ee39684d5168dcab9639581..78b405a09706fef148c11f7f45e4ff34d1602c1a 100644 --- a/packages/uni-stat/dist/uni-stat.es.js +++ b/packages/uni-stat/dist/uni-stat.es.js @@ -791,6 +791,7 @@ class Report { let options = { path: lastPageRoute, scene: this.statData.sc, + cst: 2, }; this.sendReportRequest(options); } @@ -857,6 +858,7 @@ class Report { let options = { path: route, scene: this.statData.sc, + cst: 3, }; this.sendReportRequest(options); } @@ -903,6 +905,8 @@ class Report { fvts: get_first_visit_time(), lvts: get_last_visit_time(), tvc: get_total_visit_count(), + // create session type 上报类型 ,1 应用进入 2.后台30min进入 3.页面30min进入 + cst: options.cst || 1, }); if (get_platform_name() === 'n') { this.getProperty(); @@ -961,16 +965,15 @@ class Report { * 自定义事件上报 */ sendEventRequest({ key = '', value = '' } = {}) { - let routepath = ''; try { routepath = get_route$1(); } catch (error) { const launch_options = dbGet('__launch_options'); - routepath = launch_options.path; + routepath = launch_options.path; } - + this._navigationBarTitle.config = get_page_name(routepath); this._navigationBarTitle.lt = '21'; let options = { @@ -1193,6 +1196,8 @@ class Stat extends Report { set_page_residence_time(); this.__licationShow = true; dbSet('__launch_options', options); + // 应用初始上报参数为1 + options.cst = 1; this.sendReportRequest(options, true); } load(options, self) { diff --git a/packages/uni-stat/src/core/report.js b/packages/uni-stat/src/core/report.js index a52e7a84fb0aa9e3a7904c5a3491aa0f707a2a45..054371f6c0923c91ac9ed0e499fed35e004b52be 100644 --- a/packages/uni-stat/src/core/report.js +++ b/packages/uni-stat/src/core/report.js @@ -187,6 +187,7 @@ export default class Report { let options = { path: lastPageRoute, scene: this.statData.sc, + cst: 2, } this.sendReportRequest(options) } @@ -253,6 +254,7 @@ export default class Report { let options = { path: route, scene: this.statData.sc, + cst: 3, } this.sendReportRequest(options) } @@ -299,6 +301,8 @@ export default class Report { fvts: get_first_visit_time(), lvts: get_last_visit_time(), tvc: get_total_visit_count(), + // create session type 上报类型 ,1 应用进入 2.后台30min进入 3.页面30min进入 + cst: options.cst || 1, }) if (get_platform_name() === 'n') { this.getProperty() @@ -357,16 +361,15 @@ export default class Report { * 自定义事件上报 */ sendEventRequest({ key = '', value = '' } = {}) { - let routepath = '' try { routepath = get_route() } catch (error) { const launch_options = dbGet('__launch_options') - routepath = launch_options.path + routepath = launch_options.path } - + this._navigationBarTitle.config = get_page_name(routepath) this._navigationBarTitle.lt = '21' let options = { @@ -509,21 +512,27 @@ export default class Report { return } - const uniCloudObj = uni.__stat_uniCloud_space.importObject('uni-stat-receiver', { - customUI: true - }) - uniCloudObj.report(optionsData).then(() => { - if (is_debug) { - console.log(`=== 统计队列数据上报 ===`); - console.log(optionsData); - console.log(`=== 上报结束 ===`); - } - }).catch((err) => { - if (is_debug) { - console.warn('=== 统计上报错误'); - console.error(err); - } - }) + const uniCloudObj = uni.__stat_uniCloud_space.importObject( + 'uni-stat-receiver', + { + customUI: true, + } + ) + uniCloudObj + .report(optionsData) + .then(() => { + if (is_debug) { + console.log(`=== 统计队列数据上报 ===`) + console.log(optionsData) + console.log(`=== 上报结束 ===`) + } + }) + .catch((err) => { + if (is_debug) { + console.warn('=== 统计上报错误') + console.error(err) + } + }) } if (__STAT_VERSION__ === '1') { @@ -534,16 +543,16 @@ export default class Report { data: optionsData, success: () => { if (is_debug) { - console.log(`=== 统计队列数据上报 ===`); - console.log(optionsData); - console.log(`=== 上报结束 ===`); + console.log(`=== 统计队列数据上报 ===`) + console.log(optionsData) + console.log(`=== 上报结束 ===`) } }, fail: (e) => { if (++this._retry < 3) { if (is_debug) { - console.warn('=== 统计上报错误,尝试重新上报!'); - console.error(e); + console.warn('=== 统计上报错误,尝试重新上报!') + console.error(e) } setTimeout(() => { this.sendRequest(optionsData) @@ -564,9 +573,9 @@ export default class Report { let options = get_sgin(get_encodeURIComponent_options(data)).options image.src = STAT_H5_URL + '?' + options if (is_debug) { - console.log(`=== 统计队列数据上报 ===`); - console.log(data); - console.log(`=== 上报结束 ===`); + console.log(`=== 统计队列数据上报 ===`) + console.log(data) + console.log(`=== 上报结束 ===`) } }) } diff --git a/packages/uni-stat/src/core/stat.js b/packages/uni-stat/src/core/stat.js index 57a914f80c8c8d3a09ed9253f0f18efac311e98f..15e29aa6604c7433d6414df941860a1211407520 100644 --- a/packages/uni-stat/src/core/stat.js +++ b/packages/uni-stat/src/core/stat.js @@ -55,6 +55,8 @@ class Stat extends Report { let residence_time = set_page_residence_time() this.__licationShow = true dbSet('__launch_options', options) + // 应用初始上报参数为1 + options.cst = 1 this.sendReportRequest(options, true) } load(options, self) {