敢为人鲜小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

162 lines
2.9 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
  1. <template>
  2. <view class="item" @click="$emit('click')">
  3. <!-- 商品图片 -->
  4. <view class="item-image">
  5. <image :src="item.image &&
  6. item.image.split(',')[0]" mode="aspectFill">
  7. </image>
  8. </view>
  9. <!-- 商品信息 -->
  10. <view class="info">
  11. <!-- 商品标题 -->
  12. <view class="title">
  13. {{ item.title }}
  14. </view>
  15. <!-- 价格 -->
  16. <view class="price">
  17. <view class="money">
  18. <text>{{ item.vipPrice }}/元每件</text>
  19. </view>
  20. <view class="price-imgs">
  21. <image :src="configList.vip_money_one" mode="widthFix" class="price-img"></image>
  22. <image v-if="false" :src="configList.vip_money_onevip_money_two" mode="widthFix" class="price-img">
  23. </image>
  24. <image v-if="false" :src="configList.vip_money_three" mode="widthFix" class="price-img"></image>
  25. </view>
  26. </view>
  27. <!-- 销量 -->
  28. <view class="sales-volume">
  29. <view class="sales-volume-imgbox">
  30. <image src="@/static/image/category/sales-volume-icon.png" mode="widthFix" class="sales-volume-img">
  31. </image>
  32. </view>
  33. <view class="sales-volume-number">
  34. 已售出32490+
  35. </view>
  36. </view>
  37. <!-- 购买按钮 -->
  38. <view class="buy-btn">
  39. 购买
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. export default {
  46. props: {
  47. item: {
  48. default: {}
  49. }
  50. },
  51. data() {
  52. return {
  53. }
  54. },
  55. methods: {
  56. }
  57. }
  58. </script>
  59. <style scoped lang="scss">
  60. .item {
  61. width: 100%;
  62. padding: 10rpx 20rpx;
  63. align-items: center;
  64. margin-bottom: 20rpx;
  65. display: flex;
  66. box-sizing: border-box;
  67. border-bottom: 1rpx solid #00000012;
  68. background: white;
  69. border-radius: 20rpx;
  70. // 商品图片
  71. .item-image {
  72. width: 180rpx;
  73. height: 180rpx;
  74. image {
  75. height: 100%;
  76. width: 100%;
  77. border-radius: 20rpx;
  78. }
  79. }
  80. // 商品信息
  81. .info {
  82. padding: 20rpx;
  83. color: #555;
  84. width: calc(100% - 180rpx);
  85. box-sizing: border-box;
  86. overflow: hidden;
  87. // 商品标题
  88. .title {
  89. width: 100%;
  90. font-size: 28rpx;
  91. font-weight: bold;
  92. overflow: hidden; //超出的文本隐藏
  93. text-overflow: ellipsis; //溢出用省略号显示
  94. // white-space: nowrap; //溢出不换行
  95. }
  96. // 价格
  97. .price {
  98. display: flex;
  99. align-items: center;
  100. color: #f40;
  101. font-size: 26rpx;
  102. .money {
  103. font-size: 30rpx;
  104. }
  105. .price-imgs {
  106. display: flex;
  107. flex-wrap: wrap;
  108. .price-img {
  109. width: 80rpx;
  110. margin-left: 10rpx;
  111. }
  112. }
  113. }
  114. // 销量
  115. .sales-volume {
  116. display: flex;
  117. align-items: center;
  118. flex-wrap: wrap;
  119. .sales-volume-imgbox {
  120. width: 20rpx;
  121. .sales-volume-img {
  122. width: 100%;
  123. }
  124. }
  125. .sales-volume-number {
  126. color: #B8B8B8;
  127. font-size: 26rpx;
  128. padding-left: 10rpx;
  129. }
  130. }
  131. // 购买按钮
  132. .buy-btn {
  133. background: $uni-color;
  134. color: white;
  135. display: inline-block;
  136. padding: 10rpx 20rpx;
  137. border-radius: 10rpx;
  138. }
  139. }
  140. }
  141. </style>