|
|
@@ -1,19 +1,44 @@
|
|
|
<template>
|
|
|
<view class="mainBox">
|
|
|
- <uni-nav-bar fixed="true" statusBar="true" left-icon="back" background-color="#157A2C" color="#fff" title="我的客户" @clickLeft="back">
|
|
|
+ <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="我的客户" @clickLeft="back">
|
|
|
+ <!--右菜单-->
|
|
|
+ <template slot="right">
|
|
|
+ <u-button type="success" size="small" class="u-reset-button" @click="$refs.treePicker._show()"
|
|
|
+ text="选择分类"></u-button>
|
|
|
+ </template>
|
|
|
</uni-nav-bar>
|
|
|
+
|
|
|
+ <view class="top-wrapper">
|
|
|
+ <uni-section>
|
|
|
+ <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="searchVal" placeholder="名称">
|
|
|
+ </uni-easyinput>
|
|
|
+ </uni-section>
|
|
|
+
|
|
|
+ <button class="search_btn" @click="doSearch">搜索</button>
|
|
|
+
|
|
|
+ <image class="menu_icon" src="~@/static/pda/menu.svg"></image>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </view>
|
|
|
<u-list @scrolltolower="scrolltolower">
|
|
|
<contactList :btnList="btnList" ref="contactListRef"></contactList>
|
|
|
</u-list>
|
|
|
+ <ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="confirm" title="选择分类"
|
|
|
+ :localdata="classificationList" valueKey="id" textKey="name" />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import contactList from './contactList.vue'
|
|
|
-
|
|
|
+ import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
|
|
|
+ import {
|
|
|
+ getTreeByPid,
|
|
|
+ } from '@/api/classifyManage'
|
|
|
export default {
|
|
|
components: {
|
|
|
- contactList
|
|
|
+ contactList,
|
|
|
+ baTreePicker
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -25,33 +50,56 @@
|
|
|
btnType: 'primary',
|
|
|
type: '1',
|
|
|
pageUrl: '/pages/saleManage/contact/add'
|
|
|
- },{
|
|
|
+ }, {
|
|
|
name: '详情',
|
|
|
apiName: '',
|
|
|
btnType: 'primary',
|
|
|
type: '1',
|
|
|
pageUrl: '/pages/saleManage/contact/components/drawer'
|
|
|
- }]
|
|
|
+ }],
|
|
|
+ searchVal: '',
|
|
|
+ categoryLevelId: '',
|
|
|
+ classificationList: []
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- async onShow() {
|
|
|
- // alert(1)
|
|
|
+ async onLoad() {
|
|
|
+ getTreeByPid(17).then(res => {
|
|
|
+ this.classificationList = res.data
|
|
|
+
|
|
|
+ });
|
|
|
this.userInfo = uni.getStorageSync('userInfo')
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.contactListRef.getList({
|
|
|
type: 1,
|
|
|
salesmanId: this.userInfo.userId,
|
|
|
+ name: this.searchVal,
|
|
|
+ categoryId: this.categoryLevelId,
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
-
|
|
|
+ doSearch() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.contactListRef.doSearch({
|
|
|
+ type: 1,
|
|
|
+ salesmanId: this.userInfo.userId,
|
|
|
+ name: this.searchVal,
|
|
|
+ categoryId: this.categoryLevelId,
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ confirm([id]) {
|
|
|
+ this.categoryLevelId = id
|
|
|
+ this.doSearch()
|
|
|
+ },
|
|
|
scrolltolower() {
|
|
|
this.$refs.contactListRef.getList({
|
|
|
type: 1,
|
|
|
- salesmanId: this.userInfo.userId
|
|
|
+ salesmanId: this.userInfo.userId,
|
|
|
+ name: this.searchVal,
|
|
|
+ categoryId: this.categoryLevelId,
|
|
|
})
|
|
|
},
|
|
|
}
|
|
|
@@ -71,4 +119,40 @@
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
}
|
|
|
+ .top-wrapper {
|
|
|
+ background-color: #fff;
|
|
|
+ display: flex;
|
|
|
+ width: 750rpx;
|
|
|
+ height: 88rpx;
|
|
|
+ padding: 16rpx 32rpx;
|
|
|
+ align-items: center;
|
|
|
+ gap: 16rpx;
|
|
|
+
|
|
|
+ /deep/.uni-section {
|
|
|
+ margin-top: 0px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/.uni-section-header {
|
|
|
+ padding: 0px;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .search_btn {
|
|
|
+ width: 120rpx;
|
|
|
+ height: 70rpx;
|
|
|
+ line-height: 70rpx;
|
|
|
+ padding: 0 24rpx;
|
|
|
+ background: $theme-color;
|
|
|
+ font-size: 32rpx;
|
|
|
+ color: #fff;
|
|
|
+ margin: 0;
|
|
|
+ margin-left: 26rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .menu_icon {
|
|
|
+ width: 44rpx;
|
|
|
+ height: 44rpx;
|
|
|
+ margin-left: 14rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|