|
|
@ -24,9 +24,9 @@ |
|
|
> |
|
|
> |
|
|
<view class="left"> |
|
|
<view class="left"> |
|
|
<image |
|
|
<image |
|
|
v-if="v.type==2" |
|
|
v-if="(['1','2','3'].includes(String(userType)))" |
|
|
class="pic" |
|
|
class="pic" |
|
|
:src="(v.header ? $util.img(v.header) : `@/static/images/common/yong_hu.png`)" |
|
|
src="@/static/images/common/yong_hu.png" |
|
|
model="aspectFit" |
|
|
model="aspectFit" |
|
|
></image> |
|
|
></image> |
|
|
|
|
|
|
|
|
@ -46,19 +46,27 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
|
|
|
import apiRoute from '@/api/apiRoute.js'; |
|
|
import memberApi from '@/api/member.js'; |
|
|
import memberApi from '@/api/member.js'; |
|
|
import commonApi from '@/api/common.js'; |
|
|
import commonApi from '@/api/common.js'; |
|
|
import AQUplodeImgMulti from '@/components/AQ/AQUplodeImgMulti'; |
|
|
|
|
|
import AQTabber from "@/components/AQ/AQTabber" |
|
|
import AQTabber from "@/components/AQ/AQTabber" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
components: { |
|
|
components: { |
|
|
AQTabber, |
|
|
AQTabber, |
|
|
AQUplodeImgMulti, |
|
|
|
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
|
|
|
//筛选条件 |
|
|
|
|
|
filteredData:{ |
|
|
|
|
|
page:1,//当前页码 |
|
|
|
|
|
limit:10,//每页返回数据条数 |
|
|
|
|
|
total:10,//数据总条数 |
|
|
|
|
|
personnel_id:'',//员工人力资源表id(两个参数2选1) |
|
|
|
|
|
customer_resources_id:'',//学生资源表id(两个参数2选1) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
formData: { |
|
|
formData: { |
|
|
images_arr: [], |
|
|
images_arr: [], |
|
|
images: '', |
|
|
images: '', |
|
|
@ -68,6 +76,8 @@ export default { |
|
|
|
|
|
|
|
|
//联系人列表 |
|
|
//联系人列表 |
|
|
contactList:[], |
|
|
contactList:[], |
|
|
|
|
|
userType:'',//获取用户类型|1=教练,2=销售,3=学员 |
|
|
|
|
|
from_type: '',//发送者类型|personnel=员工,customer=学生(客户) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad() { |
|
|
onLoad() { |
|
|
@ -75,16 +85,72 @@ export default { |
|
|
onShow() { |
|
|
onShow() { |
|
|
this.init(); |
|
|
this.init(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
//下拉刷新 |
|
|
|
|
|
async onPullDownRefresh() { |
|
|
|
|
|
//重置为第一页 |
|
|
|
|
|
await this.resetFilteredData() |
|
|
|
|
|
await this.getList() |
|
|
|
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
//初始化 |
|
|
//初始化 |
|
|
async init(){ |
|
|
async init(){ |
|
|
|
|
|
//获取用户类型 |
|
|
|
|
|
this.userType = uni.getStorageSync('userType') |
|
|
|
|
|
//1=教练,2=销售,3=学员 |
|
|
|
|
|
if (['1', '2'].includes(String(this.userType))) { |
|
|
|
|
|
this.from_type = 'personnel'//员工 |
|
|
|
|
|
await this.getPersonnelUserInfo() |
|
|
|
|
|
}else{ |
|
|
|
|
|
//获取学生用户详情 |
|
|
|
|
|
this.from_type = 'customer'//学生 |
|
|
|
|
|
} |
|
|
this.getContactList() |
|
|
this.getContactList() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//获取用户详情 |
|
|
|
|
|
async getPersonnelUserInfo(){ |
|
|
|
|
|
let data = {} |
|
|
|
|
|
let res = await apiRoute.getPersonnelInfo(data); |
|
|
|
|
|
if (res.code != 1){ |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: res.msg, |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
res.data.cameus_dept_arr.forEach((v,k)=>{ |
|
|
|
|
|
let d_arr = [] |
|
|
|
|
|
v.dept_arr.forEach((dv,dk)=>{ |
|
|
|
|
|
d_arr.push(dv.dept_name) |
|
|
|
|
|
}) |
|
|
|
|
|
//数组转字符串 |
|
|
|
|
|
v.dept_name_str = d_arr.join(',') |
|
|
|
|
|
}) |
|
|
|
|
|
this.filteredData.personnel_id = res.data.id |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
//获取联系人列表 |
|
|
//获取联系人列表 |
|
|
async getContactList(){ |
|
|
async getContactList(){ |
|
|
let res = await commonApi.getContactList() |
|
|
let params = {...this.filteredData} |
|
|
console.log('获取联系人列表', res) |
|
|
//判断是否还有数据 |
|
|
|
|
|
if ((this.filteredData.page - 1) * this.filteredData.limit >= this.filteredData.total) { |
|
|
|
|
|
this.loading = false |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '暂无更多', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(params.page == 1){ |
|
|
|
|
|
this.contactList = [] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let res = await apiRoute.xs_chatGetChatFriendsList(params) |
|
|
|
|
|
|
|
|
|
|
|
this.loading = false |
|
|
|
|
|
this.isReachedBottom = false; |
|
|
if (res.code != 1) { |
|
|
if (res.code != 1) { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: res.msg, |
|
|
title: res.msg, |
|
|
@ -92,7 +158,23 @@ export default { |
|
|
}) |
|
|
}) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
this.contactList = res.data |
|
|
|
|
|
|
|
|
res.data.data.forEach((v,k)=>{ |
|
|
|
|
|
v.name = '' |
|
|
|
|
|
v.count = '0' |
|
|
|
|
|
if(this.from_type == 'personnel'){ |
|
|
|
|
|
v.name = v.personnel_id_name |
|
|
|
|
|
v.count = v.unread_count_personnel |
|
|
|
|
|
}else{ |
|
|
|
|
|
v.name = v.customer_resources_id_name |
|
|
|
|
|
v.count = v.unread_count_customer_resources |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
console.log('列表',res.data.data) |
|
|
|
|
|
|
|
|
|
|
|
this.contactList = this.contactList.concat(res.data.data); // 使用 concat 方法 将新数据追加到数组中 |
|
|
|
|
|
this.filteredData.total = res.data.total |
|
|
|
|
|
this.filteredData.page++ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//######AQ上传文件组件相关###### |
|
|
//######AQ上传文件组件相关###### |
|
|
@ -153,10 +235,19 @@ export default { |
|
|
//系统消息 |
|
|
//系统消息 |
|
|
this.openViewSysMsgList(e) |
|
|
this.openViewSysMsgList(e) |
|
|
}else{ |
|
|
}else{ |
|
|
|
|
|
let from_id = ''//发送者的id |
|
|
|
|
|
let to_id = ''//接收者ID |
|
|
//站内信 |
|
|
//站内信 |
|
|
let hair_staff_id = e.hair_staff_id//发信人id |
|
|
if (this.from_type == 'personnel') { |
|
|
|
|
|
from_id = e.personnel_id |
|
|
|
|
|
to_id = e.customer_resources_id |
|
|
|
|
|
} else { |
|
|
|
|
|
from_id = e.customer_resources_id |
|
|
|
|
|
to_id = e.personnel_id |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url: `/pages/common/im_chat_info?hair_staff_id=${hair_staff_id}` |
|
|
url: `/pages/common/im_chat_info?from_id=${from_id}&to_id=${to_id}` |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|