|
|
@ -2,18 +2,7 @@ |
|
|
<view class="assemble"> |
|
|
<view class="assemble"> |
|
|
<fui-segmented-control :values="values" type="text" activeColor="#29d3b4" color="#fff" |
|
|
<fui-segmented-control :values="values" type="text" activeColor="#29d3b4" color="#fff" |
|
|
@click="segmented"></fui-segmented-control> |
|
|
@click="segmented"></fui-segmented-control> |
|
|
<view class="search"> |
|
|
|
|
|
<view :class="{'selected': select_type == 1, 'not-selected': select_type != 1}" @click="setSelect(1)">全部({{countArr.type_0}}) |
|
|
|
|
|
</view> |
|
|
|
|
|
<view :class="{'selected': select_type == 2, 'not-selected': select_type != 2}" @click="setSelect(2)">待跟进({{countArr.type_1}}) |
|
|
|
|
|
</view> |
|
|
|
|
|
<view :class="{'selected': select_type == 3, 'not-selected': select_type != 3}" @click="setSelect(3)"> |
|
|
|
|
|
7天未跟进({{countArr.type_2}}) |
|
|
|
|
|
</view> |
|
|
|
|
|
<view :class="{'selected': select_type == 4, 'not-selected': select_type != 4}" @click="setSelect(4)"> |
|
|
|
|
|
30天未成交({{countArr.type_3}}) |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<!--我的客户--> |
|
|
<!--我的客户--> |
|
|
<scroll-view |
|
|
<scroll-view |
|
|
v-if="segmented_type == 1" |
|
|
v-if="segmented_type == 1" |
|
|
@ -22,7 +11,7 @@ |
|
|
@scrolltolower="loadMoreData" |
|
|
@scrolltolower="loadMoreData" |
|
|
style="height: 100vh;" |
|
|
style="height: 100vh;" |
|
|
> |
|
|
> |
|
|
<view class="card" v-for="(v,k) in tableList" :key="k"> |
|
|
<view class="card" v-for="(v,k) in tableList_1" :key="k"> |
|
|
<view style="width: 70%;" @click="clue_info(v)"> |
|
|
<view style="width: 70%;" @click="clue_info(v)"> |
|
|
<view style="display: flex;align-items: center;padding: 20rpx;"> |
|
|
<view style="display: flex;align-items: center;padding: 20rpx;"> |
|
|
<view> |
|
|
<view> |
|
|
@ -79,10 +68,7 @@ |
|
|
@scrolltolower="loadMoreData" |
|
|
@scrolltolower="loadMoreData" |
|
|
style="height: 100vh;" |
|
|
style="height: 100vh;" |
|
|
> |
|
|
> |
|
|
<view style="color: #999999;padding: 20rpx 30rpx;"> |
|
|
<view class="card" v-for="(v,k) in tableList_2" :key="k"> |
|
|
今日待领({{countArr.lq_count}}/{{countArr.max_count}}) |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="card" v-for="(v,k) in tableList" :key="k"> |
|
|
|
|
|
<view style="width: 70%;"> |
|
|
<view style="width: 70%;"> |
|
|
<view style="display: flex;align-items: center;padding: 20rpx;"> |
|
|
<view style="display: flex;align-items: center;padding: 20rpx;"> |
|
|
<view> |
|
|
<view> |
|
|
@ -158,17 +144,10 @@ export default { |
|
|
is_gh: '2',//1=资源分配,2=我的客户 |
|
|
is_gh: '2',//1=资源分配,2=我的客户 |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
countArr:{ |
|
|
|
|
|
type_0:0, |
|
|
|
|
|
type_1:0, |
|
|
|
|
|
type_2:0, |
|
|
|
|
|
type_3:0, |
|
|
|
|
|
max_count:0, |
|
|
|
|
|
lq_count:0, |
|
|
|
|
|
|
|
|
|
|
|
},//统计数组 |
|
|
|
|
|
tableList:[],//表格数据 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//顶部Tab栏 |
|
|
values: [ |
|
|
values: [ |
|
|
{ |
|
|
{ |
|
|
id: 1, |
|
|
id: 1, |
|
|
@ -180,9 +159,28 @@ export default { |
|
|
// } |
|
|
// } |
|
|
], |
|
|
], |
|
|
select_type: 1,//筛选标签列表|1,2,3,4 |
|
|
select_type: 1,//筛选标签列表|1,2,3,4 |
|
|
segmented_type: 1,//1=我的客户,2=资源分配 |
|
|
segmented_type: 1,//当前选中的Tab栏目|1=我的客户,2=资源分配 |
|
|
|
|
|
|
|
|
userInfo:{},//用户信息 |
|
|
userInfo:{},//用户信息 |
|
|
|
|
|
//我的客户列表相关 |
|
|
|
|
|
//筛选条件 |
|
|
|
|
|
filteredData_1:{ |
|
|
|
|
|
page:1,//当前页码 |
|
|
|
|
|
limit:10,//每页返回数据条数 |
|
|
|
|
|
total:10,//数据总条数 |
|
|
|
|
|
}, |
|
|
|
|
|
//数据列表 |
|
|
|
|
|
tableList_1:[],//表格数据 |
|
|
|
|
|
|
|
|
|
|
|
//资源分配列表相关 |
|
|
|
|
|
//筛选条件 |
|
|
|
|
|
filteredData_2:{ |
|
|
|
|
|
page:1,//当前页码 |
|
|
|
|
|
limit:10,//每页返回数据条数 |
|
|
|
|
|
total:10,//数据总条数 |
|
|
|
|
|
}, |
|
|
|
|
|
//数据列表 |
|
|
|
|
|
tableList_2:[],//表格数据 |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -193,8 +191,17 @@ export default { |
|
|
//下拉刷新 |
|
|
//下拉刷新 |
|
|
async onPullDownRefresh() { |
|
|
async onPullDownRefresh() { |
|
|
//重置为第一页 |
|
|
//重置为第一页 |
|
|
await this.resetFilteredData() |
|
|
if(this.segmented_type == 1){ |
|
|
await this.getList() |
|
|
//我的客户 |
|
|
|
|
|
await this.resetFilteredData_1() |
|
|
|
|
|
await this.getList_1() |
|
|
|
|
|
}else{ |
|
|
|
|
|
//资源分配 |
|
|
|
|
|
await this.resetFilteredData_2() |
|
|
|
|
|
await this.getList_2() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
//初始化 |
|
|
//初始化 |
|
|
@ -239,10 +246,9 @@ export default { |
|
|
console.log('用户',this.userInfo) |
|
|
console.log('用户',this.userInfo) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//获取列表-我的客户相关 |
|
|
|
|
|
|
|
|
//加载更多(下一页) |
|
|
//加载更多(下一页) |
|
|
loadMoreData() { |
|
|
loadMoreData_1() { |
|
|
//判断是否加载 |
|
|
//判断是否加载 |
|
|
if (!this.isReachedBottom) { |
|
|
if (!this.isReachedBottom) { |
|
|
this.isReachedBottom = true;//设置为不可请求状态 |
|
|
this.isReachedBottom = true;//设置为不可请求状态 |
|
|
@ -250,21 +256,21 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
//重置为第一页 |
|
|
//重置为第一页 |
|
|
async resetFilteredData() { |
|
|
async resetFilteredData_1() { |
|
|
this.isReachedBottom = false; // 重置状态,以便下次触发加载更多 |
|
|
this.isReachedBottom = false; // 重置状态,以便下次触发加载更多 |
|
|
|
|
|
|
|
|
this.filteredData.page = 1//当前页码 |
|
|
this.filteredData_1.page = 1//当前页码 |
|
|
this.filteredData.limit = 10//每页返回数据条数 |
|
|
this.filteredData_1.limit = 10//每页返回数据条数 |
|
|
this.filteredData.total = 10//数据总条数 |
|
|
this.filteredData_1.total = 10//数据总条数 |
|
|
}, |
|
|
}, |
|
|
//获取我的客户列表 |
|
|
//获取列表-我的客户 |
|
|
async getList(){ |
|
|
async getList_1(){ |
|
|
this.loading = true |
|
|
this.loading = true |
|
|
|
|
|
|
|
|
let data = {...this.filteredData} |
|
|
let data = {...this.filteredData_1} |
|
|
|
|
|
|
|
|
//判断是否还有数据 |
|
|
//判断是否还有数据 |
|
|
if(this.filteredData.page * this.filteredData.limit > this.filteredData.total){ |
|
|
if(this.filteredData_1.page * this.filteredData_1.limit > this.filteredData_1.total){ |
|
|
this.loading = false |
|
|
this.loading = false |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: '暂无更多', |
|
|
title: '暂无更多', |
|
|
@ -274,7 +280,7 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(data.page == 1){ |
|
|
if(data.page == 1){ |
|
|
this.tableList = [] |
|
|
this.tableList_1 = [] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
let res = await marketApi.myClient(data) |
|
|
let res = await marketApi.myClient(data) |
|
|
@ -288,71 +294,88 @@ export default { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.tableList = this.tableList.concat(res.data.list.data); // 使用 concat 方法 将新数据追加到数组中 |
|
|
this.tableList_1 = this.tableList_1.concat(res.data.list.data); // 使用 concat 方法 将新数据追加到数组中 |
|
|
|
|
|
|
|
|
|
|
|
console.log('列表',this.tableList_1) |
|
|
|
|
|
this.filteredData_1.total = res.data.list.total |
|
|
|
|
|
this.filteredData_1.page++ |
|
|
|
|
|
|
|
|
console.log('列表',this.tableList) |
|
|
|
|
|
this.filteredData.total = res.data.list.total |
|
|
|
|
|
this.filteredData.page++ |
|
|
|
|
|
|
|
|
|
|
|
this.countArr = { |
|
|
|
|
|
type_0:res.data.count[0], |
|
|
|
|
|
type_1:res.data.count[1], |
|
|
|
|
|
type_2:res.data.count[2], |
|
|
|
|
|
type_3:res.data.count[3], |
|
|
|
|
|
max_count:res.data.gh.max_count, |
|
|
|
|
|
lq_count:res.data.gh.lq_count, |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//设置筛选条件 |
|
|
//获取列表-资源分配相关 |
|
|
async setSelect(type) { |
|
|
//加载更多(下一页) |
|
|
this.select_type = type |
|
|
loadMoreData_2() { |
|
|
//重置为第一页 |
|
|
//判断是否加载 |
|
|
await this.resetFilteredData() |
|
|
if (!this.isReachedBottom) { |
|
|
|
|
|
this.isReachedBottom = true;//设置为不可请求状态 |
|
|
|
|
|
this.getList(); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
//重置为第一页 |
|
|
|
|
|
async resetFilteredData_2() { |
|
|
|
|
|
this.isReachedBottom = false; // 重置状态,以便下次触发加载更多 |
|
|
|
|
|
this.filteredData_2.page = 1//当前页码 |
|
|
|
|
|
this.filteredData_2.limit = 10//每页返回数据条数 |
|
|
|
|
|
this.filteredData_2.total = 10//数据总条数 |
|
|
|
|
|
}, |
|
|
|
|
|
//获取列表-资源分配 |
|
|
|
|
|
async getList_2(){ |
|
|
|
|
|
this.loading = true |
|
|
|
|
|
|
|
|
if(this.segmented_type == 1){ |
|
|
let data = {...this.filteredData_2} |
|
|
this.filteredData.is_gh = '2'//2=我的客户 |
|
|
|
|
|
}else{ |
|
|
//判断是否还有数据 |
|
|
this.filteredData.is_gh = '1'//1=资源分配 |
|
|
if(this.filteredData_2.page * this.filteredData_2.limit > this.filteredData_2.total){ |
|
|
|
|
|
this.loading = false |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '暂无更多', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
switch (type) { |
|
|
if(data.page == 1){ |
|
|
//全部 |
|
|
this.tableList_2 = [] |
|
|
case 1: |
|
|
|
|
|
this.filteredData.type = '0' |
|
|
|
|
|
break |
|
|
|
|
|
//待跟进 |
|
|
|
|
|
case 2: |
|
|
|
|
|
this.filteredData.type = '1' |
|
|
|
|
|
break |
|
|
|
|
|
//7天未跟进 |
|
|
|
|
|
case 3: |
|
|
|
|
|
this.filteredData.type = '2' |
|
|
|
|
|
break |
|
|
|
|
|
//30天未成交 |
|
|
|
|
|
case 4: |
|
|
|
|
|
this.filteredData.type = '3' |
|
|
|
|
|
break |
|
|
|
|
|
} |
|
|
} |
|
|
await this.getList() |
|
|
|
|
|
|
|
|
let res = await marketApi.myClient(data) |
|
|
|
|
|
this.loading = false |
|
|
|
|
|
this.isReachedBottom = false; |
|
|
|
|
|
if (res.code != 1){ |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: res.msg, |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.tableList_2 = this.tableList_2.concat(res.data.list.data); // 使用 concat 方法 将新数据追加到数组中 |
|
|
|
|
|
|
|
|
|
|
|
console.log('列表',this.tableList_2) |
|
|
|
|
|
this.filteredData_2.total = res.data.list.total |
|
|
|
|
|
this.filteredData_2.page++ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//切换tag列表 |
|
|
//切换tag列表 |
|
|
async segmented(index) { |
|
|
async segmented(index) { |
|
|
this.select_type = 1 |
|
|
this.select_type = 1 |
|
|
this.segmented_type = index.id//1=我的客户,2=资源分配 |
|
|
this.segmented_type = index.id//1=我的客户,2=资源分配 |
|
|
//重置为第一页 |
|
|
|
|
|
await this.resetFilteredData() |
|
|
|
|
|
|
|
|
|
|
|
if(this.segmented_type == 1){ |
|
|
if(this.segmented_type == 1){ |
|
|
this.filteredData.is_gh = '2'//2=我的客户 |
|
|
//我的客户 |
|
|
|
|
|
//重置为第一页 |
|
|
|
|
|
await this.resetFilteredData_1() |
|
|
|
|
|
await this.getList_1() |
|
|
}else{ |
|
|
}else{ |
|
|
this.filteredData.is_gh = '1'//1=资源分配 |
|
|
//资源分配 |
|
|
|
|
|
//重置为第一页 |
|
|
|
|
|
await this.resetFilteredData_2() |
|
|
|
|
|
await this.getList_2() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.filteredData.type = '0' |
|
|
|
|
|
await this.getList() |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//跳转页面-我的消息 |
|
|
//跳转页面-我的消息 |
|
|
|