commodity.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view class="list">
  3. <view class="merchant"
  4. ><image class="merchant-img" :src="goodsList.image" mode="scaleToFill" />
  5. <view class="merchant-name">{{ goodsList.merchant_name }}</view>
  6. </view>
  7. <view
  8. v-for="item in goodsList.goods"
  9. :key="item.id"
  10. class="detail"
  11. v-if="item.true_stock > item.goods_num"
  12. >
  13. <image :src="item.sku_item.image" class="detail-img" mode=""></image>
  14. <view class="detail-right">
  15. <view class="">
  16. <text class="toptitle">{{ item.goods_name }}</text>
  17. <view class="weight">{{ item.sku_item.item }} </view>
  18. </view>
  19. <view class="u-flex u-row-between">
  20. <view class="money">
  21. <text>¥</text>
  22. <text style="font-size: 34rpx">{{ item.discount_price }}</text>
  23. </view>
  24. <view class="stepping">
  25. <text>x</text>
  26. <!-- <u-icon
  27. name="minus"
  28. size="12"
  29. @click="$emit('changeGoodsNum', 'reduce')"
  30. ></u-icon> -->
  31. <text>{{ item.goods_num }}</text>
  32. <!-- <u-icon
  33. name="plus"
  34. size="12"
  35. @click="$emit('changeGoodsNum', 'increase')"
  36. ></u-icon> -->
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. export default {
  45. props: {
  46. //商品列表
  47. goodsList: {
  48. typeof: Array,
  49. default: () => {
  50. return [];
  51. },
  52. },
  53. goodsValue: {
  54. typeof: Number,
  55. default: 0,
  56. },
  57. },
  58. };
  59. </script>
  60. <style scoped lang="scss">
  61. .list {
  62. margin-top: 20rpx;
  63. background-color: #fff;
  64. border-radius: 16rpx;
  65. padding: 28rpx 26rpx 36rpx 24rpx;
  66. .merchant {
  67. display: flex;
  68. justify-content: flex-start;
  69. .merchant-img {
  70. width: 38rpx;
  71. height: 38rpx;
  72. margin-right: 16rpx;
  73. }
  74. .merchant-name {
  75. font-size: 30rpx;
  76. color: #222;
  77. }
  78. }
  79. .detail {
  80. margin-top: 32rpx;
  81. display: flex;
  82. .detail-img {
  83. width: 184rpx;
  84. height: 184rpx;
  85. margin-right: 24rpx;
  86. }
  87. .detail-right {
  88. flex-direction: column;
  89. justify-content: space-between;
  90. height: 184rpx;
  91. display: flex;
  92. flex: 1;
  93. .toptitle {
  94. font-family: PingFangSC, PingFang SC;
  95. font-size: 28rpx;
  96. color: #222222;
  97. width: 100%;
  98. overflow: hidden;
  99. text-overflow: ellipsis;
  100. -webkit-line-clamp: 1;
  101. display: -webkit-box;
  102. -webkit-box-orient: vertical;
  103. word-break: break-all;
  104. margin-bottom: 16rpx;
  105. }
  106. .weight {
  107. font-family: PingFangSC, PingFang SC;
  108. font-size: 24rpx;
  109. color: rgba(34, 34, 34, 0.6);
  110. line-height: 34rpx;
  111. }
  112. .money {
  113. font-family: HarmonyOS_Sans_Medium;
  114. font-size: 24rpx;
  115. color: #f83224;
  116. line-height: 38rpx;
  117. text-align: left;
  118. font-style: normal;
  119. // font-weight: 500;
  120. font-weight: bold;
  121. }
  122. .stepping {
  123. display: flex;
  124. width: 50rpx;
  125. height: 40rpx;
  126. justify-content: space-around;
  127. align-items: center;
  128. font-size: 30rpx;
  129. // border: 2rpx solid rgba(151, 151, 151, 0.4);
  130. border-radius: 20rpx;
  131. }
  132. }
  133. }
  134. }
  135. </style>