feat:修改首页

fix/ui-0521-zz
张征 3 years ago
parent 8336805b1f
commit f4a4435c8e

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 611 B

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

@ -13,7 +13,6 @@
@click="onJumCartPage" @click="onJumCartPage"
> >
<img src="~/assets/img/layout/icon-shop.png" /> <img src="~/assets/img/layout/icon-shop.png" />
<span>购物车</span>
<div <div
v-if="cartCount > 0" v-if="cartCount > 0"
class="wrap-right-cart__tip flex flex-middle flex-center" class="wrap-right-cart__tip flex flex-middle flex-center"
@ -163,16 +162,8 @@ export default {
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.header-cart-popover__refrence { .header-cart-popover__refrence {
padding: 0 18px;
height: 42px;
line-height: 42px;
color: #999999;
border-radius: 4px;
border: 1px solid #eeeeee;
cursor: pointer; cursor: pointer;
&:hover { position: relative;
background: #eeeeee;
}
.wrap-right-cart__tip { .wrap-right-cart__tip {
width: 16px; width: 16px;
height: 16px; height: 16px;
@ -182,9 +173,12 @@ export default {
color: #ffffff; color: #ffffff;
margin-left: 4px; margin-left: 4px;
&--more { &--more {
width: unset; // width: unset;
padding: 1px 5px 0 4px; top: -8px;
right: 0px;
padding: 5;
border-radius: 7px; border-radius: 7px;
position: absolute;
} }
} }
img { img {

@ -7,18 +7,18 @@
@mouseenter="handleCategoryChange(true)" @mouseenter="handleCategoryChange(true)"
@mouseleave="handleCategoryChange(false)" @mouseleave="handleCategoryChange(false)"
> >
<div class="tab-category__label flex flex-middle"> <!-- <div class="tab-category__label flex flex-middle">
<img src="~/assets/img/layout/icon-category.png" /> <img src="~/assets/img/layout/icon-category.png" />
<span>热门分类</span> <span>热门分类</span>
</div> </div> -->
<div <div
v-show="isCategroyOpen || categroyVisible" v-show="isCategroyOpen || categroyVisible"
class="tab-category__menu flex" class="tab-category__menu"
@mouseenter="handleCategoryTwoChange(true)" @mouseenter="handleCategoryTwoChange(true)"
@mouseleave="handleCategoryTwoChange(false)" @mouseleave="handleCategoryTwoChange(false)"
> >
<!-- 左侧一级分类 --> <!-- 左侧一级分类 -->
<div class="tab-category-menu__left"> <div class="tab-category-menu__left flex flex-between flex-middle">
<div <div
v-for="item in categroyData" v-for="item in categroyData"
:key="item.id" :key="item.id"
@ -29,31 +29,27 @@
'menu-left__item--light': item.id === currentCategroyId, 'menu-left__item--light': item.id === currentCategroyId,
}" }"
> >
<img :src="item.icon" />
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
</div> <div class="menu-left__item--bottom"></div>
</div> <!-- 右侧二级分类 -->
<!-- 右侧二级分类 --> <div class="tab-category-menu__right flex-1 flex-wrap flex-between">
<div <div
v-show="categroyTwoVisible" v-for="itemList in getList(item.id)"
class="tab-category-menu__right flex-1" :key="itemList.id"
> class="menu-right-wrap__item"
<div @click="onCategoryClick(itemList.id, CATEGROY_LEVEL.TWO)"
v-for="item in list" >
:key="item.id" <img :src="itemList.picture" alt="商品分类" />
@mouseenter="handleCategoryHover(item.id)" {{ itemList.name }}
class="category-menu-right__wrap" </div>
:class="{ <!-- <div
'category-menu-right__wrap--light': item.id === currentCategroyId, v-for="item in list"
}" :key="item.id"
> @mouseenter="handleCategoryHover(item.id)"
<span class="category-menu-right__wrap"
v-for="itemList in item.list" v-show="item.id === currentCategroyId"
:key="itemList.id" ></div> -->
class="menu-right-wrap__item" </div>
@click="onCategoryClick(itemList.id, CATEGROY_LEVEL.TWO)"
>{{ itemList.name }}</span
>
</div> </div>
</div> </div>
</div> </div>
@ -101,6 +97,11 @@ export default {
}, },
}, },
methods: { methods: {
getList(id) {
let list = this.list.filter((item) => item.id == id);
console.log(`list[0]?.list`, list[0]?.list);
return list[0]?.list;
},
// //
async getCategroyData() { async getCategroyData() {
this.list = await Promise.all( this.list = await Promise.all(
@ -146,9 +147,11 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.header-category { .header-category {
height: 100%; height: 100%;
width: 700px;
.header-box-tab__category { .header-box-tab__category {
position: relative; position: relative;
height: 100%; height: 100%;
width: 700px;
.tab-category__label { .tab-category__label {
width: 190px; width: 190px;
height: 100%; height: 100%;
@ -165,63 +168,69 @@ export default {
} }
} }
.tab-category__menu { .tab-category__menu {
position: absolute; // position: absolute;
top: 38px; // top: 38px;
left: 0; // left: 0;
height: 360px; // height: 360px;
font-size: 14px; // font-size: 14px;
color: #333333; // color: #333333;
width: 100%;
height: 100%;
padding: 0 55px;
.tab-category-menu__left { .tab-category-menu__left {
width: 190px; width: 100%;
padding: 30px 0 35px 0; height: 100%;
background: #ffffff;
.menu-left__item { .menu-left__item {
height: 36px; height: 100%;
font-size: 16px;
font-weight: 400;
color: #333333;
position: relative;
cursor: pointer; cursor: pointer;
padding: 0 24px 0 41px;
margin-top: 15px; .menu-left__item--bottom {
&:first-child { width: 68px;
margin-top: 0; height: 3px;
background: #ff6a19;
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
display: none;
} }
&:hover, &:hover,
&--light { &--light {
color: #ff875b; color: #ff6a19;
} .tab-category-menu__right,
img { .menu-left__item--bottom {
width: 20px; display: flex;
height: 20px; }
margin-right: 16px;
} }
} }
} }
.tab-category-menu__right { .tab-category-menu__right {
padding: 30px 26px 35px 26px; position: absolute;
box-shadow: 7px 0px 10px 1px rgba(0, 0, 0, 0.1); top: 90px;
border: 1px solid #eeeeee; left: -54px;
width: 350px;
padding: 25px 25px 9px;
background: #ffffff; background: #ffffff;
border-radius: 0 4px 4px 0; box-shadow: 0px 0px 40px 1px rgba(0, 0, 0, 0.1);
.category-menu-right__wrap { border-radius: 4px;
height: 36px; display: none;
margin-top: 15px;
line-height: 36px; .menu-right-wrap__item {
padding: 0 16px; width: 140px;
font-size: 12px; height: 40px;
color: #999999; cursor: pointer;
white-space: nowrap; color: #333;
&:first-child { margin-bottom: 16px;
margin-top: 0; img {
} height: 40px;
&:hover, width: 40px;
&--light {
background: #f8f8f8;
} }
.menu-right-wrap__item { &:hover {
color: #999999; color: #ff875b;
margin-right: 20px;
cursor: pointer;
&:hover {
color: #ff875b;
}
} }
} }
} }

@ -251,9 +251,9 @@ export default {
} }
} }
.info-bar-header { .info-bar-header {
height: 30px; height: 40px;
color: #999999; color: #969696;
background: #f1f1f1; background: #333333;
font-size: 12px; font-size: 12px;
.info-bar-header-wrap { .info-bar-header-wrap {
height: 100%; height: 100%;
@ -264,7 +264,7 @@ export default {
padding: 0 18px; padding: 0 18px;
.content-login-text--light { .content-login-text--light {
margin-left: 6px; margin-left: 6px;
color: #ff875b; color: #969696;
cursor: pointer; cursor: pointer;
} }
} }

@ -11,47 +11,27 @@
<div class="bar-header-wrap__logo" @click="onOpenHomePage"> <div class="bar-header-wrap__logo" @click="onOpenHomePage">
<img src="~/assets/img/layout/logo-sticky.png" /> <img src="~/assets/img/layout/logo-sticky.png" />
</div> </div>
<el-menu <HeaderCategory />
:default-active="tabPath" <div class="header-box-wrap__right flex flex-middle">
mode="horizontal" <div class="box-wrap-right__search flex">
@select="onTabSelect" <div class="search-input">
> <el-input
<el-menu-item ref="searchInput"
v-for="item in tabList" v-model="searchContent"
:key="item.value" clearable
:index="item.value" placeholder="请输入商品名称"
>{{ item.label }}</el-menu-item @keyup.enter.native="onSearch"
> >
</el-menu> <img
</div> slot="suffix"
<div class="bar-header-wrap__icons flex flex-middle"> class="search-icon"
<img src="~/assets/img/layout/icon-search.png"
src="~/assets/img/layout/icon-search-sticky.png" />
@click="onEnterSearch" </el-input>
/> </div>
<div class="header-wrap-icons__shop" @click="onOpenCartPage">
<img src="~/assets/img/layout/icon-shop-sticky.png" />
<div
v-if="cartCount > 0"
:class="{ 'wrap-icons-shop__tip--more': cartCount > 10 }"
class="wrap-icons-shop__tip flex flex-middle flex-center"
>
{{ cartCount }}
</div> </div>
</div> <!-- 购物车 -->
<div <HeaderCart />
v-if="token"
class="header-wrap-icons__login"
@click="$router.push('/account/home')"
>
<img :src="userInfo.avatar" />
</div>
<div
v-else
class="header-wrap-icons__unlogin"
@click="onLoginClick"
>
登录
</div> </div>
</div> </div>
</div> </div>
@ -61,10 +41,11 @@
<HeaderInfoBar /> <HeaderInfoBar />
<div class="default-bar-header"> <div class="default-bar-header">
<div class="bar-header-box"> <div class="bar-header-box">
<div class="bar-header-box__wrap flex flex-between flex-middle"> <div class="bar-header-box__wrap flex flex-middle">
<div class="header-box-wrap__logo" @click="onOpenHomePage"> <div class="header-box-wrap__logo" @click="onOpenHomePage">
<img src="~/assets/img/layout/logo.png" /> <img src="~/assets/img/layout/logo.png" />
</div> </div>
<HeaderCategory />
<div class="header-box-wrap__right flex flex-middle"> <div class="header-box-wrap__right flex flex-middle">
<div class="box-wrap-right__search flex"> <div class="box-wrap-right__search flex">
<div class="search-input"> <div class="search-input">
@ -75,35 +56,18 @@
placeholder="请输入商品名称" placeholder="请输入商品名称"
@keyup.enter.native="onSearch" @keyup.enter.native="onSearch"
> >
<img
slot="suffix"
class="search-icon"
src="~/assets/img/layout/icon-search.png"
/>
</el-input> </el-input>
</div> </div>
<div
slot="suffix"
class="search-icon flex flex-center flex-middle"
@click="onSearch"
>
<img src="~/assets/img/layout/icon-search.png" />
</div>
</div> </div>
<!-- 购物车 --> <!-- 购物车 -->
<HeaderCart /> <HeaderCart />
</div> </div>
</div> </div>
<div class="bar-header-box__tab flex flex-middle">
<HeaderCategory />
<div
v-for="item in tabList"
:key="item.value"
class="header-box-tab__common flex flex-center flex-middle"
:class="{
'header-box-tab__common--light':
item.value === $nuxt.$route.fullPath,
}"
@click="onTabSelect(item.value)"
>
{{ item.label }}
</div>
</div>
</div> </div>
</div> </div>
<div v-if="!hideBarLine" class="layout-header-line"></div> <div v-if="!hideBarLine" class="layout-header-line"></div>
@ -224,7 +188,7 @@ export default {
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 50px; height: 70px;
z-index: 10; z-index: 10;
background: #ffffff; background: #ffffff;
box-shadow: 0px 4px 10px 1px rgba(0, 0, 0, 0.1); box-shadow: 0px 4px 10px 1px rgba(0, 0, 0, 0.1);
@ -240,10 +204,14 @@ export default {
.sticky-bar-header__wrap { .sticky-bar-header__wrap {
@include layout-box; @include layout-box;
height: 100%; height: 100%;
> div {
height: 100%;
width: 100%;
}
.bar-header-wrap__logo { .bar-header-wrap__logo {
width: 164px; width: 160px;
height: 28px; height: 40px;
margin-right: 50px; margin-right: 20px;
cursor: pointer; cursor: pointer;
img { img {
width: 100%; width: 100%;
@ -311,47 +279,44 @@ export default {
} }
} }
} }
.header-box-wrap__right {
margin-left: auto;
.box-wrap-right__search {
margin-right: 23px;
.search-input {
width: 240px;
z-index: 1;
border-radius: 4px;
/deep/.el-input__suffix{
display: flex;
align-items: center;
// margin-right: 16px;
}
.search-icon {
width: 32px;
height: 16px;
padding-right: 16px;
// margin-right: 16px;
// margin-top: 12px;
}
}
}
}
.default-bar-header { .default-bar-header {
padding-top: 32px;
position: relative; position: relative;
z-index: 3; z-index: 3;
.bar-header-box { .bar-header-box {
@include layout-box; @include layout-box;
background: #ffffff; background: #ffffff;
.bar-header-box__wrap { .bar-header-box__wrap {
height: 40px; height: 90px;
font-size: 14px; font-size: 14px;
margin-bottom: 38px;
padding-right: 50px;
cursor: pointer; cursor: pointer;
.header-box-wrap__logo { .header-box-wrap__logo {
width: 244px; width: 198px;
height: 100%; height: 50px;
}
.header-box-wrap__right {
.box-wrap-right__search {
margin-right: 23px;
.search-input {
width: 551px;
z-index: 1;
border-radius: 4px;
/deep/.el-input__inner:focus {
border-color: #ff512b;
}
}
.search-icon {
width: 77px;
margin-left: -2px;
background: linear-gradient(270deg, #ffa25a 0%, #ff7f39 100%);
border-radius: 0px 4px 4px 0px;
z-index: 2;
cursor: pointer;
img {
width: 26px;
height: 26px;
}
}
}
} }
} }
.bar-header-box__tab { .bar-header-box__tab {

@ -53,6 +53,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.home-banner { .home-banner {
@include layout-box;
/deep/.el-carousel { /deep/.el-carousel {
.el-carousel__container { .el-carousel__container {
i { i {
@ -67,7 +68,7 @@ export default {
display: none; display: none;
} }
.el-carousel__arrow--left { .el-carousel__arrow--left {
left: calc(50% - 380px) !important; left: calc(50% - 550px) !important;
} }
.el-carousel__arrow--right { .el-carousel__arrow--right {
right: calc(50% - 550px) !important; right: calc(50% - 550px) !important;

@ -7,66 +7,75 @@
--> -->
<template> <template>
<div class="home-sckill flex" @click="onJumpSeckill"> <main class="main">
<div class="home-sckill-bar" :style="{ backgroundImage: `url(${bkgUrl})` }"> <div class="home-sckill-bar flex flex-middle">
<strong class="home-sckill-title">限时秒杀</strong> <img
class="home-sckill-title"
src="~/assets/img/sckill/title.png"
alt=""
/>
<div class="home-sckill-wrap"> <div class="home-sckill-wrap">
<div class="home-sckill-wrap__tip"> <div class="home-sckill-wrap__tip">
<strong>{{ data.activityTimeVO.timeName }}</strong> {{ data.activityTimeVO.timeName }} {{ seckillText }}
<span>{{ seckillText }}</span>
</div> </div>
<div class="home-sckill-wrap__countdown flex flex-middle flex-center"> </div>
<div class="sckill-wrap-countdown__time">{{ countdown.hour }}</div> <div class="home-sckill-wrap__countdown flex flex-middle flex-center">
<span class="sckill-wrap-countdown--mark">:</span> <div class="sckill-wrap-countdown__time">{{ countdown.hour }}</div>
<div class="sckill-wrap-countdown__time">{{ countdown.minute }}</div> <span class="sckill-wrap-countdown--mark">:</span>
<span class="sckill-wrap-countdown--mark">:</span> <div class="sckill-wrap-countdown__time">
<div class="sckill-wrap-countdown__time">{{ countdown.second }}</div> {{ countdown.minute }}
</div>
<span class="sckill-wrap-countdown--mark">:</span>
<div class="sckill-wrap-countdown__time">
{{ countdown.second }}
</div> </div>
</div> </div>
</div> </div>
<div class="home-sckill-carousel"> <div class="home-sckill flex" @click="onJumpSeckill">
<el-carousel <div class="home-sckill-carousel">
height="260px" <el-carousel
arrow="always" height="260px"
:autoplay="false" arrow="always"
:loop="false" :autoplay="false"
> :loop="false"
<el-carousel-item v-for="(item, index) in goodsList" :key="index"> >
<div class="carousel-goods flex"> <el-carousel-item v-for="(item, index) in goodsList" :key="index">
<div <div class="carousel-goods flex">
v-for="(itemChild, indexChild) in item"
:key="itemChild.productId"
class="carousel-goods-box flex flex-middle"
>
<div <div
v-if="indexChild !== 0" v-for="(itemChild, indexChild) in item"
class="carousel-goods-box--line" :key="itemChild.productId"
></div> class="carousel-goods-box flex flex-middle"
<div class="carousel-goods-box__item"> >
<img <div
class="goods-box-item__cover" v-if="indexChild !== 0"
:src="itemChild.productMainPicture" class="carousel-goods-box--line"
/> ></div>
<div class="goods-box-item__wrap"> <div class="carousel-goods-box__item">
<p class="box-item-wrap__title"> <img
{{ itemChild.productName }} class="goods-box-item__cover"
</p> :src="itemChild.productMainPicture"
<strong class="box-item-wrap__price" />
>{{ itemChild.activityPrice }}</strong <div class="goods-box-item__wrap">
> <p class="box-item-wrap__title">
{{ itemChild.productName }}
</p>
<strong class="box-item-wrap__price"
>{{ itemChild.activityPrice }}</strong
>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </el-carousel-item>
</el-carousel-item> </el-carousel>
</el-carousel> </div>
</div> </div>
</div> </main>
</template> </template>
<script> <script>
import _ from "lodash"; import _ from "lodash";
const CAROUSEL_COUNT = 5; // const CAROUSEL_COUNT = 6; //
export default { export default {
name: "HomeSeckill", name: "HomeSeckill",
@ -179,57 +188,48 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.home-sckill { .home-sckill-bar {
height: 260px; width: 100%;
cursor: pointer; padding-bottom: 28px;
.home-sckill-bar { .home-sckill-title {
width: 190px; width: 110px;
height: 100%; height: 26px;
padding: 45px 0 28px 0; margin-right: 20px;
text-align: center; }
color: #ffffff; .home-sckill-wrap {
background-size: 100% 100%; .home-sckill-wrap__tip {
border-radius: 4px 0 0 4px; font-size: 18px;
.home-sckill-title { font-family: Microsoft YaHei-Regular, Microsoft YaHei;
display: block; font-weight: 400;
font-size: 28px; color: #999999;
margin-bottom: 90px; margin-right: 10px;
} }
.home-sckill-wrap { }
margin-bottom: 10px;
.home-sckill-wrap__tip { .home-sckill-wrap__countdown {
font-size: 0; .sckill-wrap-countdown__time {
strong { width: 30px;
font-size: 18px; height: 30px;
margin-right: 4px; line-height: 30px;
} text-align: center;
span { color: #ffffff;
font-size: 14px; font-size: 18px;
} font-weight: bold;
} background: #2f3430;
.home-sckill-wrap__countdown { }
margin-top: 10px; .sckill-wrap-countdown--mark {
.sckill-wrap-countdown__time { display: block;
width: 30px; font-size: 20px;
height: 30px; margin: 0 8px;
line-height: 30px;
text-align: center;
color: #ffffff;
font-size: 18px;
font-weight: bold;
background: #2f3430;
}
.sckill-wrap-countdown--mark {
display: block;
font-size: 20px;
margin: 0 8px;
}
}
} }
} }
}
.home-sckill {
height: 260px;
cursor: pointer;
.home-sckill-carousel { .home-sckill-carousel {
/deep/.el-carousel { /deep/.el-carousel {
width: 1010px; width: 1200px;
border-radius: 4px; border-radius: 4px;
.el-carousel__container { .el-carousel__container {
padding: 0 10px; padding: 0 10px;

Loading…
Cancel
Save