This commit is contained in:
木瓜一块八 2025-07-28 14:39:07 +08:00
parent fee984ea90
commit e303b98fd1
9 changed files with 1071 additions and 36 deletions

View File

@ -7,6 +7,7 @@ import {getToken} from "@/utils/auth"; // get token from cookie
import getPageTitle from "@/utils/get-page-title"; import getPageTitle from "@/utils/get-page-title";
import {asyncRoutes, constantRoutes} from "@/router"; import {asyncRoutes, constantRoutes} from "@/router";
import Layout from "@/layout"; import Layout from "@/layout";
import {getHomePath} from "@/views/setting/tools";
NProgress.configure({showSpinner: false}); // NProgress Configuration NProgress.configure({showSpinner: false}); // NProgress Configuration
@ -74,6 +75,15 @@ router.beforeEach(async (to, from, next) => {
const userid = sessionStorage.getItem("userId"); const userid = sessionStorage.getItem("userId");
const user = sessionStorage.getItem("user"); const user = sessionStorage.getItem("user");
const auths = sessionStorage.getItem("auths"); const auths = sessionStorage.getItem("auths");
const homePath =getHomePath()
if (to.path === homePath) {
next(); // 如果已经是目标路径,直接放行
NProgress.done();
return;
}
console.log("homePath",homePath);
// const homePath ='/homePage/index';
// const homePath ='/ncmatchHome/index';
const hasRoutes = const hasRoutes =
JSON.parse(sessionStorage.getItem("routes")) && JSON.parse(sessionStorage.getItem("routes")) &&
JSON.parse(sessionStorage.getItem("routes")).length JSON.parse(sessionStorage.getItem("routes")).length
@ -86,8 +96,8 @@ router.beforeEach(async (to, from, next) => {
NProgress.done(); NProgress.done();
return return
} }
if (to.path === '/homePage') { if (to.path === '/homePage'||to.path === '/ncmatchHome') {
next('/homePage/index'); next(homePath);
NProgress.done(); NProgress.done();
return return
} }
@ -96,7 +106,7 @@ router.beforeEach(async (to, from, next) => {
// NProgress.done(); // NProgress.done();
// return // return
// } // }
if (to.path.includes("/kyyForm") || to.path.includes("/screen") || to.path.includes("/beforeLogin") || to.path.includes("/wxDetailPage") || to.path.includes("/wxPage") || to.path.includes("/login") || to.path.includes("/homePage") || to.path.includes("/registrationPage") || to.path.includes("/payPage") || to.path.includes("/paySuccess") || to.path.includes("/homePageImage")) { if (to.path.includes("/ncmatchHome")||to.path.includes("/kyyForm") || to.path.includes("/screen") || to.path.includes("/beforeLogin") || to.path.includes("/wxDetailPage") || to.path.includes("/wxPage") || to.path.includes("/login") || to.path.includes("/homePage") || to.path.includes("/registrationPage") || to.path.includes("/payPage") || to.path.includes("/paySuccess") || to.path.includes("/homePageImage")) {
console.log("to", to) console.log("to", to)
try { try {
if (to.path.includes("/beforeLogin") || to.path.includes("/registrationPage")) { if (to.path.includes("/beforeLogin") || to.path.includes("/registrationPage")) {
@ -125,7 +135,8 @@ router.beforeEach(async (to, from, next) => {
} }
} }
// next(`/login?redirect=${to.path}`); // next(`/login?redirect=${to.path}`);
next('/homePage/index') console.log("路由执行了2@@@")
next(homePath)
// next(`/beforeLogin`); // next(`/beforeLogin`);
// console.log("111行被打印了") // console.log("111行被打印了")
NProgress.done(); NProgress.done();
@ -154,7 +165,7 @@ router.beforeEach(async (to, from, next) => {
// console.log(error); // console.log(error);
Message.error(error || "Has Error"); Message.error(error || "Has Error");
// next(`/login?redirect=${to.path}`); // next(`/login?redirect=${to.path}`);
next('/homePage/index') next(homePath)
// console.log("137行被打印了") // console.log("137行被打印了")
NProgress.done(); NProgress.done();
} }

View File

@ -1,19 +1,8 @@
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";
Vue.use(Router);
// const originalPush = Router.prototype.push
// Router.prototype.push = function push(location) {
// return originalPush.call(this, location).catch(err => err)}
/* Layout */ /* Layout */
import Layout from "@/layout"; import Layout from "@/layout";
import {loginUserAPI} from "@/api/login";
import {Message} from "element-ui";
import {logger} from "runjs/lib/common";
import GpuProduct from "@/views/product/productHome/capitalOnline/productItem/GpuProduct/index.vue"; import GpuProduct from "@/views/product/productHome/capitalOnline/productItem/GpuProduct/index.vue";
import CreatePrivateNet from "@/views/product/productHome/capitalOnline/Net/privateNet/createPrivateNet/index.vue"; import CreatePrivateNet from "@/views/product/productHome/capitalOnline/Net/privateNet/createPrivateNet/index.vue";
import ShowPrivateNet from "@/views/product/productHome/capitalOnline/Net/privateNet/showPrivateNet/index.vue"; import ShowPrivateNet from "@/views/product/productHome/capitalOnline/Net/privateNet/showPrivateNet/index.vue";
@ -29,6 +18,13 @@ import SecurityGroupDetail
import ShowGpu from "@/views/product/productHome/capitalOnline/productItem/GpuProduct/ShowGpu/index.vue"; import ShowGpu from "@/views/product/productHome/capitalOnline/productItem/GpuProduct/ShowGpu/index.vue";
import ShowEip from "@/views/product/productHome/capitalOnline/Net/Eip/showEip/index.vue"; import ShowEip from "@/views/product/productHome/capitalOnline/Net/Eip/showEip/index.vue";
import CreateEip from "@/views/product/productHome/capitalOnline/Net/Eip/createEip/index.vue"; import CreateEip from "@/views/product/productHome/capitalOnline/Net/Eip/createEip/index.vue";
Vue.use(Router);
// const originalPush = Router.prototype.push
// Router.prototype.push = function push(location) {
// return originalPush.call(this, location).catch(err => err)}
// import nestedRouter from '@/router/modules/nested' // import nestedRouter from '@/router/modules/nested'
/** /**
* Note: sub-menu only appear when route children.length >= 1 * Note: sub-menu only appear when route children.length >= 1
@ -165,6 +161,22 @@ export const constantRoutes = [
hidden: true, hidden: true,
meta: {title: "注册"}, meta: {title: "注册"},
}, },
{
path: "/ncmatchHome",
component: () => import("@/views/homePage/ncmatch/index.vue"),
name: "ncmatchHome",
redirect: "/ncmatchHome/index",
meta: {fullPath: "/ncmatchHome/index", title: "官网首页", noCache: true, icon: 'el-icon-s-home'},
children: [
{
path: "index",
component: () => import("@/views/homePage/ncmatch/mainPage/index.vue"),
name: "ncmatchPageIndex",
hidden: true,
meta: {title: "首页", fullPath: "/ncmatch/mainPage/index"},
},
]
},
{ {
path: "/homePage", path: "/homePage",
component: () => import("@/views/homePage/indexLast.vue"), component: () => import("@/views/homePage/indexLast.vue"),
@ -272,6 +284,7 @@ export const asyncRoutes = [
// name: 'productHome', // name: 'productHome',
// meta: {title: "概览", fullPath: "/productHome", noCache: true} // meta: {title: "概览", fullPath: "/productHome", noCache: true}
// }, // },
{ {
path: "/homePage", path: "/homePage",
component: () => import("@/views/homePage/indexLast.vue"), component: () => import("@/views/homePage/indexLast.vue"),
@ -986,19 +999,22 @@ export const asyncRoutes = [
), name: "supplierTransferApproval", meta: { ), name: "supplierTransferApproval", meta: {
title: "供应商销售收入转账审批", fullPath: "/operation/examinationManagement/supplierTransferApproval", title: "供应商销售收入转账审批", fullPath: "/operation/examinationManagement/supplierTransferApproval",
}, },
}, { },
{
path: "distributorDiscountSetting", component: () => import( path: "distributorDiscountSetting", component: () => import(
"@/views/operation/examinationManagement/distributorDiscountSetting" "@/views/operation/examinationManagement/distributorDiscountSetting"
), name: "DistributorDiscountSetting", meta: { ), name: "DistributorDiscountSetting", meta: {
title: "分销商折扣设置审批", fullPath: "/operation/examinationManagement/distributorDiscountSetting", title: "分销商折扣设置审批", fullPath: "/operation/examinationManagement/distributorDiscountSetting",
}, },
}, { },
{
path: "distributorRebateSetUp", component: () => import( path: "distributorRebateSetUp", component: () => import(
"@/views/operation/examinationManagement/distributorRebateSetUp" "@/views/operation/examinationManagement/distributorRebateSetUp"
), name: "DistributorRebateSetUp", meta: { ), name: "DistributorRebateSetUp", meta: {
title: "分销商回佣率设置审批", fullPath: "/operation/examinationManagement/DistributorRebateSetUp", title: "分销商回佣率设置审批", fullPath: "/operation/examinationManagement/DistributorRebateSetUp",
}, },
}, { },
{
path: "distributorCommissionTransferApproval", component: () => import( path: "distributorCommissionTransferApproval", component: () => import(
"@/views/operation/examinationManagement/distributorCommissionTransferApproval" "@/views/operation/examinationManagement/distributorCommissionTransferApproval"
), name: "DistributorCommissionTransferApproval", meta: { ), name: "DistributorCommissionTransferApproval", meta: {
@ -1371,7 +1387,8 @@ export const asyncRoutes = [
title: "Test", icon: "el-icon-shopping-cart-2", noCache: true, fullPath: "/Test/index", title: "Test", icon: "el-icon-shopping-cart-2", noCache: true, fullPath: "/Test/index",
}, },
},], },],
}, { },
{
path: "/operationAndMaintenance", component: Layout, redirect: "/operationAndMaintenance/index", meta: { path: "/operationAndMaintenance", component: Layout, redirect: "/operationAndMaintenance/index", meta: {
title: "运维", icon: "el-icon-s-tools", noCache: true, fullPath: "/operationAndMaintenance", title: "运维", icon: "el-icon-s-tools", noCache: true, fullPath: "/operationAndMaintenance",
}, children: [{ }, children: [{

View File

@ -5,6 +5,7 @@ import {Message} from "element-ui";
import router, {resetRouter} from "@/router"; import router, {resetRouter} from "@/router";
import store from "@/store"; import store from "@/store";
import {myBalanceAPI} from "@/api/finance/customerRechargeManagement"; import {myBalanceAPI} from "@/api/finance/customerRechargeManagement";
import {testData} from "@/views/homePage/components/topBox/testData";
const state = { const state = {
token: getToken(), token: getToken(),
@ -86,7 +87,6 @@ const actions = {
} }
) )
resetRouter(); resetRouter();
console.log("挂载前的路由是:", accessRoutes)
router.addRoutes(accessRoutes); router.addRoutes(accessRoutes);
resolve(response); resolve(response);
} }

File diff suppressed because one or more lines are too long

View File

@ -320,6 +320,7 @@ export default Vue.extend({
// url_link: 'https://www.baidu.com' // url_link: 'https://www.baidu.com'
} }
getLogoAPI(params).then((res) => { getLogoAPI(params).then((res) => {
console.log("获取接口触发了")
// if (res.data.status == true && res.data.data && res.data.data.length) { // if (res.data.status == true && res.data.data && res.data.data.length) {
// this.photosUrl = res.data.data[0]; // this.photosUrl = res.data.data[0];

View File

@ -0,0 +1,281 @@
<template>
<div id="homeOut" class="homeOut">
<TopBox id="topBox"></TopBox>
<router-view></router-view>
<!-- footer-->
<div class="footer">
<div class="left-box" style="border-bottom: 1px solid #7A82A0">
<div style="display: flex;flex-direction: column">
<img v-if="JSON.stringify(logoInfoNew)!=='{}'" style="width: 148px;height: 48px;"
:src="logoInfoNew.home.logoImg" alt=""
class="img">
<div class="content-main">
<ul class="info">
<li>地址<span v-if="JSON.stringify(logoInfoNew)!=='{}'">{{ logoInfoNew.home.adress }}</span>
</li>
<li v-if="JSON.stringify(logoInfoNew)!=='{}'"> 邮箱{{ logoInfoNew.home.email }}</li>
<li v-if="JSON.stringify(logoInfoNew)!=='{}'">电话: <span class="tel">{{ logoInfoNew.home.mobile }}</span>
</li>
<li>
<!-- <a href="" rel="noreferrer" target="_blank"></a> -->
</li>
</ul>
</div>
</div>
<ul class="bigUl">
</ul>
<div v-if="JSON.stringify(logoInfoNew)!=='{}'&&logoInfoNew.home.bannerTitle!=='开元数智'" class="right-box">
<div class="qr-box">
<div class="qr-code">
<img src="../img/kefu.jpg" style="padding: 0.08rem" alt="">
</div>
<span class="qr-content">微信客服</span>
</div>
<div class="qr-box" style="margin-left: 0.667rem">
<div class="qr-code">
<img src="../img/img.png" alt="">
</div>
<span class="qr-content">关注公众号</span>
</div>
</div>
</div>
<div style="display: flex;justify-content: center;align-items: center;width: 100%; ">
<span v-if="JSON.stringify(logoInfoNew)!=='{}'"
style="margin:15px 0 ;width: 1400px;display:flex;justify-content:center;align-items:center;color: #7A82A0;"><span
class="goStyle"
@click="goOut('https://beian.miit.gov.cn/#/Integrated/index')">
京ICP备{{
logoInfoNew.home.license
}}&nbsp;
</span> &nbsp;&nbsp;{{
logoInfoNew.home.footerTitle
}}&nbsp;{{
logoInfoNew.home.copyright
}}&nbsp; </span>
<!-- IPC备案号:{{ ICP }} <span style="margin-left: 0.267rem">版权所有 @kaiyuanyun 2023</span>-->
<!-- <img src="../../image/login/policeInsignia/policeInsignia.png" alt=""-->
<!-- style="width:0.227rem;height:0.227rem;margin-right: 0.027rem;">-->
<!-- <a href="https://beian.mps.gov.cn/#/query/webSearch?code=11010502054007" rel="noreferrer"-->
<!-- target="_blank"-->
<!-- style="margin-right:0.4rem;">京公网安备11010502054007</a>-->
<!-- <span>-->
<!-- <router-link tag="a" target="_blank"-->
<!-- :to="{ name: 'homePageImage' }">经营许可证:京B2-20232313</router-link>-->
<!-- </span>-->
</div>
</div>
</div>
</template>
<script>
import Vue from 'vue'
import TopBox from "@/views/homePage/components/topBox/index.vue";
import {mapGetters, mapState} from "vuex";
export default Vue.extend({
name: "indexLast",
components: {TopBox},
data() {
return {
currentBaseMenu: "hot", //
}
},
computed: {
...mapGetters(["sidebar", "avatar", "device"]),
...mapState({
isShowPanel: (state) => state.product.showHomeNav,
navIndex: (state) => state.product.navIndex,
gridObj: state => state.operationAnalysis.gridObj,
mybalance: state => state.user.mybalance,
logoutUrl: state => state.login.logoutUrl,
loginState: state => state.login.loginState,
logoInfoNew: state => state.product.logoInfoNew,
}),
showRegisterButton() {
const orgType = window.sessionStorage.getItem('org_type');
const userId = window.sessionStorage.getItem('userId');
console.log("此时是:", orgType !== '2' && orgType !== '3' && userId !== null)
return orgType !== '2' && orgType !== '3' && userId === null;
},
username() {
return sessionStorage.getItem('username') || '';
},
},
methods: {
goOut(url) {
window.open(url)
},
scrollToElement(id) {
const element = document.getElementById(id);
if (element) {
element.scrollIntoView({
behavior: 'smooth', //
block: 'start', // 'start', 'center', 'end', 'nearest'
});
}
},
clickBaseMenu(menu) {
console.log("emnu", menu)
this.currentBaseMenu = menu.id;
},
async goBaidu() {
this.scrollToElement('topBox')
await this.$store.commit('setShowHomeNav', true)
await this.$store.commit('setNavIndex', 0)
},
async goAliyun() {
this.scrollToElement('topBox')
await this.$store.commit('setShowHomeNav', true)
await this.$store.commit('setNavIndex', 1)
},
}
})
</script>
<style scoped lang="scss">
.homeOut {
//padding-top: 60px;
height: 100%;
overflow: auto !important;
min-width: 1500px;
}
.footer {
padding: 35px 0;
width: 100%;
display: flex;
justify-content: center;
flex-wrap: wrap;
}
.left-box {
width: 1400px;
height: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 15px;
}
.right-box {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.content-main {
mix-blend-mode: normal;
color: rgba(0, 0, 0, 1);
font-size: 0.187rem;
}
.qr-code {
img {
width: 100%;
height: 100%;
}
width: 1.853rem;
height: 1.853rem;
}
.qr-content {
mix-blend-mode: normal;
color: rgba(24, 24, 24, 1);
font-family: PingFang SC, serif;
font-weight: 600;
font-size: 0.187rem;
}
.qr-box {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
}
.logo {
background-color: #32abfc;
img {
width: 100%;
height: 100%;
}
}
.bigUl {
margin: 0 15px;
margin-left: -250px;
//padding-top: 15px;
width: fit-content;
display: flex;
justify-content: flex-start;
.bigLi {
margin: 0 25px;
}
height: 100%;
.title {
color: #222F60;
font-size: 18px;
font-weight: bold;
}
.smallUl {
font-size: 16px;
color: #7A82A0;
li {
margin: 10px 0;
}
}
}
.info {
font-size: 14px;
color: #7A82A0;
li {
margin: 10px 0;
}
}
.tel {
color: #222F60;
font-size: 20px;
}
.smallLi {
&:hover {
color: #1b5bff;
cursor: pointer;
}
}
.goStyle {
cursor: pointer;
transition: all .3s ease-in-out;
&:hover {
transition: all .3s ease-in-out;
color: #1b5bff;
}
}
</style>

View File

@ -0,0 +1,682 @@
<script lang="ts">
import Vue from 'vue'
export default Vue.extend({
name: "mainPage",
data() {
return {
searchKeyword: '洗烘一体洗衣机',
hotSearchKeywords: [
'京东奢品 低至2折',
'大牌空调低至5折',
'夏日防晒',
'饮用水',
'哑铃',
'家庭清洁',
'户外用品',
'补水喷雾',
'坚果炒货',
'四件套',
'佛雷他定'
],
topNavItems: [
{ name: '早十好价', icon: '10', color: 'red' },
{ name: '司法拍卖', icon: '⚖️', color: 'red' },
{ name: '企业购', icon: '🏢', color: 'blue' },
{ name: '京东新品', icon: '🎁', color: 'blue' },
{ name: '男装馆', icon: '👔', color: 'blue' },
{ name: '黑色星期五', icon: '🍃', color: 'green' },
{ name: '服饰美妆', icon: '👗', color: 'purple' },
{ name: '清洁馆', icon: '💧', color: 'blue' },
{ name: '五金城', icon: '⚙️', color: 'red' },
{ name: '全部频道', icon: '📱', color: 'rainbow' }
],
categories: [
{ name: '家用电器', icon: '🏠' },
{ name: '手机/运营商/数码', icon: '📱' },
{ name: '电脑/办公/文具用品', icon: '💻' },
{ name: '家居/家具/家装/厨具', icon: '🪑' },
{ name: '男装/女装/童装/内衣', icon: '👕' },
{ name: '美妆/个护清洁/宠物', icon: '💄' },
{ name: '女鞋/箱包/钟表/珠宝', icon: '👠' },
{ name: '男鞋/运动/户外', icon: '👟' },
{ name: '房产/汽车/汽车用品', icon: '🏠' },
{ name: '母婴/玩具乐器', icon: '👶' },
{ name: '食品/酒类/生鲜/特产', icon: '🍎' }
]
}
},
methods: {
handleSearch() {
console.log('搜索:', this.searchKeyword)
}
}
})
</script>
<template>
<div class="jd-homepage">
<!-- 顶部Header -->
<header class="header">
<div class="header-content">
<!-- 左侧Logo -->
<div class="logo-section">
<div class="logo">
<span class="logo-text">京东</span>
<span class="logo-mascot">🐕</span>
</div>
</div>
<!-- 中间搜索区域 -->
<div class="search-section">
<div class="search-bar">
<input
v-model="searchKeyword"
type="text"
class="search-input"
placeholder="洗烘一体洗衣机"
>
<button class="search-btn" @click="handleSearch">搜索</button>
</div>
<!-- 热搜关键词 -->
<div class="hot-search">
<a
v-for="keyword in hotSearchKeywords"
:key="keyword"
href="#"
class="hot-keyword"
>
{{ keyword }}
</a>
</div>
</div>
</div>
</header>
<!-- 主内容区域 -->
<main class="main-content">
<div class="content-wrapper">
<!-- 左侧分类导航 -->
<aside class="category-sidebar">
<ul class="category-list">
<li
v-for="category in categories"
:key="category.name"
class="category-item"
>
<span class="category-icon">{{ category.icon }}</span>
<span class="category-name">{{ category.name }}</span>
</li>
</ul>
</aside>
<!-- 中间主内容 -->
<section class="main-section">
<!-- 顶部促销横幅 -->
<div class="promo-banner">
<div class="banner-content">
<div class="banner-text">
<h3>今日精选</h3>
<p>冰箱天天特价</p>
<p>超值乐购</p>
</div>
<div class="banner-image">
<img src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjE1MCIgdmlld0JveD0iMCAwIDIwMCAxNTAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iMTUwIiBmaWxsPSIjMzMzIi8+Cjx0ZXh0IHg9IjUwIiB5PSI3NSIgZm9udC1mYW1pbHk9IkFyaWFsIiBmb250LXNpemU9IjEyIiBmaWxsPSJ3aGl0ZSIgdGV4dC1hbmNob3I9Im1pZGRsZSI+5YyF5a2Q6KOFPC90ZXh0Pgo8L3N2Zz4K" alt="冰箱" class="fridge-img">
<span class="flower-decoration">🌸</span>
</div>
</div>
</div>
</section>
<!-- 右侧用户信息栏 -->
<aside class="user-sidebar">
<!-- 用户问候卡片 -->
<div class="user-card">
<div class="user-greeting">
<h4>Hi~下午好</h4>
<p>登录后享更多优惠</p>
</div>
<button class="login-btn">立即登录</button>
<a href="#" class="register-link">注册></a>
</div>
</aside>
</div>
</main>
</div>
</template>
<style scoped lang="scss">
.jd-homepage {
min-height: 100vh;
background-color: #f8fbfe;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
// Header
.header {
padding: 10px 0;
.header-content {
max-width: 1200px;
margin: 0 auto;
display: flex;
align-items: center;
gap: 20px;
}
.logo-section {
.logo {
display: flex;
align-items: center;
gap: 5px;
.logo-text {
font-size: 24px;
font-weight: bold;
color: #e1251b;
}
.logo-mascot {
font-size: 20px;
}
}
}
.search-section {
flex: 1;
.search-bar {
display: flex;
align-items: center;
background: white;
border: 2px solid #3f68d8;
border-radius: 4px;
overflow: hidden;
.search-input {
flex: 1;
padding: 12px 15px;
border: none;
outline: none;
font-size: 14px;
}
.camera-icon {
padding: 0 10px;
color: #666;
cursor: pointer;
}
.search-btn {
background: #0864dd;
color: white;
border: none;
padding: 12px 20px;
cursor: pointer;
font-size: 14px;
&:hover {
background: #173ad4;
}
}
}
.hot-search {
margin-top: 8px;
display: flex;
gap: 15px;
flex-wrap: wrap;
.hot-keyword {
color: #666;
text-decoration: none;
font-size: 12px;
&:hover {
color: #e1251b;
}
}
}
}
.signin-section {
.signin-btn {
background: linear-gradient(45deg, #ffd700, #ff6b35);
color: white;
border: none;
padding: 8px 15px;
border-radius: 4px;
cursor: pointer;
font-size: 12px;
display: flex;
align-items: center;
gap: 5px;
.signin-icon {
font-weight: bold;
}
}
}
}
//
.main-content {
padding: 16px;
max-width: 1200px;
margin: 20px auto;
margin-top: 10px;
height: 500px;
border-radius: 10px;
overflow: hidden;
background-color:white;
border:1px solid red;
.content-wrapper {
display: grid;
grid-template-columns: 200px 1fr 250px;
gap: 20px;
}
}
//
.category-sidebar {
background-color: #f8fbfe;
height: 100%;
border-radius: 4px;
padding: 15px;
.category-list {
list-style: none;
padding: 0;
margin: 0;
.category-item {
display: flex;
align-items: center;
gap: 10px;
padding: 4px 0;
cursor: pointer;
transition: all 0.3s;
&:hover {
color: #e1251b;
background: #fafafa;
}
&:last-child {
border-bottom: none;
}
.category-icon {
font-size: 16px;
width: 20px;
text-align: center;
}
.category-name {
font-size: 14px;
}
}
}
}
//
.main-section {
.promo-banner {
background: linear-gradient(45deg, #52c41a, #73d13d);
border-radius: 8px;
padding: 20px;
margin-bottom: 20px;
position: relative;
height: 100%;
.banner-content {
display: flex;
justify-content: space-between;
align-items: center;
.banner-text {
color: white;
h3 {
margin: 0 0 10px 0;
font-size: 24px;
}
p {
margin: 5px 0;
font-size: 16px;
}
}
.banner-image {
position: relative;
.fridge-img {
width: 120px;
height: 90px;
object-fit: cover;
}
.flower-decoration {
position: absolute;
bottom: 0;
right: 0;
font-size: 20px;
}
}
}
}
.subsidy-section, .live-section, .seckill-section {
background: white;
border-radius: 8px;
padding: 20px;
margin-bottom: 20px;
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
h3 {
margin: 0;
font-size: 18px;
color: #333;
}
.official-tag, .live-tag, .seckill-tag {
background: #e1251b;
color: white;
padding: 4px 8px;
border-radius: 4px;
font-size: 12px;
}
}
}
.product-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 15px;
.product-card {
text-align: center;
.product-img {
margin-bottom: 10px;
img {
width: 80px;
height: 80px;
object-fit: cover;
border-radius: 4px;
}
}
.product-info {
.subsidy-amount {
color: #e1251b;
font-size: 12px;
margin-bottom: 5px;
}
.product-price {
font-size: 16px;
font-weight: bold;
color: #333;
}
}
}
}
.morning-deal-section {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 15px;
margin-bottom: 20px;
.deal-card {
background: white;
border-radius: 8px;
padding: 20px;
&.left-card {
h4 {
margin: 0 0 15px 0;
color: #333;
}
.deal-list {
list-style: none;
padding: 0;
margin: 0;
li {
padding: 8px 0;
border-bottom: 1px solid #f0f0f0;
color: #666;
&:last-child {
border-bottom: none;
}
}
}
}
&.right-card {
text-align: center;
h4 {
margin: 0 0 15px 0;
color: #333;
}
.deal-product {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
img {
width: 60px;
height: 60px;
object-fit: cover;
border-radius: 4px;
}
.deal-price {
font-size: 18px;
font-weight: bold;
color: #e1251b;
}
}
}
}
}
.live-cards {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 15px;
.live-card {
background: #f8f9fa;
border-radius: 8px;
padding: 15px;
text-align: center;
.live-preview {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
.live-icon {
font-size: 24px;
}
.live-text {
font-size: 14px;
color: #333;
}
.live-name {
font-size: 12px;
color: #666;
}
}
}
}
.seckill-products {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 15px;
.seckill-product {
text-align: center;
img {
width: 80px;
height: 80px;
object-fit: cover;
border-radius: 4px;
margin-bottom: 10px;
}
.seckill-price {
color: #e1251b;
font-weight: bold;
font-size: 14px;
}
}
}
.free-shipping-section, .one-yuan-section {
background: white;
border-radius: 8px;
padding: 20px;
margin-bottom: 20px;
h3 {
margin: 0 0 15px 0;
color: #333;
}
.shipping-products {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 15px;
}
.shipping-product, .one-yuan-product {
text-align: center;
img {
width: 60px;
height: 60px;
object-fit: cover;
border-radius: 4px;
margin-bottom: 10px;
}
.shipping-price, .one-yuan-price {
font-size: 14px;
color: #333;
}
}
}
}
//
.user-sidebar {
height: 100%;
.user-card {
background: white;
border-radius: 8px;
padding: 20px;
text-align: center;
margin-bottom: 20px;
.user-avatar {
font-size: 40px;
margin-bottom: 15px;
}
.user-greeting {
margin-bottom: 15px;
h4 {
margin: 0 0 5px 0;
color: #333;
}
p {
margin: 0;
color: #666;
font-size: 12px;
}
}
.login-btn {
background: #e1251b;
color: white;
border: none;
padding: 10px 20px;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
margin-bottom: 10px;
width: 100%;
&:hover {
background: #c1191f;
}
}
.register-link {
color: #666;
text-decoration: none;
font-size: 12px;
&:hover {
color: #e1251b;
}
}
}
}
//
@media (max-width: 1200px) {
.main-content .content-wrapper {
grid-template-columns: 180px 1fr 220px;
gap: 15px;
}
}
@media (max-width: 768px) {
.main-content .content-wrapper {
grid-template-columns: 1fr;
}
.category-sidebar, .user-sidebar {
display: none;
}
.header .header-content {
flex-direction: column;
gap: 10px;
}
.search-section {
width: 100%;
}
}
</style>

View File

@ -0,0 +1,28 @@
export function getHomePath() {
// let homePath= "/homePage/index"
let homePath= "/ncmatchHome/index"
// 业主机构信息
let url_link = window.location.href || '';
let domain_url = '';
if (url_link.includes('?domain_name=')) {
domain_url = url_link.split('?domain_name=')[1];
}
// 如果是业主机构
if ((domain_url.includes('ncmatch') ||
domain_url.includes('9527') ||
domain_url.includes('8889') ||
domain_url.includes('8891') ||
['xterm.kaiyuancloud.cn', 'www.kaiyuancloud.cn', 'dev.kaiyuancloud.cn', 'dev.opencomputing.cn', 'test.kaiyuancloud.cn', 'localhost'].includes(domain_url)) &&
!url_link.includes('/domain/')) {
if (domain_url.includes('ncmatch') || domain_url.includes('9527')) {
homePath = '/homePath/index'
} else if (domain_url.includes('kaiyuancloud') || domain_url.includes('opencomputing') || domain_url.includes('localhost')) {
homePath = '/ncmatchHome/index'
}
}
console.log("res是",homePath)
return homePath
}

View File

@ -0,0 +1,8 @@
const webConfig={
KYY:{
homePath:"",
},
NCMATCH:{
homePath:"",
}
}