user.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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,index) in plist" :key="index">
  19. <view class="cu-avatar round lg" :style="'background-image:url('+item.avatar+');'"></view>
  20. <view class="content">
  21. <view class="text-grey">{{item.nickname}}<text class="text-sm">({{item.mobile}})</text></view>
  22. <view class="text-orange text-sm text-cut">{{ item.userFollow.length == 0 ? followstatusarr[item.followstatus] : item.userFollow[0].remark }}</view>
  23. <view class="text-gray text-sm" v-if="item.userFollow.length == 0">注册时间:{{item.createtime}}</view>
  24. <view class="text-gray text-sm" v-else>最近跟进:{{item.userFollow[0].createtime}}</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. followstatus: 0,
  47. followstatusarr: ['全部','未跟进', '未面试', '面试通过', '面试未通过', '用户放弃', '已入职', '已离职']
  48. };
  49. },
  50. onLoad: function(){
  51. _this = this;
  52. _this.brokerinfo = uni.getStorageSync('brokerinfo') || false;
  53. if (_this.brokerinfo===false){
  54. uni.reLaunch({
  55. url: "/pages/my/my"
  56. });
  57. return false;
  58. }
  59. _this.getMore();
  60. },
  61. onPullDownRefresh: function() {
  62. _this.ppage = 1;
  63. _this.pstatus = 'more';
  64. _this.plist = [];
  65. _this.getMore();
  66. },
  67. onReachBottom: function() {
  68. if (_this.pstatus !== 'more') {
  69. return;
  70. }
  71. _this.getMore();
  72. },
  73. methods: {
  74. getMore: function() {
  75. _this.$req.ajax({
  76. path: "broker/listPartnerUser",
  77. data: {
  78. ppage: _this.ppage,
  79. psize: _this.psize,
  80. brokerid: _this.brokerinfo.id,
  81. followstatus: _this.followstatus,
  82. keyword: _this.searchval,
  83. }
  84. }).then((data) => {
  85. _this.pstatus = data.pstatus;
  86. _this.plist = _this.plist.concat(data.plist);
  87. _this.ppage += 1;
  88. uni.stopPullDownRefresh();
  89. }).catch((err) => {
  90. uni.showModal({
  91. title: '信息提示',
  92. content: err,
  93. showCancel: false
  94. });
  95. });
  96. },
  97. pageRefresh: function() {
  98. _this.pstatus = 'more';
  99. _this.ppage = 1;
  100. _this.plist = [];
  101. _this.getMore();
  102. },
  103. tabSelect: function(e) {
  104. _this.followstatus = e.currentTarget.dataset.followstatus;
  105. _this.pageRefresh();
  106. },
  107. goLPage: function(pageurl) {
  108. _this.userinfo = _this.checkLogin("/pages/my/my");
  109. if (_this.userinfo===false){
  110. return false;
  111. }
  112. uni.navigateTo({
  113. url: pageurl,
  114. fail: function(){
  115. uni.switchTab({
  116. url: pageurl
  117. });
  118. }
  119. });
  120. },
  121. goNavPage: function(pageurl) {
  122. _this.userinfo = _this.checkLogin("/pages/my/my");
  123. if (_this.userinfo===false){
  124. return false;
  125. }
  126. uni.redirectTo({
  127. url: pageurl
  128. });
  129. },
  130. }
  131. }
  132. </script>
  133. <style>
  134. .cu-list.menu-avatar .cu-item{ height: 170rpx !important; }
  135. </style>