myRecommendation.vue 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <!-- 我的推荐 -->
  2. <template>
  3. <div class="d-flex">
  4. <div class="pa-3 mr-3 white-bgc" style="min-height: 500px; border-radius: 5px; flex: 1;">
  5. <div style="width: 100%;">
  6. <!-- 统计 -->
  7. <div class="statisticsBox">
  8. <div class="statisticsBox-item" :class="{'act': index === active}" v-for="(item, index) in statisticsList" :key="item.name" @click="statisticsClick(item, index)">
  9. <div style="font-size: 18px; color: #333; font-weight: bold;">{{ statistics[item.name] || '0' }}</div>
  10. <div style="font-size: 13px; color: #666;">{{ item.label }}</div>
  11. </div>
  12. </div>
  13. <div class="topTip">推荐好友入职得赏金</div>
  14. <!-- 数据 -->
  15. <TablePage :items="dataList"></TablePage>
  16. </div>
  17. </div>
  18. <!-- 滚动区域 -->
  19. <div class="pa-3 white-bgc" style="height: 300px; border-radius: 5px; width: 360px;">
  20. 滚动区域
  21. </div>
  22. </div>
  23. </template>
  24. <script setup>
  25. import TablePage from './components/table.vue'
  26. import { ref } from 'vue'
  27. defineOptions({name: 'defineOptions-name'})
  28. // 数据统计
  29. const statistics = ref({ statisticsA: '3', statisticsB: '7', statisticsC: '5', statisticsD: '2', statisticsE: '1' })
  30. const statisticsList = ref([
  31. { count: '', label: '已报名', name: 'statisticsA' },
  32. { count: '', label: '已过筛', name: 'statisticsB' },
  33. { count: '', label: '已过面', name: 'statisticsC' },
  34. { count: '', label: '已入职', name: 'statisticsD' },
  35. { count: '', label: '已结算', name: 'statisticsE' }
  36. ])
  37. const avatarList = [
  38. 'https://img0.baidu.com/it/u=230622178,1565949306&fm=253&fmt=auto&app=138&f=JPEG?w=449&h=300',
  39. 'https://img0.baidu.com/it/u=1401084042,2724457850&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=726',
  40. 'https://q7.itc.cn/q_70/images03/20240423/6d236fae5c8f44ed9b60d977f32debb7.jpeg',
  41. 'https://q1.itc.cn/q_70/images03/20240609/1c1be14298be4dbe978e55bde6e958b0.jpeg',
  42. 'https://q4.itc.cn/q_70/images03/20240528/298d4abda5e4469d98fa77e7cde46525.jpeg',
  43. 'https://q5.itc.cn/q_70/images03/20240520/ceb0d77d1be24eea8cd3826994eac1c1.jpeg',
  44. 'https://img1.baidu.com/it/u=3995643348,1848098846&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=800',
  45. ]
  46. const dataList = ref([])
  47. const dataItem = {
  48. name: '用户',
  49. 应聘公司: '门墩儿科技',
  50. 应聘职位: '酒店前台',
  51. 岗位薪资: '8000-10000/月',
  52. 推荐进度: '已报名',
  53. 赏金: '100积分',
  54. }
  55. const active = ref(0)
  56. const statisticsClick = (item, index) => {
  57. active.value = index
  58. const count = statistics.value[item.name] ? statistics.value[item.name] - 0 : 0
  59. dataList.value = []
  60. for (let i = 0; i < count; i++) {
  61. dataList.value.push({ ...dataItem, avatar: avatarList[i], name: dataItem.name+(i+1) })
  62. }
  63. }
  64. statisticsClick(statisticsList.value[0])
  65. </script>
  66. <style lang="scss" scoped>
  67. .topTip {
  68. color: #999;
  69. margin-top: 8px;
  70. font-size: 14px;
  71. padding: 5px 10px;
  72. width: 100%;
  73. // background-color: var(--default-bgc);
  74. }
  75. .statisticsBox {
  76. display: flex;
  77. justify-content: space-around;
  78. border-radius: 10px;
  79. text-align: center;
  80. padding: 10px 0;
  81. background-color: var(--default-bgc);
  82. .act {
  83. div, span { color: var(--v-primary-base) !important; }
  84. }
  85. .statisticsBox-item {
  86. cursor: pointer;
  87. &:hover {
  88. div { color: var(--v-primary-base) !important; }
  89. }
  90. }
  91. }
  92. </style>