broker.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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()">
  7. </input>
  8. </view>
  9. <view class="action">
  10. <button class="cu-btn bg-white shadow-blur round" @click="pageRefresh()">搜索</button>
  11. </view>
  12. </view>
  13. <view class="cu-list menu-avatar">
  14. <view class="cu-item" v-for="(item,index) in plist" :key="index">
  15. <view class="cu-avatar round lg" :style="'background-image:url('+$getImageUrl('static/images/applet/index/topApplyIcon.png')+');'"></view>
  16. <view class="content">
  17. <view class="text-grey">{{item.title}}
  18. <text class="text-sm">({{item.mobile}})</text>
  19. </view>
  20. <view class="text-orange text-sm">用户邀请数:{{item.user_count}}</view>
  21. <view class="text-gray text-sm">
  22. <text>当前收益:{{item.income}}元</text>
  23. <text class="margin-left-sm">总收益:{{item.income_total}}元</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/listPartnerBroker",
  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. tabSelect: function(e) {
  101. _this.pageRefresh();
  102. },
  103. goLPage: function(pageurl) {
  104. _this.userinfo = _this.checkLogin("/pages/my/my");
  105. if (_this.userinfo === false) {
  106. return false;
  107. }
  108. uni.navigateTo({
  109. url: pageurl,
  110. fail: function() {
  111. uni.switchTab({
  112. url: pageurl
  113. });
  114. }
  115. });
  116. },
  117. goNavPage: function(pageurl) {
  118. _this.userinfo = _this.checkLogin("/pages/my/my");
  119. if (_this.userinfo === false) {
  120. return false;
  121. }
  122. uni.redirectTo({
  123. url: pageurl
  124. });
  125. },
  126. }
  127. }
  128. </script>
  129. <style>
  130. .cu-list.menu-avatar .cu-item {
  131. height: 170rpx !important;
  132. }
  133. </style>