list.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view>
  3. <view class="tab">
  4. <u-tabs :list="tab" :current="current" @click="click"></u-tabs>
  5. </view>
  6. <view class="cmain">
  7. <view class="position">
  8. <view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
  9. <view class="top">
  10. <view class="title omit">{{ item.title }}</view>
  11. <view class="op" v-if="item.status != 0 && item.state == 0" style="color: #ccc">
  12. <text class="icon">&#xe622;</text>
  13. <text>审核中</text>
  14. </view>
  15. <view class="op" v-if="item.status != 0 && item.state == 1" style="color: #07cb4c">
  16. <text class="icon">&#xe622;</text>
  17. <text>开放中</text>
  18. </view>
  19. <view class="op" v-if="item.status != 0 && item.state == 2" style="color: #ccc">
  20. <text class="icon">&#xe622;</text>
  21. <text>审核不通过</text>
  22. </view>
  23. <view class="op" v-if="item.status == 0 || item.state == 3" style="color: #ccc">
  24. <text class="icon">&#xe622;</text>
  25. <text>已关闭</text>
  26. </view>
  27. <view class="clear"></view>
  28. </view>
  29. <view class="con">
  30. <view class="desc">
  31. <text class="tag">{{ item.experience == '不限' ? '经验不限' : item.experience }}</text>
  32. <text class="tag">{{ item.education == '不限' ? '学历不限' : item.education }}</text>
  33. <text class="tag">{{ item.salary }}</text>
  34. <view class="clear"></view>
  35. </view>
  36. <view class="clear"></view>
  37. </view>
  38. </view>
  39. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  40. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  41. </view>
  42. </view>
  43. <se v-model="show" :list="tab" @confirm="confirm"></se>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. data() {
  49. return {
  50. user: this.getUser(),
  51. show: false,
  52. name: '全职',
  53. tab: [{ name: '全职' }, { name: '兼职' }],
  54. list: [],
  55. param: { pageNum: 1, pageSize: 10, types: '全职', orderByColumn: 'createTime', isAsc: 'desc' },
  56. loadMore: true
  57. };
  58. },
  59. onLoad(e) {
  60. this.http.request({
  61. url: '/app/position/updateIsRead',
  62. success: (res) => {}
  63. });
  64. if (this.user.types == 0) {
  65. this.tab = ['兼职', '任务'];
  66. this.param.types = '兼职';
  67. }
  68. this.getData();
  69. uni.$on('position', (res) => {
  70. this.refresh();
  71. });
  72. },
  73. methods: {
  74. //去发布
  75. confirm(e) {
  76. uni.navigateTo({
  77. url: '/pages/position/push?types=' + e
  78. });
  79. },
  80. select(item) {
  81. this.param.types = item;
  82. this.refresh();
  83. },
  84. detail(item) {
  85. uni.navigateTo({
  86. url: '/pages/position/push?id=' + item.id
  87. });
  88. },
  89. getData() {
  90. this.http.request({
  91. url: '/app/position/user/push/list',
  92. data: this.param,
  93. loading: 'false',
  94. success: (res) => {
  95. this.loadMore = res.data.pages > this.param.pageNum ? true : false;
  96. res.data.rows.forEach((item) => {
  97. item.createTime = uni.$u.timeFrom(Date.parse(item.createTime));
  98. this.list.push(item);
  99. });
  100. }
  101. });
  102. },
  103. //刷新数据
  104. refresh() {
  105. this.loadMore = true;
  106. this.param.pageNum = 1;
  107. this.list = [];
  108. this.getData();
  109. }
  110. },
  111. //下拉刷新
  112. onPullDownRefresh() {
  113. setTimeout(() => {
  114. this.refresh();
  115. uni.stopPullDownRefresh();
  116. }, 1000);
  117. },
  118. //上拉加载
  119. onReachBottom() {
  120. if (this.loadMore) {
  121. this.param.pageNum++;
  122. this.getData();
  123. }
  124. }
  125. };
  126. </script>
  127. <style lang="scss">
  128. </style>