index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view class="preview-resume">
  3. <nav-bar title="简历预览" color="#000" class="nav-bar">
  4. <view class="import-btn" slot="right">导出</view>
  5. </nav-bar>
  6. <view class="tabs">
  7. <view class="tab" :class="{ active: index === activeIndex }" v-for="(tab, index) in tabs" :key="index" @click="handleChangeTab(index)">
  8. <view class="tab-name">{{ tab.name }}</view>
  9. <view class="tab-active"></view>
  10. </view>
  11. </view>
  12. <scroll-view class="content" :scroll-y="true">
  13. <previewResume v-if="activeIndex == 0"></previewResume>
  14. <indexCard v-else-if="activeIndex == 1"></indexCard>
  15. <chatCard v-else-if="activeIndex == 2"></chatCard>
  16. </scroll-view>
  17. </view>
  18. </template>
  19. <script>
  20. import navBar from "@/components/nav-bar/index.vue";
  21. import previewResume from '@/components/resume/preview-resume.vue';
  22. import indexCard from '@/components/resume/index-card.vue';
  23. import chatCard from '@/components/resume/chat-card.vue';
  24. export default {
  25. components: {
  26. navBar,
  27. previewResume,
  28. indexCard,
  29. chatCard
  30. },
  31. data() {
  32. return {
  33. tabs: [
  34. {
  35. name: '在线简历'
  36. },
  37. {
  38. name: '首页卡片'
  39. },
  40. {
  41. name: '沟通卡片'
  42. }
  43. ],
  44. activeIndex: 0
  45. }
  46. },
  47. onLoad(options) {
  48. if (options.type) {
  49. // type: index首页卡片、chat沟通卡片
  50. if (options.type === 'index') {
  51. this.activeIndex = 1
  52. } else if (options.type === 'chat') {
  53. this.activeIndex = 2
  54. }
  55. }
  56. },
  57. methods: {
  58. handleChangeTab(index) {
  59. this.activeIndex = index
  60. }
  61. }
  62. }
  63. </script>
  64. <style lang="scss" scoped>
  65. .nav-bar {
  66. height: 96rpx;
  67. background: #fff;
  68. }
  69. .import-btn {
  70. font-size: 24rpx;
  71. font-weight: 400;
  72. color: rgba(153, 153, 153, 1);
  73. }
  74. .preview-resume {
  75. display: flex;
  76. flex-direction: column;
  77. height: 100vh;
  78. background: rgba(241, 245, 248, 1);
  79. }
  80. // tabs栏
  81. .tabs {
  82. display: flex;
  83. justify-content: center;
  84. background-color: #fff;
  85. height: 80rpx;
  86. .tab {
  87. padding: 24rpx 32rpx 12rpx;
  88. .tab-name {
  89. color: rgba(51, 51, 51, 1);
  90. line-height: 32rpx;
  91. }
  92. .tab-active {
  93. width: 50rpx;
  94. height: 6rpx;
  95. border-radius: 6rpx;
  96. margin: 6rpx auto 0;
  97. }
  98. }
  99. .active {
  100. .tab-name {
  101. color: rgba(1, 107, 246, 1);
  102. font-weight: bold;
  103. }
  104. .tab-active {
  105. background: rgba(1, 107, 246, 1);
  106. }
  107. }
  108. }
  109. .content {
  110. height: 100px;
  111. flex: 1;
  112. margin-top: 32rpx;
  113. }
  114. </style>