V1.2.0需求 4个页面新增及功能 待处理编辑器锚点定位、编辑器发布的文章UI优化、中英文翻译

This commit is contained in:
2025-07-25 16:39:37 +08:00
parent 9fa026f267
commit 22dad92ef9
27 changed files with 3374 additions and 1269 deletions

View File

@@ -559,6 +559,49 @@ const childrenRoutes = [
}
}
},
{//公告详情
path: 'announcementDetails',
name: 'AnnouncementDetails',
component: () => import('../views/announcementDetails/index.vue'),
meta: {
title: '公告详情',
// description: i18n.t(`seo.announcements`) || 'M2Pool 矿池公告中心,提供最新的公告、通知和重要信息,让用户及时了解矿池的最新动态和服务变更。',
allAuthority: [`all`],
// keywords: {
// en: 'Announcement Center,Latest Announcements,Mining Pool News,Service Updates,Important Notices',
// zh: 'M2Pool 矿池,公告中心,最新公告,矿池动态,服务更新,重要通知'
// }
}
},
{//常见问题
path: 'commonProblem',
name: 'CommonProblem',
component: () => import('../views/commonProblem/index.vue'),
meta: {
title: '常见问题',
// description: i18n.t(`seo.announcements`) || 'M2Pool 矿池公告中心,提供最新的公告、通知和重要信息,让用户及时了解矿池的最新动态和服务变更。',
allAuthority: [`all`],
// keywords: {
// en: 'Announcement Center,Latest Announcements,Mining Pool News,Service Updates,Important Notices',
// zh: 'M2Pool 矿池,公告中心,最新公告,矿池动态,服务更新,重要通知'
// }
}
},
{//搜索结果页面
path: 'searchResult',
name: 'SearchResult',
component: () => import('../views/searchResult/index.vue'),
meta: {
title: '搜索结果',
// description: i18n.t(`seo.announcements`) || 'M2Pool 矿池公告中心,提供最新的公告、通知和重要信息,让用户及时了解矿池的最新动态和服务变更。',
allAuthority: [`all`],
// keywords: {
// en: 'Announcement Center,Latest Announcements,Mining Pool News,Service Updates,Important Notices',
// zh: 'M2Pool 矿池,公告中心,最新公告,矿池动态,服务更新,重要通知'
// }
}
},
{//警报通知
path: 'alerts',
name: 'Alerts',
@@ -827,13 +870,28 @@ const router = new VueRouter({
base: process.env.BASE_URL,
routes,
strict: true, // 启用严格模式,不允许尾部斜杠
scrollBehavior(to, from, savedPosition) { //每次路由跳转时,滚动到顶部
// 如果有保存的滚动位置(比如浏览器前进后退),就用它
if (savedPosition) {
return savedPosition;
} else {
// 否则滚动到顶部,并使用平滑滚动
return { x: 0, y: 0, behavior: 'smooth' };
}
}
})
router.afterEach(() => {
Vue.nextTick(() => {
// 滚动主内容区
const contentMain = document.querySelector('.el-main');
if (contentMain) {
contentMain.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
}
// 兼容其它页面(如登录页等)
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
});
});
router.beforeEach((to, from, next) => {
const lang = to.params.lang || (localStorage.getItem('lang') || 'en');