myList.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="我的客户" @clickLeft="back">
  4. <!--右菜单-->
  5. <template slot="right">
  6. <u-button type="success" size="small" class="u-reset-button" @click="$refs.treePicker._show()"
  7. text="选择分类"></u-button>
  8. </template>
  9. </uni-nav-bar>
  10. <view class="top-wrapper">
  11. <uni-section>
  12. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="searchVal" placeholder="名称">
  13. </uni-easyinput>
  14. </uni-section>
  15. <button class="search_btn" @click="doSearch">搜索</button>
  16. <image class="menu_icon" src="~@/static/pda/menu.svg"></image>
  17. </view>
  18. <u-list @scrolltolower="scrolltolower">
  19. <contactList :btnList="btnList" ref="contactListRef"></contactList>
  20. </u-list>
  21. <ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="confirm" title="选择分类"
  22. :localdata="classificationList" valueKey="id" textKey="name" />
  23. </view>
  24. </template>
  25. <script>
  26. import contactList from './contactList.vue'
  27. import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
  28. import {
  29. getTreeByPid,
  30. } from '@/api/classifyManage'
  31. export default {
  32. components: {
  33. contactList,
  34. baTreePicker
  35. },
  36. data() {
  37. return {
  38. userInfo: {},
  39. treeList: [],
  40. btnList: [{
  41. name: '修改',
  42. apiName: '',
  43. btnType: 'primary',
  44. type: '1',
  45. pageUrl: '/pages/saleManage/contact/add'
  46. }, {
  47. name: '详情',
  48. apiName: '',
  49. btnType: 'primary',
  50. type: '1',
  51. pageUrl: '/pages/saleManage/contact/components/drawer'
  52. }, {
  53. name: '跟进',
  54. apiName: '',
  55. btnType: 'primary',
  56. type: '1',
  57. pageUrl: '/pages/saleManage/contact/followList',
  58. judge: [],
  59. }, ],
  60. searchVal: '',
  61. categoryLevelId: '',
  62. classificationList: []
  63. }
  64. },
  65. async onShow() {
  66. getTreeByPid(17).then(res => {
  67. this.classificationList = res.data
  68. });
  69. this.userInfo = uni.getStorageSync('userInfo')
  70. this.$nextTick(() => {
  71. this.$refs.contactListRef.doSearch({
  72. type: 1,
  73. salesmanId: this.userInfo.userId,
  74. name: this.searchVal,
  75. categoryId: this.categoryLevelId,
  76. })
  77. })
  78. },
  79. methods: {
  80. doSearch() {
  81. this.$nextTick(() => {
  82. this.$refs.contactListRef.doSearch({
  83. type: 1,
  84. salesmanId: this.userInfo.userId,
  85. name: this.searchVal,
  86. categoryId: this.categoryLevelId,
  87. })
  88. })
  89. },
  90. confirm([id]) {
  91. this.categoryLevelId = id
  92. this.doSearch()
  93. },
  94. scrolltolower() {
  95. this.$refs.contactListRef.getList({
  96. type: 1,
  97. salesmanId: this.userInfo.userId,
  98. name: this.searchVal,
  99. categoryId: this.categoryLevelId,
  100. })
  101. },
  102. }
  103. }
  104. </script>
  105. <style lang="scss" scoped>
  106. .add {
  107. width: 96rpx;
  108. height: 96rpx;
  109. border-radius: 48rpx;
  110. background: #3c9cff;
  111. position: fixed;
  112. bottom: 100rpx;
  113. right: 24rpx;
  114. display: flex;
  115. align-items: center;
  116. justify-content: center;
  117. }
  118. .top-wrapper {
  119. background-color: #fff;
  120. display: flex;
  121. width: 750rpx;
  122. height: 88rpx;
  123. padding: 16rpx 32rpx;
  124. align-items: center;
  125. gap: 16rpx;
  126. /deep/.uni-section {
  127. margin-top: 0px;
  128. }
  129. /deep/.uni-section-header {
  130. padding: 0px;
  131. }
  132. .search_btn {
  133. width: 120rpx;
  134. height: 70rpx;
  135. line-height: 70rpx;
  136. padding: 0 24rpx;
  137. background: $theme-color;
  138. font-size: 32rpx;
  139. color: #fff;
  140. margin: 0;
  141. margin-left: 26rpx;
  142. }
  143. .menu_icon {
  144. width: 44rpx;
  145. height: 44rpx;
  146. margin-left: 14rpx;
  147. }
  148. }
  149. </style>