index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <view class="main pt0">
  3. <view class="message _error" v-if="total > 0">你有:{{ 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="top">
  6. <view class="title omit">{{ item.title }}</view>
  7. <view class="bage" v-if="item.noRead > 0">{{ item.noRead > 99 ? '99+' : item.noRead }}</view>
  8. </view>
  9. <view class="desc">
  10. <view class="progress">
  11. <u-line-progress :percentage="(item.isRead / item.total).toFixed(2) * 100" :height="20" text="已读"></u-line-progress>
  12. </view>
  13. <view class="all">{{ item.total }}份</view>
  14. </view>
  15. </view>
  16. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  17. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. data() {
  23. return {
  24. list: [],
  25. param: { pageNum: 1, pageSize: 10, type: 0 },
  26. loadMore: true,
  27. total: 0
  28. };
  29. },
  30. onLoad(e) {
  31. this.getData();
  32. },
  33. methods: {
  34. getData() {
  35. this.total = 0;
  36. this.http.request({
  37. url: '/app/deliver/receive',
  38. data: this.param,
  39. loading: 'false',
  40. success: (res) => {
  41. this.loadMore = res.data.pages > this.param.pageNum ? true : false;
  42. res.data.rows.forEach((item) => {
  43. this.list.push(item);
  44. item.noRead = parseInt(item.total) - parseInt(item.isRead);
  45. this.total = this.total + item.noRead;
  46. });
  47. }
  48. });
  49. },
  50. go(url) {
  51. uni.navigateTo({ url: url });
  52. },
  53. //刷新数据
  54. refresh() {
  55. this.loadMore = true;
  56. this.param.pageNum = 1;
  57. this.list = [];
  58. this.getData();
  59. }
  60. },
  61. //下拉刷新
  62. onPullDownRefresh() {
  63. setTimeout(() => {
  64. this.refresh();
  65. uni.stopPullDownRefresh();
  66. }, 1000);
  67. },
  68. //上拉加载
  69. onReachBottom() {
  70. if (this.loadMore) {
  71. this.param.pageNum++;
  72. this.getData();
  73. }
  74. }
  75. };
  76. </script>
  77. <style lang="scss">
  78. .item {
  79. background-color: white;
  80. border-radius: 7px;
  81. padding: 15px;
  82. overflow: hidden;
  83. margin-bottom: 12px;
  84. .top {
  85. overflow: hidden;
  86. position: relative;
  87. .title {
  88. border-radius: 3px;
  89. font-weight: bold;
  90. font-size: 18px;
  91. width: 70%;
  92. float: left;
  93. }
  94. .salary {
  95. float: right;
  96. color: orangered;
  97. padding-right: 7px;
  98. }
  99. .bage {
  100. position: absolute;
  101. padding: 0px 5px;
  102. border-radius: 20px;
  103. background-color: red;
  104. color: white;
  105. top: 2px;
  106. right: 7px;
  107. font-size: 14px;
  108. }
  109. }
  110. .desc {
  111. margin-top: 10px;
  112. color: $font-c;
  113. font-size: 15px;
  114. margin-left: -5px;
  115. overflow: hidden;
  116. .progress {
  117. float: left;
  118. width: 90%;
  119. }
  120. .all {
  121. float: left;
  122. padding-left: 5px;
  123. }
  124. }
  125. }
  126. </style>