Commit c9c9934613a9a7692ea9c46cb8258a0a9e4b5b10

Authored by boyang
1 parent 70a1f94e

feat: 开发手机端热销、推荐

components/ProductDetail.vue
... ... @@ -505,7 +505,7 @@ const props = defineProps<{
505 505 }>();
506 506 const info = props.info;
507 507 let { data: resData } = await useAsyncData(
508   - "detail",
  508 + "list",
509 509 () =>
510 510 $fetch("/shop/product/list", {
511 511 method: "GET",
... ... @@ -798,6 +798,17 @@ th {
798 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 812 .image-row {
802 813 display: flex;
803 814 height: 245px;
... ... @@ -818,6 +829,14 @@ th {
818 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 840 @media screen and (min-width: 1537px) {
822 841 .image-row img {
823 842 width: 240px;
... ... @@ -830,6 +849,12 @@ th {
830 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 858 @media screen and (min-width: 1537px) {
834 859 .image-name {
835 860 display: block;
... ... @@ -852,6 +877,17 @@ th {
852 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 892 button .recommendButton {
857 893 margin: 0 0px;
... ...
pages/index.vue
... ... @@ -459,6 +459,13 @@ const hotLength = computed(() =>
459 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 470 .active {
464 471 background-color: #1086e8;
... ... @@ -493,6 +500,16 @@ const hotLength = computed(() =>
493 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 513 .image-row {
497 514 display: flex;
498 515 height: 305px;
... ... @@ -509,6 +526,12 @@ const hotLength = computed(() =>
509 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 535 @media screen and (min-width: 1537px) {
513 536 .imageTotal {
514 537 display: inline-block;
... ... @@ -537,6 +560,13 @@ const hotLength = computed(() =>
537 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 570 @media screen and (min-width: 1537px) {
541 571 .image-name {
542 572 display: block;
... ... @@ -559,6 +589,17 @@ const hotLength = computed(() =>
559 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 603 button .recommendButton {
563 604 margin: 0 0px;
564 605 cursor: pointer;
... ...
pages/products/index.vue
... ... @@ -533,6 +533,17 @@ const hotLength = computed(() =>
533 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 547 .image-row {
537 548 display: flex;
538 549 height: 245px;
... ... @@ -553,6 +564,14 @@ const hotLength = computed(() =>
553 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 575 @media screen and (min-width: 1537px) {
557 576 .image-row img {
558 577 width: 240px;
... ... @@ -565,6 +584,12 @@ const hotLength = computed(() =>
565 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 593 @media screen and (min-width: 1537px) {
569 594 .image-name {
570 595 display: block;
... ... @@ -587,6 +612,17 @@ const hotLength = computed(() =>
587 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 627 button .recommendButton {
592 628 margin: 0 0px;
... ...