小程序端工程代码
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.

78 lines
1.7 KiB

  1. <template>
  2. <view class="quality-recommend">
  3. <!-- <view class="slider-banner swiper">
  4. <swiper indicatorDots="true" v-if="banner.length > 0">
  5. <block v-for="(item, imgUrlsIndex) in imgUrls" :key="imgUrlsIndex">
  6. <swiper-item>
  7. <image :src="item.img" class="slide-image" />
  8. </swiper-item>
  9. </block>
  10. </swiper>
  11. </view> -->
  12. <view class="title acea-row row-center-wrapper">
  13. <view class="line"></view>
  14. <view class="name">
  15. <text class="iconfont icon-cuxiaoguanli"></text>促销单品
  16. </view>
  17. <view class="line"></view>
  18. </view>
  19. <Promotion-good :benefit="goodsList"></Promotion-good>
  20. </view>
  21. </template>
  22. <script>
  23. // import { swiper, swiperSlide } from "vue-awesome-swiper";
  24. import PromotionGood from "@/components/PromotionGood";
  25. import {
  26. getGroomList
  27. } from "@/api/store";
  28. export default {
  29. name: "GoodsPromotion",
  30. components: {
  31. // swiper,
  32. // swiperSlide,
  33. PromotionGood
  34. },
  35. props: {},
  36. data: function() {
  37. return {
  38. imgUrls: [],
  39. goodsList: [],
  40. RecommendSwiper: {
  41. pagination: {
  42. el: ".swiper-pagination",
  43. clickable: true
  44. },
  45. autoplay: {
  46. disableOnInteraction: false,
  47. delay: 2000
  48. },
  49. loop: true,
  50. speed: 1000,
  51. observer: true,
  52. observeParents: true
  53. }
  54. };
  55. },
  56. mounted: function() {
  57. this.getIndexGroomList();
  58. },
  59. methods: {
  60. getIndexGroomList: function() {
  61. let that = this;
  62. getGroomList(4)
  63. .then(res => {
  64. that.imgUrls = res.data.banner;
  65. that.goodsList = res.data.list;
  66. })
  67. .catch((err) => {
  68. uni.showToast({
  69. title: err.msg || err.response.data.msg|| err.response.data.message,
  70. icon: 'none',
  71. duration: 2000
  72. });
  73. });
  74. }
  75. }
  76. };
  77. </script>