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

105 lines
2.0 KiB

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