Browse Source

fix: 877 广告位图片未自适应

ShangHai_LongXiang
jiannibang 3 years ago
parent
commit
0d87fdcfd9
  1. 65
      src/views/Index/Index.vue

65
src/views/Index/Index.vue

@ -240,10 +240,12 @@ const handleFood = id => {
height: 100vh; height: 100vh;
position: absolute; position: absolute;
top: 0; top: 0;
.header { .header {
width: 100%; width: 100%;
height: 515px; height: 515px;
padding: 392px 0 0 68px; padding: 392px 0 0 68px;
.hot-search { .hot-search {
.title { .title {
font-style: normal; font-style: normal;
@ -252,8 +254,10 @@ const handleFood = id => {
line-height: 23px; line-height: 23px;
color: var(--index-hotSearchTitleColor); color: var(--index-hotSearchTitleColor);
} }
.row { .row {
margin-top: 16px; margin-top: 16px;
.item { .item {
position: relative; position: relative;
display: inline-block; display: inline-block;
@ -262,6 +266,7 @@ const handleFood = id => {
background: var(--index-hotSearchBg); background: var(--index-hotSearchBg);
border-radius: var(--global-radius, 100px); border-radius: var(--global-radius, 100px);
.text { .text {
text-align: center; text-align: center;
font-weight: 900; font-weight: 900;
@ -285,12 +290,14 @@ const handleFood = id => {
top: -10px; top: -10px;
} }
} }
.item + .item { .item + .item {
margin-left: 24px; margin-left: 24px;
} }
} }
} }
} }
.content { .content {
position: relative; position: relative;
width: 100%; width: 100%;
@ -318,6 +325,7 @@ const handleFood = id => {
border-radius: var(--global-radius, 32px); border-radius: var(--global-radius, 32px);
padding: 40px; padding: 40px;
z-index: 1; z-index: 1;
.title { .title {
font-style: normal; font-style: normal;
font-weight: 900; font-weight: 900;
@ -325,6 +333,7 @@ const handleFood = id => {
line-height: 66px; line-height: 66px;
color: #ffffff; color: #ffffff;
} }
.meta { .meta {
margin-top: 8px; margin-top: 8px;
font-style: normal; font-style: normal;
@ -333,11 +342,13 @@ const handleFood = id => {
line-height: 19px; line-height: 19px;
color: rgba(255, 255, 255, 0.8); color: rgba(255, 255, 255, 0.8);
} }
img { img {
margin-top: 40px; margin-top: 40px;
width: 259px; width: 259px;
} }
} }
.bottom-right { .bottom-right {
position: absolute; position: absolute;
width: 108px; width: 108px;
@ -351,6 +362,7 @@ const handleFood = id => {
line-height: 16px; line-height: 16px;
text-align: center; text-align: center;
color: var(--index-guideMetaColor); color: var(--index-guideMetaColor);
.qrcode { .qrcode {
position: absolute; position: absolute;
width: 84px; width: 84px;
@ -363,6 +375,7 @@ const handleFood = id => {
align-items: center; align-items: center;
} }
} }
.meta1 { .meta1 {
display: inline-flex; display: inline-flex;
font-weight: 700; font-weight: 700;
@ -370,12 +383,14 @@ const handleFood = id => {
line-height: 23px; line-height: 23px;
color: var(--index-guideMetaColor); color: var(--index-guideMetaColor);
margin-bottom: 6px; margin-bottom: 6px;
img { img {
width: 20px; width: 20px;
height: 20px; height: 20px;
margin-left: 4px; margin-left: 4px;
} }
} }
.meta2 { .meta2 {
font-weight: 900; font-weight: 900;
font-size: 32px; font-size: 32px;
@ -383,6 +398,7 @@ const handleFood = id => {
color: var(--index-guideColor); color: var(--index-guideColor);
} }
} }
.food, .food,
.rec { .rec {
position: absolute; position: absolute;
@ -392,6 +408,7 @@ const handleFood = id => {
left: 447px; left: 447px;
width: 565px; width: 565px;
height: 557px; height: 557px;
h1 { h1 {
z-index: 1; z-index: 1;
font-weight: 900; font-weight: 900;
@ -400,6 +417,7 @@ const handleFood = id => {
color: #ffffff; color: #ffffff;
margin-bottom: 8px; margin-bottom: 8px;
} }
h2 { h2 {
z-index: 1; z-index: 1;
font-weight: 700; font-weight: 700;
@ -407,9 +425,11 @@ const handleFood = id => {
line-height: 19px; line-height: 19px;
color: rgba(255, 255, 255, 0.8); color: rgba(255, 255, 255, 0.8);
} }
.brandSwiper { .brandSwiper {
height: 389px; height: 389px;
z-index: 0; z-index: 0;
:deep() { :deep() {
.swiper-wrapper { .swiper-wrapper {
transition-timing-function: linear; transition-timing-function: linear;
@ -422,12 +442,14 @@ const handleFood = id => {
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
} }
.grid { .grid {
margin-top: 40px; margin-top: 40px;
display: grid; display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr; grid-template-columns: 1fr 1fr 1fr 1fr;
width: 485px; width: 485px;
gap: 15px; gap: 15px;
.item { .item {
width: 110px; width: 110px;
height: 110px; height: 110px;
@ -438,6 +460,7 @@ const handleFood = id => {
} }
} }
} }
.food { .food {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -446,6 +469,7 @@ const handleFood = id => {
border: var(--index-foodBorder); border: var(--index-foodBorder);
align-items: center; align-items: center;
overflow: hidden; overflow: hidden;
.title { .title {
z-index: 1; z-index: 1;
margin-top: 4px; margin-top: 4px;
@ -458,6 +482,7 @@ const handleFood = id => {
padding: 32px 0 0 40px; padding: 32px 0 0 40px;
} }
} }
.rec { .rec {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -466,6 +491,7 @@ const handleFood = id => {
border-radius: var(--global-radius, 32px); border-radius: var(--global-radius, 32px);
align-items: center; align-items: center;
overflow: hidden; overflow: hidden;
.title { .title {
z-index: 1; z-index: 1;
margin-top: 8px; margin-top: 8px;
@ -485,48 +511,57 @@ const handleFood = id => {
right: 68px; right: 68px;
top: 637px; top: 637px;
display: flex; display: flex;
.item:nth-child(5n + 1) { .item:nth-child(5n + 1) {
.icon { .icon {
background: var(--menu-indexBg1); background: var(--menu-indexBg1);
} }
} }
.item:nth-child(5n + 2) { .item:nth-child(5n + 2) {
.icon { .icon {
background: var(--menu-indexBg2); background: var(--menu-indexBg2);
} }
} }
.item:nth-child(5n + 3) { .item:nth-child(5n + 3) {
.icon { .icon {
background: var(--menu-indexBg3); background: var(--menu-indexBg3);
} }
} }
.item:nth-child(5n + 4) { .item:nth-child(5n + 4) {
.icon { .icon {
background: var(--menu-indexBg4); background: var(--menu-indexBg4);
} }
} }
.item:nth-child(5n + 5) { .item:nth-child(5n + 5) {
.icon { .icon {
background: var(--menu-indexBg5); background: var(--menu-indexBg5);
} }
} }
.item { .item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex: 1; flex: 1;
height: 151px; height: 151px;
justify-content: space-between; justify-content: space-between;
.icon { .icon {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 118px; height: 118px;
border-radius: var(--global-radius, 24px); border-radius: var(--global-radius, 24px);
img { img {
width: 80px; width: 80px;
height: 80px; height: 80px;
} }
} }
.title { .title {
font-weight: 700; font-weight: 700;
font-size: 18px; font-size: 18px;
@ -535,10 +570,12 @@ const handleFood = id => {
color: var(--menu-indexColor); color: var(--menu-indexColor);
} }
} }
.item + .item { .item + .item {
margin-left: 24px; margin-left: 24px;
} }
} }
.acts { .acts {
position: absolute; position: absolute;
left: 68px; left: 68px;
@ -546,6 +583,7 @@ const handleFood = id => {
bottom: 46px; bottom: 46px;
width: 944px; width: 944px;
height: 531px; height: 531px;
:deep(.swiper) { :deep(.swiper) {
.swiper-pagination { .swiper-pagination {
top: 20px; top: 20px;
@ -553,6 +591,7 @@ const handleFood = id => {
bottom: auto; bottom: auto;
left: auto; left: auto;
width: auto; width: auto;
.swiper-pagination-bullet { .swiper-pagination-bullet {
width: 34px !important; width: 34px !important;
height: 4px !important; height: 4px !important;
@ -560,6 +599,7 @@ const handleFood = id => {
border-radius: 6px !important; border-radius: 6px !important;
opacity: inherit !important; opacity: inherit !important;
margin: 0; margin: 0;
&.swiper-pagination-bullet-active { &.swiper-pagination-bullet-active {
background: #ffffff; background: #ffffff;
border-radius: 6px !important; border-radius: 6px !important;
@ -567,17 +607,21 @@ const handleFood = id => {
} }
} }
} }
.banner-wrapper { .banner-wrapper {
position: relative; position: relative;
width: 100%;
height: 100%;
width: 944px;
height: 531px;
border-radius: var(--global-radius, 24px); border-radius: var(--global-radius, 24px);
overflow: hidden; overflow: hidden;
.banner { .banner {
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: cover; object-fit: cover;
border-radius: var(--global-radius, 24px);
} }
.name { .name {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
@ -603,56 +647,73 @@ const handleFood = id => {
font-weight: 700; font-weight: 700;
color: var(--color-white-opacity); color: var(--color-white-opacity);
text-transform: uppercase; text-transform: uppercase;
i { i {
font-size: 60px; font-size: 60px;
} }
} }
} }
@media (min-aspect-ratio: 1/1) { @media (min-aspect-ratio: 1/1) {
.index-container { .index-container {
.header { .header {
height: 280px; height: 280px;
flex: 0 0 280px; flex: 0 0 280px;
padding: 157px 0 0 0; padding: 157px 0 0 0;
.hot-search { .hot-search {
.title { .title {
text-align: center; text-align: center;
} }
.row { .row {
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
} }
} }
.content { .content {
.guide { .guide {
top: 84px; top: 84px;
width: 339px; width: 339px;
height: 625px; height: 625px;
padding: 528px 0 0 40px; padding: 528px 0 0 40px;
.top { .top {
height: 500px; height: 500px;
} }
} }
.rec, .rec,
.food { .food {
height: 625px; height: 625px;
top: 84px; top: 84px;
.brandSwiper { .brandSwiper {
height: 457px; height: 457px;
} }
} }
.menu { .menu {
left: 1068px; left: 1068px;
right: 68px; right: 68px;
top: 84px; top: 84px;
} }
.acts { .acts {
top: 267px; top: 267px;
left: 1068px; left: 1068px;
right: 68px; right: 68px;
width: 784px; width: 784px;
height: 442px; height: 442px;
.banner-wrapper {
width: 784px;
height: 442px;
.name {
width: 784px;
}
}
} }
} }
} }

Loading…
Cancel
Save