cookbookList.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <view class="cookbook">
  3. <view v-for="(item,index) in list" :key="index" class="cookbook-item">
  4. <view class="cookbook-item-img">
  5. <image style="width: 100%;height: 100%;" :src="item.cookbook_photos[0] ?item.cookbook_photos[0] :''" mode=""></image>
  6. </view>
  7. <view class="cookbook-item-content">
  8. <view class="cookbook-item-content-title">
  9. {{item.cookbook_name}}
  10. </view>
  11. <view class="nourishment">
  12. <view class="nourishment-item">
  13. <view class="">
  14. 能量
  15. </view>
  16. <view class="">
  17. {{item.energy}}(Kcal)
  18. </view>
  19. </view>
  20. <view class="nourishment-item">
  21. <view class="">
  22. 碳水化合物
  23. </view>
  24. <view class="">
  25. {{item.carbohydrate}}(g)
  26. </view>
  27. </view>
  28. <view class="nourishment-item">
  29. <view class="">
  30. 蛋白质
  31. </view>
  32. <view class="">
  33. {{item.protein}}(g)
  34. </view>
  35. </view>
  36. <view class="nourishment-item">
  37. <view class="">
  38. 维生素C
  39. </view>
  40. <view class="">
  41. {{item.vitamin_c}}(mg)
  42. </view>
  43. </view>
  44. <view class="nourishment-item">
  45. <view class="">
  46. 膳食纤维
  47. </view>
  48. <view class="">
  49. {{item.dietary_fiber}}(g)
  50. </view>
  51. </view>
  52. <view class="nourishment-item">
  53. <view class="">
  54. 脂肪
  55. </view>
  56. <view class="">
  57. {{item.fat}}(g)
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. export default {
  67. name: "cookbookList",
  68. props: {
  69. list: {
  70. type: Array,
  71. default: () => []
  72. }
  73. },
  74. data() {
  75. return {
  76. };
  77. }
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. .cookbook {
  82. width: 100%;
  83. font-family: 'PingFang';
  84. .cookbook-item {
  85. width: 100%;
  86. height: 194rpx;
  87. background-color: #fff;
  88. border-radius: 5.33px;
  89. margin-bottom: 32rpx;
  90. box-shadow: 0px 0px 6.67px 0px rgba(147, 147, 147, 0.20);
  91. overflow: hidden;
  92. display: flex;
  93. .cookbook-item-img {
  94. width: 214rpx;
  95. height: 100%;
  96. }
  97. .cookbook-item-content {
  98. flex: 1;
  99. padding: 10rpx;
  100. .cookbook-item-content-title {
  101. border-bottom: 1px solid #f2f2f2;
  102. font-size: 32rpx;
  103. font-weight: 700;
  104. }
  105. }
  106. }
  107. }
  108. .nourishment {
  109. font-size: 24rpx;
  110. display: flex;
  111. flex-wrap: wrap;
  112. .nourishment-item {
  113. display: flex;
  114. width: 50%;
  115. box-sizing: border-box;
  116. justify-content: space-between;
  117. padding-right: 10rpx;
  118. padding-right: 10rpx;
  119. }
  120. }
  121. </style>