From 3e51d7f81e6a1d2c2e5a25076e6e2fb7b2721fa8 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Fri, 6 Jun 2025 12:48:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=87=E4=BB=B6=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E9=94=99=E4=B9=B1=EF=BC=8C=E4=BB=8Ebase=E6=90=AC?= =?UTF-8?q?=E8=BF=90=E8=BF=87=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages.json | 5 +- src/pages/about/about.vue | 43 ++++++++++++--- src/pages/about/components/request.vue | 75 +++++++++++++++++++++++--- src/utils/index.ts | 2 - 4 files changed, 105 insertions(+), 20 deletions(-) diff --git a/src/pages.json b/src/pages.json index 33eddc7..f349226 100644 --- a/src/pages.json +++ b/src/pages.json @@ -57,8 +57,7 @@ "path": "pages/about/about", "type": "page", "style": { - "navigationBarTitleText": "关于", - "navigationStyle": "custom" + "navigationBarTitleText": "关于" } }, { @@ -72,7 +71,7 @@ "path": "pages/login/index", "type": "page", "style": { - "navigationBarTitleText": "登录", + "navigationBarTitleText": "登录", "navigationStyle": "custom" } }, diff --git a/src/pages/about/about.vue b/src/pages/about/about.vue index 7ec3b5f..2ba2e3c 100644 --- a/src/pages/about/about.vue +++ b/src/pages/about/about.vue @@ -1,7 +1,36 @@ -import RequestComp from './components/request.vue' import UploadComp from './components/upload.vue' -import i18n, { t } from '@/locale/index' onShow(() => { console.log('About Show', t('app.name')) -console.log(uni.getLocale()) console.log(i18n.global.locale) // #ifdef MP-WEIXIN // fix -微信小程序需要手动调用 api 设置一次国际化标题。 uni.setNavigationBarTitle({ title: t('app.name') }) -// #endif }) // 获取屏幕边界到安全区域距离 const { safeAreaInsets } = uni.getSystemInfoSync() const -gotoPage = (path) => { uni.navigateTo({ url: `/pages/about/${path}`, }) } const toSubPage = () => { -uni.navigateTo({ url: '/pages-sub/demo/index', }) } + +{ + style: { + navigationBarTitleText: '关于', + }, +} + + + + + + + diff --git a/src/pages/about/components/request.vue b/src/pages/about/components/request.vue index b2e599b..d8a1e96 100644 --- a/src/pages/about/components/request.vue +++ b/src/pages/about/components/request.vue @@ -1,8 +1,67 @@ -import useRequest from '@/hooks/useRequest' import { getFooAPI, postFooAPI, IFooItem } from -'@/service/index/foo' import { ref } from 'vue' // import { findPetsByStatusQueryOptions } from -'@/service/app' // import { useQuery } from '@tanstack/vue-query' const recommendUrl = -ref('http://laf.run/signup?code=ohaOgIX') // const initialData = { // name: 'initialData', // id: -'1234', // } const initialData = undefined // -适合少部分全局性的接口————多个页面都需要的请求接口,额外编写一个 Service 层 const { loading, error, -data, run } = useRequest - + +{ + layout: 'demo', + style: { + navigationBarTitleText: '请求', + }, +} + + + + + diff --git a/src/utils/index.ts b/src/utils/index.ts index 196493e..b722e93 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -12,8 +12,6 @@ export const getLastPage = () => { return pages[pages.length - 1] } -export const tabBarList = tabBar?.list || [] - /** 判断当前页面是否是 tabbar 页 */ export const getIsTabbar = () => { try {