client.vue 2.7 KB

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