service.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <view class="service">
  3. <view class="recommend">
  4. <view class="recommend-item" :class="{red:recommend==index}" v-for="(item,index) in choice" :key="item.id">
  5. {{item.name}}
  6. </view>
  7. </view>
  8. <view class="content">
  9. <view class="content-item" v-for="(item,index) in 8">
  10. <image src="" mode="" class="neironga2"></image>
  11. <view class="name">
  12. 清洁控油去角质洁面乳套装洗面奶氨基酸...
  13. </view>
  14. <view class="number">
  15. <view class="large">
  16. ¥ <text>269.</text>00
  17. </view>
  18. <view class="small">¥298.00</view>
  19. </view>
  20. <view class="sell">
  21. 已售12件
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default{
  29. data(){
  30. return{
  31. choice:[
  32. {
  33. id:1,
  34. name:"推荐",
  35. },
  36. {
  37. id:2,
  38. name:"热销",
  39. },
  40. {
  41. id:3,
  42. name:"新品",
  43. },
  44. {
  45. id:4,
  46. name:"皮肤美容"
  47. }
  48. ]
  49. }
  50. },
  51. methods:{
  52. }
  53. }
  54. </script>
  55. <style scoped lang="scss">
  56. .content{
  57. display: flex;
  58. flex-wrap: wrap;
  59. justify-content: space-between;
  60. padding: 30rpx;
  61. background-color: #f5f5f5;
  62. .content-item{
  63. background-color: #ffffff;
  64. border-radius: 18rpx;
  65. overflow: hidden;
  66. margin-bottom: 30rpx;
  67. image{
  68. width: 336rpx;
  69. height: 336rpx;
  70. background-color: red;
  71. }
  72. .number{
  73. display: flex;
  74. align-items: center;
  75. padding: 0 30rpx;
  76. .large{
  77. color: #ED3D07;
  78. font-size: 20rpx;
  79. font-weight: Medium;
  80. text{
  81. font-size: 36rpx;
  82. font-weight: Bold;
  83. }
  84. }
  85. .small{
  86. font-size: 22rpx;
  87. color: #999999;
  88. font-weight: 400;
  89. text-decoration: line-through;
  90. margin-left: 16rpx;
  91. }
  92. }
  93. .sell{
  94. padding: 0 30rpx;
  95. font-size: 22rpx;
  96. font-weight: 400;
  97. color: #999999;
  98. margin-bottom: 36rpx;
  99. margin-top: 8rpx;
  100. }
  101. .name{
  102. width: 276rpx;
  103. padding: 0 30rpx;
  104. overflow: hidden;
  105. text-overflow: ellipsis;
  106. display: -webkit-box;
  107. -webkit-line-clamp: 2;
  108. -webkit-box-orient: vertical;
  109. word-wrap: break-word;
  110. word-break: break-all;
  111. white-space: normal !important
  112. }
  113. }
  114. }
  115. .recommend {
  116. display: flex;
  117. background-color: #f5f5f5;
  118. border-radius: 40rpx 40rpx 0 0;
  119. .recommend-item {
  120. font-weight: 500;
  121. padding: 15rpx 30rpx;
  122. background-color: #ffffff;
  123. margin: 40rpx 0 30rpx 30rpx;
  124. border-radius: 34rpx;
  125. }
  126. }
  127. </style>