特易招,招聘小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
2.4 KiB

11 months ago
10 months ago
8 months ago
10 months ago
9 months ago
10 months ago
11 months ago
10 months ago
9 months ago
11 months ago
9 months ago
8 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
8 months ago
11 months ago
9 months ago
11 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="我的收藏"
  4. bgColor="#3796F8"
  5. leftClick
  6. color="#fff"
  7. @leftClick="$utils.navigateBack"/>
  8. <userListSwipe
  9. :options="options"
  10. v-if="role"
  11. keyName="employResume"
  12. @clickSwipeAction="clickSwipeAction"
  13. :list="list"/>
  14. <workListSwipe
  15. :options="options"
  16. v-else
  17. keyName="employJob"
  18. @clickSwipeAction="clickSwipeAction"
  19. :list="list"/>
  20. <uv-empty mode="list" v-if="list.length == 0"></uv-empty>
  21. </view>
  22. </template>
  23. <script>
  24. import workListSwipe from '@/components/list/workList/workListSwipe.vue'
  25. import userListSwipe from '@/components/list/userList/userListSwipe.vue'
  26. import mixinList from '@/mixins/list.js'
  27. import { mapState } from 'vuex'
  28. export default {
  29. mixins : [mixinList],
  30. components : {
  31. workListSwipe,
  32. userListSwipe,
  33. },
  34. data() {
  35. return {
  36. options: [
  37. {
  38. text: '删除',
  39. style: {
  40. backgroundColor: '#FA5A0A'
  41. }
  42. },
  43. ],
  44. mixinsListApi : 'employeeQueryCollectionJobList',
  45. list2 : [],
  46. }
  47. },
  48. computed : {
  49. ...mapState([
  50. 'role',
  51. ]),
  52. },
  53. onLoad() {
  54. this.mixinsListApi = (this.role ? 'boss' : 'employee') + 'QueryCollectionJobList'
  55. },
  56. methods: {
  57. clickSwipeAction({e, item}){
  58. console.log(e, item);
  59. if(this.role){
  60. this.addResumeCollection(item.employResume.id)
  61. }else{
  62. this.addJobCollection(item.employJob.id)
  63. }
  64. },
  65. addJobCollection(jobId) {
  66. let data = {
  67. jobId
  68. }
  69. this.$api('addJobCollection', data, res => {
  70. if (res.code == 200) {
  71. uni.showToast({
  72. title: res.message,
  73. icon: 'none'
  74. })
  75. }
  76. this.getData();
  77. })
  78. },
  79. addResumeCollection(resumeId){
  80. let data = {
  81. resumeId
  82. }
  83. this.$api('addResumeCollection', data, res => {
  84. this.getData();
  85. if(res.code == 200){
  86. uni.showToast({
  87. title: res.message,
  88. icon: 'none'
  89. })
  90. }
  91. })
  92. },
  93. // getDataThen(list, total, result){
  94. // let l = []
  95. // result.forEach(res => {
  96. // if(this.role){
  97. // res.employResume.collection = res.employCollectionResume
  98. // l.push(res.employResume)
  99. // }else{
  100. // res.employJob.collection = res.employCollectionJob
  101. // l.push(res.employJob)
  102. // }
  103. // })
  104. // this.list2 = l
  105. // },
  106. }
  107. }
  108. </script>
  109. <style scoped lang="scss">
  110. .page{
  111. /deep/ .uv-swipe-action{
  112. width: 100%;
  113. }
  114. }
  115. </style>