mirror of
https://gitee.com/likeadmin/likeadmin_java.git
synced 2026-06-01 22:50:44 +08:00
登录配置相关,调整登录逻辑,底部导航配置相关
This commit is contained in:
33
app/src/components/tabbar/tabbar.vue
Normal file
33
app/src/components/tabbar/tabbar.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<u-tabbar v-bind="tabbarStyle" :list="tabbarList" @change="handleChange"></u-tabbar>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useAppStore } from '@/stores/app'
|
||||
import { currentPage, navigateTo } from '@/utils/util'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
const appStore = useAppStore()
|
||||
const tabbarList = computed(() => {
|
||||
return appStore.getTabbarConfig.map((item: any) => ({
|
||||
iconPath: item.unselected,
|
||||
selectedIconPath: item.selected,
|
||||
text: item.name,
|
||||
link: JSON.parse(item.link),
|
||||
pagePath: JSON.parse(item.link).path
|
||||
}))
|
||||
})
|
||||
|
||||
const tabbarStyle = computed(() => ({
|
||||
activeColor: appStore.getStyleConfig.selectedColor,
|
||||
inactiveColor: appStore.getStyleConfig.defaultColor
|
||||
}))
|
||||
const handleChange = (index: number) => {
|
||||
const selectTab = tabbarList.value[index]
|
||||
navigateTo(selectTab.link, 'reLaunch')
|
||||
}
|
||||
// onMounted(() => {
|
||||
// const page = currentPage()
|
||||
// console.log(page)
|
||||
// })
|
||||
</script>
|
||||
@@ -117,32 +117,6 @@
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"backgroundColor": "#F8F8F8"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#666666",
|
||||
"selectedColor": "#4173FF",
|
||||
"borderStyle": "black",
|
||||
"backgroundColor": "#ffffff",
|
||||
"list": [
|
||||
{
|
||||
"iconPath": "/static/images/tabs/home.png",
|
||||
"selectedIconPath": "/static/images/tabs/home_s.png",
|
||||
"pagePath": "pages/index/index",
|
||||
"text": "首页"
|
||||
},
|
||||
{
|
||||
"iconPath": "/static/images/tabs/news.png",
|
||||
"selectedIconPath": "/static/images/tabs/news_s.png",
|
||||
"pagePath": "pages/news/news",
|
||||
"text": "资讯"
|
||||
},
|
||||
{
|
||||
"iconPath": "/static/images/tabs/user.png",
|
||||
"selectedIconPath": "/static/images/tabs/user_s.png",
|
||||
"pagePath": "pages/user/user",
|
||||
"text": "我的"
|
||||
}
|
||||
]
|
||||
},
|
||||
"easycom": {
|
||||
"custom": {
|
||||
"^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)": "z-paging/components/z-paging$1/z-paging$1.vue",
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
:item="item"
|
||||
/>
|
||||
</view>
|
||||
<tabbar />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
</view>
|
||||
</tab>
|
||||
</tabs>
|
||||
<tabbar />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<w-user-banner :content="item.content" :styles="item.styles" />
|
||||
</template>
|
||||
</view>
|
||||
<tabbar />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -9,16 +9,16 @@ export const useAppStore = defineStore({
|
||||
state: (): AppSate => ({
|
||||
config: {
|
||||
website: {},
|
||||
login: {}
|
||||
login: {},
|
||||
tabbar: [],
|
||||
style: {}
|
||||
}
|
||||
}),
|
||||
getters: {
|
||||
getWebsiteConfig(state) {
|
||||
return state.config.website
|
||||
},
|
||||
getLoginConfig(state) {
|
||||
return state.config.login
|
||||
}
|
||||
getWebsiteConfig: (state) => state.config.website,
|
||||
getLoginConfig: (state) => state.config.login,
|
||||
getTabbarConfig: (state) => state.config.tabbar,
|
||||
getStyleConfig: (state) => state.config.style
|
||||
},
|
||||
actions: {
|
||||
getImageUrl(url: string) {
|
||||
|
||||
@@ -28,7 +28,6 @@ export const getRect = (selector: string, all = false, context?: any) => {
|
||||
}
|
||||
|
||||
/**
|
||||
<<<<<<< HEAD
|
||||
* @description 获取当前页面实例
|
||||
*/
|
||||
export function currentPage() {
|
||||
@@ -52,19 +51,16 @@ export enum LinkTypeEnum {
|
||||
'SHOP_PAGES' = 'shop',
|
||||
'CUSTOM_LINK' = 'custom'
|
||||
}
|
||||
export function navigateTo(link: Link) {
|
||||
|
||||
export function navigateTo(link: Link, navigateType: 'navigateTo' | 'reLaunch' = 'navigateTo') {
|
||||
let url: string
|
||||
switch (link.type) {
|
||||
case LinkTypeEnum.SHOP_PAGES:
|
||||
url = link.query ? `${link.path}?${objectToQuery(link.query)}` : link.path
|
||||
if (link.isTab) {
|
||||
uni.switchTab({ url })
|
||||
} else {
|
||||
uni.navigateTo({ url })
|
||||
}
|
||||
uni[navigateType]({ url })
|
||||
break
|
||||
case LinkTypeEnum.CUSTOM_LINK:
|
||||
uni.navigateTo({ url: `/pages/webview/webview?url=${link.path}` })
|
||||
uni[navigateType]({ url: `/pages/webview/webview?url=${link.path}` })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user