myuser.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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 class="action basis-xs">
  27. <view class="text-grey text-sm">{{followstatusarr[item.followstatus]}}</view>
  28. <view class="cu-tag bg-blue margin-top-xs" @tap="goLPage('/pages/broker/setfollow?userid='+item.id)">我要跟进</view>
  29. </view>
  30. </view>
  31. </view>
  32. <uni-load-more :status="pstatus"></uni-load-more>
  33. </view>
  34. </template>
  35. <script>
  36. import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
  37. var _this;
  38. export default {
  39. components: {
  40. uniLoadMore
  41. },
  42. data() {
  43. return {
  44. brokerinfo: {},
  45. searchval: "",
  46. pstatus: 'more',
  47. ppage: 1,
  48. psize: 20,
  49. plist: [],
  50. followstatus: 0,
  51. followstatusarr: ['全部','未跟进', '未面试', '面试通过', '面试未通过', '用户放弃', '已入职', '已离职']
  52. };
  53. },
  54. onLoad: function(){
  55. _this = this;
  56. _this.brokerinfo = uni.getStorageSync('brokerinfo') || false;
  57. if (_this.brokerinfo===false){
  58. uni.reLaunch({
  59. url: "/pages/my/my"
  60. });
  61. return false;
  62. }
  63. _this.getMore();
  64. },
  65. onPullDownRefresh: function() {
  66. _this.ppage = 1;
  67. _this.pstatus = 'more';
  68. _this.plist = [];
  69. _this.getMore();
  70. },
  71. onReachBottom: function() {
  72. if (_this.pstatus !== 'more') {
  73. return;
  74. }
  75. _this.getMore();
  76. },
  77. methods: {
  78. getMore: function() {
  79. _this.$req.ajax({
  80. path: "broker/listuser",
  81. data: {
  82. ppage: _this.ppage,
  83. psize: _this.psize,
  84. brokerid: _this.brokerinfo.id,
  85. followstatus: _this.followstatus,
  86. keyword: _this.searchval,
  87. }
  88. }).then((data) => {
  89. _this.pstatus = data.pstatus;
  90. _this.plist = _this.plist.concat(data.plist);
  91. _this.ppage += 1;
  92. uni.stopPullDownRefresh();
  93. }).catch((err) => {
  94. uni.showModal({
  95. title: '信息提示',
  96. content: err,
  97. showCancel: false
  98. });
  99. });
  100. },
  101. pageRefresh: function() {
  102. _this.pstatus = 'more';
  103. _this.ppage = 1;
  104. _this.plist = [];
  105. _this.getMore();
  106. },
  107. tabSelect: function(e) {
  108. _this.followstatus = e.currentTarget.dataset.followstatus;
  109. _this.pageRefresh();
  110. },
  111. goLPage: function(pageurl) {
  112. _this.userinfo = _this.checkLogin("/pages/my/my");
  113. if (_this.userinfo===false){
  114. return false;
  115. }
  116. uni.navigateTo({
  117. url: pageurl,
  118. fail: function(){
  119. uni.switchTab({
  120. url: pageurl
  121. });
  122. }
  123. });
  124. },
  125. goNavPage: function(pageurl) {
  126. _this.userinfo = _this.checkLogin("/pages/my/my");
  127. if (_this.userinfo===false){
  128. return false;
  129. }
  130. uni.redirectTo({
  131. url: pageurl
  132. });
  133. },
  134. }
  135. }
  136. </script>
  137. <style>
  138. .cu-list.menu-avatar .cu-item{ height: 170rpx !important; }
  139. </style>