Commit d45e0829 by lijiabin

【需求 20331】 perf: 全部页面加入返回按钮

parent 031a28de
...@@ -8,7 +8,7 @@ import ExchangeYabiRecordDialog from './components/exchangeYabiRecordDilaog.vue' ...@@ -8,7 +8,7 @@ import ExchangeYabiRecordDialog from './components/exchangeYabiRecordDilaog.vue'
import type { AuctionItemDto } from '@/api' import type { AuctionItemDto } from '@/api'
import { useYaBiStore } from '@/stores' import { useYaBiStore } from '@/stores'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import BackButton from '@/components/common/BackButton/index.vue'
const yabiStore = useYaBiStore() const yabiStore = useYaBiStore()
const { yabiData } = storeToRefs(yabiStore) const { yabiData } = storeToRefs(yabiStore)
...@@ -197,7 +197,8 @@ const onBid = async (item: AuctionItemDto) => { ...@@ -197,7 +197,8 @@ const onBid = async (item: AuctionItemDto) => {
} }
</script> </script>
<template> <template>
<div> <div class="relative">
<BackButton />
<div class="flex gap-6"> <div class="flex gap-6">
<div class="flex-3/4 min-w-0"> <div class="flex-3/4 min-w-0">
<div class="bg-white/90 backdrop-blur-sm rounded-2xl p-6 shadow-lg border border-white/60"> <div class="bg-white/90 backdrop-blur-sm rounded-2xl p-6 shadow-lg border border-white/60">
......
...@@ -60,6 +60,10 @@ export default defineComponent(() => { ...@@ -60,6 +60,10 @@ export default defineComponent(() => {
const activeMenu = computed(() => route.path) const activeMenu = computed(() => route.path)
const handleBackFront = () => {
router.push('/')
}
const findTitle = (menuList: MenuItem[], path: string): string | undefined => { const findTitle = (menuList: MenuItem[], path: string): string | undefined => {
for (const item of menuList) { for (const item of menuList) {
if (item.path === path) { if (item.path === path) {
...@@ -126,7 +130,13 @@ export default defineComponent(() => { ...@@ -126,7 +130,13 @@ export default defineComponent(() => {
<div class="header-left"> <div class="header-left">
<h1 class="header-title">{currentTitle.value}</h1> <h1 class="header-title">{currentTitle.value}</h1>
</div> </div>
<div class="header-right"></div>
<div class="header-right">
{/* 返回企业文化前台 */}
<el-button type="primary" plain size="small" onClick={handleBackFront}>
返回企业文化前台
</el-button>
</div>
</header> </header>
<main class="content-main"> <main class="content-main">
......
<template> <template>
<div ref="searchPageRef" class="bg-white/90"> <div ref="searchPageRef" class="bg-white/90 relative">
<BackButton />
<div> <div>
<!-- 搜索栏 --> <!-- 搜索栏 -->
<div class="p-4"> <div class="p-4">
<div class="flex items-center gap-2 justify-between"> <div class="flex items-center gap-2 justify-end">
<el-button link @click="router.back()" class="text-gray-600 hover:text-primary">
<el-icon class="mr-1">
<IEpArrowLeft />
</el-icon>
返回
</el-button>
<div class="w-auto flex items-center gap-2"> <div class="w-auto flex items-center gap-2">
<el-input <el-input
v-model="searchParams.title" v-model="searchParams.title"
...@@ -72,7 +66,7 @@ ...@@ -72,7 +66,7 @@
v-for="item in list" v-for="item in list"
:key="item.articleId" :key="item.articleId"
class="flex gap-4 p-4 rounded-lg hover:bg-gray-50 transition-colors cursor-pointer" class="flex gap-4 p-4 rounded-lg hover:bg-gray-50 transition-colors cursor-pointer"
@click="handleClick(item)" @click="jumpToArticleDetailPage({ type: item.type, id: item.articleId })"
> >
<!-- 封面图 --> <!-- 封面图 -->
<div <div
...@@ -181,9 +175,8 @@ import { articleTypeListOptions } from '@/constants' ...@@ -181,9 +175,8 @@ import { articleTypeListOptions } from '@/constants'
import { getColumnListViewMore } from '@/api' import { getColumnListViewMore } from '@/api'
import { usePageSearch, useScrollTop, useNavigation } from '@/hooks' import { usePageSearch, useScrollTop, useNavigation } from '@/hooks'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import type { SearchMoreColumnItemDto } from '@/api' import BackButton from '@/components/common/BackButton/index.vue'
const router = useRouter()
const route = useRoute() const route = useRoute()
const searchPageRef = ref<HTMLElement | null>(null) const searchPageRef = ref<HTMLElement | null>(null)
const { handleBackTop } = useScrollTop(searchPageRef) const { handleBackTop } = useScrollTop(searchPageRef)
...@@ -218,10 +211,6 @@ const handleSearch = () => { ...@@ -218,10 +211,6 @@ const handleSearch = () => {
refresh() refresh()
} }
const handleClick = (item: SearchMoreColumnItemDto) => {
jumpToArticleDetailPage({ type: item.type, id: item.articleId })
}
onActivated(() => {}) onActivated(() => {})
</script> </script>
......
<template> <template>
<div class="min-h-screen bg-gray-50 rounded-lg"> <div class="min-h-screen bg-gray-50 rounded-lg relative">
<BackButton />
<!-- 顶部背景区域 --> <!-- 顶部背景区域 -->
<div <div
class="box relative h-150px bg-gradient-to-r from-purple-400 via-pink-300 to-blue-300" class="box relative h-150px bg-gradient-to-r from-purple-400 via-pink-300 to-blue-300"
...@@ -99,7 +100,7 @@ import dayjs from 'dayjs' ...@@ -99,7 +100,7 @@ import dayjs from 'dayjs'
import { usePageSearch, useNavigation } from '@/hooks' import { usePageSearch, useNavigation } from '@/hooks'
import { articleTypeListOptions } from '@/constants' import { articleTypeListOptions } from '@/constants'
import type { OtherUserInfoDto } from '@/api/otherUserPage/types' import type { OtherUserInfoDto } from '@/api/otherUserPage/types'
import BackButton from '@/components/common/BackButton/index.vue'
const route = useRoute() const route = useRoute()
const { jumpToArticleDetailPage } = useNavigation() const { jumpToArticleDetailPage } = useNavigation()
const { list, total, searchParams, goToPage, changePageSize } = usePageSearch( const { list, total, searchParams, goToPage, changePageSize } = usePageSearch(
......
<template> <template>
<div> <div class="relative">
<BackButton />
<div class="flex gap-6"> <div class="flex gap-6">
<!-- 左侧:商品列表区域 --> <!-- 左侧:商品列表区域 -->
<div class="flex-3/4 min-w-0"> <div class="flex-3/4 min-w-0">
...@@ -241,6 +242,8 @@ import ExchangeGoodsRecordDialog from './components/exchangeGoodsRecordDilaog.vu ...@@ -241,6 +242,8 @@ import ExchangeGoodsRecordDialog from './components/exchangeGoodsRecordDilaog.vu
import ExchangeYabiRecordDialog from './components/exchangeYabiRecordDilaog.vue' import ExchangeYabiRecordDialog from './components/exchangeYabiRecordDilaog.vue'
import { useYaBiStore } from '@/stores' import { useYaBiStore } from '@/stores'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import BackButton from '@/components/common/BackButton/index.vue'
const yabiStore = useYaBiStore() const yabiStore = useYaBiStore()
const { yabiData } = storeToRefs(yabiStore) const { yabiData } = storeToRefs(yabiStore)
......
<template> <template>
<div class="min-h-screen bg-gradient-to-br"> <div class="min-h-screen bg-gradient-to-br">
<div class="max-w-4xl mx-auto"> <div class="max-w-4xl mx-auto relative">
<!-- 主表单卡片 --> <!-- 主表单卡片 -->
<BackButton />
<div class="bg-white rounded-lg shadow-lg p-8"> <div class="bg-white rounded-lg shadow-lg p-8">
<el-form ref="formRef" :model="form" label-position="top" :rules="rules"> <el-form ref="formRef" :model="form" label-position="top" :rules="rules">
<!-- 标题输入 --> <!-- 标题输入 -->
...@@ -128,6 +130,8 @@ import { selectDepOrUser } from '@/utils' ...@@ -128,6 +130,8 @@ import { selectDepOrUser } from '@/utils'
import { useUserStore } from '@/stores' import { useUserStore } from '@/stores'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import type { ISelectDept } from '@/utils/wxUtil' import type { ISelectDept } from '@/utils/wxUtil'
import BackButton from '@/components/common/BackButton/index.vue'
const router = useRouter() const router = useRouter()
const userStore = useUserStore() const userStore = useUserStore()
const { userInfo } = storeToRefs(userStore) const { userInfo } = storeToRefs(userStore)
......
<template> <template>
<div class="min-h-screen"> <div class="min-h-screen relative">
<el-form :model="form" :rules="rules" ref="formRef" label-position="top"> <el-form :model="form" :rules="rules" ref="formRef" label-position="top">
<div class="max-w-6xl mx-auto grid gap-6"> <div class="max-w-6xl mx-auto grid gap-6 relative">
<!-- 左侧主要内容 --> <!-- 左侧主要内容 -->
<BackButton />
<div class="col-span-8 space-y-6"> <div class="col-span-8 space-y-6">
<!-- 视频上传区域 --> <!-- 视频上传区域 -->
<div <div
...@@ -351,6 +353,7 @@ import type { TagItemDto, AddOrUpdateVideoDto } from '@/api' ...@@ -351,6 +353,7 @@ import type { TagItemDto, AddOrUpdateVideoDto } from '@/api'
import { useVideoStore, useUserStore } from '@/stores' import { useVideoStore, useUserStore } from '@/stores'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { selectDepOrUser } from '@/utils' import { selectDepOrUser } from '@/utils'
import BackButton from '@/components/common/BackButton/index.vue'
const videoStore = useVideoStore() const videoStore = useVideoStore()
const { videoList } = storeToRefs(videoStore) const { videoList } = storeToRefs(videoStore)
......
<template> <template>
<div ref="searchPageRef" class="bg-white/90"> <div ref="searchPageRef" class="bg-white/90 relative">
<BackButton />
<div> <div>
<!-- 搜索栏 --> <!-- 搜索栏 -->
<div class="p-4"> <div class="p-4">
<div class="flex items-center gap-2 justify-between"> <div class="flex items-center gap-2 justify-end">
<el-button link @click="router.back()" class="text-gray-600 hover:text-primary">
<el-icon class="mr-1">
<IEpArrowLeft />
</el-icon>
返回
</el-button>
<div class="w-auto flex items-center gap-2"> <div class="w-auto flex items-center gap-2">
<el-input <el-input
v-model="searchParams.title" v-model="searchParams.title"
...@@ -210,9 +204,9 @@ import { articleTypeListOptions } from '@/constants' ...@@ -210,9 +204,9 @@ import { articleTypeListOptions } from '@/constants'
import { getArticleList } from '@/api/article' import { getArticleList } from '@/api/article'
import { usePageSearch, useScrollTop, useNavigation } from '@/hooks' import { usePageSearch, useScrollTop, useNavigation } from '@/hooks'
import { ArticleTypeEnum } from '@/constants' import { ArticleTypeEnum } from '@/constants'
import BackButton from '@/components/common/BackButton/index.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
const router = useRouter()
const route = useRoute() const route = useRoute()
const searchPageRef = ref<HTMLElement | null>(null) const searchPageRef = ref<HTMLElement | null>(null)
const { handleBackTop } = useScrollTop(searchPageRef) const { handleBackTop } = useScrollTop(searchPageRef)
......
<template> <template>
<div class="min-h-screen bg-gray-50 rounded-lg"> <div class="min-h-screen bg-gray-50 rounded-lg relative">
<BackButton />
<!-- 顶部背景区域 --> <!-- 顶部背景区域 -->
<div class="box relative h-200px bg-gradient-to-r from-purple-400 via-pink-300 to-blue-300"> <div class="box relative h-200px bg-gradient-to-r from-purple-400 via-pink-300 to-blue-300">
<!-- 顶部操作按钮 --> <!-- 顶部操作按钮 -->
...@@ -165,7 +166,7 @@ import type { RouteLocationNormalizedLoadedGeneric } from 'vue-router' ...@@ -165,7 +166,7 @@ import type { RouteLocationNormalizedLoadedGeneric } from 'vue-router'
import type { TabPaneName } from 'element-plus' import type { TabPaneName } from 'element-plus'
import { IS_REAL_KEY } from '@/constants/symbolKey' import { IS_REAL_KEY } from '@/constants/symbolKey'
import { useOnlineTimeStore, useUserStore } from '@/stores' import { useOnlineTimeStore, useUserStore } from '@/stores'
import BackButton from '@/components/common/BackButton/index.vue'
const { showOnlineTime } = storeToRefs(useOnlineTimeStore()) const { showOnlineTime } = storeToRefs(useOnlineTimeStore())
const router = useRouter() const router = useRouter()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment