product.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view class="list-box">
  3. <navigator class="item" :url="'/packageCase/product/detail?id=' + item.sa_fadid" v-for="item in list"
  4. :key="item.sa_fadid" hover-class="navigator-hover">
  5. <image class="image" :src="item.cover" mode="aspectFill" lazy-load="true" />
  6. <view class="title u-line-1">
  7. {{ item.name }}
  8. </view>
  9. </navigator>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. name: "list",
  15. props: {
  16. list: {
  17. type: Array
  18. }
  19. },
  20. methods: {
  21. handleList(list) {
  22. return list.map(v => {
  23. v.cover = v.attinfos.length ? this.getSpecifiedImage(v.attinfos.find(s => s.usetype == "sa_fad") || v.attinfos[0]) : uni.getStorageSync("site").logo || ''
  24. return v
  25. })
  26. }
  27. },
  28. }
  29. </script>
  30. <style lang="scss">
  31. .list-box {
  32. display: flex;
  33. flex-wrap: wrap;
  34. justify-content: space-between;
  35. .item {
  36. width: 173px;
  37. height: 207px;
  38. margin-top: 10px;
  39. border-radius: 5px;
  40. overflow: hidden;
  41. flex-shrink: 0;
  42. .image {
  43. width: 173px;
  44. height: 172px;
  45. background: #F5F5F5;
  46. border-radius: 5px;
  47. }
  48. .title {
  49. width: 100%;
  50. height: 25px;
  51. line-height: 20px;
  52. font-family: PingFang SC, PingFang SC;
  53. font-size: 14px;
  54. color: #333333;
  55. margin-top: 10px;
  56. text-align: center;
  57. }
  58. }
  59. }
  60. </style>