ns-goods-recommend.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <view class="goods-recommend">
  3. <view class="mt-[60rpx] flex flex-col items-center sidebar-margin pb-[50rpx]">
  4. <view class="flex items-center mb-[30rpx]" v-if="goodsList && Object.keys(goodsList).length">
  5. <image class="w-[38rpx] h-[22rpx]" :src="img('addon/mall/like/title_left.png')" mode="aspectFill" />
  6. <text class="text-[30rpx] mx-[18rpx] font-500 text-[#EF000C]">猜你喜欢</text>
  7. <image class="w-[38rpx] h-[22rpx]" :src="img('addon/mall/like/title_right.png')" mode="aspectFill" />
  8. </view>
  9. <diy-goods-list @loadingFn="getGoodsListFn" :component="goodsData" />
  10. </view>
  11. </view>
  12. </template>
  13. <script setup lang="ts">
  14. import { img } from '@/utils/common';
  15. import { ref } from 'vue'
  16. import diyGoodsList from '@/addon/mall/components/diy/mall-goods-list/index.vue';
  17. // 获取分销商品数据
  18. const goodsList = ref()
  19. const getGoodsListFn = (data: any) => {
  20. goodsList.value = data || {}
  21. }
  22. // 商品列表组件
  23. const goodsData = ref({
  24. style: 'style-2',
  25. num: 10,
  26. source: 'all',
  27. topElementRounded: 12,
  28. bottomElementRounded: 12,
  29. margin: {
  30. both: 10,
  31. bottom: 0,
  32. top: 0
  33. },
  34. priceStyle: {
  35. mainColor: "#FF4142",
  36. control: true
  37. },
  38. goodsNameStyle: {
  39. color: "#303133",
  40. control: true,
  41. fontWeight: "normal"
  42. },
  43. saleStyle: {
  44. color: "#999",
  45. control: true
  46. },
  47. labelStyle: {
  48. isShow: true,
  49. control: true
  50. },
  51. btnStyle: {
  52. fontWeight: false,
  53. padding: 0,
  54. aroundRadius: 25,
  55. textColor: "#fff",
  56. startBgColor: '#FF4142',
  57. endBgColor: '#FF4142',
  58. style: 'nc-icon-gouwuche1',
  59. control: true
  60. }
  61. });
  62. </script>
  63. <style lang="scss" scoped>
  64. </style>