myworker.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view>
  3. <view class="cu-bar search bg-gray">
  4. <view class="search-form round text-center">
  5. <text class="cuIcon-search"></text>
  6. <input v-model="searchval" :adjust-position="false" type="text" placeholder="搜索店名或手机号" confirm-type="search" @confirm="pageRefresh()"></input>
  7. </view>
  8. <view class="action">
  9. <button class="cu-btn bg-white shadow-blur round" @click="pageRefresh()">搜索</button>
  10. </view>
  11. </view>
  12. <!-- <scroll-view scroll-x class="bg-white nav text-center solid-bottom">
  13. <block v-for="(item,index) in followstatusarr" :key="index">
  14. <view class="cu-item" :class="followstatus==index?'text-blue cur':''" @tap="tabSelect" :data-followstatus="index">{{item}}</view>
  15. </block>
  16. </scroll-view> -->
  17. <view class="cu-list menu-avatar">
  18. <view class="cu-item" v-for="item in plist">
  19. <view class="cu-avatar round lg" :style="'background-image:url('+item.tilpic+');'"></view>
  20. <view class="content">
  21. <view class="text-grey">{{item.title}}</view>
  22. <view class="text-gray text-sm flex">
  23. <text class="text-cut">{{item.mobile}}</text>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <uni-load-more :status="pstatus"></uni-load-more>
  29. </view>
  30. </template>
  31. <script>
  32. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  33. var _this;
  34. export default {
  35. components: {
  36. uniLoadMore
  37. },
  38. data() {
  39. return {
  40. brokerinfo: {},
  41. searchval: "",
  42. pstatus: 'more',
  43. ppage: 1,
  44. psize: 20,
  45. plist: [],
  46. };
  47. },
  48. onLoad: function(){
  49. _this = this;
  50. _this.brokerinfo = uni.getStorageSync('brokerinfo') || false;
  51. if (_this.brokerinfo===false){
  52. uni.reLaunch({
  53. url: "/pages/my/my"
  54. });
  55. return false;
  56. }
  57. _this.getMore();
  58. },
  59. onPullDownRefresh: function() {
  60. _this.ppage = 1;
  61. _this.pstatus = 'more';
  62. _this.plist = [];
  63. _this.getMore();
  64. },
  65. onReachBottom: function() {
  66. if (_this.pstatus !== 'more') {
  67. return;
  68. }
  69. _this.getMore();
  70. },
  71. methods: {
  72. getMore: function() {
  73. _this.$req.ajax({
  74. path: "broker/listWorker",
  75. data: {
  76. ppage: _this.ppage,
  77. psize: _this.psize,
  78. brokerid: _this.brokerinfo.id,
  79. keyword: _this.searchval,
  80. }
  81. }).then((data) => {
  82. _this.pstatus = data.pstatus;
  83. _this.plist = _this.plist.concat(data.plist);
  84. _this.ppage += 1;
  85. uni.stopPullDownRefresh();
  86. }).catch((err) => {
  87. uni.showModal({
  88. title: '信息提示',
  89. content: err,
  90. showCancel: false
  91. });
  92. });
  93. },
  94. pageRefresh: function() {
  95. _this.pstatus = 'more';
  96. _this.ppage = 1;
  97. _this.plist = [];
  98. _this.getMore();
  99. },
  100. }
  101. }
  102. </script>
  103. <style>
  104. .cu-list.menu-avatar .cu-item{ height: 170rpx !important; }
  105. </style>