diff --git a/components.d.ts b/components.d.ts index be9ab83..4abfee0 100644 --- a/components.d.ts +++ b/components.d.ts @@ -7,9 +7,15 @@ export {} declare module 'vue' { export interface GlobalComponents { + PageWrapper: typeof import('./src/components/page-wrapper.vue')['default'] Tabbar: typeof import('./src/components/Tabbar.vue')['default'] WdButton: typeof import('wot-design-uni/components/wd-button/wd-button.vue')['default'] + WdCell: typeof import('wot-design-uni/components/wd-cell/wd-cell.vue')['default'] + WdCellGroup: typeof import('wot-design-uni/components/wd-cell-group/wd-cell-group.vue')['default'] + WdForm: typeof import('wot-design-uni/components/wd-form/wd-form.vue')['default'] + WdInput: typeof import('wot-design-uni/components/wd-input/wd-input.vue')['default'] WdTabbar: typeof import('wot-design-uni/components/wd-tabbar/wd-tabbar.vue')['default'] WdTabbarItem: typeof import('wot-design-uni/components/wd-tabbar-item/wd-tabbar-item.vue')['default'] + WdToast: typeof import('wot-design-uni/components/wd-toast/wd-toast.vue')['default'] } } diff --git a/src/components/.gitkeep b/src/components/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/components/TabBar.vue b/src/components/TabBar.vue index 2eade6e..b9cfd53 100644 --- a/src/components/TabBar.vue +++ b/src/components/TabBar.vue @@ -2,6 +2,7 @@ import { ref } from 'vue'; import { useRouter, useRoute } from 'uni-mini-router' import { onMounted, computed, watch } from 'vue'; +import { useTabbar } from '@/stores/useTabbar'; const props = defineProps({ currentName: { @@ -10,18 +11,12 @@ const props = defineProps({ } }) -const route = useRoute() const router = useRouter() +const tab = useTabbar() -const activeTab = ref('home') - -onMounted(() => { - activeTab.value = props.currentName -}) - -watch(activeTab, (val) => { - router.pushTab({ name: val }) -}) +// onMounted(() => { +// tab.activeTab = props.currentName +// }) const nameLabelIconMap = { home: { @@ -49,8 +44,8 @@ const tabList = computed(() => router.routes.map((route: { name: keyof typeof na - - + + diff --git a/src/components/page-wrapper.vue b/src/components/page-wrapper.vue new file mode 100644 index 0000000..be70705 --- /dev/null +++ b/src/components/page-wrapper.vue @@ -0,0 +1,27 @@ + + + + + + + + + + + diff --git a/src/composables/useConfig.ts b/src/composables/useConfig.ts new file mode 100644 index 0000000..a1de689 --- /dev/null +++ b/src/composables/useConfig.ts @@ -0,0 +1,10 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; + +export const useConfig = defineStore('config', () => { + const BASE_URL = ref("https://ppmp.fenshenzhike.com/api"); + + return { + BASE_URL + } +}) \ No newline at end of file diff --git a/src/pages.json b/src/pages.json index 91ea00e..d9241a7 100644 --- a/src/pages.json +++ b/src/pages.json @@ -13,6 +13,13 @@ "style": { "navigationBarTitleText": "我的" } + }, + { + "name": "login", + "path": "pages/login/index", + "style": { + "navigationBarTitleText": "登录" + } } ], "tabBar": { diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index f533e5f..a6681d8 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -1,30 +1,18 @@ - - - - - {{ title }} - - Increment - + + + + + + Welcome + + - - + diff --git a/src/pages/my/index.vue b/src/pages/my/index.vue index 790d819..bb60101 100644 --- a/src/pages/my/index.vue +++ b/src/pages/my/index.vue @@ -1,12 +1,21 @@ - - 我的页面 - - + + + + + + + + + + 退出账号 + + +
- {{ title }} -
+ Welcome +