index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <view class="memberManage">
  3. <view class="membere-title">会员列表</view>
  4. <template v-if="accountList.length > 0">
  5. <view class="membere-list">
  6. <view
  7. class="member-item"
  8. v-for="(item, index) in accountList"
  9. :key="index"
  10. >
  11. <view class="item-top">
  12. <view class="img-box">
  13. <image
  14. :src="item.headImage"
  15. mode="aspectFit|aspectFill|widthFix"
  16. lazy-load="true"
  17. />
  18. </view>
  19. <view class="text-box">
  20. <view class="name">
  21. <view>{{ item.nickName }}</view>
  22. <template v-if="item.level == '团长'">
  23. <view class="tuan">{{ item.level }}</view>
  24. </template>
  25. <template v-else-if="item.level == '合伙人'">
  26. <view class="hehuo">{{ item.level }}</view>
  27. </template>
  28. <template v-else>
  29. <view>{{ item.level }}</view>
  30. </template>
  31. </view>
  32. <view class="phone">{{ item.phone }}</view>
  33. </view>
  34. </view>
  35. <view class="item-bottom">
  36. <view class="bottom-contact">
  37. <image
  38. src="@/static/image/user/business_user.png"
  39. mode="aspectFit|aspectFill|widthFix"
  40. lazy-load="true"
  41. />
  42. <text>查看邀请人</text>
  43. </view>
  44. <view class="bottom-contact">
  45. <image
  46. src="@/static/image/user/business_phone.png"
  47. mode="aspectFit|aspectFill|widthFix"
  48. lazy-load="true"
  49. />
  50. <text>电话联系</text>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </template>
  56. <template v-else>
  57. <view class="empty">
  58. <image class="" src="@/static/image/order/empty.png" />
  59. <text>该商家下面没有会员</text>
  60. </view>
  61. </template>
  62. </view>
  63. </template>
  64. <script>
  65. import { getBuyerList } from "@/config/index";
  66. export default {
  67. created() {
  68. // this.accountInfo = uni.getStorageSync("storage_info");
  69. // this.queryData.phone = this.accountInfo.phone
  70. this.getList();
  71. },
  72. data() {
  73. return {
  74. accountInfo: {},
  75. queryData: {
  76. page: "1",
  77. pageSize: "10",
  78. phone: "",
  79. },
  80. accountList: [],
  81. total: 0,
  82. };
  83. },
  84. methods: {
  85. // 获取会员列表
  86. async getList() {
  87. this.$loading.show("获取中...");
  88. try {
  89. let { data, total } = await getBuyerList(this.queryData);
  90. this.accountList = [...this.accountList, ...data.list];
  91. this.total = total;
  92. } finally {
  93. this.$loading.hide();
  94. }
  95. },
  96. },
  97. // 触底加载
  98. onReachBottom() {
  99. if (this.accountList.length >= this.total) return;
  100. this.queryData.page++;
  101. this.getList();
  102. },
  103. };
  104. </script>
  105. <style lang="scss" scoped>
  106. @import "./index.scss";
  107. </style>