index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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 },
  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. console.log('asd:' + this.total);
  48. }
  49. });
  50. },
  51. go(url) {
  52. uni.navigateTo({ url: url });
  53. },
  54. //刷新数据
  55. refresh() {
  56. this.loadMore = true;
  57. this.param.pageNum = 1;
  58. this.list = [];
  59. this.getData();
  60. }
  61. },
  62. //下拉刷新
  63. onPullDownRefresh() {
  64. setTimeout(() => {
  65. this.refresh();
  66. uni.stopPullDownRefresh();
  67. }, 1000);
  68. },
  69. //上拉加载
  70. onReachBottom() {
  71. if (this.loadMore) {
  72. this.param.pageNum++;
  73. this.getData();
  74. }
  75. }
  76. };
  77. </script>
  78. <style lang="scss">
  79. .item {
  80. background-color: white;
  81. border-radius: 7px;
  82. padding: 15px;
  83. overflow: hidden;
  84. margin-bottom: 12px;
  85. .top {
  86. overflow: hidden;
  87. position: relative;
  88. .title {
  89. border-radius: 3px;
  90. font-weight: bold;
  91. font-size: 18px;
  92. width: 70%;
  93. float: left;
  94. }
  95. .bage {
  96. position: absolute;
  97. padding: 0px 5px;
  98. border-radius: 20px;
  99. background-color: red;
  100. color: white;
  101. top: 2px;
  102. right: 7px;
  103. font-size: 14px;
  104. }
  105. }
  106. .desc {
  107. margin-top: 10px;
  108. color: $font-c;
  109. font-size: 15px;
  110. margin-left: -5px;
  111. overflow: hidden;
  112. .progress {
  113. float: left;
  114. width: 90%;
  115. }
  116. .all {
  117. float: left;
  118. padding-left: 5px;
  119. }
  120. }
  121. }
  122. </style>