This commit is contained in:
hrx 2025-11-25 15:52:13 +08:00
parent 013ce924bb
commit b7f234f613
6 changed files with 67 additions and 184 deletions

View File

@ -270,7 +270,7 @@ Vue.use(HappyScroll)
// console.log('防调试保护已启用'); // console.log('防调试保护已启用');
// } // }
// ==================== 防 F12 和右键检查功能结束 ==================== // ==================== 防F12和右键检查功能结束 ====================
Vue.use(Element, { Vue.use(Element, {
size: Cookies.get('size') || 'medium' // set element-ui default size size: Cookies.get('size') || 'medium' // set element-ui default size

View File

@ -13,8 +13,8 @@
<div class="nav-list"> <div class="nav-list">
<!-- 首页 --> <!-- 首页 -->
<p :class="{ active: $route.path.includes('/index') }"> <p :class="{ active: $route.path.includes('/index') }">
<!-- 动态判断域名跳转首页 -->
<a @click="$router.push('/homePage/index')">{{ translations[language].home }}</a> <a @click="goHome">{{ translations[language].home }}</a>
</p> </p>
<!-- 产品与服务鼠标移入显示子菜单 --> <!-- 产品与服务鼠标移入显示子菜单 -->
<p @mouseleave="sildeOut" @mouseenter="sildeIn(product_service)"> <p @mouseleave="sildeOut" @mouseenter="sildeIn(product_service)">
@ -35,18 +35,13 @@
<!-- 用户区域登录/注册按钮和用户下拉菜单 --> <!-- 用户区域登录/注册按钮和用户下拉菜单 -->
<div class="user-area"> <div class="user-area">
<!-- 中英互译 -->
<!-- <div class="language-toggle" @click="toggleLanguage">
<span class="iconfont icon-ditu_diqiu_o"></span>
<span class="language-text">{{ language === 'zh' ? 'English' : '中文' }}</span>
</div> -->
<!-- AI --> <!-- AI -->
<i class="iconfont icon-AIzhushou functions" @click="handleAIClick"></i> <i class="iconfont icon-AIzhushou functions" @click="handleAIClick"></i>
<!-- 客服 --> <!-- 客服 -->
<i class="iconfont icon-kefu functions" @click="handleServiceClick"></i> <i class="iconfont icon-kefu functions" @click="handleServiceClick"></i>
<!-- 控制台按钮已登录 --> <!-- 控制台按钮已登录 -->
<a @click="goB" v-if="loginState" class="login-btn">{{ translations[language].console }}</a> <a @click="goB" v-if="loginState" class="login-btn">{{ translations[language].console }}</a>
<!-- 消息 - 修改这里点击时打开消息中心 --> <!-- 消息 -->
<i class="iconfont icon-xiaoxi functions" @click="handleMessageClick"></i> <i class="iconfont icon-xiaoxi functions" @click="handleMessageClick"></i>
<!-- 登录按钮未登录 --> <!-- 登录按钮未登录 -->
<a @click="$router.push({ <a @click="$router.push({
@ -62,29 +57,25 @@
<!-- 用户下拉菜单已登录 --> <!-- 用户下拉菜单已登录 -->
<el-dropdown v-if="loginState" @visible-change="handleShow" <el-dropdown v-if="loginState" @visible-change="handleShow"
class="avatar-container right-menu-item hover-effect nick-name-style" style="margin-right: 0" trigger="click"> class="avatar-container right-menu-item hover-effect nick-name-style" style="margin-right: 0" trigger="click">
<div class="avatar-wrapper"> <!-- 头像区域添加点击事件 -->
<!-- 显示用户名首字母头像和用户名 --> <div class="avatar-wrapper" @click="goHome">
<i <i
style="font-size: 18px; color: #262626;font-weight: 400;cursor: pointer;display: flex;justify-content: flex-end;align-items: center"> style="font-size: 18px; color: #262626;font-weight: 400;cursor: pointer;display: flex;justify-content: flex-end;align-items: center">
<div class="imgUser"><img src="../../../../assets/image/user.png" alt=""></div> <div class="imgUser"><img src="../../../../assets/image/user.png" alt=""></div>
{{ nick_name }} {{ nick_name }}
<!-- 下拉箭头图标 -->
<i id="resverIcon" class="el-icon-arrow-up el-icon--right resverIcon"></i> <i id="resverIcon" class="el-icon-arrow-up el-icon--right resverIcon"></i>
</i> </i>
</div> </div>
<!-- 用户信息下拉菜单内容 --> <!-- 用户信息下拉菜单内容 -->
<el-dropdown-menu slot="dropdown" style="width: 230px;font-size: 16px;" divided> <el-dropdown-menu slot="dropdown" style="width: 230px;font-size: 16px;" divided>
<!-- 用户信息头部 -->
<div style="display: flex;flex-direction: column;padding:15px 15px;background-color: #f0f2f5"> <div style="display: flex;flex-direction: column;padding:15px 15px;background-color: #f0f2f5">
<span style="font-weight: bold;font-size: 20px;margin-bottom: 5px;color: #333333">{{ nick_name }}</span> <span style="font-weight: bold;font-size: 20px;margin-bottom: 5px;color: #333333">{{ nick_name }}</span>
<span style="font-size: 12px;color:#666;display: flex;justify-content:flex-start;align-items: center"> ID: <span style="font-size: 12px;color:#666;display: flex;justify-content:flex-start;align-items: center"> ID:
<!-- 用户ID点击复制按钮可复制 -->
<span ref="contentToCopy"> <span ref="contentToCopy">
{{ {{
userId userId
}} }}
</span> </span>
<!-- 复制按钮 -->
<svg @click="copyBtn" class="copy-btn" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" <svg @click="copyBtn" class="copy-btn" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"
width="12" height="12" style="fill: #1019ab;"> width="12" height="12" style="fill: #1019ab;">
<path <path
@ -93,9 +84,7 @@
</svg> </svg>
</span> </span>
</div> </div>
<!-- 分割线 -->
<el-divider style="margin: 0!important;"></el-divider> <el-divider style="margin: 0!important;"></el-divider>
<!-- 客户角色余额和充值按钮 -->
<div v-if="role.includes('客户')" <div v-if="role.includes('客户')"
style="padding: 0 18px; width: 100%;height: 60px;display: flex;justify-content: space-between;align-items: center"> style="padding: 0 18px; width: 100%;height: 60px;display: flex;justify-content: space-between;align-items: center">
<span style="color:#666;display: block;font-size: 14px;" class="moneyNow"><span <span style="color:#666;display: block;font-size: 14px;" class="moneyNow"><span
@ -107,11 +96,9 @@
{{ translations[language].recharge }} {{ translations[language].recharge }}
</el-button> </el-button>
</div> </div>
<!-- 个人中心菜单项 -->
<el-dropdown-item v-if="role.includes('客户')" @click.native="$router.push('/customer/customerInformation')"> <el-dropdown-item v-if="role.includes('客户')" @click.native="$router.push('/customer/customerInformation')">
<span style="display: block">{{ translations[language].personalCenter }}</span> <span style="display: block">{{ translations[language].personalCenter }}</span>
</el-dropdown-item> </el-dropdown-item>
<!-- 退出登录菜单项 -->
<el-dropdown-item @click.native="logout"> <el-dropdown-item @click.native="logout">
<span style="display: block">{{ translations[language].logout }}</span> <span style="display: block">{{ translations[language].logout }}</span>
</el-dropdown-item> </el-dropdown-item>
@ -120,10 +107,9 @@
</div> </div>
</div> </div>
<!-- 悬浮面板显示生态与合作的详细子菜单 --> <!-- 悬浮面板 -->
<div @mouseleave="sildeOut" @mouseenter="keepPanel" v-show="isShowPanel" class="panel"> <div @mouseleave="sildeOut" @mouseenter="keepPanel" v-show="isShowPanel" class="panel">
<div class="inPanel"> <div class="inPanel">
<!-- 左侧面板一级和二级菜单 -->
<div class="panelLeft"> <div class="panelLeft">
<ul class="outUl"> <ul class="outUl">
<li style="cursor: default" class="outLi" v-for="item in showPanelData" :key="item.firTitle"> <li style="cursor: default" class="outLi" v-for="item in showPanelData" :key="item.firTitle">
@ -141,9 +127,7 @@
</li> </li>
</ul> </ul>
</div> </div>
<!-- 分隔线 -->
<span class="ge"></span> <span class="ge"></span>
<!-- 左侧面板三级菜单如果存在且不等于二级菜单标题 -->
<div <div
v-if="secMenuData.length > 0 && secMenuData[0].thrMenu && secMenuData[0].thrMenu.length > 0 && secMenuData[0].thrMenu[0].thrTitle != null && secMenuData[0].secTitle !== secMenuData[0].thrMenu[0].thrTitle" v-if="secMenuData.length > 0 && secMenuData[0].thrMenu && secMenuData[0].thrMenu.length > 0 && secMenuData[0].thrMenu[0].thrTitle != null && secMenuData[0].secTitle !== secMenuData[0].thrMenu[0].thrTitle"
class="panelLeft"> class="panelLeft">
@ -154,11 +138,9 @@
</li> </li>
</ul> </ul>
</div> </div>
<!-- 分隔线 -->
<span <span
v-if="secMenuData.length > 0 && secMenuData[0].thrMenu && secMenuData[0].thrMenu.length > 0 && secMenuData[0].thrMenu[0].thrTitle != null && secMenuData[0].secTitle !== secMenuData[0].thrMenu[0].thrTitle" v-if="secMenuData.length > 0 && secMenuData[0].thrMenu && secMenuData[0].thrMenu.length > 0 && secMenuData[0].thrMenu[0].thrTitle != null && secMenuData[0].secTitle !== secMenuData[0].thrMenu[0].thrTitle"
class="ge"></span> class="ge"></span>
<!-- 右侧面板最细粒度的菜单项 -->
<div class="panelRight" <div class="panelRight"
v-if="showPanelRightData.length > 0 && showPanelRightData[0] && showPanelRightData[0].value"> v-if="showPanelRightData.length > 0 && showPanelRightData[0] && showPanelRightData[0].value">
<ul class="leastMenu inBox"> <ul class="leastMenu inBox">
@ -169,7 +151,6 @@
</li> </li>
</ul> </ul>
</div> </div>
<!-- 当没有数据时显示空状态 -->
<div class="panelRight" v-else> <div class="panelRight" v-else>
<div style="text-align: center; color: #999; padding: 20px;"> <div style="text-align: center; color: #999; padding: 20px;">
{{ translations[language].noData }} {{ translations[language].noData }}
@ -190,23 +171,14 @@
<script> <script>
import Vue from 'vue' import Vue from 'vue'
//
import { computingData, networkData, storageData, testData } from "@/views/homePage/components/topBox/testData"; import { computingData, networkData, storageData, testData } from "@/views/homePage/components/topBox/testData";
// API
import { reqNavList, reqNewHomeFestival, reqNewHomeSync } from "@/api/newHome"; import { reqNavList, reqNewHomeFestival, reqNewHomeSync } from "@/api/newHome";
// Vuex
import { mapGetters, mapState } from "vuex"; import { mapGetters, mapState } from "vuex";
// API
import { getLogoAPI, getUserInfoAPI } from "@/api/login"; import { getLogoAPI, getUserInfoAPI } from "@/api/login";
import { reqApplyChannel } from "@/api/customer/channel"; import { reqApplyChannel } from "@/api/customer/channel";
// store
import store from "@/store"; import store from "@/store";
//
import { getHomePath } from '@/views/setting/tools' import { getHomePath } from '@/views/setting/tools'
//
import { languageStore, languageBus } from '@/utils/language' import { languageStore, languageBus } from '@/utils/language'
//
import MessageCenter from '@/components/MessageCenter/MessageCenter.vue' import MessageCenter from '@/components/MessageCenter/MessageCenter.vue'
export default Vue.extend({ export default Vue.extend({
@ -216,25 +188,25 @@ export default Vue.extend({
}, },
data() { data() {
return { return {
messageCenterVisible: false, // messageCenterVisible: false,
homePath: getHomePath(), // homePath: getHomePath(),
isShowKbossCharge: false, // Kboss isShowKbossCharge: false,
role: sessionStorage.getItem("jueseNew") == "admin" ? [] : sessionStorage.getItem("jueseNew"), // role: sessionStorage.getItem("jueseNew") == "admin" ? [] : sessionStorage.getItem("jueseNew"),
userId: sessionStorage.getItem("userId"), // ID userId: sessionStorage.getItem("userId"),
firId: "", // ID firId: "",
secId: "", // ID secId: "",
nick_name: "", // nick_name: "",
showTimer: null, // showTimer: null,
hideTimer: null, // hideTimer: null,
showPanelData: [], // showPanelData: [],
secMenuData: [], // secMenuData: [],
showPanelRightData: [], // showPanelRightData: [],
threeData: [], // threeData: [],
fourData: [], // 使 fourData: [],
product_service: [], // product_service: [],
language: 'zh', // language: 'zh',
languageChangedHandler: null, // languageChangedHandler: null,
messageCount: 0, // messageCount: 0,
translations: { translations: {
zh: { zh: {
home: '首页', home: '首页',
@ -253,17 +225,14 @@ export default Vue.extend({
aiAssistant: 'AI助手', aiAssistant: 'AI助手',
customerService: '在线客服', customerService: '在线客服',
featureComingSoon: '功能即将上线,敬请期待!', featureComingSoon: '功能即将上线,敬请期待!',
//
'云': '云', '云': '云',
'算': '算', '算': '算',
'网': '网', '网': '网',
'用': '用', '用': '用',
//
'百度云': '百度云', '百度云': '百度云',
'智算': '智算', '智算': '智算',
'算力网络': '算力网络', '算力网络': '算力网络',
'AI应用': 'AI应用', 'AI应用': 'AI应用',
//
'计算': '计算', '计算': '计算',
'网络': '网络', '网络': '网络',
'存储': '存储', '存储': '存储',
@ -279,7 +248,6 @@ export default Vue.extend({
'智能短信': '智能短信', '智能短信': '智能短信',
'智慧医疗': '智慧医疗', '智慧医疗': '智慧医疗',
'智慧客服': '智慧客服', '智慧客服': '智慧客服',
//
'云服务器_GPU': '云服务器_GPU', '云服务器_GPU': '云服务器_GPU',
'云服务器_BCC': '云服务器_BCC', '云服务器_BCC': '云服务器_BCC',
'专属服务器': '专属服务器', '专属服务器': '专属服务器',
@ -368,17 +336,14 @@ export default Vue.extend({
aiAssistant: 'AI Assistant', aiAssistant: 'AI Assistant',
customerService: 'Customer Service', customerService: 'Customer Service',
featureComingSoon: 'Feature coming soon, stay tuned!', featureComingSoon: 'Feature coming soon, stay tuned!',
//
'云': 'Cloud', '云': 'Cloud',
'算': 'Computing', '算': 'Computing',
'网': 'Network', '网': 'Network',
'用': 'Application', '用': 'Application',
//
'百度云': 'Baidu Cloud', '百度云': 'Baidu Cloud',
'智算': 'Intelligent Computing', '智算': 'Intelligent Computing',
'算力网络': 'Computing Power Network', '算力网络': 'Computing Power Network',
'AI应用': 'AI Application', 'AI应用': 'AI Application',
//
'计算': 'Compute', '计算': 'Compute',
'网络': 'Network', '网络': 'Network',
'存储': 'Storage', '存储': 'Storage',
@ -394,7 +359,6 @@ export default Vue.extend({
'智能短信': 'Smart SMS', '智能短信': 'Smart SMS',
'智慧医疗': 'Smart Healthcare', '智慧医疗': 'Smart Healthcare',
'智慧客服': 'Smart Customer Service', '智慧客服': 'Smart Customer Service',
//
'云服务器_GPU': 'Cloud Server GPU', '云服务器_GPU': 'Cloud Server GPU',
'云服务器_BCC': 'Cloud Server BCC', '云服务器_BCC': 'Cloud Server BCC',
'专属服务器': 'Dedicated Server', '专属服务器': 'Dedicated Server',
@ -470,30 +434,19 @@ export default Vue.extend({
} }
}, },
created() { created() {
// homePath
this.homePath = getHomePath() this.homePath = getHomePath()
// sessionStorageuserIdtrue
if (sessionStorage.getItem('userId')) { if (sessionStorage.getItem('userId')) {
this.$store.commit('setLoginState', true); // Vuex this.$store.commit('setLoginState', true);
} }
//
!this.showRegisterButton && this.getUserInfo(); !this.showRegisterButton && this.getUserInfo();
//
this.init() this.init()
//
this.initLanguage() this.initLanguage()
//
this.initData() this.initData()
}, },
mounted() { mounted() {
// sessionStorage
if (sessionStorage.getItem("username")) { if (sessionStorage.getItem("username")) {
this.nick_name = sessionStorage.getItem("username"); this.nick_name = sessionStorage.getItem("username");
} }
//
this.$nextTick(() => { this.$nextTick(() => {
const topContainer = document.getElementById('topContainer'); const topContainer = document.getElementById('topContainer');
if (topContainer) { if (topContainer) {
@ -505,40 +458,37 @@ export default Vue.extend({
}); });
}, },
beforeDestroy() { beforeDestroy() {
//
if (this.languageChangedHandler) { if (this.languageChangedHandler) {
languageBus.$off('language-changed', this.languageChangedHandler) languageBus.$off('language-changed', this.languageChangedHandler)
} }
}, },
computed: { computed: {
// Vuexgetters
...mapGetters(["sidebar", "avatar", "device"]), ...mapGetters(["sidebar", "avatar", "device"]),
// Vuexstate
...mapState({ ...mapState({
isShowPanel: (state) => state.product.showHomeNav, // isShowPanel: (state) => state.product.showHomeNav,
navIndex: (state) => state.product.navIndex, // navIndex: (state) => state.product.navIndex,
gridObj: state => state.operationAnalysis.gridObj, // 使 gridObj: state => state.operationAnalysis.gridObj,
mybalance: state => state.user.mybalance, // mybalance: state => state.user.mybalance,
logoutUrl: state => state.login.logoutUrl, // 退URL logoutUrl: state => state.login.logoutUrl,
loginStateVuex: state => state.login.loginState, // Vuex loginStateVuex: state => state.login.loginState,
logoInfoNew: state => state.product.logoInfoNew, // Logo logoInfoNew: state => state.product.logoInfoNew,
}), }),
// VuexsessionStorageuserId
loginState() { loginState() {
const userId = sessionStorage.getItem('userId'); const userId = sessionStorage.getItem('userId');
return this.loginStateVuex || (userId !== null && userId !== 'null' && userId !== ''); return this.loginStateVuex || (userId !== null && userId !== 'null' && userId !== '');
}, },
//
showRegisterButton() { showRegisterButton() {
const orgType = window.sessionStorage.getItem('org_type'); const orgType = window.sessionStorage.getItem('org_type');
const userId = window.sessionStorage.getItem('userId'); const userId = window.sessionStorage.getItem('userId');
console.log("此时是:", orgType !== '2' && orgType !== '3' && userId !== null)
return orgType !== '2' && orgType !== '3' && userId === null; return orgType !== '2' && orgType !== '3' && userId === null;
}, },
//
username() { username() {
return sessionStorage.getItem('username') || ''; return sessionStorage.getItem('username') || '';
}, },
// ncmatch.cn
isNcmatchDomain() {
return window.location.hostname.includes('ncmatch.cn');
}
}, },
methods: { methods: {
// AI // AI
@ -548,7 +498,6 @@ export default Vue.extend({
duration: 3000, duration: 3000,
showClose: true showClose: true
}); });
}, },
// //
@ -563,14 +512,11 @@ export default Vue.extend({
// //
handleMessageClick() { handleMessageClick() {
if (this.loginState) { if (this.loginState) {
//
this.messageCenterVisible = true; this.messageCenterVisible = true;
//
if (this.$refs.messageCenter) { if (this.$refs.messageCenter) {
this.$refs.messageCenter.open(); this.$refs.messageCenter.open();
} }
} else { } else {
//
this.handleGoLogin() this.handleGoLogin()
} }
}, },
@ -582,51 +528,26 @@ export default Vue.extend({
// //
initLanguage() { initLanguage() {
// store
this.language = languageStore.getLanguage() this.language = languageStore.getLanguage()
console.log('topBox初始化语言:', this.language)
// 便
this.languageChangedHandler = (lang) => { this.languageChangedHandler = (lang) => {
console.log('topBox接收到语言变化:', lang)
this.language = lang this.language = lang
} }
//
languageBus.$on('language-changed', this.languageChangedHandler) languageBus.$on('language-changed', this.languageChangedHandler)
}, },
// - 使 //
toggleLanguage() { toggleLanguage() {
const newLanguage = this.language === 'zh' ? 'en' : 'zh'; const newLanguage = this.language === 'zh' ? 'en' : 'zh';
console.log('topBox切换语言到:', newLanguage);
// 使
languageStore.setLanguage(newLanguage); languageStore.setLanguage(newLanguage);
//
setTimeout(() => {
console.log('切换后验证 - topBox语言:', this.language);
console.log('切换后验证 - store语言:', languageStore.getLanguage());
}, 200);
}, },
// //
getTranslation(key) { getTranslation(key) {
if (!key) return '' if (!key) return ''
return this.translations[this.language]?.[key] || key return this.translations[this.language]?.[key] || key
}, },
// //
debugLanguage() {
console.log('=== topBox语言调试信息 ===');
console.log('当前语言:', this.language);
console.log('languageStore状态:', languageStore.getLanguage());
console.log('localStorage状态:', localStorage.getItem('language'));
languageStore.debug();
},
//
goB() { goB() {
if (sessionStorage.getItem('jueseNew').includes('客户')) { if (sessionStorage.getItem('jueseNew').includes('客户')) {
this.$router.push('/product/productHome') this.$router.push('/product/productHome')
@ -638,7 +559,6 @@ export default Vue.extend({
// Logo // Logo
init() { init() {
let remoteUrl = '' let remoteUrl = ''
// APIURL
if (window.location.href.includes("dev")) { if (window.location.href.includes("dev")) {
remoteUrl = 'https://www.kaiyuancloud.cn/dev/reseller/get_ipc_logo.dspy' remoteUrl = 'https://www.kaiyuancloud.cn/dev/reseller/get_ipc_logo.dspy'
} else if (window.location.href.includes("localhost")) { } else if (window.location.href.includes("localhost")) {
@ -648,13 +568,10 @@ export default Vue.extend({
} }
let params = { let params = {
url_link: window.location.href.split("#")[0] // URL url_link: window.location.href.split("#")[0]
} }
getLogoAPI(params).then((res) => { getLogoAPI(params).then((res) => {
console.log("获取接口触发了")
if (res.status == true && res.data && res.data.length) { if (res.status == true && res.data && res.data.length) {
console.log("res.data[0].additional_msg", res.data[0].additional_msg)
// LogoVuex
this.$store.commit('setLogoInfoNew', res.data[0].additional_msg); this.$store.commit('setLogoInfoNew', res.data[0].additional_msg);
this.isShow = true this.isShow = true
if (res.data[0].orgname == '中关村数智人工智能产业联盟') { if (res.data[0].orgname == '中关村数智人工智能产业联盟') {
@ -665,7 +582,6 @@ export default Vue.extend({
if (this.photosUrl.orgname != '业主机构') { if (this.photosUrl.orgname != '业主机构') {
this.isLogo = true this.isLogo = true
this.logoImg = this.photosUrl.logo; this.logoImg = this.photosUrl.logo;
this.$store.commit('setLogo', this.photosUrl.logo) this.$store.commit('setLogo', this.photosUrl.logo)
this.logoText = this.photosUrl.orgname; this.logoText = this.photosUrl.orgname;
} else { } else {
@ -673,7 +589,6 @@ export default Vue.extend({
} }
} else { } else {
this.$message({ this.$message({
// message: res.msg,
message: "获取ipc失败~", message: "获取ipc失败~",
type: "error", type: "error",
}); });
@ -683,24 +598,19 @@ export default Vue.extend({
// 退 // 退
async logout() { async logout() {
this.$store.commit('setLoginState', false) // Vuexfalse this.$store.commit('setLoginState', false)
//
store.commit('tagsView/resetBreadcrumbState'); store.commit('tagsView/resetBreadcrumbState');
sessionStorage.removeItem("auths"); sessionStorage.removeItem("auths");
sessionStorage.removeItem("routes"); sessionStorage.removeItem("routes");
sessionStorage.removeItem("user"); sessionStorage.removeItem("user");
sessionStorage.removeItem("userId"); sessionStorage.removeItem("userId");
sessionStorage.removeItem("org_type") sessionStorage.removeItem("org_type")
localStorage.removeItem("auths"); localStorage.removeItem("auths");
localStorage.removeItem("routes"); localStorage.removeItem("routes");
localStorage.removeItem("user"); localStorage.removeItem("user");
localStorage.removeItem("userId"); localStorage.removeItem("userId");
localStorage.removeItem("org_type") localStorage.removeItem("org_type")
localStorage.removeItem('userId') localStorage.removeItem('userId')
//
if (!window.location.href.includes('homePage/index')) { if (!window.location.href.includes('homePage/index')) {
await this.$router.push(getHomePath()); await this.$router.push(getHomePath());
} }
@ -724,7 +634,7 @@ export default Vue.extend({
}) })
}, },
// sessionStorage //
initMybalance() { initMybalance() {
return sessionStorage.getItem('mybalance') return sessionStorage.getItem('mybalance')
}, },
@ -742,10 +652,8 @@ export default Vue.extend({
// //
async getUserInfo() { async getUserInfo() {
if (!this.userId) return; if (!this.userId) return;
getUserInfoAPI({ id: this.userId }).then((res) => { getUserInfoAPI({ id: this.userId }).then((res) => {
if (res.status) { if (res.status) {
// this.nick_name = res.data[0].nick_name;
this.userInfoList = res.data; this.userInfoList = res.data;
sessionStorage.setItem("orgid", res.data[0].orgid); sessionStorage.setItem("orgid", res.data[0].orgid);
} else { } else {
@ -760,21 +668,18 @@ export default Vue.extend({
// / // /
handleShow(isShow) { handleShow(isShow) {
let resverNode = document.getElementById('resverIcon') let resverNode = document.getElementById('resverIcon')
if (isShow) { if (isShow) {
if (this.role.includes('客户')) { if (this.role.includes('客户')) {
this.$store.dispatch('user/getCustmoersMoney') // this.$store.dispatch('user/getCustmoersMoney')
} }
resverNode.style.transform = 'rotate(180deg)'
resverNode.style.transform = 'rotate(180deg)' //
} else { } else {
resverNode.style.transform = 'rotate(0)' // resverNode.style.transform = 'rotate(0)'
} }
}, },
// //
sildeThrMenu(item) { sildeThrMenu(item) {
console.log("it", item)
let res = [] let res = []
res.push(item) res.push(item)
this.showPanelRightData = res this.showPanelRightData = res
@ -782,15 +687,12 @@ export default Vue.extend({
// //
clickGo(item) { clickGo(item) {
this.$store.commit('setShowHomeNav', false) // this.$store.commit('setShowHomeNav', false)
console.log("电机的item是", item)
let userId = sessionStorage.getItem('userId') let userId = sessionStorage.getItem('userId')
const orgType = window.sessionStorage.getItem('org_type'); const orgType = window.sessionStorage.getItem('org_type');
let isKehu = orgType === '2' || orgType === '3'; let isKehu = orgType === '2' || orgType === '3';
console.log("userId", userId)
if (item.type === '百度云') { if (item.type === '百度云') {
if (this.loginState) { if (this.loginState) {
//
this.$store.commit('setRedirectUrl', item.url) this.$store.commit('setRedirectUrl', item.url)
localStorage.setItem('redirectUrl', item.url) localStorage.setItem('redirectUrl', item.url)
localStorage.setItem('userRescourseUrl', item.listUrl) localStorage.setItem('userRescourseUrl', item.listUrl)
@ -814,12 +716,11 @@ export default Vue.extend({
} }
} else if (item.type === '阿里云') { } else if (item.type === '阿里云') {
if (this.loginState) { if (this.loginState) {
//
reqNewHomeSync().then(response => { reqNewHomeSync().then(response => {
if (response.status) { if (response.status) {
reqNewHomeFestival().then(res => { reqNewHomeFestival().then(res => {
if (res.status) { if (res.status) {
window.open(res.data) // window.open(res.data)
} else { } else {
this.$message.warning(res.msg) this.$message.warning(res.msg)
} }
@ -868,16 +769,10 @@ export default Vue.extend({
// //
changeData(data) { changeData(data) {
this.showPanelData = data || [] this.showPanelData = data || []
//
this.secMenuData = data?.[0]?.secMenu || [] this.secMenuData = data?.[0]?.secMenu || []
// threeDatashowPanelRightData
if (this.secMenuData.length > 0) { if (this.secMenuData.length > 0) {
const firstSecMenu = this.secMenuData[0] const firstSecMenu = this.secMenuData[0]
this.threeData = firstSecMenu.thrMenu || [] this.threeData = firstSecMenu.thrMenu || []
// thrTitlenull
if (this.threeData.length > 0) { if (this.threeData.length > 0) {
this.showPanelRightData = this.threeData.map(item => ({ this.showPanelRightData = this.threeData.map(item => ({
...item, ...item,
@ -898,14 +793,12 @@ export default Vue.extend({
// //
initData() { initData() {
reqNavList({ url_link: window.location.href }).then(res => { reqNavList({ url_link: window.location.href }).then(res => {
console.log("res", res.data.product_service)
if (res.status) { if (res.status) {
this.product_service = this.buildData(res.data.product_service) // this.product_service = this.buildData(res.data.product_service)
this.changeData(this.product_service) this.changeData(this.product_service)
} }
}).catch(error => { }).catch(error => {
console.error("获取导航数据失败:", error) console.error("获取导航数据失败:", error)
//
this.product_service = [] this.product_service = []
this.changeData([]) this.changeData([])
}) })
@ -921,7 +814,7 @@ export default Vue.extend({
secItem.thrMenu.forEach(thrItem => { secItem.thrMenu.forEach(thrItem => {
if (thrItem.value && Array.isArray(thrItem.value)) { if (thrItem.value && Array.isArray(thrItem.value)) {
thrItem.value.forEach(valueItem => { thrItem.value.forEach(valueItem => {
valueItem.type = secItem.secTitle; // typesecTitle valueItem.type = secItem.secTitle;
}); });
} }
}); });
@ -929,15 +822,12 @@ export default Vue.extend({
}); });
} }
}); });
return data; // return data;
}, },
// //
sildeSecMenu(item) { sildeSecMenu(item) {
console.log("获取的item时", item)
this.secId = item.id this.secId = item.id
// thrMenuthrTitlenull
if (!item.thrMenu || item.thrMenu.length === 0) { if (!item.thrMenu || item.thrMenu.length === 0) {
this.threeData = [] this.threeData = []
this.showPanelRightData = [{ this.showPanelRightData = [{
@ -946,13 +836,10 @@ export default Vue.extend({
}] }]
return return
} }
// thrTitlenull
this.threeData = item.thrMenu.map(menu => ({ this.threeData = item.thrMenu.map(menu => ({
...menu, ...menu,
thrTitle: menu.thrTitle || item.secTitle thrTitle: menu.thrTitle || item.secTitle
})) }))
this.showPanelRightData = this.threeData this.showPanelRightData = this.threeData
}, },
@ -971,7 +858,6 @@ export default Vue.extend({
sildeItemIn(item) { sildeItemIn(item) {
this.firId = item.id this.firId = item.id
this.secId = item.secMenu[0].id this.secId = item.secMenu[0].id
console.log("获取的item时", item)
this.secMenuData = item.secMenu || [] this.secMenuData = item.secMenu || []
this.showPanelRightData = this.secMenuData[0].thrMenu || [] this.showPanelRightData = this.secMenuData[0].thrMenu || []
}, },
@ -981,12 +867,10 @@ export default Vue.extend({
// //
sildeIn(item) { sildeIn(item) {
console.log("sildeIn", item)
this.changeData(item) this.changeData(item)
if (this.hideTimer) { if (this.hideTimer) {
clearTimeout(this.hideTimer) clearTimeout(this.hideTimer)
} }
//
this.showTimer = setTimeout(() => { this.showTimer = setTimeout(() => {
this.$store.commit('setShowHomeNav', true) this.$store.commit('setShowHomeNav', true)
}, 100) }, 100)
@ -997,7 +881,6 @@ export default Vue.extend({
if (this.showTimer) { if (this.showTimer) {
clearTimeout(this.showTimer) clearTimeout(this.showTimer)
} }
//
this.hideTimer = setTimeout(() => { this.hideTimer = setTimeout(() => {
this.$store.commit('setShowHomeNav', false) this.$store.commit('setShowHomeNav', false)
}, 200) }, 200)
@ -1014,13 +897,19 @@ export default Vue.extend({
handleGoLogin() { handleGoLogin() {
let token = this.$store.getters.token; let token = this.$store.getters.token;
if (!token) { if (!token) {
//
this.$message.warning('请先登录哦~'); this.$message.warning('请先登录哦~');
this.$router.push({ this.$router.push({
path: '/login' path: '/login'
}); });
} else { }
},
//
goHome() {
if (this.isNcmatchDomain) {
this.$router.push('/ncmatchHome/index');
} else {
this.$router.push('/homePage/index');
} }
} }
}, },
@ -1118,7 +1007,6 @@ export default Vue.extend({
.language-toggle { .language-toggle {
cursor: pointer; cursor: pointer;
margin-right: 20px; margin-right: 20px;
// width: 60px;
text-align: center; text-align: center;
border-radius: 4px; border-radius: 4px;
font-size: 14px; font-size: 14px;
@ -1140,11 +1028,9 @@ export default Vue.extend({
} }
a { a {
// padding: 8px 16px;
border-radius: 4px; border-radius: 4px;
font-size: 14px; font-size: 14px;
text-decoration: none; text-decoration: none;
// margin-left: 10px;
transition: all 0.3s; transition: all 0.3s;
} }
@ -1158,7 +1044,6 @@ export default Vue.extend({
} }
.register-btn { .register-btn {
// height: 50px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -1231,7 +1116,6 @@ export default Vue.extend({
li { li {
padding: 10px; padding: 10px;
//cursor: pointer;
transition: background-color 0.3s; transition: background-color 0.3s;
&:hover { &:hover {
@ -1350,7 +1234,6 @@ export default Vue.extend({
} }
.clickItem { .clickItem {
//margin: 30px 0 !important;
margin-bottom: 15px !important; margin-bottom: 15px !important;
&:hover { &:hover {

View File

@ -1022,7 +1022,7 @@ $light_gray: #eee;
$dark_gray: #889aa4; $dark_gray: #889aa4;
.main-box { .main-box {
background: url('/static/img/banner.0798e703.png') no-repeat center center; background: url('/static/img/banner.png') no-repeat center center;
background-size: cover; background-size: cover;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;

View File

@ -357,9 +357,9 @@ export default {
this.isDisabled1 = false; this.isDisabled1 = false;
this.dialogVisible = false; this.dialogVisible = false;
that.SendCode_text1 = "获取验证码"; that.SendCode_text1 = "获取验证码";
clearInterval(that.timer1); clearInterval(this.timer1);
that.timer1 = null; this.timer1 = null;
that.time_count1 = 60; this.time_count1 = 60;
this.$refs.form.resetFields(); this.$refs.form.resetFields();
} else { } else {
this.$message({ this.$message({