index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view class="main pt0">
  3. <view class="message _error" v-if="total > 0">你有:{{ this.total }}份简历未处理,请及时处理。</view>
  4. <view class="item" v-for="(item, index) in list" :key="index" @click="go('/pages/user/resume/deliver/receive/list?id=' + item.id + '&title=' + item.title + '&total=' + item.total)">
  5. <view class="title omit">{{ item.title }}</view>
  6. <view class="desc">
  7. <view class="progress">
  8. <u-line-progress :percentage="(item.isRead / item.total).toFixed(2) * 100" :height="20" text="已读"></u-line-progress>
  9. </view>
  10. <view class="all">{{ item.total }}份</view>
  11. </view>
  12. </view>
  13. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  14. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. list: [],
  22. param: { pageNum: 1, pageSize: 10 },
  23. loadMore: true,
  24. total: 0
  25. };
  26. },
  27. onLoad(e) {
  28. this.getData();
  29. },
  30. methods: {
  31. getData() {
  32. this.total = 0;
  33. this.http.request({
  34. url: '/app/deliver/receive',
  35. data: this.param,
  36. loading: 'false',
  37. success: (res) => {
  38. this.loadMore = res.data.pages > this.param.pageNum ? true : false;
  39. res.data.rows.forEach((item) => {
  40. this.list.push(item);
  41. this.total = this.total + (item.total - item.isRead);
  42. });
  43. }
  44. });
  45. },
  46. go(url) {
  47. uni.navigateTo({ url: url });
  48. },
  49. //刷新数据
  50. refresh() {
  51. this.loadMore = true;
  52. this.param.pageNum = 1;
  53. this.list = [];
  54. this.getData();
  55. }
  56. },
  57. //下拉刷新
  58. onPullDownRefresh() {
  59. setTimeout(() => {
  60. this.refresh();
  61. uni.stopPullDownRefresh();
  62. }, 1000);
  63. },
  64. //上拉加载
  65. onReachBottom() {
  66. if (this.loadMore) {
  67. this.param.pageNum++;
  68. this.getData();
  69. }
  70. }
  71. };
  72. </script>
  73. <style lang="scss">
  74. .item {
  75. background-color: white;
  76. border-radius: 7px;
  77. padding: 15px;
  78. overflow: hidden;
  79. margin-bottom: 12px;
  80. .title {
  81. border-radius: 3px;
  82. font-weight: bold;
  83. font-size: 18px;
  84. }
  85. .desc {
  86. margin-top: 10px;
  87. color: $font-c;
  88. font-size: 15px;
  89. margin-left: -5px;
  90. .progress {
  91. float: left;
  92. width: 90%;
  93. }
  94. .all {
  95. float: left;
  96. padding-left: 5px;
  97. }
  98. }
  99. }
  100. </style>