RecommendStore.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <div class="container marketing">
  3. <div class="toggle-store">
  4. <toggle-store/>
  5. </div>
  6. <!--供应商-->
  7. <div class="carousel" v-if="storeType === 'supplier'">
  8. <banner/>
  9. </div>
  10. <!--品牌-->
  11. <div class="carousel" v-else-if="storeType === 'brand'">
  12. <recommend-brand></recommend-brand>
  13. </div>
  14. <!--店铺-->
  15. <div class="carousel" v-else>
  16. <!--<carousel :banners="banners" v-for="item in init" v-if="item.show" :key="item.id" />-->
  17. <carousel :banners="banners"/>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import ToggleStore from './ToggleStore.vue'
  23. import Carousel from './Carousel.vue'
  24. import Banner from '~components/supplier/banner.vue'
  25. import RecommendBrand from '~components/brandCenter/RecommendBrand.vue'
  26. export default {
  27. name: 'recommend-store',
  28. data () {
  29. return {
  30. init: [{id: 0, show: true}]
  31. }
  32. },
  33. components: {
  34. ToggleStore,
  35. Carousel,
  36. Banner,
  37. RecommendBrand
  38. },
  39. computed: {
  40. storeType () {
  41. return this.$route.params.type
  42. },
  43. // providerType () {
  44. // return this.$route.path === '/provider/home' ? 'agency' : 'original'
  45. // },
  46. banners () {
  47. if (this.$store.state.carousel.banners) {
  48. this.init[this.init.length - 1].show = false
  49. this.init.push({
  50. id: this.init.length,
  51. show: true
  52. })
  53. return this.$store.state.carousel.banners.data.data
  54. } else {
  55. return ''
  56. }
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="scss" scoped>
  62. @import '~assets/scss/variables';
  63. .marketing {
  64. width: 1190px;
  65. height: 422px;
  66. padding-top: 20px!important ;
  67. overflow: hidden;
  68. .toggle-store {
  69. float: left;
  70. margin-right: 15px;
  71. width: 220px;
  72. height: 402px
  73. }
  74. .carousel {
  75. width: 955px;
  76. min-height: 400px;
  77. display: inline-block;
  78. float: left;
  79. border-radius: 5px;
  80. }
  81. /*.carousel_670 {*/
  82. /*width: 670px;*/
  83. /*min-height: 360px;*/
  84. /*display: inline-block;*/
  85. /*float: left;*/
  86. /*border: 1px solid #D6D3CE;*/
  87. /*}*/
  88. .new-store {
  89. width: 280px;
  90. min-height: 360px;
  91. float: left;
  92. display: inline-block;
  93. }
  94. }
  95. </style>