Index.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. import { useRoute, useRouter } from "vue-router";
  27. const router = useRouter();
  28. const current = ref("all");
  29. const componentsMap = {
  30. all: All,
  31. buy: Buy,
  32. sell: Sell,
  33. };
  34. const currentComponent = computed(() => componentsMap[current.value]);
  35. const messageChange = (key) => {
  36. current.value = key;
  37. };
  38. const toPath = () => {
  39. router.back();
  40. };
  41. </script>
  42. <style lang="less" scoped>
  43. .loan-header {
  44. position: fixed;
  45. left: 0;
  46. top: 0;
  47. z-index: 1;
  48. width: 100%;
  49. height: 48px;
  50. background: #ffffff;
  51. overflow: hidden;
  52. .header-content {
  53. display: flex;
  54. flex-direction: row;
  55. justify-content: center;
  56. align-items: center;
  57. position: relative;
  58. width: 100%;
  59. height: 48px;
  60. .left-arrow-image {
  61. position: absolute;
  62. left: 14px;
  63. top: 16px;
  64. width: 9px;
  65. height: 16px;
  66. }
  67. .save {
  68. position: absolute;
  69. top: 15px;
  70. right: 16px;
  71. img {
  72. width: 15px;
  73. height: 16px;
  74. }
  75. }
  76. }
  77. }
  78. .notifi-classifi {
  79. display: flex;
  80. flex-direction: row;
  81. justify-content: flex-start;
  82. align-items: flex-end;
  83. margin: 0 auto;
  84. margin-top: 48px;
  85. width: 345px;
  86. height: 24px;
  87. .sys-notifi {
  88. margin-left: 40px;
  89. }
  90. }
  91. </style>