index.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. //import * as WxJsApi from '@/utils/wxJsApi.js'
  2. import * as API from '@/apis/hr/my.js'
  3. import ResumeItem from '@/components/hr/ResumeItem.vue'
  4. export default {
  5. data() {
  6. return {
  7. keyword:"",
  8. pageIndex:1,
  9. recordsTotal:0,
  10. list: [ ],
  11. isReady:false,
  12. src: '/static/img/head.png',
  13. }
  14. },
  15. components: {
  16. ResumeItem
  17. },
  18. onLoad(op){
  19. //this.id=op.id;
  20. },
  21. onReachBottom() {
  22. if(this.result.length<this.recordsTotal){
  23. this.myLoadmore();
  24. }
  25. },
  26. methods: {
  27. del(id){
  28. uni.showLoading({
  29. title:"加载中",mask:true,
  30. })
  31. API.cancelCollectResume(id).then((res) => {
  32. this.getList(true);
  33. uni.hideLoading()
  34. }).catch(error => {
  35. uni.showToast({
  36. title:error
  37. })
  38. })
  39. },
  40. myLoadmore(){
  41. this.pageIndex+=1;
  42. this.getList()
  43. },getList(bl){
  44. uni.showLoading({
  45. title:"加载中",mask:true,
  46. })
  47. if(bl){
  48. this.list=[];
  49. this.pageIndex=1;
  50. }
  51. var data={
  52. positionName:this.keyword,
  53. pageIndex:this.pageIndex
  54. };
  55. API.loadCollectResumes(data).then((res) => {
  56. this.list=[
  57. ...this.list,
  58. ...res.data.data
  59. ];
  60. this.recordsTotal=res.data.recordsTotal
  61. uni.hideLoading()
  62. }).catch(error => {
  63. uni.showToast({
  64. title:error
  65. })
  66. })
  67. }
  68. },onReady(){
  69. this.getList()
  70. this.isReady=true;
  71. },onShow(){
  72. if(this.isReady){
  73. }
  74. },
  75. }