PromotionGood.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <div class="promotionGood" v-if="benefit.length > 0">
  3. <!--<router-link-->
  4. <!--:to="{ path: '/detail/' + item.id }"-->
  5. <!--class="item acea-row row-between-wrapper"-->
  6. <!--v-for="(item, index) in benefit"-->
  7. <!--:key="index"-->
  8. <!--&gt;-->
  9. <div
  10. @click="goDetail(item)"
  11. v-for="(item, index) in benefit"
  12. :key="index"
  13. class="item acea-row row-between-wrapper"
  14. >
  15. <div class="pictrue">
  16. <img v-lazy="item.image" alt="img" class="image" />
  17. <span
  18. class="pictrue_log pictrue_log_class"
  19. v-if="item.activity && item.activity.type === '1'"
  20. >秒杀</span
  21. >
  22. <span
  23. class="pictrue_log pictrue_log_class"
  24. v-if="item.activity && item.activity.type === '2'"
  25. >砍价</span
  26. >
  27. <span
  28. class="pictrue_log pictrue_log_class"
  29. v-if="item.activity && item.activity.type === '3'"
  30. >拼团</span
  31. >
  32. </div>
  33. <div class="text">
  34. <div class="name line1">{{ item.store_name }}</div>
  35. <div class="sp-money acea-row">
  36. <div class="moneyCon">
  37. 促销价: ¥<span class="num">{{ item.price }}</span>
  38. </div>
  39. </div>
  40. <div class="acea-row row-between-wrapper">
  41. <div class="money">日常价:¥{{ item.ot_price }}</div>
  42. <div>仅剩:{{ item.stock }}{{ item.unit_name }}</div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </template>
  48. <script>
  49. import { goShopDetail } from "@libs/order";
  50. export default {
  51. name: "PromotionGood",
  52. props: {
  53. benefit: {
  54. type: Array,
  55. default: () => []
  56. }
  57. },
  58. data: function() {
  59. return {};
  60. },
  61. methods: {
  62. // 商品详情跳转
  63. goDetail(item) {
  64. goShopDetail(item).then(() => {
  65. this.$router.push({ path: "/detail/" + item.id });
  66. });
  67. }
  68. }
  69. };
  70. </script>