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.

93 lines
1.8 KiB

3 months ago
  1. <template>
  2. <view class='promotionGood'>
  3. <block v-for="(item,index) in benefit.slice(0,6)" :key="index">
  4. <view class='item' @tap="goDetail(item)" hover-class="none">
  5. <view class='pictrue'>
  6. <image :src='item.image'></image>
  7. </view>
  8. <view class='money'>
  9. <text class="rmb">¥</text>
  10. <text class="price">{{item.price}}</text>
  11. <text class="ot-price">{{item.otPrice}}</text>
  12. </view>
  13. </view>
  14. </block>
  15. </view>
  16. </template>
  17. <script>
  18. import animationType from '@/utils/animationType.js'
  19. export default {
  20. props: {
  21. benefit: {
  22. type: Array,
  23. default: function() {
  24. return [];
  25. }
  26. }
  27. },
  28. data() {
  29. return {
  30. };
  31. },
  32. methods: {
  33. goDetail(item) {
  34. uni.navigateTo({
  35. animationType: animationType.type, animationDuration: animationType.duration,
  36. url: `/pages/goods/goods_details/index?id=${item.id}`
  37. })
  38. }
  39. }
  40. }
  41. </script>
  42. <style scoped lang='scss'>
  43. .promotionGood {
  44. padding: 0 30rpx;
  45. display: flex;
  46. flex-wrap: wrap;
  47. padding: 15rpx 24rpx;
  48. .item {
  49. width: 215rpx;
  50. display: flex;
  51. flex-direction: column;
  52. justify-content: center;
  53. padding: 15rpx 9rpx;
  54. .pictrue {
  55. height: 198rpx;
  56. border-radius: 12rpx;
  57. image {
  58. width: 100%;
  59. height: 100%;
  60. border-radius: 12rpx;
  61. }
  62. }
  63. .money {
  64. font-size: 30rpx;
  65. margin-top: 10rpx;
  66. overflow:hidden;
  67. text-overflow:ellipsis;
  68. white-space:nowrap;
  69. .rmb {
  70. font-weight: bold;
  71. @include price_color(theme);
  72. font-size: 20rpx;
  73. }
  74. .price{
  75. @include price_color(theme);
  76. font-weight: bold;
  77. }
  78. .ot-price {
  79. color: #999;
  80. text-decoration: line-through;
  81. font-size: 20rpx;
  82. margin-left: 4rpx;
  83. }
  84. }
  85. }
  86. }
  87. </style>