Commit cd856636a875109a06b652f06443a14dbe1f6b08
1 parent
c9c99346
feat: 开发手机端期刊推荐
Showing
1 changed file
with
51 additions
and
24 deletions
components/MobileProductDetail.vue
@@ -206,8 +206,10 @@ | @@ -206,8 +206,10 @@ | ||
206 | <v-tabs | 206 | <v-tabs |
207 | class="tabs" | 207 | class="tabs" |
208 | v-model="tab" | 208 | v-model="tab" |
209 | - bg-color="#fff" | ||
210 | - slider-color="#1d89e4" | 209 | + style="margin-top: 25px; margin-bottom: 20px" |
210 | + color="white" | ||
211 | + bg-color="#eeeeee" | ||
212 | + slider-color="blue-lighten-1" | ||
211 | selected-class="active" | 213 | selected-class="active" |
212 | > | 214 | > |
213 | <v-tab :value="1">Product Details</v-tab> | 215 | <v-tab :value="1">Product Details</v-tab> |
@@ -263,8 +265,9 @@ | @@ -263,8 +265,9 @@ | ||
263 | <v-tabs | 265 | <v-tabs |
264 | class="tabs" | 266 | class="tabs" |
265 | v-model="tabProduct" | 267 | v-model="tabProduct" |
266 | - bg-color="#fff" | ||
267 | - slider-color="#1d89e4" | 268 | + color="white" |
269 | + bg-color="#eeeeee" | ||
270 | + slider-color="blue-lighten-1" | ||
268 | selected-class="active" | 271 | selected-class="active" |
269 | style="margin-bottom: 20px" | 272 | style="margin-bottom: 20px" |
270 | > | 273 | > |
@@ -397,20 +400,39 @@ | @@ -397,20 +400,39 @@ | ||
397 | <!-- <v-window-item key="3" :value="3"> 2 </v-window-item> --> | 400 | <!-- <v-window-item key="3" :value="3"> 2 </v-window-item> --> |
398 | </v-window> | 401 | </v-window> |
399 | </div> | 402 | </div> |
400 | - <!-- <div class="tw-pb-[64px] ma-4 rounded-lg"> | 403 | + <div class="tw-pb-[64px] ma-4 rounded-lg"> |
401 | <v-tabs | 404 | <v-tabs |
402 | class="tabs" | 405 | class="tabs" |
403 | v-model="tabJournal" | 406 | v-model="tabJournal" |
404 | - bg-color="#fff" | ||
405 | - slider-color="#1d89e4" | 407 | + color="white" |
408 | + bg-color="#eeeeee" | ||
409 | + slider-color="blue-lighten-1" | ||
406 | selected-class="active" | 410 | selected-class="active" |
407 | > | 411 | > |
408 | <v-tab :value="1">JOURNAL RECOMMENDATION</v-tab> | 412 | <v-tab :value="1">JOURNAL RECOMMENDATION</v-tab> |
409 | </v-tabs> | 413 | </v-tabs> |
410 | - <v-window v-model="tab"> | ||
411 | - <v-window-item key="1" :value="1"> </v-window-item> | 414 | + <v-window v-model="tabJournal"> |
415 | + <v-window-item key="1" :value="1"> | ||
416 | + <v-list> | ||
417 | + <v-list-item | ||
418 | + v-for="item in info.journals" | ||
419 | + :key="item.id" | ||
420 | + @click="navigateToUrl(item.link)" | ||
421 | + @mouseenter="hoveredItem = item.id" | ||
422 | + @mouseleave="hoveredItem = null" | ||
423 | + > | ||
424 | + <v-list-item-title> | ||
425 | + <span | ||
426 | + :class="['title', { 'full-title': hoveredItem === item.id }]" | ||
427 | + > | ||
428 | + {{ item.title }} | ||
429 | + </span> | ||
430 | + </v-list-item-title> | ||
431 | + </v-list-item> | ||
432 | + </v-list> | ||
433 | + </v-window-item> | ||
412 | </v-window> | 434 | </v-window> |
413 | - </div> --> | 435 | + </div> |
414 | <!-- Basic use --> | 436 | <!-- Basic use --> |
415 | <div class="social-share-container"> | 437 | <div class="social-share-container"> |
416 | <SocialShare | 438 | <SocialShare |
@@ -457,9 +479,9 @@ const info = props.info; | @@ -457,9 +479,9 @@ const info = props.info; | ||
457 | // onMounted(() => { | 479 | // onMounted(() => { |
458 | // dialogStore.updateDialog(true) | 480 | // dialogStore.updateDialog(true) |
459 | // }) | 481 | // }) |
460 | -const tab = ref(0); | ||
461 | -const tabProduct = ref(0); | ||
462 | -const tabJournal = ref(0); | 482 | +const tab = ref(); |
483 | +const tabProduct = ref(); | ||
484 | +const tabJournal = ref(); | ||
463 | const slide = ref(0); | 485 | const slide = ref(0); |
464 | const router = useRouter(); | 486 | const router = useRouter(); |
465 | const href1 = ref("/products"); | 487 | const href1 = ref("/products"); |
@@ -481,7 +503,11 @@ const currentIndexHot = ref(1); | @@ -481,7 +503,11 @@ const currentIndexHot = ref(1); | ||
481 | const total = ref(3); | 503 | const total = ref(3); |
482 | const hotTotal = ref(10); | 504 | const hotTotal = ref(10); |
483 | const isOrNotMobile = isMobile(); | 505 | const isOrNotMobile = isMobile(); |
506 | +const hoveredItem = ref(null); | ||
484 | 507 | ||
508 | +const navigateToUrl = (url) => { | ||
509 | + window.open(url); // 在新标签页中打开链接 | ||
510 | +}; | ||
485 | const loadProducts = async () => { | 511 | const loadProducts = async () => { |
486 | const pageSize = 4; | 512 | const pageSize = 4; |
487 | loading.value = true; | 513 | loading.value = true; |
@@ -502,8 +528,8 @@ const loadProducts = async () => { | @@ -502,8 +528,8 @@ const loadProducts = async () => { | ||
502 | } | 528 | } |
503 | ); | 529 | ); |
504 | total.value = resData.value.data.total; | 530 | total.value = resData.value.data.total; |
505 | - if (total.value > 30) { | ||
506 | - total.value = 30; | 531 | + if (total.value > 50) { |
532 | + total.value = 50; | ||
507 | } | 533 | } |
508 | recommendList.value = resData.value.data.records; | 534 | recommendList.value = resData.value.data.records; |
509 | maxPageRe.value = resData.value.data.pages; | 535 | maxPageRe.value = resData.value.data.pages; |
@@ -724,21 +750,22 @@ const hotLength = computed(() => | @@ -724,21 +750,22 @@ const hotLength = computed(() => | ||
724 | </script> | 750 | </script> |
725 | 751 | ||
726 | <style lang="scss" scoped> | 752 | <style lang="scss" scoped> |
727 | -.tabs { | ||
728 | - border-bottom: 2px solid #cbd9e4; | ||
729 | -} | ||
730 | - | ||
731 | -.active { | ||
732 | - background-color: #fff; | ||
733 | -} | ||
734 | // .tabs { | 753 | // .tabs { |
735 | -// border-bottom: 2px solid #1f88e5; | 754 | +// border-bottom: 2px solid #cbd9e4; |
736 | // } | 755 | // } |
737 | 756 | ||
738 | // .active { | 757 | // .active { |
739 | -// background-color: #1086e8; | 758 | +// background-color: #fff; |
740 | // } | 759 | // } |
741 | 760 | ||
761 | +.tabs { | ||
762 | + border-bottom: 2px solid #1f88e5; | ||
763 | +} | ||
764 | + | ||
765 | +.active { | ||
766 | + background-color: #1086e8; | ||
767 | +} | ||
768 | + | ||
742 | .tw-sticky { | 769 | .tw-sticky { |
743 | position: sticky; | 770 | position: sticky; |
744 | } | 771 | } |