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

75 lines
1.4 KiB

7 months ago
5 months ago
7 months ago
7 months ago
7 months ago
5 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
5 months ago
7 months ago
7 months ago
4 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <scroll-view
  3. scroll-y="true"
  4. :style="{height: height}"
  5. @scrolltolower="loadMoreData">
  6. <view class="bossList">
  7. <view
  8. @click="$utils.navigateTo('/pages_order/work/bossDetail?id=' + item.id)"
  9. :key="index"
  10. v-for="(item, index) in list">
  11. <bossItem :item="item"/>
  12. </view>
  13. <uv-empty mode="list" v-if="list.length == 0"></uv-empty>
  14. </view>
  15. </scroll-view>
  16. </template>
  17. <script>
  18. import bossItem from './bossItem.vue'
  19. export default {
  20. components : {
  21. bossItem,
  22. },
  23. props : {
  24. height : {
  25. default : 'auto'
  26. },
  27. api : {
  28. default : ''
  29. },
  30. },
  31. data() {
  32. return {
  33. queryParams: {
  34. pageNo: 1,
  35. pageSize: 10,
  36. },
  37. total : 0,
  38. list : [],
  39. }
  40. },
  41. methods: {
  42. getData(){
  43. if(uni.getStorageSync('token')){
  44. this.queryParams.token = uni.getStorageSync('token')
  45. }
  46. this.$api(this.api, this.queryParams, res => {
  47. uni.stopPullDownRefresh()
  48. if(res.code == 200){
  49. this.list = res.result.records || res.result
  50. this.total = res.result.total || res.result.length
  51. this.$emit('total', this.total)
  52. }else{
  53. this.$emit('total', 0)
  54. }
  55. })
  56. },
  57. loadMoreData(){
  58. if(this.queryParams.pageSize <= this.list.length){
  59. this.queryParams.pageSize += 10
  60. this.getData()
  61. }
  62. },
  63. }
  64. }
  65. </script>
  66. <style scoped lang="scss">
  67. .bossList {
  68. &>view{
  69. margin: 20rpx;
  70. }
  71. }
  72. </style>