demandlog.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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-blue cur':''" @tap="tabSelect" data-status="0">全部</view>
  6. <view class="cu-item flex-sub" :class="status==3?'text-blue cur':''" @tap="tabSelect" data-status="3">已上架</view>
  7. <view class="cu-item flex-sub" :class="status==4?'text-blue cur':''" @tap="tabSelect" data-status="4">已停招</view>
  8. <view class="cu-item flex-sub" :class="status==5?'text-blue cur':''" @tap="tabSelect" data-status="5">已下架</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-demand-item margin-tb-sm">
  14. <view class="cu-item shadow padding-top-sm">
  15. <view class="padding-lr padding-bottom-xs flex justify-between align-center" @tap="goDetail(item.id)">
  16. <view class="basis-xl text-bold text-lg text-cut">{{item.demand.title}}</view>
  17. <view class="basis-xs text-cut text-right text-gray text-sm">{{item.demand.city}}</view>
  18. </view>
  19. <view class="padding-lr flex justify-between align-bottom" @tap="goDetail(item.id)">
  20. <view v-if="item.demand.wtype==1"><text class="text-red text-bold">{{item.demand.zwagall}}</text></view>
  21. <view v-if="item.demand.wtype==5"><text class="text-red text-bold">其他</text></view>
  22. <view v-else><text class="text-red text-bold">{{item.demand.bwagall}}</text></view>
  23. <view class="text-red">{{item.demand.ftype_text}}:{{item.demand.fwagall}}</view>
  24. </view>
  25. <view class="padding-lr text-cut" @tap="goDetail(item.id)">
  26. <view v-for="(titem,tindex) in item.demand.tags" :key="tindex" class="cu-tag light bg-gray sm">{{titem}}</view>
  27. </view>
  28. <view class="text-gray padding-lr padding-tb-sm flex align-center justify-between" @tap="goShop(item.demand.workerid)">
  29. <view class="text-cut basis-xl">
  30. <view class="cu-capsule margin-right-sm">
  31. <view class="cu-tag bg-red">
  32. <text class="cuIcon-safe"></text>
  33. </view>
  34. <view class="cu-tag line-red">认证企业</view>
  35. </view>
  36. {{item.worker.title}}
  37. </view>
  38. <view class="text-gray text-right basis-xs">
  39. <text class="cuIcon-shop margin-right-xs text-lg"></text>
  40. 进店
  41. </view>
  42. </view>
  43. <view class="grid solids-top text-center col-2 padding-tb-sm bg-white">
  44. <view @tap="delDemandlog" :data-itemlogid="item.id" :data-itemindex="index"><text class="cuIcon-delete padding-right-xs"></text> 删除 </view>
  45. <view @tap="makeTelephone" :data-telephone="item.demand.telephone"><text class="cuIcon-phone padding-right-xs"></text> 咨询 </view>
  46. </view>
  47. </view>
  48. </view>
  49. </block>
  50. <uni-load-more :status="pstatus"></uni-load-more>
  51. <view class="padding"></view>
  52. </view>
  53. </template>
  54. <script>
  55. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  56. var _this;
  57. export default {
  58. components: {
  59. uniLoadMore
  60. },
  61. data() {
  62. return {
  63. isRotate: false,
  64. status: 3,
  65. userinfo: false,
  66. workerinfo: false,
  67. param: {},
  68. pstatus: 'more',
  69. ppage: 1,
  70. psize: 20,
  71. plist: []
  72. }
  73. },
  74. onLoad: function(option) {
  75. _this = this;
  76. _this.status = option.status || 3;
  77. _this.userinfo = _this.checkLogin("/pages/my/my");
  78. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  79. if (_this.userinfo === false || _this.workerinfo === false) {
  80. uni.reLaunch({
  81. url: "/pages/my/my"
  82. });
  83. return false;
  84. }
  85. _this.getMore();
  86. },
  87. onPullDownRefresh: function() {
  88. _this.pageRefresh();
  89. },
  90. onReachBottom: function() {
  91. if (_this.pstatus !== 'more') {
  92. return;
  93. }
  94. _this.getMore();
  95. },
  96. methods: {
  97. delDemandlog: function(e) {
  98. var itemlogid = e.currentTarget.dataset.itemlogid;
  99. var itemindex = e.currentTarget.dataset.itemindex;
  100. uni.showModal({
  101. title: '信息提示',
  102. content: '删除后不可恢复,确定要删除吗?',
  103. success: function(res) {
  104. if (res.confirm) {
  105. _this.$req.ajax({
  106. path: "demand/deldemandlog",
  107. data: {
  108. gworkerid: _this.workerinfo.id,
  109. logid: itemlogid
  110. }
  111. }).then((data) => {
  112. _this.modalName = null;
  113. _this.plist.splice( itemindex, 1 );
  114. }).catch((err) => {
  115. uni.showModal({
  116. title: '信息提示',
  117. content: err,
  118. showCancel: false
  119. });
  120. });
  121. }
  122. }
  123. });
  124. },
  125. pageRefresh: function() {
  126. _this.pstatus = 'more';
  127. _this.ppage = 1;
  128. _this.plist = [];
  129. _this.getMore();
  130. },
  131. getMore: function() {
  132. _this.$req.ajax({
  133. path: "demand/listdemandlog",
  134. data: {
  135. ppage: _this.ppage,
  136. psize: _this.psize,
  137. status: _this.status,
  138. gworkerid: _this.workerinfo.id
  139. }
  140. }).then((data) => {
  141. _this.param = data.param;
  142. _this.pstatus = data.pstatus;
  143. _this.plist = _this.plist.concat(data.plist);
  144. _this.ppage += 1;
  145. uni.stopPullDownRefresh();
  146. }).catch((err) => {
  147. uni.showModal({
  148. title: '信息提示',
  149. content: err,
  150. showCancel: false
  151. });
  152. });
  153. },
  154. tabSelect: function(e) {
  155. _this.status = e.currentTarget.dataset.status;
  156. _this.pageRefresh();
  157. },
  158. makeTelephone: function(e) {
  159. var telephone = e.currentTarget.dataset.telephone;
  160. uni.makePhoneCall({
  161. phoneNumber: telephone
  162. });
  163. },
  164. goDetail: function(comjobsid) {
  165. uni.navigateTo({
  166. url: '/pages/comjobs/detail?comjobsid=' + comjobsid
  167. });
  168. },
  169. goShop: function(workerid) {
  170. uni.navigateTo({
  171. url: '/pages/worker/shop?workerid=' + workerid
  172. });
  173. },
  174. },
  175. }
  176. </script>
  177. <style>
  178. .picmodal{ width: 640rpx; background-color: transparent; }
  179. .picmodal image{ width: 100%; }
  180. .picmodal .bg-img{ position: relative; }
  181. .picmodalclose{ position: absolute; top: 0rpx; right: 0rpx; }
  182. </style>