talents.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view>
  3. <!-- 头部 -->
  4. <view class="bg-white header flex row-center">
  5. <block v-if="cate_id">
  6. <u-icon name="file-text-fill" color="#DD4250" size="32"></u-icon>
  7. <view class="cate-title m-l-10">{{ cate.title }}</view>
  8. </block>
  9. <block v-else-if="keyword">
  10. <u-icon name="search" color="#DD4250" size="32"></u-icon>
  11. <view class="cate-title m-l-10">搜索关键字:{{ keyword }}</view>
  12. </block>
  13. <block v-else>
  14. <u-icon name="file-text-fill" color="#DD4250" size="32"></u-icon>
  15. <view class="cate-title m-l-10">人才列表</view>
  16. </block>
  17. </view>
  18. <view>
  19. <!-- 列表 -->
  20. <talents-list :cid="cate_id" :keyword="keyword"></talents-list>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import {
  26. mapActions,
  27. mapGetters
  28. } from 'vuex'
  29. import {
  30. getCategoryDetail
  31. } from '@/api/app';
  32. export default {
  33. data() {
  34. return {
  35. statusBarHeight: 0,
  36. cate_id: null, //分类id
  37. keyword: '',
  38. cate: {
  39. title: ''
  40. }
  41. };
  42. },
  43. created() {
  44. uni.getSystemInfo({
  45. success: (res) => {
  46. this.statusBarHeight = res.statusBarHeight;
  47. }
  48. });
  49. },
  50. onLoad() {
  51. this.cate_id = this.$Route.query.cate_id;
  52. this.keyword = this.$Route.query.keyword;
  53. if (this.cate_id) {
  54. this.getCategoryFun()
  55. }
  56. },
  57. onShow() {
  58. this.getUser();
  59. },
  60. methods: {
  61. ...mapActions(['getUser']),
  62. async getCategoryFun() {
  63. const {
  64. status,
  65. data
  66. } = await getCategoryDetail({
  67. id: this.cate_id
  68. });
  69. if (status == 1) {
  70. this.cate = data
  71. }
  72. },
  73. },
  74. computed: {
  75. ...mapGetters(['appConfig']),
  76. }
  77. };
  78. </script>
  79. <style lang="scss">
  80. .header {
  81. padding: 30rpx;
  82. .cate-title {
  83. font-size: 32rpx;
  84. font-weight: 400;
  85. }
  86. }
  87. </style>