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

97 lines
1.8 KiB

6 months ago
6 months ago
6 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
6 months ago
6 months ago
4 months ago
4 months ago
6 months ago
6 months ago
6 months ago
4 months ago
6 months ago
4 months ago
4 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 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/userDetail?id=' + item.id)"
  9. :key="index"
  10. v-for="(item, index) in list">
  11. <userItem :item="keyName ? item[keyName] : item"
  12. :headImage="item.headImage"
  13. :sex="item.sex"
  14. />
  15. </view>
  16. <uv-empty mode="list" v-if="list.length == 0"></uv-empty>
  17. </view>
  18. </scroll-view>
  19. </template>
  20. <script>
  21. import userItem from './userItem.vue'
  22. export default {
  23. components : {
  24. userItem,
  25. },
  26. props : {
  27. height : {
  28. default : 'auto'
  29. },
  30. api : {
  31. default : 'bossQueryJobList'
  32. },
  33. handleData : {},
  34. keyName : {
  35. default : ''
  36. }
  37. },
  38. data() {
  39. return {
  40. queryParams: {
  41. pageNo: 1,
  42. pageSize: 10,
  43. },
  44. total : 0,
  45. list : [],
  46. }
  47. },
  48. methods: {
  49. getData(params, query){
  50. if(uni.getStorageSync('token')){
  51. this.queryParams.token = uni.getStorageSync('token')
  52. }
  53. let queryParams = {
  54. pageNo: this.queryParams.pageNo,
  55. pageSize: this.queryParams.pageSize,
  56. }
  57. if(params && params.length > 0){
  58. params.forEach(n => {
  59. queryParams[n.name] = n.value
  60. })
  61. }
  62. if(query){
  63. for(let key in query){
  64. queryParams[key] = query[key]
  65. }
  66. }
  67. this.$api(this.api, queryParams, res => {
  68. uni.stopPullDownRefresh()
  69. if(res.code == 200){
  70. this.list = res.result.records || res.result
  71. this.total = res.result.total || res.result.length
  72. this.handleData && this.handleData(this)
  73. }
  74. })
  75. },
  76. loadMoreData(){
  77. if(this.queryParams.pageSize <= this.list.length){
  78. this.queryParams.pageSize += 10
  79. this.getData()
  80. }
  81. },
  82. }
  83. }
  84. </script>
  85. <style scoped lang="scss">
  86. .bossList {
  87. &>view{
  88. margin: 20rpx;
  89. }
  90. }
  91. </style>