From b1f7fbf64eeacf28de2c7138db634c72e3b2c0e3 Mon Sep 17 00:00:00 2001 From: mehaotian <490272692@qq.com> Date: Fri, 25 Oct 2024 14:34:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(stat):=20=E4=BF=AE=E5=A4=8D=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E6=B8=A0=E9=81=93=E7=B1=BB=E5=9E=8B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uni-stat/utssdk/common/utils/pageInfo.uts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/uni_modules/uni-stat/utssdk/common/utils/pageInfo.uts b/uni_modules/uni-stat/utssdk/common/utils/pageInfo.uts index 7d29938d..02d926e0 100644 --- a/uni_modules/uni-stat/utssdk/common/utils/pageInfo.uts +++ b/uni_modules/uni-stat/utssdk/common/utils/pageInfo.uts @@ -149,11 +149,11 @@ export const get_version = () : string => { * 获取渠道 */ export const get_channel = () : string => { - // const platformName = get_platform_name() - let channel = '' - // if (platformName === 'n') { - // channel = plus.runtime.channel - // } + const platformName = get_platform_name() + let channel:string = '' + if (platformName === 'n') { + channel = sysAppBase.channel ?? '' + } // if (platformName === 'wx') { // // TODO 需要调研小程序二维码渠道如何获取; // } @@ -227,11 +227,11 @@ export const get_page_name = (routepath : string) : string => { let page_now = pages.find((p): boolean => p.route == routepath) if (page_now == null) { return '' - } + } // @ts-ignore page = page_now.vm! } - + // @ts-ignore const pageStyle = (page.$page as UniPage).getPageStyle() const titleText = pageStyle['navigationBarTitleText'] ?? '' @@ -247,7 +247,7 @@ export const get_page_vm = () : Page | null => { return null } let page = pages[pages.length - 1] - // TODO 正常来说,调用当前方法的地方只在 生命周期内,数组内最少会有一个页面,所以理论上是不存在获取不到的情况的 + // TODO 正常来说,调用当前方法的地方只在 生命周期内,数组内最少会有一个页面,所以理论上是不存在获取不到的情况的 // @ts-ignore return page.vm } -- GitLab