diff --git a/pages/API/dialog-page/dialog-1.uvue b/pages/API/dialog-page/dialog-1.uvue index d62e6bc672e5452cd81b46022355d939a1c0948c..12d9d7476ecc1f4aca77c083ac1866c16494007d 100644 --- a/pages/API/dialog-page/dialog-1.uvue +++ b/pages/API/dialog-page/dialog-1.uvue @@ -43,10 +43,10 @@ // 自动化测试 setLifeCycleNum(state.lifeCycleNum + 1) const currentPages = getCurrentPages() - const parentPage = this.getParentPage()! + const parentPage = this.$page.getParentPage()! const grandParentPage = parentPage.getParentPage() const dialogPages = parentPage.getDialogPages() - const dialogPage = this.$dialogPage! + const dialogPage = this.$page as UniDialogPage if ( currentPages.length == 1 && grandParentPage == null && @@ -126,7 +126,7 @@ }, closeThisDialog() { uni.closeDialogPage({ - dialogPage: this.$dialogPage, + dialogPage: this.$page as UniDialogPage, success(res) { console.log('closeThisDialog success', res) // 自动化测试 diff --git a/pages/API/dialog-page/dialog-2.uvue b/pages/API/dialog-page/dialog-2.uvue index f13ae08e6046bed3708960568458c9e0f4ed0d9f..ca71940c24a8301eb57bb4c7e7d08ae943dedb3e 100644 --- a/pages/API/dialog-page/dialog-2.uvue +++ b/pages/API/dialog-page/dialog-2.uvue @@ -93,7 +93,7 @@ }, closeThisDialog() { uni.closeDialogPage({ - dialogPage: this.$dialogPage, + dialogPage: this.$page as UniDialogPage, success(res) { console.log('closeThisDialog success', res) // 自动化测试 @@ -138,4 +138,4 @@ .mt-10 { margin-top: 10px; } - + diff --git a/pages/API/get-current-pages/get-current-pages.uvue b/pages/API/get-current-pages/get-current-pages.uvue index 69d8114fe76c1816e16faeaa3add5e8bdf2c9b69..3e66d8f390cbedbc893e95475ec04d9551509c8b 100644 --- a/pages/API/get-current-pages/get-current-pages.uvue +++ b/pages/API/get-current-pages/get-current-pages.uvue @@ -112,14 +112,14 @@ getPageStyle() : UTSJSONObject { const pages = getCurrentPages(); const currentPage = pages[pages.length - 1]; - this.currentPageStyle = currentPage.$getPageStyle() + this.currentPageStyle = currentPage.getPageStyle() return this.currentPageStyle; }, setPageStyle(style : UTSJSONObject) { console.log('setPageStyle:', style); const pages = getCurrentPages(); const currentPage = pages[pages.length - 1]; - currentPage.$setPageStyle(style); + currentPage.setPageStyle(style); }, goSetDisablePullDownRefresh() { uni.navigateTo({ @@ -175,4 +175,4 @@ .radio-value { margin-left: 10px; } - + diff --git a/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.uvue b/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.uvue index f190e74ef85553723e27a05d117d4c2d91e0ad91..2d8d995b9cbeab6683343f75116348af1e5c6267 100644 --- a/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.uvue +++ b/pages/API/get-current-pages/set-page-style-disable-pull-down-refresh.uvue @@ -44,13 +44,13 @@ getPageStyle() { const pages = getCurrentPages(); const currentPage = pages[pages.length - 1]; - this.currentPageStyle = currentPage.$getPageStyle(); + this.currentPageStyle = currentPage.getPageStyle(); }, setPageStyle(enable : boolean) { // 目前仅支持 enablePullDownRefresh const pages = getCurrentPages(); const currentPage = pages[pages.length - 1]; - currentPage.$setPageStyle({ + currentPage.setPageStyle({ enablePullDownRefresh: enable }); this.enablePullDownRefreshStatus = enable @@ -95,4 +95,4 @@ margin-top: 15px; opacity: .8; } - + diff --git a/pages/API/set-page-backgroundColorContent/set-page-backgroundColorContent.uvue b/pages/API/set-page-backgroundColorContent/set-page-backgroundColorContent.uvue index b4121e588f1cebd2859e6da1f738be06ca513366..473ef629058781b7147d12bf85d8af80205e3b0f 100644 --- a/pages/API/set-page-backgroundColorContent/set-page-backgroundColorContent.uvue +++ b/pages/API/set-page-backgroundColorContent/set-page-backgroundColorContent.uvue @@ -16,10 +16,10 @@ changeColor() { let pages = getCurrentPages() let page = pages[pages.length - 1] - page.$setPageStyle({ "backgroundColorContent": this.isChange ? "" : "red" }) + page.setPageStyle({ "backgroundColorContent": this.isChange ? "" : "red" }) this.isChange = !this.isChange - let pageJson = page.$getPageStyle() + let pageJson = page.getPageStyle() this.currentBackgroundColorContent = pageJson["backgroundColorContent"] } } @@ -32,4 +32,4 @@ align-items: center; justify-content: center; } - + diff --git a/uni_modules/uni-stat/utssdk/common/utils/pageInfo.uts b/uni_modules/uni-stat/utssdk/common/utils/pageInfo.uts index c7392118794aca428b67fe11fdd630581413974a..db20808dfa5db3251a6f6f0358bc01f9e7e9efcd 100644 --- a/uni_modules/uni-stat/utssdk/common/utils/pageInfo.uts +++ b/uni_modules/uni-stat/utssdk/common/utils/pageInfo.uts @@ -224,19 +224,16 @@ export const get_page_name = (routepath : string) : string => { if (page.route != routepath) { const pages = getCurrentPages() // 如果传入路由与当前页面不同,则从页面栈找一个,如果找不到返回空 - let page_now = pages.find((v) : boolean => { - if (v.route == routepath) { - return true; - } - return false - }) + let page_now = pages.find((p): boolean => p.route == routepath) if (page_now == null) { return '' - } - page = page_now + } + // @ts-ignore + page = page_now.vm! } - - const pageStyle = page.$getPageStyle() + + // @ts-ignore + const pageStyle = page.$page.getPageStyle() const titleText = pageStyle['navigationBarTitleText'] ?? '' return titleText as string } @@ -250,8 +247,9 @@ export const get_page_vm = () : Page | null => { return null } let page = pages[pages.length - 1] - // TODO 正常来说,调用当前方法的地方只在 生命周期内,数组内最少会有一个页面,所以理论上是不存在获取不到的情况的 - return page + // TODO 正常来说,调用当前方法的地方只在 生命周期内,数组内最少会有一个页面,所以理论上是不存在获取不到的情况的 + // @ts-ignore + return page.vm } @@ -416,17 +414,17 @@ 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 - } - // #endif - // #ifndef APP-ANDROID - if (config?.spaceId != '') { - return config - } - // #endif + console.log(config); + // #ifdef APP-ANDROID + if (config.spaceId != '') { + return config + } + // #endif + // #ifndef APP-ANDROID + if (config?.spaceId != '') { + return config + } + // #endif return null } @@ -510,4 +508,4 @@ export const calibration = (eventName : string, options : any | null) : boolean return true } return false -} +}