Index.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <div class="loan-header">
  3. <div class="header-content pf600 fs16 fc1F2937">
  4. <img
  5. class="left-arrow-image"
  6. src="@/assets/icon/index/left-arrow.svg"
  7. @click="toPath()" />
  8. 贷款
  9. <div class="save">
  10. <img src="@/assets/icon/asset/rili.png" alt="" />
  11. </div>
  12. </div>
  13. </div>
  14. <div class="notifi-classifi">
  15. <div class="pf600 fs18 fc121212" @click="messageChange('all')">全部</div>
  16. <div class="sys-notifi pf600 fs14 fcA8A8A8" @click="messageChange('buy')">购买</div>
  17. <div class="sys-notifi pf600 fs14 fcA8A8A8" @click="messageChange('sell')">出售</div>
  18. </div>
  19. <component :is="currentComponent" />
  20. </template>
  21. <script setup>
  22. import All from "./All.vue";
  23. import Buy from "./Buy.vue";
  24. import Sell from "./Sell.vue";
  25. import { ref, computed } from "vue";
  26. const current = ref("all");
  27. const componentsMap = {
  28. all: All,
  29. buy: Buy,
  30. sell: Sell,
  31. };
  32. const currentComponent = computed(() => componentsMap[current.value]);
  33. const messageChange = (key) => {
  34. current.value = key;
  35. };
  36. </script>
  37. <style lang="less" scoped>
  38. .loan-header {
  39. position: fixed;
  40. left: 0;
  41. top: 0;
  42. z-index: 1;
  43. width: 100%;
  44. height: 48px;
  45. background: #ffffff;
  46. overflow: hidden;
  47. .header-content {
  48. display: flex;
  49. flex-direction: row;
  50. justify-content: center;
  51. align-items: center;
  52. position: relative;
  53. width: 100%;
  54. height: 48px;
  55. .left-arrow-image {
  56. position: absolute;
  57. left: 14px;
  58. top: 16px;
  59. width: 9px;
  60. height: 16px;
  61. }
  62. .save {
  63. position: absolute;
  64. top: 15px;
  65. right: 16px;
  66. img {
  67. width: 15px;
  68. height: 16px;
  69. }
  70. }
  71. }
  72. }
  73. .notifi-classifi {
  74. display: flex;
  75. flex-direction: row;
  76. justify-content: flex-start;
  77. align-items: flex-end;
  78. margin: 0 auto;
  79. margin-top: 48px;
  80. width: 345px;
  81. height: 24px;
  82. .sys-notifi {
  83. margin-left: 40px;
  84. }
  85. }
  86. </style>