RecommendStore.vue 2.2 KB

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