list.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view>
  3. </view>
  4. </template>
  5. <script>
  6. import config from '@/config'
  7. const baseUrl = config.baseUrl
  8. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  9. export default{
  10. components:{},
  11. data(){
  12. return{
  13. hrimg:require('@/work/static/images/hrimg.png'),
  14. list:[],
  15. pageSize: 10,
  16. pageNum: 1,
  17. reachflag: true,
  18. wtdt:'',
  19. }
  20. },
  21. // 上拉触底加载更多触发事件
  22. onReachBottom() {
  23. // if (this.reachflag) {
  24. // this.pageNum++
  25. // this.getDataFn()
  26. // }
  27. },
  28. methods:{
  29. checkPermi, checkRole,
  30. getNextFn(){
  31. this.$tab.navigateTo("/work/pages/business/add")
  32. },
  33. getDataFn(){
  34. var params={
  35. pageSize:this.pageSize,
  36. pageNum: this.pageNum,
  37. }
  38. getCaseListFn(params).then(res=>{
  39. if(res.code==200){
  40. if (res.rows.length < this.pageSize) {
  41. this.reachflag = false
  42. this.wtdt = '到底了~';
  43. } else {
  44. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  45. if (num < res.total) {
  46. this.reachflag = true
  47. this.wtdt = ''
  48. } else {
  49. this.reachflag = false
  50. this.wtdt = '到底了~';
  51. }
  52. }
  53. if (this.pageNum == 1) {
  54. this.list = res.rows;
  55. } else {
  56. this.list = this.list.concat(res.rows)
  57. }
  58. }else{
  59. this.$toast(res.msg)
  60. }
  61. })
  62. },
  63. },
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. </style>