RecommendStore.vue 1.7 KB

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