特易招,招聘小程序
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.

127 lines
2.5 KiB

4 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
4 months ago
4 months ago
2 months ago
4 months ago
2 months ago
2 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
3 weeks ago
2 months ago
4 months ago
2 months ago
4 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. uni.showModal({
  59. title: '确认删除吗?',
  60. success : res => {
  61. if(res.confirm){
  62. if(this.role){
  63. this.addResumeCollection(item.employResume.id)
  64. }else{
  65. this.addJobCollection(item.employJob.id)
  66. }
  67. }
  68. }
  69. })
  70. },
  71. addJobCollection(jobId) {
  72. let data = {
  73. jobId
  74. }
  75. this.$api('addJobCollection', data, res => {
  76. if (res.code == 200) {
  77. uni.showToast({
  78. title: res.message,
  79. icon: 'none'
  80. })
  81. }
  82. this.getData();
  83. })
  84. },
  85. addResumeCollection(resumeId){
  86. let data = {
  87. resumeId
  88. }
  89. this.$api('addResumeCollection', data, res => {
  90. this.getData();
  91. if(res.code == 200){
  92. uni.showToast({
  93. title: res.message,
  94. icon: 'none'
  95. })
  96. }
  97. })
  98. },
  99. // getDataThen(list, total, result){
  100. // let l = []
  101. // result.forEach(res => {
  102. // if(this.role){
  103. // res.employResume.collection = res.employCollectionResume
  104. // l.push(res.employResume)
  105. // }else{
  106. // res.employJob.collection = res.employCollectionJob
  107. // l.push(res.employJob)
  108. // }
  109. // })
  110. // this.list2 = l
  111. // },
  112. }
  113. }
  114. </script>
  115. <style scoped lang="scss">
  116. .page{
  117. /deep/ .uv-swipe-action{
  118. width: 100%;
  119. }
  120. }
  121. </style>