index.js 1.4 KB

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