index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <div style="min-width: 1184px;" class="white-bgc">
  3. <!-- 搜索框 -->
  4. <div class="py-5 stickyBox">
  5. <div class="search d-flex align-center">
  6. <v-text-field
  7. v-model="inputVal"
  8. placeholder="请输入关键词"
  9. color="primary"
  10. variant="plain"
  11. density="compact"
  12. clearable
  13. :hide-details="true"
  14. class="ml-3 px-2"
  15. style="height: 100%; line-height: 100%;"
  16. @keyup.enter="handleSearch"
  17. ></v-text-field>
  18. <v-btn class="searchBtn" prepend-icon="mdi-shopping-search-outline" @click="handleSearch">搜索</v-btn>
  19. </div>
  20. </div>
  21. <!-- 轮播图 -->
  22. <Carousel />
  23. <!-- 热门商品 -->
  24. <HotGoods class="my-10 default-width" />
  25. </div>
  26. </template>
  27. <script setup>
  28. defineOptions({ name: 'mall-home-index'})
  29. import { ref } from 'vue'
  30. import Carousel from './components/carousel.vue'
  31. import HotGoods from './components/hotGoods.vue'
  32. import { useMallStore } from '@/store/mall'
  33. // 获取装修模版
  34. useMallStore().getMallDiyTemplate()
  35. const inputVal = ref('')
  36. const handleSearch = () => {}
  37. </script>
  38. <style scoped lang="scss">
  39. .stickyBox {
  40. position: sticky;
  41. top: 48px;
  42. z-index: 999;
  43. background-color: #fff;
  44. }
  45. .search {
  46. height: 50px;
  47. width: 800px;
  48. border: 2px solid var(--v-primary-base);
  49. border-radius: 5px;
  50. margin: 0 auto;
  51. .searchBtn {
  52. width: 180px;
  53. height: 50px;
  54. line-height: 48px;
  55. text-align: center;
  56. font-size: 18px;
  57. color: #fff;
  58. background-color: var(--v-primary-base);
  59. cursor: pointer;
  60. }
  61. }
  62. </style>