HomeSlider.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <div class="home-slider">
  3. <div class="s1">
  4. <CategorySort />
  5. </div>
  6. <div class="s2">
  7. <el-carousel height="459px" arrow="hover">
  8. <el-carousel-item
  9. v-for="(item_banner, index_banner) in demoData"
  10. :key="index_banner"
  11. >
  12. <a href="javascript:void(0)" @click="diyNavTo(item_banner)">
  13. <!-- <img :src="item_banner.imgUrl" /> -->
  14. <div :style="`background-image:url(${item_banner.imgUrl})`"></div>
  15. </a>
  16. </el-carousel-item>
  17. </el-carousel>
  18. </div>
  19. <div class="s3">
  20. <p class="title">Sign up to enjoy exciting Buyers Club benefits</p>
  21. <p class="link" v-if="!filtersStore.getLoginFlag">
  22. <nuxt-link to="/login">
  23. <span>{{L['登录']}}</span>
  24. </nuxt-link>
  25. </p>
  26. <p class="link" v-if="!filtersStore.getLoginFlag">
  27. <nuxt-link to="/register">
  28. <span>{{L['注册']}}</span>
  29. </nuxt-link>
  30. </p>
  31. <p class="link" v-if="filtersStore.getLoginFlag">
  32. <nuxt-link to="/">
  33. <span>{{L['退出']}}</span>
  34. </nuxt-link>
  35. </p>
  36. <p class="link">
  37. <nuxt-link to="/home/contact">
  38. <span>{{L['发布需求']}}</span>
  39. </nuxt-link>
  40. </p>
  41. <p class="desc">
  42. this is demo,this is demothis is demothis is demothis is demothis is demothis is demo,this is demo,this is demothis is demothis is demo,this is demo
  43. </p>
  44. </div>
  45. </div>
  46. </template>
  47. <script setup>
  48. import { ElCarousel, ElCarouselItem } from "element-plus";
  49. import { useFiltersStore } from "@/store/filter.js";
  50. const filtersStore = useFiltersStore();
  51. const L = getCurLanguage();
  52. const demoData = [
  53. {
  54. imgUrl:
  55. "/images/admin/deco/lchSfBcyKhyiycXXzVE.jpg",
  56. },
  57. {
  58. imgUrl:
  59. "/images/admin/deco/lchSfBcyKhyiycXXzVE.jpg",
  60. },
  61. ];
  62. </script>
  63. <style lang="scss" scoped>
  64. .home-slider {
  65. width: 1210px;
  66. margin: 0 auto;
  67. position: relative;
  68. height: 459px;
  69. background: #fff;
  70. margin-bottom: 30px;
  71. box-shadow: -1px 5px 10px 0px #ddd;
  72. .s1{
  73. width: 187px;
  74. float: left;
  75. }
  76. .s2{
  77. width: calc(100% - 437px);
  78. float: left;
  79. }
  80. .s3{
  81. width: 250px;
  82. float: left;
  83. padding: 10px 30px;
  84. .title{
  85. font-size: 16px;
  86. }
  87. .link{
  88. display: block;
  89. width: 100%;
  90. background: $colorMain;
  91. font-size: 15px;
  92. text-align: center;
  93. padding: 5px 0px;
  94. border-radius: 10px;
  95. margin: 10px auto;
  96. &:hover{
  97. opacity: .7;
  98. }
  99. a{
  100. color: #fff;
  101. }
  102. }
  103. .desc{
  104. font-size: 14px;
  105. line-height: 2;
  106. }
  107. }
  108. .el-carousel {
  109. width: 100%;
  110. margin: 0 auto;
  111. }
  112. background: #f8f8f8;
  113. .el-carousel__item {
  114. div {
  115. background-position: center center;
  116. width: 100%;
  117. height: 459px;
  118. background-repeat: no-repeat;
  119. background-size: cover;
  120. }
  121. }
  122. }
  123. </style>