智慧教务系统UniApp前端项目(使用中2025-0517)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

562 lines
14 KiB

<template>
<view class="assemble">
<fui-segmented-control :values="values" type="text" activeColor="#29d3b4" color="#fff"
@click="segmented"></fui-segmented-control>
<!--我的客户-->
<scroll-view
v-if="segmented_type == 1"
scroll-y="true"
:lower-threshold="lowerThreshold"
@scrolltolower="loadMoreData"
style="height: 100vh;"
>
<view class="card" v-for="(v,k) in tableList_1" :key="k">
<view style="width: 70%;" @click="clue_info(v)">
<view style="display: flex;align-items: center;padding: 20rpx;">
<view>
<image src="@/static/images/index/myk.png" class="card-image"></image>
</view>
<view class="card-text">{{ v.student_name }}</view>
<view class="card-label">{{ v.is_status == 1 ? '试听' : '成交' }}</view>
</view>
<view class="card-con">
首联系人:{{ v.contact_name }} <span class="card-con-span">{{ v.decision_maker }}</span>
</view>
<view class="card-date">
<view class="card-con">{{ $util.formatToDateTime((v.follow && v.follow.follow_up_time || ''), 'm-d H:i') }}
跟进
</view>
<view style="margin-left: 30rpx;">
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image
v-if="['A+','A','A-'].includes(v.follow && v.follow.initial_customer_intent || '')"
src="@/static/images/index/intention3.png"
class="drop-image-x"
></image>
<image
v-else-if="['B+','B','B-'].includes(v.follow && v.follow.initial_customer_intent || '')"
src="@/static/images/index/intention2.png"
class="drop-image-x"
></image>
<image
v-else
src="@/static/images/index/intention1.png"
class="drop-image-x"
></image>
</view>
<view class="title-x">意向:{{ v.follow && v.follow.initial_customer_intent || '' }}</view>
</view>
</view>
</view>
</view>
<view style="width: 15%;">
<image src="@/static/images/index/message.png" class="image" @click="openViewMyMessage(v)"></image>
</view>
<view style="width: 15%;">
<image v-if="v.student_phone" src="@/static/images/index/phone.png" class="image" @click="dialTel(v)"></image>
</view>
</view>
</scroll-view>
<!--资源分配-->
<scroll-view
v-if="segmented_type == 2"
scroll-y="true"
:lower-threshold="lowerThreshold"
@scrolltolower="loadMoreData"
style="height: 100vh;"
>
<view class="card" v-for="(v,k) in tableList_2" :key="k">
<view style="width: 70%;">
<view style="display: flex;align-items: center;padding: 20rpx;">
<view>
<image src="@/static/images/index/myk.png" class="card-image"></image>
</view>
<view class="card-text">{{v.student_name}}</view>
<view class="card-label">{{v.is_status == 1 ? '试听' : '成交'}}</view>
</view>
<view class="card-con">
首联系人{{v.contact_name}} <span class="card-con-span">{{v.decision_maker}}</span>
</view>
<view class="card-date">
<view class="card-con">{{ $util.formatToDateTime((v.follow && v.follow.follow_up_time || ''),'m-d H:i') }} 跟进</view>
<view style="margin-left: 30rpx;">
<view style="display: flex;align-items: center;">
<view style="padding: 12rpx;">
<image
v-if="['A+','A','A-'].includes(v.follow && v.follow.initial_customer_intent || '')"
src="@/static/images/index/intention3.png"
class="drop-image-x"
></image>
<image
v-else-if="['B+','B','B-'].includes(v.follow && v.follow.initial_customer_intent || '')"
src="@/static/images/index/intention2.png"
class="drop-image-x"
></image>
<image
v-else
src="@/static/images/index/intention1.png"
class="drop-image-x"
></image>
</view>
<view class="title-x">意向:{{ v.follow && v.follow.initial_customer_intent || '' }}</view>
</view>
</view>
</view>
</view>
<view style="width: 15%;">
<!-- <image src="@/static/images/index/message.png" class="image"></image>-->
</view>
<view style="width: 15%;" @click="getSales(v)">
<view class="ling">领</view>
</view>
</view>
</scroll-view>
<view style="height: 170rpx;"></view>
<AQTabber/>
</view>
</template>
<script>
import AQTabber from "@/components/AQ/AQTabber.vue"
import apiRoute from '@/api/apiRoute.js';
import marketApi from '@/api/market.js';
export default {
components: {
AQTabber,
},
data() {
return {
loading:false,//加载状态
lowerThreshold: 100,//距离底部多远触发
isReachedBottom: false,//防止重复加载|true=不可加载|false=可加载
//筛选条件
filteredData:{
page:1,//当前页码
limit:10,//每页返回数据条数
total:10,//数据总条数
type: '0',//0=全部,1=待跟进,2=7天,3=30天
is_gh: '2',//1=资源分配,2=我的客户
},
//顶部Tab栏
values: [
{
id: 1,
name: '我的客户'
},
// {
// id: 2,
// name: '资源分配'
// }
],
select_type: 1,//筛选标签列表|1,2,3,4
segmented_type: 1,//当前选中的Tab栏目|1=我的客户,2=资源分配
userInfo:{},//用户信息
//我的客户列表相关
//筛选条件
filteredData_1:{
page:1,//当前页码
limit:10,//每页返回数据条数
total:10,//数据总条数
},
//数据列表
tableList_1:[],//表格数据
//资源分配列表相关
//筛选条件
filteredData_2:{
page:1,//当前页码
limit:10,//每页返回数据条数
total:10,//数据总条数
},
//数据列表
tableList_2:[],//表格数据
}
},
onLoad(options) {},
onShow(){
this.init()//初始化
},
//下拉刷新
async onPullDownRefresh() {
//重置为第一页
if(this.segmented_type == 1){
//我的客户
await this.resetFilteredData_1()
await this.getList_1()
}else{
//资源分配
await this.resetFilteredData_2()
await this.getList_2()
}
},
methods: {
//初始化
async init(){
await this.getUserInfo();
// await this.getList();
},
//获取用户信息
async getUserInfo(){
let res = await apiRoute.getPersonnelInfo({})
if (res.code != 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.userInfo = res.data
//判断用户是不是经理,是就展示"资源分配"
if(this.userInfo.role_key_arr.includes('manager')){
this.values = [
{
id: 1,
name: '我的客户'
},
{
id: 2,
name: '资源分配'
}
]
}else{
this.values = [
{
id: 1,
name: '我的客户'
},
]
}
console.log('用户',this.userInfo)
},
//获取列表-我的客户相关
//加载更多(下一页)
loadMoreData_1() {
//判断是否加载
if (!this.isReachedBottom) {
this.isReachedBottom = true;//设置为不可请求状态
this.getList();
}
},
//重置为第一页
async resetFilteredData_1() {
this.isReachedBottom = false; // 重置状态,以便下次触发加载更多
this.filteredData_1.page = 1//当前页码
this.filteredData_1.limit = 10//每页返回数据条数
this.filteredData_1.total = 10//数据总条数
},
//获取列表-我的客户
async getList_1(){
this.loading = true
let data = {...this.filteredData_1}
//判断是否还有数据
if(this.filteredData_1.page * this.filteredData_1.limit > this.filteredData_1.total){
this.loading = false
uni.showToast({
title: '暂无更多',
icon: 'none'
})
return
}
if(data.page == 1){
this.tableList_1 = []
}
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_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++
},
//获取列表-资源分配相关
//加载更多(下一页)
loadMoreData_2() {
//判断是否加载
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
let data = {...this.filteredData_2}
//判断是否还有数据
if(this.filteredData_2.page * this.filteredData_2.limit > this.filteredData_2.total){
this.loading = false
uni.showToast({
title: '暂无更多',
icon: 'none'
})
return
}
if(data.page == 1){
this.tableList_2 = []
}
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列表
async segmented(index) {
this.select_type = 1
this.segmented_type = index.id//1=我的客户,2=资源分配
if(this.segmented_type == 1){
//我的客户
//重置为第一页
await this.resetFilteredData_1()
await this.getList_1()
}else{
//资源分配
//重置为第一页
await this.resetFilteredData_2()
await this.getList_2()
}
},
//跳转页面-我的消息
openViewMyMessage(item) {
let hair_staff_id = item.hair_staff_id
uni.navigateTo({
url: `/pages/common/im_chat_info?hair_staff_id=${hair_staff_id}`
})
},
//拨打电话
async dialTel(item) {
let tel = item.student_phone
if (!tel) {
uni.showToast({
title: '电话号码为空',
icon: 'none'
});
return;
}
let param = {
sales_id: item.id//线索id
}
let res = await marketApi.setCallUp(param)//添加通过记录
if (res.code != 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
uni.makePhoneCall({
phoneNumber: tel
})
},
//客户详情
clue_info(item) {
let id = item.id
uni.navigateTo({
url: `/pages/market/clue/clue_info?id=${id}`
})
},
//公海-领取客户
async getSales(item){
let param = {
sales_id:item.id
}
let res = await marketApi.getSales(param)
if(res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
uni.showToast({
title: res.msg,
icon: 'success'
})
//延迟1s执行
setTimeout(() => {
let param = {
index:{
id:2//2=公海客户列表
}
}
this.segmented(param)
}, 1000)
},
}
}
</script>
<style lang="less" scoped>
.assemble{
width: 100%;
height: 100vh;
background-color: #292929;
overflow: auto;
}
.search{
width: 92%;
margin: auto;
display: flex;
margin-top: 20rpx;
}
.selected{
background: #294e48;
border-radius: 16rpx;
padding: 12rpx 8rpx;
text-align: center;
color: #29d3b4;
margin-left: 5rpx;
}
.not-selected{
margin-left: 5rpx;
background: #ffffff;
border: 4rpx #959595 solid;
border-radius: 16rpx;
padding: 12rpx 8rpx;
text-align: center;
}
.card{
width: 92%;
margin: 20rpx auto;
background: #434544;
border-radius: 16rpx;
display: flex;
align-items: center;
}
.card-image{
width: 60rpx;
height: 60rpx;
}
.card-text{
font-size: 46rpx;
padding-left: 16rpx;
color: #fff;
}
.card-label{
margin-left: 30rpx;
background: #76575a;
width: 130rpx;
padding: 8rpx 20rpx;
color: #c9595a;
text-align: center;
border-radius: 0 50rpx 50rpx 40rpx;
}
.card-con{
font-size: 30rpx;
padding: 20rpx 10rpx 20rpx 16rpx;
color: #fff;
}
.card-con-span{
font-size: 24rpx;
color: #a47332;
padding-left: 12rpx;
}
.drop-image-x {
width: 20rpx;
height: 20rpx;
}
.title-x {
font-size: 28rpx;
color: #fff;
padding-left: 10rpx;
}
.card-date{
display: flex;
align-items: center;
justify-content: space-between;
}
.image{
width: 70rpx;
height: 70rpx;
}
.neck{
width: 60rpx;
height: 60rpx;
border-radius: 50%;
background: #f59a23;
color: #fff;
line-height: 60rpx;
text-align: center;
}
//领取按钮
.ling{
display: flex;
justify-content: center;
align-items: center;
border-radius:50%;
color: #fff;
width: 50rpx;
height: 50rpx;
background-color: #F59A23;
}
</style>