index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <view class='promotionGood'>
  3. <block v-for="(item,index) in benefit" :key="index">
  4. <view class='item acea-row row-between-wrapper' @tap="goDetail(item)" hover-class="none">
  5. <view class='pictrue'>
  6. <image :src='item.image'></image>
  7. <span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '1'">秒杀</span>
  8. <span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '2'">砍价</span>
  9. <span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '3'">拼团</span>
  10. </view>
  11. <view class='text'>
  12. <view class='name line1'>{{item.store_name}}</view>
  13. <view class='sp-money acea-row'>
  14. <view class='moneyCon'>促销价: ¥<text class='num'>{{item.price}}</text></view>
  15. </view>
  16. <view class='acea-row row-between-wrapper'>
  17. <view class='money'>日常价:¥{{item.ot_price}}</view>
  18. <view>仅剩:{{item.stock}}{{item.unit_name}}</view>
  19. </view>
  20. </view>
  21. </view>
  22. </block>
  23. </view>
  24. </template>
  25. <script>
  26. import {mapGetters} from "vuex";
  27. import { goShopDetail } from '@/libs/order.js'
  28. export default {
  29. computed: mapGetters(['uid']),
  30. props: {
  31. benefit: {
  32. type: Array,
  33. default: function() {
  34. return [];
  35. }
  36. }
  37. },
  38. data() {
  39. return {
  40. };
  41. },
  42. methods: {
  43. goDetail(item){
  44. goShopDetail(item,this.uid).then(res=>{
  45. uni.navigateTo({
  46. url:`/pages/goods_details/index?id=${item.id}`
  47. })
  48. })
  49. }
  50. }
  51. }
  52. </script>
  53. <style scoped lang='scss'>
  54. .promotionGood {
  55. padding: 0 30rpx;
  56. }
  57. .promotionGood .item {
  58. border-bottom: 1rpx solid #eee;
  59. height: 250rpx;
  60. }
  61. .promotionGood .item .pictrue {
  62. position: relative;
  63. width: 188rpx;
  64. height: 188rpx;
  65. }
  66. .promotionGood .item .pictrue image {
  67. width: 100%;
  68. height: 100%;
  69. border-radius: 8rpx;
  70. }
  71. .promotionGood .item .text {
  72. font-size: 24rpx;
  73. color: #999;
  74. width: 472rpx;
  75. }
  76. .promotionGood .item .text .name {
  77. font-size: 30rpx;
  78. color: #333;
  79. }
  80. .promotionGood .item .text .sp-money {
  81. margin: 34rpx 0 20rpx 0;
  82. }
  83. .promotionGood .item .text .sp-money .moneyCon {
  84. padding: 0 18rpx;
  85. background-color: red;
  86. height: 46rpx;
  87. line-height: 46rpx;
  88. background-image: linear-gradient(to right, #ff6248 0%, #ff3e1e 100%);
  89. font-size: 20rpx;
  90. color: #fff;
  91. border-radius: 24rpx 3rpx 24rpx 3rpx;
  92. }
  93. .promotionGood .item .text .sp-money .moneyCon .num {
  94. font-size: 24rpx;
  95. }
  96. .promotionGood .item .text .money {
  97. text-decoration: line-through;
  98. }
  99. </style>