outjoblist.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view>
  3. <scroll-view scroll-x class="bg-white nav solid-bottom solid-bottom echo-fixed-top">
  4. <view class="flex text-center">
  5. <view class="cu-item flex-sub" :class="status==0?'text-red cur':''" @tap="tabSelect" data-status="0">全部</view>
  6. <view class="cu-item flex-sub" :class="status==1?'text-red cur':''" @tap="tabSelect" data-status="1">审核通过</view>
  7. <view class="cu-item flex-sub" :class="status==2?'text-red cur':''" @tap="tabSelect" data-status="2">待审核</view>
  8. <view class="cu-item flex-sub" :class="status==3?'text-red cur':''" @tap="tabSelect" data-status="3">审核不通过</view>
  9. </view>
  10. </scroll-view>
  11. <view class="echo-fixed-top-empty"></view>
  12. <block v-for="(item,index) in plist" :key="index">
  13. <view class="cu-card dynamic no-card solid-bottom echo-comjobs-item margin-tb-sm">
  14. <view class="cu-item shadow padding-top-sm padding-bottom">
  15. <view class="padding-lr padding-bottom-xs flex justify-between align-center">
  16. <view class="basis-xl text-bold text-lg text-cut">
  17. {{item.title}}
  18. <text class="text-sm text-red">{{item.num}}名</text>
  19. </view>
  20. <view class="basis-xs text-cut text-right text-gray text-sm">{{item.city}}</view>
  21. </view>
  22. <view class="padding-lr flex justify-between align-bottom">
  23. <view><text class="text-red text-bold">工资:{{item.salary}}</text></view>
  24. </view>
  25. <view class="padding-lr padding-bottom-sm text-cut">
  26. <view v-for="(titem,tindex) in item.tags" :key="tindex" class="cu-tag light bg-gray sm">{{titem}}</view>
  27. </view>
  28. <view class="grid solids-top text-center col-2">
  29. <view @tap="goOutjob" :data-id="item.id" class="padding-top"><text class="cuIcon-write padding-right-xs"></text> 编辑 </view>
  30. <view @tap="delOutjob" :data-id="item.id" class="text-red padding-top"><text class="cuIcon-pulldown padding-right-xs"></text> 删除 </view>
  31. </view>
  32. </view>
  33. </view>
  34. </block>
  35. <uni-load-more :status="pstatus"></uni-load-more>
  36. <view class="padding"></view>
  37. <button class="cu-btn bg-themeBtn lg shadow echo-gohome" data-pageurl="/pages/worker/outjobform" @tap="goPage"> 发布招聘 </button>
  38. </view>
  39. </template>
  40. <script>
  41. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  42. var _this;
  43. export default {
  44. components: {
  45. uniLoadMore
  46. },
  47. data() {
  48. return {
  49. isRotate: false,
  50. status: 0,
  51. userinfo: false,
  52. workerinfo: false,
  53. param: {},
  54. pstatus: 'more',
  55. ppage: 1,
  56. psize: 20,
  57. plist: [],
  58. }
  59. },
  60. onLoad: function(option) {
  61. _this = this;
  62. _this.userinfo = _this.checkLogin("/pages/my/my");
  63. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  64. if (_this.userinfo === false || _this.workerinfo === false) {
  65. uni.reLaunch({
  66. url: "/pages/my/my"
  67. });
  68. return false;
  69. }
  70. },
  71. onShow: function() {
  72. _this.pageRefresh();
  73. },
  74. onPullDownRefresh: function() {
  75. _this.pageRefresh();
  76. },
  77. onReachBottom: function() {
  78. if (_this.pstatus !== 'more') {
  79. return;
  80. }
  81. _this.getMore();
  82. },
  83. methods: {
  84. delOutjob: function(e) {
  85. var id = e.currentTarget.dataset.id;
  86. _this.$req.ajax({
  87. path: "woutjobs/delrecruit",
  88. data: {
  89. id: id,
  90. userid: _this.userinfo.id,
  91. workerid: _this.workerinfo.id,
  92. }
  93. }).then((data) => {
  94. _this.pageRefresh();
  95. }).catch((err) => {
  96. uni.showModal({
  97. title: '信息提示',
  98. content: err,
  99. showCancel: false
  100. });
  101. });
  102. },
  103. pageRefresh: function() {
  104. _this.pstatus = 'more';
  105. _this.ppage = 1;
  106. _this.plist = [];
  107. _this.getMore();
  108. },
  109. getMore: function() {
  110. _this.$req.ajax({
  111. path: "woutjobs/listjobs",
  112. data: {
  113. ppage: _this.ppage,
  114. psize: _this.psize,
  115. status: _this.status,
  116. workerid: _this.workerinfo.id
  117. }
  118. }).then((data) => {
  119. _this.param = data.param;
  120. _this.pstatus = data.pstatus;
  121. _this.plist = _this.plist.concat(data.plist);
  122. _this.ppage += 1;
  123. uni.stopPullDownRefresh();
  124. }).catch((err) => {
  125. uni.showModal({
  126. title: '信息提示',
  127. content: err,
  128. showCancel: false
  129. });
  130. });
  131. },
  132. tabSelect: function(e) {
  133. _this.status = e.currentTarget.dataset.status;
  134. _this.pageRefresh();
  135. },
  136. goOutjob: function(e) {
  137. let id = e.currentTarget.dataset.id;
  138. uni.navigateTo({
  139. url: '/pages/worker/outjobform?id='+id
  140. });
  141. },
  142. goPage: function(e) {
  143. var pageurl = e.currentTarget.dataset.pageurl;
  144. uni.navigateTo({
  145. url: pageurl,
  146. fail: function() {
  147. uni.switchTab({
  148. url: pageurl
  149. });
  150. }
  151. });
  152. },
  153. },
  154. }
  155. </script>
  156. <style>
  157. .picmodal{ width: 640rpx; background-color: transparent; }
  158. .picmodal image{ width: 100%; }
  159. .picmodal .bg-img{ position: relative; }
  160. .picmodalclose{ position: absolute; top: 0rpx; right: 0rpx; }
  161. </style>