{{ baseItem.description }}
+ {{ getBaseItemTitle() }} +{{ getBaseItemDescription() }}
- {{ netItem.description }} + {{ getNetItemDescription() }}
- 产品优势 + {{ translations[language].productAdvantage }}
- 天津
+ {{ translations[language].tianjin }}
- 四川
+ {{ translations[language].sichuan }}
- 上海
+ {{ translations[language].shanghai }}
- 江苏
+ {{ translations[language].jiangsu }}
尊敬用户:
-您好~~
-本平台公示的所有产品折扣活动均真实有效,价格体系严格遵循公开透明原则。
+ {{ translations[language].officialStatement }} +{{ translations[language].dearUser }}:
+{{ translations[language].greeting }}
+{{ translations[language].statement1 }}
- 特别说明:云服务产品页面所示价格属参考性标价,实际交易金额须以资源清单订单页面为准。{{ translations[language].statement2 }}
-请您知悉上述条款并放心进行购买决策,如有任何疑问,可随时联系平台官方客服,我们将为您详细说明。
+{{ translations[language].statement3 }}
@@ -368,6 +368,8 @@ import { mapState } from "vuex"; import IndexTwo from "@/views/homePage/mainPage/logoG/indexTwo.vue"; import HomePageSticky from "@/components/HomePageSticky/index.vue"; +// 导入语言管理 +import { languageStore, languageBus } from '@/utils/language' export default Vue.extend({ name: "mainPage", @@ -379,55 +381,195 @@ export default Vue.extend({ currentBaseMenu: "hot", currentNetMenu: "hot", currentSuanMenu: 'hot', - suanMenu: [ - { id: "hot", name: "热门推荐", icon: require("../newImg/niu.png"), activeIcon: require("../newImg/niuActive.png") }, - { id: "4090", name: "4090", icon: require("./img/suan/1.png"), activeIcon: require("./img/suan/1.png") }, - { id: "A100", name: "A100", icon: require("./img/suan/2.png"), activeIcon: require("./img/suan/2.png") }, - { id: "A800", name: "A800", icon: require("./img/suan/3.png"), activeIcon: require("./img/suan/3.png") }, - { id: "910B", name: "910B", icon: require("./img/suan/5.png"), activeIcon: require("./img/suan/5.png") } - ], - baseMenu: [ - { id: "hot", name: "热门推荐", icon: require("../newImg/niu.png"), activeIcon: require("../newImg/niuActive.png") }, - { id: "computing", name: "计算", icon: require("../newImg/computing.png"), activeIcon: require("../newImg/computingActive.png") }, - { id: "storage", name: "存储", icon: require("../newImg/cun.png"), activeIcon: require("../newImg/cunActive.png") }, - { id: "database", name: "数据库", icon: require("../newImg/database.png"), activeIcon: require("../newImg/databaseActive.png") }, - { id: "container", name: "人脸识别", icon: require("../newImg/container.png"), activeIcon: require("../newImg/containerActive.png") } - ], - netMenu: [ - { id: "hot", name: "热门推荐", icon: require("../newImg/niu.png"), activeIcon: require("../newImg/niuActive.png") }, - { id: "hlzx", name: "互联网专线", icon: require("./img/net/1.png"), activeIcon: require("./img/net/1.png") }, - { id: "SDWAN", name: "SDWAN", icon: require("./img/net/2.png"), activeIcon: require("./img/net/2.png") }, - { id: "DCI", name: "DCI", icon: require("./img/net/3.png"), activeIcon: require("./img/net/3.png") }, - { id: "AI", name: "AI专线", icon: require("./img/net/4.png"), activeIcon: require("./img/net/4.png") } - ], base: {}, baseItem: {}, net: {}, netItem: {}, suan: {}, suanItem: {}, - // 定义导航项数据,传递给子组件 - stickySections: [ - { title: '云筑企业基座', ref: 'baseSection' }, - { title: '智算未来征程', ref: 'suanSection' }, - { title: '网织智能经纬', ref: 'netSection' }, - ] + // 从共享状态获取语言 + language: languageStore.getLanguage(), + translations: { + zh: { + // Banner 区域 + aiButler: '您身边的AI管家', + slogan: '全 球 领 先 的 AI 服 务 运 营 商', + product1Name: '4090 裸金属', + product2Name: '云资源', + month: '台/月', + discount: '直降', + + // 基础产品区域 + baseTitle1: '云筑', + baseTitle2: '企业基座', + baseSubtitle: '多云融合 让上云更简单', + + // 智算区域 + suanTitle1: '智算', + suanTitle2: '未来征程', + suanSubtitle: '多元异构 灵活短租', + shortRent: '可短租', + + // 网络区域 + netTitle1: '网织', + netTitle2: '智能经纬', + netSubtitle: '云算网融合 让连接更简单', + productAdvantage: '产品优势', + applicationScenario: '应用场景', + partners: '合作伙伴', + + // 资源区域 + resourcesTitle1: '算力', + resourcesTitle2: '资源', + beijing: '北京', + tianjin: '天津', + sichuan: '四川', + shanghai: '上海', + jiangsu: '江苏', + computeCenters: '算力中心接入', + computingPower: '算力', + realTimeResponse: '实时算力响应', + registeredUsers: '注册用户', + + // 按钮文本 + buyNow: '立即购买', + consultNow: '立即咨询', + viewDetails: '查看详情', + experienceNow: '立即体验', + officialDiscount: '官网折扣', + + // 输入框 + phonePlaceholder: '请输入您的手机号', + + // 弹窗内容 + officialStatement: '官方申明', + dearUser: '尊敬用户', + greeting: '您好~~', + statement1: '本平台公示的所有产品折扣活动均真实有效,价格体系严格遵循公开透明原则。', + specialNote: '特别说明', + statement2: '云服务产品页面所示价格属参考性标价,实际交易金额须以资源清单订单页面为准。', + statement3: '请您知悉上述条款并放心进行购买决策,如有任何疑问,可随时联系平台官方客服,我们将为您详细说明。', + customerService: '客服热线', + currentDate: '2025年6月30日', + + // 菜单项 + hotRecommend: '热门推荐', + computing: '计算', + storage: '存储', + database: '数据库', + container: '人脸识别', + internetLine: '互联网专线', + sdwan: 'SDWAN', + dci: 'DCI', + aiLine: 'AI专线', + + // 粘性导航 + stickyBase: '云筑企业基座', + stickySuan: '智算未来征程', + stickyNet: '网织智能经纬' + }, + en: { + // Banner 区域 + aiButler: 'Your AI Butler', + slogan: 'Leading AI Service Operator Worldwide', + product1Name: '4090 Bare Metal', + product2Name: 'Cloud Resources', + month: 'unit/month', + discount: 'Off', + + // 基础产品区域 + baseTitle1: 'Cloud Build', + baseTitle2: 'Enterprise Foundation', + baseSubtitle: 'Multi-cloud integration makes cloud migration easier', + + // 智算区域 + suanTitle1: 'Intelligent Computing', + suanTitle2: 'Future Journey', + suanSubtitle: 'Multi-source heterogeneous Flexible short-term rental', + shortRent: 'Short rent available', + + // 网络区域 + netTitle1: 'Network Weaving', + netTitle2: 'Smart Framework', + netSubtitle: 'Cloud-computing-network integration makes connection easier', + productAdvantage: 'Product Advantages', + applicationScenario: 'Application Scenarios', + partners: 'Partners', + + // 资源区域 + resourcesTitle1: 'Computing', + resourcesTitle2: 'Resources', + beijing: 'Beijing', + tianjin: 'Tianjin', + sichuan: 'Sichuan', + shanghai: 'Shanghai', + jiangsu: 'Jiangsu', + computeCenters: 'Compute Centers Access', + computingPower: 'Computing Power', + realTimeResponse: 'Real-time Response', + registeredUsers: 'Registered Users', + + // 按钮文本 + buyNow: 'Buy Now', + consultNow: 'Consult Now', + viewDetails: 'View Details', + experienceNow: 'Experience Now', + officialDiscount: 'Official Discount', + + // 输入框 + phonePlaceholder: 'Please enter your phone number', + + // 弹窗内容 + officialStatement: 'Official Statement', + dearUser: 'Dear User', + greeting: 'Hello~~', + statement1: 'All product discount activities displayed on this platform are valid and the pricing system strictly follows the principle of transparency.', + specialNote: 'Special Note', + statement2: 'The prices shown on cloud service product pages are reference prices, and the actual transaction amount shall be subject to the resource list order page.', + statement3: 'Please be aware of the above terms and make purchase decisions with confidence. If you have any questions, please contact our official customer service at any time for detailed explanation.', + customerService: 'Customer Service', + currentDate: 'June 30, 2025', + + // 菜单项 + hotRecommend: 'Hot Recommend', + computing: 'Computing', + storage: 'Storage', + database: 'Database', + container: 'Face Recognition', + internetLine: 'Internet Line', + sdwan: 'SDWAN', + dci: 'DCI', + aiLine: 'AI Line', + + // 粘性导航 + stickyBase: 'Cloud Enterprise Foundation', + stickySuan: 'Intelligent Computing Journey', + stickyNet: 'Smart Network Framework' + } + } } }, + created() { + // 监听语言变化事件 + languageBus.$on('language-changed', (lang) => { + this.language = lang + }) + }, mounted() { // 监听滚动 控制sticky显示隐藏 document.getElementById("homeOut").addEventListener('scroll', (e) =>{ - - // console.log("滚动条事件",e.target.scrollTop); - if (e.target.scrollTop > 500) { - document.getElementById('sticky').style.display = 'block' - } else { - document.getElementById('sticky').style.display = 'none' - } - + if (e.target.scrollTop > 500) { + document.getElementById('sticky').style.display = 'block' + } else { + document.getElementById('sticky').style.display = 'none' + } }) this.initData() }, + beforeDestroy() { + // 移除事件监听 + languageBus.$off('language-changed') + }, computed: { ...mapState({ logoInfoNew: state => state.product.logoInfoNew, @@ -438,6 +580,120 @@ export default Vue.extend({ }, }, methods: { + // 获取粘性导航数据 + getStickySections() { + return [ + { title: this.translations[this.language].stickyBase, ref: 'baseSection' }, + { title: this.translations[this.language].stickySuan, ref: 'suanSection' }, + { title: this.translations[this.language].stickyNet, ref: 'netSection' }, + ] + }, + + // 获取基础菜单 + getBaseMenu() { + return [ + { id: "hot", name: this.translations[this.language].hotRecommend, icon: require("../newImg/niu.png"), activeIcon: require("../newImg/niuActive.png") }, + { id: "computing", name: this.translations[this.language].computing, icon: require("../newImg/computing.png"), activeIcon: require("../newImg/computingActive.png") }, + { id: "storage", name: this.translations[this.language].storage, icon: require("../newImg/cun.png"), activeIcon: require("../newImg/cunActive.png") }, + { id: "database", name: this.translations[this.language].database, icon: require("../newImg/database.png"), activeIcon: require("../newImg/databaseActive.png") }, + { id: "container", name: this.translations[this.language].container, icon: require("../newImg/container.png"), activeIcon: require("../newImg/containerActive.png") } + ] + }, + + // 获取智算菜单 + getSuanMenu() { + return [ + { id: "hot", name: this.translations[this.language].hotRecommend, icon: require("../newImg/niu.png"), activeIcon: require("../newImg/niuActive.png") }, + { id: "4090", name: "4090", icon: require("./img/suan/1.png"), activeIcon: require("./img/suan/1.png") }, + { id: "A100", name: "A100", icon: require("./img/suan/2.png"), activeIcon: require("./img/suan/2.png") }, + { id: "A800", name: "A800", icon: require("./img/suan/3.png"), activeIcon: require("./img/suan/3.png") }, + { id: "910B", name: "910B", icon: require("./img/suan/5.png"), activeIcon: require("./img/suan/5.png") } + ] + }, + + // 获取网络菜单 + getNetMenu() { + return [ + { id: "hot", name: this.translations[this.language].hotRecommend, icon: require("../newImg/niu.png"), activeIcon: require("../newImg/niuActive.png") }, + { id: "hlzx", name: this.translations[this.language].internetLine, icon: require("./img/net/1.png"), activeIcon: require("./img/net/1.png") }, + { id: "SDWAN", name: this.translations[this.language].sdwan, icon: require("./img/net/2.png"), activeIcon: require("./img/net/2.png") }, + { id: "DCI", name: this.translations[this.language].dci, icon: require("./img/net/3.png"), activeIcon: require("./img/net/3.png") }, + { id: "AI", name: this.translations[this.language].aiLine, icon: require("./img/net/4.png"), activeIcon: require("./img/net/4.png") } + ] + }, + + // 获取Banner标题 + getBannerTitle() { + if (this.language === 'en') { + // 这里可以根据需要提供英文的banner标题 + return this.logoInfoNew.home.bannerTitle || "" + } + return this.logoInfoNew.home.bannerTitle || "" + }, + + // 获取基础产品标题 + getBaseItemTitle() { + if (this.language === 'en') { + // 这里可以根据实际数据结构提供英文标题 + return this.baseItem.title || "" + } + return this.baseItem.title || "" + }, + + // 获取基础产品描述 + getBaseItemDescription() { + if (this.language === 'en') { + // 这里可以根据实际数据结构提供英文描述 + return this.baseItem.description || "" + } + return this.baseItem.description || "" + }, + + // 获取基础产品列表 + getBaseItemList() { + // 这里可以处理产品列表的翻译 + return this.baseItem.list || [] + }, + + // 获取智算产品标题 + getSuanItemTitle() { + if (this.language === 'en') { + return this.suanItem.title || "" + } + return this.suanItem.title || "" + }, + + // 获取智算产品列表 + getSuanItemList() { + return this.suanItem.list || [] + }, + + // 获取网络产品标题 + getNetItemTitle() { + if (this.language === 'en') { + return this.netItem.title || "" + } + return this.netItem.title || "" + }, + + // 获取网络产品描述 + getNetItemDescription() { + if (this.language === 'en') { + return this.netItem.description || "" + } + return this.netItem.description || "" + }, + + // 获取网络产品优势列表 + getNetAdvantageList() { + return this.netItem.advantageList || [] + }, + + // 获取网络产品标签列表 + getNetTagList() { + return this.netItem.tagList || [] + }, + goBaiduFn(item) { if (this.loginState) { this.$store.commit('setRedirectUrl', item.url) @@ -507,7 +763,7 @@ export default Vue.extend({ // 处理来自子组件的导航事件 handleNavigation(index) { console.log('父组件接收到导航事件,索引:', index); - const sectionRef = this.stickySections[index]?.ref; + const sectionRef = this.getStickySections()[index]?.ref; if (sectionRef && this.$refs[sectionRef]) { // 使用原生 scrollIntoView 实现平滑滚动 this.$refs[sectionRef].scrollIntoView({ @@ -515,14 +771,16 @@ export default Vue.extend({ block: 'start', inline: 'start' }); - } } - }, + } }) + + - - - -