8.10更新

This commit is contained in:
hrx 2026-08-10 16:18:30 +08:00
parent 9d430f08ab
commit cff67aa2b5
17 changed files with 122 additions and 536 deletions

View File

@ -1,11 +1,10 @@
.news-view-page { .news-view-page {
position: relative; position: relative;
width: 100%;
max-width: 100%;
min-width: 0;
min-height: 100vh; min-height: 100vh;
overflow-x: clip; overflow-x: hidden;
overflow-y: hidden;
color: #1f2937; color: #1f2937;
padding: 0 12%;
background: background:
radial-gradient(circle at 78% 18%, rgba(236, 72, 153, 0.07) 0%, rgba(236, 72, 153, 0) 32%), radial-gradient(circle at 78% 18%, rgba(236, 72, 153, 0.07) 0%, rgba(236, 72, 153, 0) 32%),
radial-gradient(circle at 18% 16%, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0) 36%), radial-gradient(circle at 18% 16%, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0) 36%),
@ -13,17 +12,15 @@
} }
.news-shell { .news-shell {
position: relative; // position: relative;
z-index: 1; z-index: 1;
box-sizing: border-box; // max-width: 1280px;
width: 100%; // margin: 0 auto;
max-width: 1400px;
margin: 0 auto;
padding: 0 24px; padding: 0 24px;
} }
.orb { .orb {
position: absolute; position: fixed;
z-index: 0; z-index: 0;
border-radius: 50%; border-radius: 50%;
filter: blur(110px); filter: blur(110px);
@ -60,9 +57,9 @@
} }
.news-hero { .news-hero {
position: relative; // position: relative;
padding: 140px 0 72px; padding: 140px 0 72px;
overflow: hidden; // overflow: hidden;
} }
.news-hero::before { .news-hero::before {
@ -98,6 +95,8 @@
} }
.hero-content { .hero-content {
text-align: left;
margin: 0 ;
animation: fadeInUp 0.8s ease-out forwards; animation: fadeInUp 0.8s ease-out forwards;
} }
@ -201,9 +200,8 @@
.news-featured, .news-featured,
.news-item { .news-item {
position: relative; position: relative;
width: 100%;
max-width: 100%;
overflow: hidden; overflow: hidden;
cursor: pointer; cursor: pointer;
background: #fff; background: #fff;
border: 1px solid rgba(0, 0, 0, 0.04); border: 1px solid rgba(0, 0, 0, 0.04);
@ -260,19 +258,11 @@
.news-featured-inner { .news-featured-inner {
display: grid; display: grid;
grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); grid-template-columns: 1fr 2fr;
align-items: stretch; min-height: 180px;
width: 100%;
min-height: 280px;
}
.news-featured-img {
position: relative;
overflow: hidden;
width: 100%;
min-height: 280px;
} }
.news-featured-img,
.news-item-img { .news-item-img {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
@ -295,8 +285,6 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
min-width: 0;
width: 100%;
padding: 24px 40px; padding: 24px 40px;
} }
@ -508,15 +496,6 @@
align-items: flex-start; align-items: flex-start;
} }
.news-featured-inner {
grid-template-columns: 1fr;
}
.news-featured-img {
width: 100%;
min-height: 220px;
}
.filter-tabs { .filter-tabs {
display: flex; display: flex;
border-radius: 20px; border-radius: 20px;
@ -528,10 +507,15 @@
font-size: 14px; font-size: 14px;
} }
.news-featured-inner,
.news-grid { .news-grid {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
.news-featured-img {
height: 220px;
}
.news-featured-body { .news-featured-body {
padding: 24px; padding: 24px;
} }

View File

@ -12,7 +12,6 @@ import 'xterm/css/xterm.css'
// import 'lib-flexible/flexible' // import 'lib-flexible/flexible'
import '@/styles/index.scss' // global css import '@/styles/index.scss' // global css
import '@/assets/less/news/news.less'
import globalMixin from '@/mixin/globalMixin'; // 替换为实际的文件路径 import globalMixin from '@/mixin/globalMixin'; // 替换为实际的文件路径

View File

@ -1,9 +1,6 @@
import Vue from 'vue' import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
import store from '@/store' import store from '@/store'
import { scheduleHomePageLayoutReset, resetHomePageLayout } from '@/utils/resetHomePageLayout'
const HOME_ROUTE_RE = /^\/(homePage|ncmatchHome)(\/|$)/
/* Layout */ /* Layout */
import Layout from '@/layout' import Layout from '@/layout'
import GpuProduct from '@/views/product/productHome/capitalOnline/productItem/GpuProduct/index.vue' import GpuProduct from '@/views/product/productHome/capitalOnline/productItem/GpuProduct/index.vue'
@ -2621,18 +2618,10 @@ const router = createRouter()
// 在beforeRouteLeave导航守卫中清空面包屑状态 // 在beforeRouteLeave导航守卫中清空面包屑状态
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
if (HOME_ROUTE_RE.test(to.path) || HOME_ROUTE_RE.test(from.path)) { // 清空面包屑状态的代码
resetHomePageLayout() // store.commit('tagsView/resetBreadcrumbState');
}
next() next()
}) })
router.afterEach((to) => {
if (!HOME_ROUTE_RE.test(to.path)) return
scheduleHomePageLayoutReset()
window.setTimeout(() => scheduleHomePageLayoutReset(), 900)
})
window.addEventListener('beforeunload', function() { window.addEventListener('beforeunload', function() {
// 清空面包屑状态的代码 // 清空面包屑状态的代码
store.commit('tagsView/resetBreadcrumbState') store.commit('tagsView/resetBreadcrumbState')

View File

@ -1,140 +0,0 @@
// 官网 shell:html/body 不滚动,仅 #homeOut 内部纵向滚动,彻底避免 SPA 跳转后 scrollLeft 残留
html.home-page-shell-active,
body.home-page-shell-active {
width: 100% !important;
max-width: 100% !important;
height: 100% !important;
overflow: hidden !important;
margin: 0 !important;
padding: 0 !important;
}
html.home-page-shell-active #app,
body.home-page-shell-active #app {
width: 100% !important;
max-width: 100% !important;
min-width: 0 !important;
height: 100% !important;
overflow: hidden !important;
}
.home-page-shell {
display: flex;
flex-direction: column;
width: 100%;
max-width: 100%;
min-width: 0;
height: 100vh;
height: 100dvh;
overflow: hidden;
position: relative;
isolation: isolate;
}
.home-page-shell > #topBox,
.home-page-shell > #topBox.top-nav,
#topBox.top-nav {
flex: 0 0 auto;
min-width: 0 !important;
max-width: 100% !important;
width: 100% !important;
}
.home-page-shell #homeOut {
flex: 1 1 auto;
width: 100% !important;
max-width: 100% !important;
min-width: 0 !important;
min-height: 0 !important;
overflow-x: hidden !important;
overflow-y: auto !important;
overscroll-behavior-x: none;
margin: 0 !important;
padding: 0 !important;
}
.home-page-shell .home-route-stage,
.home-page-shell .home-router-view {
width: 100% !important;
max-width: 100% !important;
min-width: 0 !important;
overflow-x: hidden !important;
box-sizing: border-box;
}
.home-page-shell .home-router-view > * {
width: 100%;
max-width: 100%;
min-width: 0;
box-sizing: border-box;
}
.home-page-shell .train-page,
.home-page-shell .agent-store-page,
.home-page-shell .jd-homepage,
.home-page-shell .product-service-page,
.home-page-shell .news-view-page,
.home-page-shell .about-page,
.home-page-shell .home-main-page {
overflow-x: hidden;
}
.home-page-shell .about-page,
.home-page-shell .about-container {
width: 100%;
max-width: 100%;
min-width: 0;
box-sizing: border-box;
}
.home-page-shell .grid-bg {
width: 100% !important;
max-width: 100% !important;
margin-left: 0 !important;
margin-right: 0 !important;
}
.home-page-shell .product-service-page.single-product-page {
height: auto !important;
min-height: calc(100vh - 82px);
overflow-y: visible !important;
overflow-x: hidden !important;
}
.home-page-shell .nav-container {
max-width: 100%;
}
.home-page-shell .news-shell {
width: 100%;
max-width: 1400px;
margin-left: auto;
margin-right: auto;
box-sizing: border-box;
}
.home-page-shell .news-featured-inner {
display: grid !important;
grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
align-items: stretch;
width: 100%;
min-height: 280px;
}
.home-page-shell .news-featured-body {
width: 100%;
min-width: 0;
}
.home-page-shell .news-featured,
.home-page-shell .news-item {
width: 100%;
max-width: 100%;
}
.home-page-shell .footer {
width: 100%;
max-width: 100%;
box-sizing: border-box;
}

View File

@ -1,182 +0,0 @@
const HOME_SHELL_CLASS = 'home-page-shell-active'
const RESET_TARGETS = [
'.home-page-shell',
'#homeOut',
'.home-route-stage',
'.home-router-view'
]
let scrollLockBound = false
let homeOutObserver = null
function attachHomeOutScrollListener() {
const homeOut = getHomeOut()
if (!homeOut || homeOut.dataset.scrollLockBound === '1') return
homeOut.dataset.scrollLockBound = '1'
homeOut.addEventListener('scroll', lockHomeOutHorizontalScroll, { passive: true })
}
export function enableHomePageBodyScroll() {
document.documentElement.classList.add(HOME_SHELL_CLASS)
document.body.classList.add(HOME_SHELL_CLASS)
bindHomeOutScrollLock()
bindHomeOutResizeObserver()
attachHomeOutScrollListener()
}
export function disableHomePageBodyScroll() {
document.documentElement.classList.remove(HOME_SHELL_CLASS)
document.body.classList.remove(HOME_SHELL_CLASS)
if (homeOutObserver) {
homeOutObserver.disconnect()
homeOutObserver = null
}
}
function getHomeOut() {
return document.getElementById('homeOut')
}
function getHomeScroller() {
return getHomeOut() || document.documentElement
}
function clearInlineLayoutStyles(element) {
if (!element || !element.style) return
element.style.removeProperty('width')
element.style.removeProperty('max-width')
element.style.removeProperty('min-width')
element.style.removeProperty('transform')
element.style.removeProperty('margin-left')
element.style.removeProperty('left')
}
function resetElementScroll(element, resetVertical = true) {
if (!element) return
element.scrollLeft = 0
if (resetVertical) {
element.scrollTop = 0
}
}
function resetScrollableDescendants(root) {
if (!root || !root.querySelectorAll) return
root.querySelectorAll('*').forEach((element) => {
if (element.scrollLeft) {
element.scrollLeft = 0
}
})
}
function lockHomeOutHorizontalScroll() {
const homeOut = getHomeOut()
if (!homeOut) return
if (homeOut.scrollLeft !== 0) {
homeOut.scrollLeft = 0
}
resetElementScroll(document.documentElement, false)
resetElementScroll(document.body, false)
if (window.scrollX !== 0) {
window.scrollTo(0, 0)
}
}
export function resetHomePageLayout(resetVertical = true) {
const homeOut = getHomeOut()
RESET_TARGETS.forEach((selector) => {
document.querySelectorAll(selector).forEach((element) => {
resetElementScroll(element, resetVertical)
clearInlineLayoutStyles(element)
})
})
if (homeOut) {
resetElementScroll(homeOut, resetVertical)
clearInlineLayoutStyles(homeOut)
resetScrollableDescendants(homeOut)
}
resetElementScroll(document.documentElement, resetVertical)
resetElementScroll(document.body, resetVertical)
window.scrollTo(0, 0)
lockHomeOutHorizontalScroll()
}
export function scheduleHomePageLayoutReset(resetVertical = true) {
attachHomeOutScrollListener()
resetHomePageLayout(resetVertical)
window.requestAnimationFrame(() => resetHomePageLayout(resetVertical))
window.setTimeout(() => resetHomePageLayout(resetVertical), 0)
window.setTimeout(() => resetHomePageLayout(resetVertical), 80)
window.setTimeout(() => resetHomePageLayout(resetVertical), 200)
window.setTimeout(() => resetHomePageLayout(resetVertical), 500)
window.setTimeout(() => resetHomePageLayout(resetVertical), 900)
}
export function scrollHomeSection(id, offset = 82) {
const homeOut = getHomeOut()
const element = document.getElementById(id)
if (!element) return false
lockHomeOutHorizontalScroll()
if (homeOut) {
const top = element.getBoundingClientRect().top - homeOut.getBoundingClientRect().top + homeOut.scrollTop - offset
homeOut.scrollTo({
left: 0,
top: Math.max(top, 0),
behavior: 'smooth'
})
return true
}
const top = element.getBoundingClientRect().top + window.pageYOffset - offset
window.scrollTo({
left: 0,
top: Math.max(top, 0),
behavior: 'smooth'
})
return true
}
export function bindHomeOutScrollLock() {
if (scrollLockBound) return
scrollLockBound = true
document.addEventListener('scroll', (event) => {
if (!document.body.classList.contains(HOME_SHELL_CLASS)) return
if (event.target === getHomeOut()) {
lockHomeOutHorizontalScroll()
}
}, true)
window.addEventListener('resize', () => scheduleHomePageLayoutReset(true), { passive: true })
}
export function bindHomeOutResizeObserver() {
if (homeOutObserver || typeof ResizeObserver === 'undefined') return
homeOutObserver = new ResizeObserver(() => {
if (!document.body.classList.contains(HOME_SHELL_CLASS)) return
lockHomeOutHorizontalScroll()
})
const observe = () => {
const homeOut = getHomeOut()
if (homeOut) homeOutObserver.observe(homeOut)
}
observe()
window.setTimeout(observe, 0)
}
export const bindHomeHorizontalScrollLock = bindHomeOutScrollLock
export const bindHomeOutHorizontalScrollLock = bindHomeOutScrollLock
export function getHomeScrollContainer() {
return getHomeScroller()
}

View File

@ -205,13 +205,8 @@
</template> </template>
<script> <script>
import { scheduleHomePageLayoutReset } from '@/utils/resetHomePageLayout'
export default { export default {
name: 'HomeAbout', name: 'HomeAbout',
mounted() {
scheduleHomePageLayoutReset()
},
methods: { methods: {
moveCardGlow(event) { moveCardGlow(event) {
const card = event.currentTarget const card = event.currentTarget

View File

@ -10,8 +10,10 @@
} }
.grid-bg { .grid-bg {
width: 100%; width: 100vw;
min-height: 100vh; min-height: 100vh;
margin-left: calc(50% - 50vw);
margin-right: calc(50% - 50vw);
overflow: hidden; overflow: hidden;
background: background:
linear-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1px), linear-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1px),

View File

@ -87,7 +87,6 @@
<script> <script>
import Talk from '@/views/homePage/dialog/talk/index.vue' import Talk from '@/views/homePage/dialog/talk/index.vue'
import { scheduleHomePageLayoutReset } from '@/utils/resetHomePageLayout'
export default { export default {
name: 'AgentStore', name: 'AgentStore',
@ -137,9 +136,6 @@ export default {
return result return result
} }
}, },
mounted() {
scheduleHomePageLayoutReset()
},
methods: { methods: {
setMainTab(tab) { setMainTab(tab) {
this.activeMainTab = tab this.activeMainTab = tab

View File

@ -259,7 +259,6 @@ import { gotoYuanJingAPI } from '@/api/gotoYuanJing'
import { setLocale } from '@/i18n' import { setLocale } from '@/i18n'
import MessageCenter from '@/components/MessageCenter/MessageCenter.vue' import MessageCenter from '@/components/MessageCenter/MessageCenter.vue'
import LoginDialog from '@/views/LoginDialog/LoginDialog.vue' import LoginDialog from '@/views/LoginDialog/LoginDialog.vue'
import { scheduleHomePageLayoutReset, scrollHomeSection } from '@/utils/resetHomePageLayout'
const LOCALE_KEY = 'kboss-locale' const LOCALE_KEY = 'kboss-locale'
const SUPPORTED_LOCALES = ['zh-CN', 'en-US'] const SUPPORTED_LOCALES = ['zh-CN', 'en-US']
@ -462,18 +461,8 @@ export default Vue.extend({
// ========================= // =========================
navigateTo(path) { navigateTo(path) {
this.closeProductPanelImmediate() this.closeProductPanelImmediate()
this.blurActiveElement() if (this.$route.path === path) return
if (this.$route.path === path) { this.$router.push(path).catch(() => {})
scheduleHomePageLayoutReset()
return
}
this.$router.push(path).then(() => {
scheduleHomePageLayoutReset()
}).catch(() => {})
},
blurActiveElement() {
const active = document.activeElement
if (active && typeof active.blur === 'function') active.blur()
}, },
goHome() { goHome() {
this.closeProductPanelImmediate() this.closeProductPanelImmediate()
@ -482,16 +471,21 @@ export default Vue.extend({
}, },
goHomeAnchor(id) { goHomeAnchor(id) {
this.closeProductPanelImmediate() this.closeProductPanelImmediate()
this.blurActiveElement()
const scrollToTarget = (attempt = 0) => { const scrollToTarget = (attempt = 0) => {
if (scrollHomeSection(id)) return const target = document.getElementById(id)
if (target) {
target.scrollIntoView({ behavior: 'smooth', block: 'start' })
return true
}
if (attempt < 30) { if (attempt < 30) {
window.setTimeout(() => scrollToTarget(attempt + 1), 100) window.setTimeout(() => scrollToTarget(attempt + 1), 100)
} }
return false
} }
const startScroll = () => window.setTimeout(() => scrollToTarget(), 120)
if (this.$route.path.includes('/homePage/index')) { if (this.$route.path.includes('/homePage/index')) {
this.$nextTick(startScroll) this.$nextTick(() => {
window.setTimeout(() => scrollToTarget(), 80)
})
return return
} }
this.$router.push({ path: '/homePage/index', query: { anchor: id } }).catch(() => {}) this.$router.push({ path: '/homePage/index', query: { anchor: id } }).catch(() => {})
@ -501,8 +495,6 @@ export default Vue.extend({
this.$router.push({ this.$router.push({
path: '/homePage/tokenMarket', path: '/homePage/tokenMarket',
query: { category: 'TOKEN市集', single: '1' } query: { category: 'TOKEN市集', single: '1' }
}).then(() => {
scheduleHomePageLayoutReset()
}).catch(() => {}) }).catch(() => {})
}, },
async goYuanjing() { async goYuanjing() {
@ -929,19 +921,8 @@ export default Vue.extend({
line-height: 82px; line-height: 82px;
font-weight: 600; font-weight: 600;
white-space: nowrap; white-space: nowrap;
outline: none;
-webkit-tap-highlight-color: transparent;
transition: color 0.2s ease; transition: color 0.2s ease;
&:focus {
outline: none;
}
&:focus-visible {
color: #1e6fff;
box-shadow: inset 0 -2px 0 #1e6fff;
}
&:hover, &:hover,
&.active { &.active {
color: #1e6fff; color: #1e6fff;

View File

@ -1,19 +1,12 @@
<template> <template>
<div class="home-page-shell"> <div id="homeOut" class="homeOut">
<TopBox id="topBox"></TopBox> <TopBox id="topBox"></TopBox>
<div id="homeOut" class="homeOut"> <div class="home-router-view">
<div class="home-route-stage"> <router-view></router-view>
<div class="home-router-view"> </div>
<router-view <!-- footer-->
:key="$route.fullPath" <div class="footer">
@hook:mounted="handleChildRouteMounted"
@hook:updated="handleChildRouteMounted"
></router-view>
</div>
</div>
<!-- footer-->
<div class="footer">
<div class="footer-main"> <div class="footer-main">
<div class="footer-brand-col"> <div class="footer-brand-col">
<img <img
@ -103,20 +96,12 @@
<!-- </span>--> <!-- </span>-->
</div> </div>
</div> </div>
</div>
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue' import Vue from 'vue'
import TopBox from "@/views/homePage/components/topBox/index.vue"; import TopBox from "@/views/homePage/components/topBox/index.vue";
import {mapGetters, mapState} from "vuex"; import {mapGetters, mapState} from "vuex";
import '@/styles/home-page-shell.scss'
import {
disableHomePageBodyScroll,
enableHomePageBodyScroll,
scheduleHomePageLayoutReset,
scrollHomeSection
} from '@/utils/resetHomePageLayout'
export default Vue.extend({ export default Vue.extend({
name: "indexLast", name: "indexLast",
@ -263,39 +248,43 @@ export default Vue.extend({
}, },
mounted() { mounted() {
enableHomePageBodyScroll() this.scrollToRouteAnchor()
scheduleHomePageLayoutReset()
},
beforeDestroy() {
disableHomePageBodyScroll()
}, },
watch: { watch: {
'$route.fullPath'() { '$route.fullPath'() {
scheduleHomePageLayoutReset()
this.$nextTick(() => { this.$nextTick(() => {
const anchor = this.$route.query.anchor if (this.scrollToRouteAnchor()) return
if (anchor && this.$route.path.includes('/homePage/index')) { this.scrollHomeToTop()
window.setTimeout(() => { window.setTimeout(this.scrollHomeToTop, 0)
scrollHomeSection(anchor)
}, 120)
return
}
scheduleHomePageLayoutReset()
}) })
} }
}, },
methods: { methods: {
handleChildRouteMounted() { scrollToRouteAnchor() {
scheduleHomePageLayoutReset() const anchor = this.$route.query.anchor
this.$nextTick(() => { if (!anchor || !this.$route.path.includes('/homePage/index')) return false
scheduleHomePageLayoutReset() window.setTimeout(() => {
}) this.scrollToElementWithRetry(anchor)
}, 120)
return true
}, },
resetHomeLayout() { scrollToElementWithRetry(id, attempt = 0) {
scheduleHomePageLayoutReset() const element = document.getElementById(id)
if (element) {
element.scrollIntoView({ behavior: 'smooth', block: 'start' })
return true
}
if (attempt < 30) {
window.setTimeout(() => this.scrollToElementWithRetry(id, attempt + 1), 100)
}
return false
}, },
scrollHomeToTop() { scrollHomeToTop() {
scheduleHomePageLayoutReset() const container = this.$el
if (container) container.scrollTop = 0
window.scrollTo(0, 0)
document.documentElement.scrollTop = 0
document.body.scrollTop = 0
}, },
goOut(url){ goOut(url){
window.open(url) window.open(url)
@ -305,7 +294,13 @@ export default Vue.extend({
this.$router.push(path) this.$router.push(path)
}, },
scrollToElement(id) { scrollToElement(id) {
scrollHomeSection(id) const element = document.getElementById(id);
if (element) {
element.scrollIntoView({
behavior: 'smooth', // 平滑滚动
block: 'start', // 滚动到顶部对齐(可选:'start', 'center', 'end', 'nearest')
});
}
}, },
clickBaseMenu(menu) { clickBaseMenu(menu) {
console.log("emnu", menu) console.log("emnu", menu)
@ -361,67 +356,46 @@ export default Vue.extend({
<style scoped lang="scss"> <style scoped lang="scss">
.home-page-shell {
display: flex;
flex-direction: column;
width: 100%;
height: 100vh;
height: 100dvh;
min-width: 0;
overflow: hidden;
}
.homeOut { .homeOut {
flex: 1 1 auto; //padding-top: 60px;
width: 100%; width: 100%;
min-width: 0; min-width: 0;
min-height: 0; height: 100%;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto !important;
// background: linear-gradient(180deg, #f0f7ff 0%, #ffffff 60%, #f5f8ff 100%);
} }
#topBox{
.home-route-stage { // height: 82px;
width: 100%; background: transparent!important;
max-width: 100%; background-color: transparent!important;
min-width: 0; box-shadow: none!important;
overflow-x: hidden; border: 0!important;
}
#topBox {
background: transparent !important;
background-color: transparent !important;
box-shadow: none !important;
border: 0 !important;
} }
.home-router-view { .home-router-view {
width: 100%; width: 100%;
max-width: 100%;
min-width: 0; min-width: 0;
padding-top: 0; padding-top: 0;
box-sizing: border-box; box-sizing: border-box;
overflow-x: hidden;
} }
.footer { .footer {
padding: 38px 0 22px; padding: 38px 0 22px;
width: 100%; width: 100%;
max-width: 100%;
display: flex; display: flex;
justify-content: center; justify-content: center;
flex-wrap: wrap; flex-wrap: wrap;
background: #f1f3f7; background: #f1f3f7;
box-sizing: border-box;
} }
.footer-main { .footer-main {
width: 100%; width: 1400px;
max-width: 1400px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: flex-start; align-items: flex-start;
gap: 38px; gap: 38px;
padding: 0 24px 32px; padding: 0 0 32px;
border-bottom: 1px solid rgba(122, 130, 160, 0.22); border-bottom: 1px solid rgba(122, 130, 160, 0.22);
box-sizing: border-box; box-sizing: border-box;
} }
@ -560,8 +534,7 @@ export default Vue.extend({
} }
.footer-record__text { .footer-record__text {
width: 100%; width: 1400px;
max-width: 1400px;
margin: 18px 0 0; margin: 18px 0 0;
display: flex; display: flex;
justify-content: center; justify-content: center;

View File

@ -174,7 +174,6 @@ import Vue from 'vue'
import { reqPublishProductSearchFirstPage, reqEnterpriseAuditInfoSearch, reqHomepageProductCategory, reqGetSupplyAndDemandSquareList } from '@/api/ncmatch' import { reqPublishProductSearchFirstPage, reqEnterpriseAuditInfoSearch, reqHomepageProductCategory, reqGetSupplyAndDemandSquareList } from '@/api/ncmatch'
import { mapGetters, mapState } from "vuex"; import { mapGetters, mapState } from "vuex";
import { gotoYuanJingAPI } from '@/api/gotoYuanJing' import { gotoYuanJingAPI } from '@/api/gotoYuanJing'
import { scheduleHomePageLayoutReset } from '@/utils/resetHomePageLayout'
export default Vue.extend({ export default Vue.extend({
name: "mainPage", name: "mainPage",
@ -187,9 +186,6 @@ export default Vue.extend({
created() { created() {
this.getHomepageProductCategory() this.getHomepageProductCategory()
}, },
mounted() {
scheduleHomePageLayoutReset()
},
data() { data() {
return { return {
boxLoading: false, boxLoading: false,

View File

@ -570,9 +570,9 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.home-main-page { .home-main-page {
min-height: 100vh; width: 100%;
max-width: 100%;
min-width: 0; min-width: 0;
min-height: 100vh;
background-color: #f0f7ff !important; background-color: #f0f7ff !important;
background-image: linear-gradient(180deg, #f0f7ff 0%, #ffffff 60%, #f5f8ff 100%) !important; background-image: linear-gradient(180deg, #f0f7ff 0%, #ffffff 60%, #f5f8ff 100%) !important;
color: #111827; color: #111827;
@ -642,7 +642,7 @@ body.dark-theme .bg-orb {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 120px 24px 96px; padding: 120px 5% 96px;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
background: transparent; background: transparent;
@ -756,7 +756,7 @@ body.dark-theme .bg-orb {
.ai-solution-section { .ai-solution-section {
position: relative; position: relative;
padding: 60px 24px 110px; padding: 60px 5% 110px;
scroll-margin-top: 90px; scroll-margin-top: 90px;
overflow: hidden; overflow: hidden;
background: transparent; background: transparent;
@ -1153,7 +1153,7 @@ body.dark-theme .bg-orb {
.case-section { .case-section {
position: relative; position: relative;
padding: 96px 24px 112px; padding: 96px 5% 112px;
background: transparent; background: transparent;
} }
@ -1359,7 +1359,7 @@ body.dark-theme .bg-orb {
.news-section { .news-section {
position: relative; position: relative;
padding: 96px 24px 112px; padding: 96px 5% 112px;
overflow: hidden; overflow: hidden;
background: transparent; background: transparent;
} }

View File

@ -35,7 +35,6 @@
<script> <script>
import { reqNewsDetail } from '@/api/newsapi/newsapi' import { reqNewsDetail } from '@/api/newsapi/newsapi'
import { scheduleHomePageLayoutReset } from '@/utils/resetHomePageLayout'
export default { export default {
name: 'NewsDetail', name: 'NewsDetail',
@ -73,12 +72,19 @@ export default {
window.setTimeout(this.scrollToTop, 0) window.setTimeout(this.scrollToTop, 0)
}) })
}, },
mounted() {
scheduleHomePageLayoutReset()
},
methods: { methods: {
scrollToTop() { scrollToTop() {
scheduleHomePageLayoutReset() window.scrollTo(0, 0)
document.documentElement.scrollTop = 0
document.body.scrollTop = 0
const scrollContainers = [
document.querySelector('.homeOut'),
document.querySelector('.home-router-view'),
document.querySelector('#app')
].filter(Boolean)
scrollContainers.forEach((container) => {
container.scrollTop = 0
})
}, },
goBack() { goBack() {
this.$router.push('/homePage/news') this.$router.push('/homePage/news')

View File

@ -107,7 +107,6 @@
<script> <script>
import { reqNewsList } from '@/api/newsapi/newsapi' import { reqNewsList } from '@/api/newsapi/newsapi'
import { scheduleHomePageLayoutReset } from '@/utils/resetHomePageLayout'
export default { export default {
name: 'NewsView', name: 'NewsView',
data() { data() {
@ -158,12 +157,6 @@ export default {
created() { created() {
this.getNewsList() this.getNewsList()
}, },
mounted() {
scheduleHomePageLayoutReset()
},
activated() {
scheduleHomePageLayoutReset()
},
methods: { methods: {
goAbout() { goAbout() {
this.$router.push('/homePage/about') this.$router.push('/homePage/about')
@ -281,12 +274,12 @@ export default {
this.newsList = [] this.newsList = []
this.total = 0 this.total = 0
this.$message.error(this.$t('newsView.loadFail')) this.$message.error(this.$t('newsView.loadFail'))
} finally {
this.$nextTick(() => {
scheduleHomePageLayoutReset()
})
} }
} }
} }
} }
</script> </script>
<style scoped lang="less">
@import url('../../../assets/less/news/news.less');
</style>

View File

@ -102,8 +102,6 @@
</template> </template>
<script> <script>
import { scheduleHomePageLayoutReset } from '@/utils/resetHomePageLayout'
export default { export default {
name: 'TrainPlatform', name: 'TrainPlatform',
data() { data() {
@ -131,9 +129,6 @@ export default {
] ]
} }
}, },
mounted() {
scheduleHomePageLayoutReset()
},
methods: { methods: {
handleStart() { handleStart() {
this.$message.info('开始使用训推平台') this.$message.info('开始使用训推平台')

View File

@ -11,8 +11,10 @@
} }
.grid-bg { .grid-bg {
width: 100%; width: 100vw;
min-height: 100vh; min-height: 100vh;
margin-left: calc(50% - 50vw);
margin-right: calc(50% - 50vw);
overflow: hidden; overflow: hidden;
background: background:
linear-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1px), linear-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1px),

View File

@ -223,7 +223,6 @@
<script> <script>
import { reqNavList, reqNewHomeSync, reqNewHomeFestival } from "@/api/newHome"; import { reqNavList, reqNewHomeSync, reqNewHomeFestival } from "@/api/newHome";
import { gotoYuanJingAPI } from '@/api/gotoYuanJing' import { gotoYuanJingAPI } from '@/api/gotoYuanJing'
import { scheduleHomePageLayoutReset } from '@/utils/resetHomePageLayout'
const getImageUrlPrefix = () => { const getImageUrlPrefix = () => {
const origin = window.location.origin const origin = window.location.origin
@ -355,12 +354,8 @@ export default {
} }
}, },
async mounted() { async mounted() {
scheduleHomePageLayoutReset() await this.loadNavData();
await this.loadNavData() this.initializeDefaultData();
this.initializeDefaultData()
this.$nextTick(() => {
scheduleHomePageLayoutReset()
})
}, },
methods: { methods: {
// 判断当前一级分类是否为 TOKEN 市集,后续用于切换独立渲染逻辑。 // 判断当前一级分类是否为 TOKEN 市集,后续用于切换独立渲染逻辑。
@ -917,9 +912,11 @@ export default {
min-height: calc(100vh - 100px); min-height: calc(100vh - 100px);
&.single-product-page { &.single-product-page {
min-height: calc(100vh - 82px); height: 100vh;
min-height: 100vh;
padding: 82px 0 0; padding: 82px 0 0;
background: linear-gradient(180deg, #f3f7ff 0%, #ffffff 100%); background: linear-gradient(180deg, #f3f7ff 0%, #ffffff 100%);
overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
.product-content { .product-content {