log.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view>
  3. <block v-for="(item,index) in plist" :key="index">
  4. <view class="cu-card dynamic no-card solid-bottom echo-comjobs-item padding-top-sm padding-lr-sm radius">
  5. <view class="cu-item shadow padding-top-sm">
  6. <view class="padding-lr flex justify-between align-center">
  7. <view class="basis-lg text-bold text-df text-cut">{{item.worker.title}}</view>
  8. <view class="basis-sm text-cut text-right text-red text-sm">
  9. {{item.status_text}}
  10. </view>
  11. </view>
  12. <view class="padding-lr padding-tb-xs flex justify-end">
  13. <view class="cu-btn bg-green radius" @tap="dealInvite(item.id,2)" v-if="item.status == 1">接受邀请</view>
  14. <view class="cu-btn bg-red margin-left-sm radius" @tap="dealInvite(item.id,3)" v-if="item.status == 1">拒绝邀请</view>
  15. <view class="cu-btn bg-blue margin-left-sm radius" @tap="toCompany(item.workerid)">查看公司</view>
  16. </view>
  17. </view>
  18. </view>
  19. </block>
  20. <uni-load-more :status="pstatus"></uni-load-more>
  21. </view>
  22. </template>
  23. <script>
  24. import slFilter from '@/components/sl-filter/sl-filter.vue';
  25. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  26. var _this;
  27. export default {
  28. components: {
  29. slFilter,
  30. uniLoadMore
  31. },
  32. data() {
  33. return {
  34. userinfo: {},
  35. pstatus: 'more',
  36. ppage: 1,
  37. psize: 20,
  38. plist: [],
  39. };
  40. },
  41. onLoad: function(option){
  42. _this = this;
  43. _this.userinfo = _this.checkLogin("/pages/resume/log");
  44. _this.getMore();
  45. },
  46. onPullDownRefresh: function() {
  47. _this.pageRefresh();
  48. },
  49. onReachBottom: function() {
  50. if (_this.pstatus !== 'more') {
  51. return;
  52. }
  53. _this.getMore();
  54. },
  55. methods: {
  56. pageRefresh: function() {
  57. _this.pstatus = 'more';
  58. _this.ppage = 1;
  59. _this.plist = [];
  60. _this.getMore();
  61. },
  62. getMore: function() {
  63. _this.$req.ajax({
  64. path: "resume/userLog",
  65. data: {
  66. userid: _this.userinfo.id
  67. }
  68. }).then((data) => {
  69. _this.pstatus = data.status;
  70. _this.plist = _this.plist.concat(data.list);
  71. _this.ppage += 1;
  72. uni.stopPullDownRefresh();
  73. }).catch((err) => {
  74. uni.showModal({
  75. title: '信息提示',
  76. content: err,
  77. showCancel: false
  78. });
  79. });
  80. },
  81. dealInvite: function(id,status) {
  82. var text = status == 2 ? '接受' : '拒绝';
  83. uni.showModal({
  84. title: '信息提示',
  85. content: '确定要' + text + '邀请?',
  86. success: (res) => {
  87. if(res.confirm) {
  88. _this.$req.ajax({
  89. path: "resume/dealInvite",
  90. data: {
  91. id: id,
  92. status: status,
  93. }
  94. }).then((data) => {
  95. _this.pageRefresh();
  96. }).catch((err) => {
  97. uni.showModal({
  98. title: '信息提示',
  99. content: err,
  100. showCancel: false
  101. });
  102. });
  103. }
  104. }
  105. });
  106. },
  107. toCompany: function(workerid) {
  108. uni.navigateTo({
  109. url: '/pages/worker/shop?workerid=' + workerid
  110. });
  111. }
  112. }
  113. }
  114. </script>
  115. <style>
  116. </style>