myList.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. searchVal: '',
  54. categoryLevelId: '',
  55. classificationList: []
  56. }
  57. },
  58. async onLoad() {
  59. getTreeByPid(17).then(res => {
  60. this.classificationList = res.data
  61. });
  62. this.userInfo = uni.getStorageSync('userInfo')
  63. this.$nextTick(() => {
  64. this.$refs.contactListRef.getList({
  65. type: 1,
  66. salesmanId: this.userInfo.userId,
  67. name: this.searchVal,
  68. categoryId: this.categoryLevelId,
  69. })
  70. })
  71. },
  72. methods: {
  73. doSearch() {
  74. this.$nextTick(() => {
  75. this.$refs.contactListRef.doSearch({
  76. type: 1,
  77. salesmanId: this.userInfo.userId,
  78. name: this.searchVal,
  79. categoryId: this.categoryLevelId,
  80. })
  81. })
  82. },
  83. confirm([id]) {
  84. this.categoryLevelId = id
  85. this.doSearch()
  86. },
  87. scrolltolower() {
  88. this.$refs.contactListRef.getList({
  89. type: 1,
  90. salesmanId: this.userInfo.userId,
  91. name: this.searchVal,
  92. categoryId: this.categoryLevelId,
  93. })
  94. },
  95. }
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. .add {
  100. width: 96rpx;
  101. height: 96rpx;
  102. border-radius: 48rpx;
  103. background: #3c9cff;
  104. position: fixed;
  105. bottom: 100rpx;
  106. right: 24rpx;
  107. display: flex;
  108. align-items: center;
  109. justify-content: center;
  110. }
  111. .top-wrapper {
  112. background-color: #fff;
  113. display: flex;
  114. width: 750rpx;
  115. height: 88rpx;
  116. padding: 16rpx 32rpx;
  117. align-items: center;
  118. gap: 16rpx;
  119. /deep/.uni-section {
  120. margin-top: 0px;
  121. }
  122. /deep/.uni-section-header {
  123. padding: 0px;
  124. }
  125. .search_btn {
  126. width: 120rpx;
  127. height: 70rpx;
  128. line-height: 70rpx;
  129. padding: 0 24rpx;
  130. background: $theme-color;
  131. font-size: 32rpx;
  132. color: #fff;
  133. margin: 0;
  134. margin-left: 26rpx;
  135. }
  136. .menu_icon {
  137. width: 44rpx;
  138. height: 44rpx;
  139. margin-left: 14rpx;
  140. }
  141. }
  142. </style>