myorder.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view>
  3. <view class="cu-list menu">
  4. <block v-for="(item,index) in plist" :key="index">
  5. <view class="cu-item arrow" @tap="goLPage('/pages/broker/getorder?id='+item.id)">
  6. <view class="content padding-tb-sm">
  7. <view>{{item.demand.title}}</view>
  8. <view class="text-gray text-sm">招聘工厂:{{item.demand.worker.title}}</view>
  9. <view class="text-gray text-sm">剩余人数:{{item.snatch_num}}</view>
  10. </view>
  11. <view class="action text-gray">{{item.status_text}}</view>
  12. </view>
  13. </block>
  14. </view>
  15. <uni-load-more :status="pstatus"></uni-load-more>
  16. </view>
  17. </template>
  18. <script>
  19. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  20. var _this;
  21. export default {
  22. components: {
  23. uniLoadMore
  24. },
  25. data() {
  26. return {
  27. brokerinfo: {},
  28. pstatus: 'more',
  29. ppage: 1,
  30. psize: 20,
  31. plist: [],
  32. followstatus: 0,
  33. followstatusarr: ['全部','未跟进', '未面试', '面试通过', '面试未通过', '用户放弃', '已入职', '已离职']
  34. };
  35. },
  36. onLoad: function(){
  37. _this = this;
  38. _this.brokerinfo = uni.getStorageSync('brokerinfo') || false;
  39. if (_this.brokerinfo===false){
  40. uni.reLaunch({
  41. url: "/pages/my/my"
  42. });
  43. return false;
  44. }
  45. _this.getMore();
  46. },
  47. onPullDownRefresh: function() {
  48. _this.ppage = 1;
  49. _this.pstatus = 'more';
  50. _this.plist = [];
  51. _this.getMore();
  52. },
  53. onReachBottom: function() {
  54. if (_this.pstatus !== 'more') {
  55. return;
  56. }
  57. _this.getMore();
  58. },
  59. methods: {
  60. getMore: function() {
  61. _this.$req.ajax({
  62. path: "broker/listorder",
  63. data: {
  64. ppage: _this.ppage,
  65. psize: _this.psize,
  66. brokerid: _this.brokerinfo.id,
  67. followstatus: _this.followstatus
  68. }
  69. }).then((data) => {
  70. _this.pstatus = data.pstatus;
  71. _this.plist = _this.plist.concat(data.plist);
  72. _this.ppage += 1;
  73. uni.stopPullDownRefresh();
  74. }).catch((err) => {
  75. uni.showModal({
  76. title: '信息提示',
  77. content: err,
  78. showCancel: false
  79. });
  80. });
  81. },
  82. pageRefresh: function() {
  83. _this.pstatus = 'more';
  84. _this.ppage = 1;
  85. _this.plist = [];
  86. _this.getMore();
  87. },
  88. tabSelect: function(e) {
  89. _this.followstatus = e.currentTarget.dataset.followstatus;
  90. _this.pageRefresh();
  91. },
  92. goLPage: function(pageurl) {
  93. _this.userinfo = _this.checkLogin("/pages/my/my");
  94. if (_this.userinfo===false){
  95. return false;
  96. }
  97. uni.navigateTo({
  98. url: pageurl,
  99. fail: function(){
  100. uni.switchTab({
  101. url: pageurl
  102. });
  103. }
  104. });
  105. },
  106. goNavPage: function(pageurl) {
  107. _this.userinfo = _this.checkLogin("/pages/my/my");
  108. if (_this.userinfo===false){
  109. return false;
  110. }
  111. uni.redirectTo({
  112. url: pageurl
  113. });
  114. },
  115. }
  116. }
  117. </script>
  118. <style>
  119. .cu-list.menu-avatar .cu-item{ height: 170rpx !important; }
  120. </style>