珠宝小程序前端代码
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.

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