snatch.vue 5.9 KB

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