workerlist.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <view>
  3. <view class="cu-bar search">
  4. <view class="search-form round text-center">
  5. <text class="cuIcon-search"></text>
  6. <input @input="bindInput" :adjust-position="false" type="text" placeholder="搜索企业名称" confirm-type="search"></input>
  7. </view>
  8. <view class="action" v-if="searchval!==''">
  9. <button class="cu-btn bg-white shadow-blur round" @click="btnSearch()">搜索</button>
  10. </view>
  11. </view>
  12. <scroll-view scroll-x class="bg-white nav solid-bottom">
  13. <view class="flex text-center">
  14. <view class="cu-item flex-sub" :class="wtype==0?'text-blue cur':''" @tap="tabSelect" data-wtype="0">全部</view>
  15. <view class="cu-item flex-sub" :class="wtype==1?'text-blue cur':''" @tap="tabSelect" data-wtype="1">普通企业</view>
  16. <view class="cu-item flex-sub" :class="wtype==2?'text-blue cur':''" @tap="tabSelect" data-wtype="2">派遣企业</view>
  17. </view>
  18. </scroll-view>
  19. <block v-for="(item,index) in plist" :key="index">
  20. <view class="cu-card dynamic no-card solid-bottom echo-supply-item">
  21. <view class="cu-item shadow padding-top-sm padding-bottom" @tap="goShop(item.id)">
  22. <view class="flex justify-between">
  23. <view class="cu-avatar radius xl margin-left" :style="'background-image:url('+item.tilpic+');'"></view>
  24. <view class="echo-plistitem">
  25. <view class="padding-right padding-bottom-sm flex text-bold justify-between align-center">{{item.title}}</view>
  26. <view class="padding-right text-cut text-sm text-gray flex justify-between align-center">
  27. <view class="basis-xl text-cut">{{item.province}} {{item.city}}</view>
  28. <view class="basis-xs text-cut text-right text-gray text-sm">{{item.wtype_text}}</view>
  29. </view>
  30. <view class="text-gray padding-right padding-top-sm flex align-center justify-between" @tap="goShop(item.id)">
  31. <view class="flex align-center">
  32. <image class="iconyrz" :src="$getImageUrl('static/images/applet/iconyrz.png')" mode="scaleToFill"></image>
  33. </view>
  34. <view class="text-gray text-right basis-xs">
  35. <text class="cuIcon-shop margin-right-xs text-lg"></text>
  36. 进店
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </block>
  44. <uni-load-more :status="pstatus"></uni-load-more>
  45. <view class="padding-sm"></view>
  46. <view class="padding-xl"></view>
  47. <view class="cu-bar tabbar bg-white foot">
  48. <view class="action text-gray" @tap="goNavPage('/pages/worker/worker')">
  49. <view class="cuIcon-cu-image">
  50. <image src="../../static/tabbar/windex.png"></image>
  51. </view>
  52. 首页
  53. </view>
  54. <view class="action text-gray" @tap="goNavPage('/pages/demand/demand')">
  55. <view class="cuIcon-cu-image">
  56. <image src="../../static/tabbar/wdemand.png"></image>
  57. </view>
  58. 订单
  59. </view>
  60. <!-- #ifndef MP-WEIXIN -->
  61. <view class="action text-gray videoimg" @tap="goNavPage('/pages/video/video')">
  62. <view class="cuIcon-cu-image">
  63. <image src="../../static/tabbar/video.png"></image>
  64. </view>
  65. 录视频
  66. </view>
  67. <!-- #endif -->
  68. <view class="action text-gray" @tap="goNavPage('/pages/supply/supply')">
  69. <view class="cuIcon-cu-image">
  70. <image src="../../static/tabbar/wsupply.png"></image>
  71. </view>
  72. 供人
  73. </view>
  74. <!--
  75. <view class="action text-blue" @tap="goNavPage('/pages/worker/workerlist')">
  76. <view class="cuIcon-cu-image">
  77. <image src="../../static/tabbar/wworkerSelected.png"></image>
  78. </view>
  79. 企业1
  80. </view>
  81. -->
  82. </view>
  83. <wxContact></wxContact>
  84. </view>
  85. </template>
  86. <script>
  87. import slFilter from '@/components/sl-filter/sl-filter.vue';
  88. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  89. var _this;
  90. export default {
  91. components: {
  92. slFilter,
  93. uniLoadMore
  94. },
  95. data() {
  96. return {
  97. userinfo: false,
  98. workerinfo: false,
  99. wtype: 0,
  100. searchval: "",
  101. pstatus: 'more',
  102. ppage: 1,
  103. psize: 20,
  104. plist: []
  105. };
  106. },
  107. onLoad: function(option){
  108. _this = this;
  109. _this.userinfo = _this.checkLogin("/pages/my/my");
  110. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  111. if (_this.userinfo === false || _this.workerinfo === false) {
  112. uni.reLaunch({
  113. url: "/pages/my/my"
  114. });
  115. return false;
  116. }
  117. _this.getMore();
  118. },
  119. onPullDownRefresh: function() {
  120. _this.pageRefresh();
  121. },
  122. onReachBottom: function() {
  123. if (_this.pstatus !== 'more') {
  124. return;
  125. }
  126. _this.getMore();
  127. },
  128. onShareAppMessage: function(res) {
  129. return {
  130. title: "招聘企业",
  131. path: "/pages/worker/workerlist"
  132. }
  133. },
  134. methods: {
  135. // 搜索
  136. bindInput: function(e) {
  137. _this.searchval = e.detail.value;
  138. },
  139. btnSearch: function() {
  140. if (_this.searchval == "") {
  141. uni.showModal({
  142. title: '信息提示',
  143. content: "请输入要搜索的关键字...",
  144. showCancel: false
  145. });
  146. return false;
  147. }
  148. _this.pageRefresh();
  149. },
  150. pageRefresh: function() {
  151. _this.pstatus = 'more';
  152. _this.ppage = 1;
  153. _this.plist = [];
  154. _this.getMore();
  155. },
  156. getMore: function() {
  157. _this.$req.ajax({
  158. path: "worker/listworker",
  159. data: {
  160. ppage: _this.ppage,
  161. psize: _this.psize,
  162. wtype: _this.wtype,
  163. searchval: _this.searchval
  164. }
  165. }).then((data) => {
  166. _this.pstatus = data.pstatus;
  167. _this.plist = _this.plist.concat(data.plist);
  168. _this.ppage += 1;
  169. uni.stopPullDownRefresh();
  170. }).catch((err) => {
  171. uni.showModal({
  172. title: '信息提示',
  173. content: err,
  174. showCancel: false
  175. });
  176. });
  177. },
  178. tabSelect: function(e) {
  179. _this.wtype = e.currentTarget.dataset.wtype;
  180. _this.pageRefresh();
  181. },
  182. goShop: function(workerid) {
  183. uni.navigateTo({
  184. url: '/pages/worker/shop?workerid=' + workerid
  185. });
  186. },
  187. goNavPage: function(pageurl) {
  188. _this.userinfo = _this.checkLogin("/pages/my/my");
  189. if (_this.userinfo === false) {
  190. return false;
  191. }
  192. uni.redirectTo({
  193. url: pageurl
  194. });
  195. },
  196. }
  197. }
  198. </script>
  199. <style>
  200. .echo-plistitem{ width: 570rpx; }
  201. </style>