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

113 lines
1.7 KiB

2 months ago
  1. <template>
  2. <view class="item" @click="$emit('click')">
  3. <view class="item-image">
  4. <image :src="item.image &&
  5. item.image.split(',')[0]" mode="aspectFill">
  6. </image>
  7. </view>
  8. <view class="info">
  9. <view class="title">
  10. {{ item.title }}
  11. </view>
  12. <view class="desc">
  13. {{ item.sku }}
  14. </view>
  15. <view class="price"
  16. v-if="[2].includes(item.type)">
  17. <view class="">
  18. 会员价<text>{{ item.vipPrice }}</text>
  19. </view>
  20. <view class="">
  21. 零售价<text>{{ item.price }}</text>
  22. </view>
  23. </view>
  24. <view class="price"
  25. v-else>
  26. <view class="">
  27. 价格<text>{{ item.price }}</text>
  28. </view>
  29. <view class="">
  30. 原价<text>{{ item.oldPrice }}</text>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. props: {
  39. item: {
  40. default: {}
  41. }
  42. },
  43. data() {
  44. return {
  45. }
  46. },
  47. methods: {
  48. }
  49. }
  50. </script>
  51. <style scoped lang="scss">
  52. .item {
  53. padding: 10rpx 20rpx;
  54. align-items: center;
  55. margin-bottom: 20rpx;
  56. display: flex;
  57. width: 100%;
  58. box-sizing: border-box;
  59. border-bottom: 1rpx solid #00000012;
  60. .item-image {
  61. width: 140rpx;
  62. height: 140rpx;
  63. flex-shrink: 0;
  64. image {
  65. height: 100%;
  66. width: 100%;
  67. border-radius: 20rpx;
  68. }
  69. }
  70. .info {
  71. padding: 20rpx;
  72. color: #555;
  73. flex: 1;
  74. .title {
  75. font-size: 28rpx;
  76. font-weight: 900;
  77. }
  78. .desc {
  79. font-size: 22rpx;
  80. color: #777;
  81. margin-top: 10rpx;
  82. }
  83. .price {
  84. text-align: right;
  85. color: #f40;
  86. font-size: 26rpx;
  87. text{
  88. font-size: 30rpx;
  89. font-weight: 900;
  90. }
  91. &>view:nth-child(2){
  92. font-size: 22rpx;
  93. color: #777;
  94. text{
  95. font-size: 26rpx;
  96. font-weight: 900;
  97. }
  98. }
  99. }
  100. }
  101. }
  102. </style>