client.vue 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <view class="client">
  3. <mescroll-body top="30" bottom="40" @init="mescrollInit" @down="downCallback" @up="upCallback" :option="{}">
  4. <view class="common-list">
  5. <view class="common-item" v-for="(item,index) in list" :key="item.id"
  6. @click="$navigateTo('/pages/clientDetail/clientDetail?clientId='+item.id)">
  7. <view class="title">{{item.name}}</view>
  8. <view class="date">{{item.visitingTime}}</view>
  9. <view>
  10. <view class="space" v-for="(node,index) in item.roomMap" :key="index">{{node}}</view>
  11. </view>
  12. <view class="other">
  13. <view class="item">
  14. <view class="label">客户行业</view>
  15. <view class="value">{{item.customerIndustry}}</view>
  16. </view>
  17. <view class="item">
  18. <view class="label">客户需求</view>
  19. <view class="value">{{item.demand}}</view>
  20. </view>
  21. </view>
  22. <view class="state">
  23. <view class="create">
  24. <uni-icons class="inherit-icons" type="person-filled" color="#08979c" size="18"></uni-icons>
  25. <text class="name">{{user.userName}}</text>
  26. </view>
  27. <view class="tag">
  28. <view class="status-tag info" v-if="!item.status">待邀请</view>
  29. <view class="status-tag warning" v-if="item.status == 1">邀请中</view>
  30. <view class="status-tag success" v-if="item.status == 2">通过邀请</view>
  31. <view class="status-tag error" v-if="item.status == 3">拒绝邀请</view>
  32. </view>
  33. </view>
  34. <view class="icon">
  35. <uni-icons type="staff-filled" color="#08979c" size="30"></uni-icons>
  36. </view>
  37. </view>
  38. </view>
  39. </mescroll-body>
  40. </view>
  41. </template>
  42. <script>
  43. import {
  44. getCustomerListByPage
  45. } from '@/request/api/my.js'
  46. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  47. export default {
  48. mixins: [MescrollMixin], // 使用mixin
  49. data() {
  50. return {
  51. list: [],
  52. user: {}
  53. }
  54. },
  55. onShow() {
  56. this.user = this.$store.getters.user;
  57. },
  58. onLoad() {},
  59. methods: {
  60. /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  61. upCallback(page) {
  62. getCustomerListByPage({
  63. currPage: page.num,
  64. pageSize: 10,
  65. userId: this.$store.getters.user.userId
  66. }).then(res => {
  67. if (res.code === 200) {
  68. this.mescroll.endBySize(res.data.dataList.length, res.data.totalCount);
  69. if (page.num == 1) this.list = []; //如果是第一页需手动制空列表
  70. let data = res.data.dataList;
  71. this.list = this.list.concat(data); //追加新数据
  72. } else {
  73. this.mescroll.endErr();
  74. }
  75. }).catch(() => {
  76. //联网失败, 结束加载
  77. this.mescroll.endErr();
  78. })
  79. }
  80. }
  81. }
  82. </script>
  83. <style lang="scss">
  84. </style>