Commit c9c9934613a9a7692ea9c46cb8258a0a9e4b5b10
1 parent
70a1f94e
feat: 开发手机端热销、推荐
Showing
3 changed files
with
114 additions
and
1 deletions
components/ProductDetail.vue
@@ -505,7 +505,7 @@ const props = defineProps<{ | @@ -505,7 +505,7 @@ const props = defineProps<{ | ||
505 | }>(); | 505 | }>(); |
506 | const info = props.info; | 506 | const info = props.info; |
507 | let { data: resData } = await useAsyncData( | 507 | let { data: resData } = await useAsyncData( |
508 | - "detail", | 508 | + "list", |
509 | () => | 509 | () => |
510 | $fetch("/shop/product/list", { | 510 | $fetch("/shop/product/list", { |
511 | method: "GET", | 511 | method: "GET", |
@@ -798,6 +798,17 @@ th { | @@ -798,6 +798,17 @@ th { | ||
798 | padding: 0; | 798 | padding: 0; |
799 | } | 799 | } |
800 | } | 800 | } |
801 | +@media screen and (max-width: 1280px) { | ||
802 | + #image-container { | ||
803 | + display: flex; | ||
804 | + align-items: center; | ||
805 | + justify-content: center; | ||
806 | + height: 320px; | ||
807 | + margin: 10px auto 0px; | ||
808 | + width: 80%; | ||
809 | + padding: 0; | ||
810 | + } | ||
811 | +} | ||
801 | .image-row { | 812 | .image-row { |
802 | display: flex; | 813 | display: flex; |
803 | height: 245px; | 814 | height: 245px; |
@@ -818,6 +829,14 @@ th { | @@ -818,6 +829,14 @@ th { | ||
818 | width: 200px; | 829 | width: 200px; |
819 | } | 830 | } |
820 | } | 831 | } |
832 | +@media screen and (max-width: 1280px) { | ||
833 | + .imageTotal { | ||
834 | + display: inline-block; | ||
835 | + margin: 0 5px; | ||
836 | + text-align: center; | ||
837 | + width: 200px; | ||
838 | + } | ||
839 | +} | ||
821 | @media screen and (min-width: 1537px) { | 840 | @media screen and (min-width: 1537px) { |
822 | .image-row img { | 841 | .image-row img { |
823 | width: 240px; | 842 | width: 240px; |
@@ -830,6 +849,12 @@ th { | @@ -830,6 +849,12 @@ th { | ||
830 | height: 140px; | 849 | height: 140px; |
831 | } | 850 | } |
832 | } | 851 | } |
852 | +@media screen and (max-width: 1280px) { | ||
853 | + .image-row img { | ||
854 | + width: 160px; | ||
855 | + height: 160px; | ||
856 | + } | ||
857 | +} | ||
833 | @media screen and (min-width: 1537px) { | 858 | @media screen and (min-width: 1537px) { |
834 | .image-name { | 859 | .image-name { |
835 | display: block; | 860 | display: block; |
@@ -852,6 +877,17 @@ th { | @@ -852,6 +877,17 @@ th { | ||
852 | margin-left: 10px; | 877 | margin-left: 10px; |
853 | } | 878 | } |
854 | } | 879 | } |
880 | +@media screen and (max-width: 1280px) { | ||
881 | + .image-name { | ||
882 | + display: block; | ||
883 | + margin-top: 5px; | ||
884 | + font-size: 16px; | ||
885 | + width: 180px; | ||
886 | + color: #555; | ||
887 | + text-align: left; | ||
888 | + margin-left: 20px; | ||
889 | + } | ||
890 | +} | ||
855 | 891 | ||
856 | button .recommendButton { | 892 | button .recommendButton { |
857 | margin: 0 0px; | 893 | margin: 0 0px; |
pages/index.vue
@@ -459,6 +459,13 @@ const hotLength = computed(() => | @@ -459,6 +459,13 @@ const hotLength = computed(() => | ||
459 | width: 80%; | 459 | width: 80%; |
460 | } | 460 | } |
461 | } | 461 | } |
462 | +@media screen and (max-width: 1280px) { | ||
463 | + .tabs { | ||
464 | + border-bottom: 2px solid #1f88e5; | ||
465 | + margin: 10px auto 0px; | ||
466 | + width: 95%; | ||
467 | + } | ||
468 | +} | ||
462 | 469 | ||
463 | .active { | 470 | .active { |
464 | background-color: #1086e8; | 471 | background-color: #1086e8; |
@@ -493,6 +500,16 @@ const hotLength = computed(() => | @@ -493,6 +500,16 @@ const hotLength = computed(() => | ||
493 | width: 80%; | 500 | width: 80%; |
494 | } | 501 | } |
495 | } | 502 | } |
503 | +@media screen and (max-width: 1280px) { | ||
504 | + #image-container { | ||
505 | + display: flex; | ||
506 | + align-items: center; | ||
507 | + justify-content: center; | ||
508 | + height: 260px; | ||
509 | + margin: 10px auto 30px; | ||
510 | + width: 90%; | ||
511 | + } | ||
512 | +} | ||
496 | .image-row { | 513 | .image-row { |
497 | display: flex; | 514 | display: flex; |
498 | height: 305px; | 515 | height: 305px; |
@@ -509,6 +526,12 @@ const hotLength = computed(() => | @@ -509,6 +526,12 @@ const hotLength = computed(() => | ||
509 | height: 245px; | 526 | height: 245px; |
510 | } | 527 | } |
511 | } | 528 | } |
529 | +@media screen and (max-width: 1280px) { | ||
530 | + .image-row { | ||
531 | + display: flex; | ||
532 | + height: 220px; | ||
533 | + } | ||
534 | +} | ||
512 | @media screen and (min-width: 1537px) { | 535 | @media screen and (min-width: 1537px) { |
513 | .imageTotal { | 536 | .imageTotal { |
514 | display: inline-block; | 537 | display: inline-block; |
@@ -537,6 +560,13 @@ const hotLength = computed(() => | @@ -537,6 +560,13 @@ const hotLength = computed(() => | ||
537 | height: 140px; | 560 | height: 140px; |
538 | } | 561 | } |
539 | } | 562 | } |
563 | +@media screen and (max-width: 1280px) { | ||
564 | + .image-row img { | ||
565 | + width: 160px; | ||
566 | + height: 160px; | ||
567 | + margin-left: 10px; | ||
568 | + } | ||
569 | +} | ||
540 | @media screen and (min-width: 1537px) { | 570 | @media screen and (min-width: 1537px) { |
541 | .image-name { | 571 | .image-name { |
542 | display: block; | 572 | display: block; |
@@ -559,6 +589,17 @@ const hotLength = computed(() => | @@ -559,6 +589,17 @@ const hotLength = computed(() => | ||
559 | margin-left: 10px; | 589 | margin-left: 10px; |
560 | } | 590 | } |
561 | } | 591 | } |
592 | +@media screen and (max-width: 1280px) { | ||
593 | + .image-name { | ||
594 | + display: block; | ||
595 | + margin-top: 5px; | ||
596 | + font-size: 16px; | ||
597 | + width: 180px; | ||
598 | + color: #555; | ||
599 | + text-align: left; | ||
600 | + margin-left: 5px; | ||
601 | + } | ||
602 | +} | ||
562 | button .recommendButton { | 603 | button .recommendButton { |
563 | margin: 0 0px; | 604 | margin: 0 0px; |
564 | cursor: pointer; | 605 | cursor: pointer; |
pages/products/index.vue
@@ -533,6 +533,17 @@ const hotLength = computed(() => | @@ -533,6 +533,17 @@ const hotLength = computed(() => | ||
533 | padding: 0; | 533 | padding: 0; |
534 | } | 534 | } |
535 | } | 535 | } |
536 | +@media screen and (max-width: 1280px) { | ||
537 | + #image-container { | ||
538 | + display: flex; | ||
539 | + align-items: center; | ||
540 | + justify-content: center; | ||
541 | + height: 320px; | ||
542 | + margin: 10px auto 0px; | ||
543 | + width: 80%; | ||
544 | + padding: 0; | ||
545 | + } | ||
546 | +} | ||
536 | .image-row { | 547 | .image-row { |
537 | display: flex; | 548 | display: flex; |
538 | height: 245px; | 549 | height: 245px; |
@@ -553,6 +564,14 @@ const hotLength = computed(() => | @@ -553,6 +564,14 @@ const hotLength = computed(() => | ||
553 | width: 200px; | 564 | width: 200px; |
554 | } | 565 | } |
555 | } | 566 | } |
567 | +@media screen and (max-width: 1280px) { | ||
568 | + .imageTotal { | ||
569 | + display: inline-block; | ||
570 | + margin: 0 5px; | ||
571 | + text-align: center; | ||
572 | + width: 200px; | ||
573 | + } | ||
574 | +} | ||
556 | @media screen and (min-width: 1537px) { | 575 | @media screen and (min-width: 1537px) { |
557 | .image-row img { | 576 | .image-row img { |
558 | width: 240px; | 577 | width: 240px; |
@@ -565,6 +584,12 @@ const hotLength = computed(() => | @@ -565,6 +584,12 @@ const hotLength = computed(() => | ||
565 | height: 140px; | 584 | height: 140px; |
566 | } | 585 | } |
567 | } | 586 | } |
587 | +@media screen and (max-width: 1280px) { | ||
588 | + .image-row img { | ||
589 | + width: 160px; | ||
590 | + height: 160px; | ||
591 | + } | ||
592 | +} | ||
568 | @media screen and (min-width: 1537px) { | 593 | @media screen and (min-width: 1537px) { |
569 | .image-name { | 594 | .image-name { |
570 | display: block; | 595 | display: block; |
@@ -587,6 +612,17 @@ const hotLength = computed(() => | @@ -587,6 +612,17 @@ const hotLength = computed(() => | ||
587 | margin-left: 10px; | 612 | margin-left: 10px; |
588 | } | 613 | } |
589 | } | 614 | } |
615 | +@media screen and (max-width: 1280px) { | ||
616 | + .image-name { | ||
617 | + display: block; | ||
618 | + margin-top: 5px; | ||
619 | + font-size: 16px; | ||
620 | + width: 180px; | ||
621 | + color: #555; | ||
622 | + text-align: left; | ||
623 | + margin-left: 10px; | ||
624 | + } | ||
625 | +} | ||
590 | 626 | ||
591 | button .recommendButton { | 627 | button .recommendButton { |
592 | margin: 0 0px; | 628 | margin: 0 0px; |