moreFromBrand.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <script lang='ts' setup>
  2. import { getBrandGoodsListApi } from '~/api/model/brand'
  3. import { PageSizeEnum } from '~/enums/sizeEnum'
  4. const props = defineProps({
  5. brandId: { type: String, default: '' },
  6. brandInfo: { type: Object, default: () => {} },
  7. })
  8. const brandGoodsList = ref<any>([])
  9. watch(() => props.brandId, (id) => {
  10. if (!id)
  11. return
  12. getBrandGoodsList(id)
  13. }, {
  14. immediate: true,
  15. })
  16. async function getBrandGoodsList(brandId = props.brandId, pageNo = PageSizeEnum.PAGE, pageSize = 8) {
  17. const res: any = await getBrandGoodsListApi({
  18. brandId,
  19. pageNo,
  20. pageSize,
  21. })
  22. brandGoodsList.value = res.records
  23. }
  24. </script>
  25. <template>
  26. <div v-if="!!brandInfo" class="w-1400px mx-auto mb-160px">
  27. <h2 class="!mb-60px !fw-700 text-40px text-#363C40 text-center custom-title-font">
  28. Brand information
  29. </h2>
  30. <div class="flex pb-60px items-center">
  31. <img :src="brandInfo?.brandLogo" class="w-120px h-120px object-contain b-rd-10px" alt="" srcset="">
  32. <div class="ml-28px">
  33. <div class="fw-700 text-32px text-#363C40 custom-title-font mb-24px">
  34. {{ brandInfo?.brandName }}
  35. </div>
  36. <div class="text-16px text-#999999">
  37. {{ brandInfo?.brandStory }}
  38. </div>
  39. </div>
  40. </div>
  41. <div v-if="brandGoodsList.length">
  42. <div class="grid grid-gap-66px grid-cols-4">
  43. <div v-for="item in brandGoodsList" :key="item.id">
  44. <common-goods-item :item @update:login="getBrandGoodsList" />
  45. </div>
  46. </div>
  47. </div>
  48. <div class="flex justify-center items-center mt-60px">
  49. <NuxtLink :to="`/brand/${brandId}`" class="flex justify-center items-center cursor-pointer">
  50. <div class="underline fw-500 text-#5B463E text-22px hover:text-#CC9879">
  51. View All
  52. </div>
  53. <svgo-arrow class="!w-20px !h-20px ml-16px" />
  54. </NuxtLink>
  55. </div>
  56. </div>
  57. </template>
  58. <style lang='less' scoped>
  59. </style>