wdemandlog.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <view>
  3. <view class="bg-white padding text-xl text-black text-bold">
  4. {{demand.title}}(<text class="text-red text-bold">{{demand.num}}人</text>)
  5. </view>
  6. <view class="bg-white padding-lr padding-bottom">
  7. <view class="text-lg text-red text-bold">{{demand.ftype_text}}:{{demand.fwagall}}</view>
  8. </view>
  9. <view class="bg-white padding-lr padding-bottom flex justify-between">
  10. <view><text class="text-red text-bold">{{demand.wtype_text}}</text></view>
  11. <view><text class="text-red text-bold">{{demand.zwagall}}</text></view>
  12. <text class="text-sm text-gray">{{demand.city}} {{demand.district}}</text>
  13. </view>
  14. <view class="bg-white padding-lr padding-bottom margin-bottom-sm align-center">
  15. <view v-for="(item,index) in demand.tags" :key="index" class="cu-tag light bg-grey margin-bottom-xs">{{item}}</view>
  16. </view>
  17. <view class="cu-bar bg-white solids-bottom">
  18. <view class="action">
  19. <text class="cuIcon-titles text-red"></text> 接单记录
  20. </view>
  21. <view class="action">
  22. <text class="text-df">共 {{logcount}} 条 </text>
  23. <view class="cuIcon-right"></view>
  24. </view>
  25. </view>
  26. <view class="cu-list menu-avatar">
  27. <block v-for="(item,index) in plist" :key="index">
  28. <view class="cu-item ">
  29. <view class="cu-avatar radius lg" :style="'background-image:url('+item.worker.tilpic+');'"></view>
  30. <view class="content">
  31. <view class="text-black">
  32. <view class="text-cut">{{item.worker.title}}(<text class="text-red text-bold">{{item.num}}人</text></view>)
  33. </view>
  34. <view class="text-gray text-sm flex">
  35. <view class="text-cut">接单时间:{{item.createtime}}</view>
  36. </view>
  37. </view>
  38. <view class="action">
  39. <button class="cu-btn bg-themeBtn cuIcon" @tap="makeTelephone" :data-telephone="item.worker.mobile">
  40. <text class="cuIcon-phone"></text>
  41. </button>
  42. </view>
  43. </view>
  44. </block>
  45. </view>
  46. <uni-load-more :status="pstatus"></uni-load-more>
  47. </view>
  48. </template>
  49. <script>
  50. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  51. var _this;
  52. export default {
  53. components: {
  54. uniLoadMore
  55. },
  56. data() {
  57. return {
  58. isRotate: false,
  59. userinfo: false,
  60. workerinfo: false,
  61. demand: {},
  62. logcount: 0,
  63. pstatus: 'more',
  64. ppage: 1,
  65. psize: 20,
  66. plist: []
  67. };
  68. },
  69. onLoad: function(option) {
  70. _this = this;
  71. var demandid = option.demandid || 0;
  72. _this.userinfo = _this.checkLogin("/pages/my/my");
  73. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  74. if (_this.userinfo === false || _this.workerinfo === false) {
  75. uni.reLaunch({
  76. url: "/pages/my/my"
  77. });
  78. return false;
  79. }
  80. _this.$req.ajax({
  81. path: "wdemand/pagewdemandlog",
  82. data: {
  83. demandid: demandid,
  84. workerid: _this.workerinfo.id
  85. }
  86. }).then((data) => {
  87. _this.demand = data.demand;
  88. _this.logcount = data.logcount;
  89. _this.getMore();
  90. }).catch((err) => {
  91. uni.showModal({
  92. title: '信息提示',
  93. content: err,
  94. showCancel: false
  95. });
  96. });
  97. },
  98. onPullDownRefresh: function() {
  99. _this.pageRefresh();
  100. },
  101. onReachBottom: function() {
  102. if (_this.pstatus !== 'more') {
  103. return;
  104. }
  105. _this.getMore();
  106. },
  107. methods: {
  108. pageRefresh: function() {
  109. _this.pstatus = 'more';
  110. _this.ppage = 1;
  111. _this.plist = [];
  112. _this.getMore();
  113. },
  114. getMore: function() {
  115. _this.$req.ajax({
  116. path: "wdemand/wdemandloglist",
  117. data: {
  118. ppage: _this.ppage,
  119. psize: _this.psize,
  120. workerid: _this.workerinfo.id,
  121. demandid: _this.demand.id
  122. }
  123. }).then((data) => {
  124. _this.pstatus = data.pstatus;
  125. _this.plist = _this.plist.concat(data.plist);
  126. _this.ppage += 1;
  127. uni.stopPullDownRefresh();
  128. }).catch((err) => {
  129. uni.showModal({
  130. title: '信息提示',
  131. content: err,
  132. showCancel: false
  133. });
  134. });
  135. },
  136. delWorderlog: function(e) {
  137. var itemlogid = e.currentTarget.dataset.itemlogid;
  138. var itemindex = e.currentTarget.dataset.itemindex;
  139. uni.showModal({
  140. title: '信息提示',
  141. content: '删除后不可恢复,确定要删除吗?',
  142. success: function(res) {
  143. if (res.confirm) {
  144. _this.$req.ajax({
  145. path: "worder/dellog",
  146. data: {
  147. userid: _this.userinfo.id,
  148. getworkerid: _this.workerinfo.id,
  149. logid: itemlogid
  150. }
  151. }).then((data) => {
  152. _this.modalName = null;
  153. _this.plist.splice( itemindex, 1 );
  154. }).catch((err) => {
  155. uni.showModal({
  156. title: '信息提示',
  157. content: err,
  158. showCancel: false
  159. });
  160. });
  161. }
  162. }
  163. });
  164. },
  165. tabSelect: function(e) {
  166. _this.status = e.currentTarget.dataset.status;
  167. _this.pageRefresh();
  168. },
  169. makeTelephone: function(e) {
  170. var telephone = e.currentTarget.dataset.telephone;
  171. uni.makePhoneCall({
  172. phoneNumber: telephone
  173. });
  174. }
  175. }
  176. }
  177. </script>
  178. <style>
  179. </style>