log.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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 padding-bottom" @tap="goDetail(item.comjobs.id)">
  6. <view class="padding-lr flex justify-between align-center">
  7. <view class="basis-lg text-bold text-df text-cut">
  8. {{item.comjobs.title}}
  9. <text class="text-red text-sm" v-if="item.comjobs.wtype==1">(按月)</text>
  10. <text class="text-red text-sm" v-if="item.comjobs.wtype==2">(按时)</text>
  11. <text class="text-red text-sm" v-if="item.comjobs.wtype==3">(按件)</text>
  12. <text class="text-red text-sm" v-if="item.comjobs.wtype==4">(按项目)</text>
  13. </view>
  14. <view class="basis-sm text-cut text-right text-gray text-sm">
  15. <view class="basis-xs text-cut text-right text-gray text-sm" @tap.stop="delLog(index, item.id)">取消报名</view>
  16. </view>
  17. </view>
  18. <view class="padding-lr flex justify-between align-bottom">
  19. <view class="basis-lg text-bold text-df text-cut">
  20. <view><text class="text-red text-bold">{{item.comjobs.zwagall}}</text></view>
  21. </view>
  22. <view class="basis-sm text-cut text-right text-red text-sm">
  23. {{item.status_text}}
  24. </view>
  25. </view>
  26. <view class="padding-lr padding-tb-xs text-cut">
  27. <view v-for="(titem,tindex) in item.comjobs.tags" :key="tindex" class="cu-tag light bg-blue lg echo-tags-item">{{titem}}</view>
  28. </view>
  29. <view class="padding-lr text-cut text-sm flex justify-between align-center">
  30. <view class="basis-lg text-df text-cut">{{item.comjobs.worker.title}}</view>
  31. <view class="basis-sm text-cut text-right text-sm">
  32. 浏览量:{{item.comjobs.volume}}
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </block>
  38. <uni-load-more :status="pstatus"></uni-load-more>
  39. </view>
  40. </template>
  41. <script>
  42. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  43. var _this;
  44. export default {
  45. components: {
  46. uniLoadMore
  47. },
  48. data() {
  49. return {
  50. userinfo: {},
  51. pstatus: 'more',
  52. ppage: 1,
  53. psize: 20,
  54. plist: []
  55. };
  56. },
  57. onLoad: function(){
  58. _this = this;
  59. _this.userinfo = _this.checkLogin("/pages/comjobs/log");
  60. if (_this.userinfo===false){
  61. return false;
  62. }
  63. _this.getMore();
  64. },
  65. onPullDownRefresh: function() {
  66. _this.ppage = 1;
  67. _this.pstatus = 'more';
  68. _this.plist = [];
  69. _this.getMore();
  70. },
  71. onReachBottom: function() {
  72. if (_this.pstatus !== 'more') {
  73. return;
  74. }
  75. _this.getMore();
  76. },
  77. methods: {
  78. delLog: function(index,logid) {
  79. uni.showModal({
  80. title: '温馨提示',
  81. content: '确定要删除吗?',
  82. success(res) {
  83. if (res.confirm) {
  84. _this.$req.ajax({
  85. path: "comjobs/dellog",
  86. data: {
  87. logid: logid,
  88. userid: _this.userinfo.id
  89. }
  90. }).then((data) => {
  91. _this.plist.splice(index, 1);
  92. }).catch((err) => {
  93. uni.showModal({
  94. title: '信息提示',
  95. content: err,
  96. showCancel: false
  97. });
  98. });
  99. }
  100. }
  101. });
  102. },
  103. getMore: function() {
  104. _this.$req.ajax({
  105. path: "comjobs/listlog",
  106. data: {
  107. ppage: _this.ppage,
  108. psize: _this.psize,
  109. userid: _this.userinfo.id
  110. }
  111. }).then((data) => {
  112. _this.pstatus = data.pstatus;
  113. _this.plist = _this.plist.concat(data.plist);
  114. _this.ppage += 1;
  115. uni.stopPullDownRefresh();
  116. }).catch((err) => {
  117. uni.showModal({
  118. title: '信息提示',
  119. content: err,
  120. showCancel: false
  121. });
  122. });
  123. },
  124. goDetail: function(comjobsid) {
  125. uni.navigateTo({
  126. url: '/pages/comjobs/detail?comjobsid=' + comjobsid
  127. });
  128. },
  129. goShop: function(workerid) {
  130. uni.navigateTo({
  131. url: '/pages/worker/shop?workerid=' + workerid
  132. });
  133. },
  134. }
  135. }
  136. </script>
  137. <style>
  138. </style>