Browse Source

Merge branch 'master' of ssh://gitlab.frkj.cc:222/php/ZhiHuiJiaoWu_UniApp

master
王泽彦 1 year ago
parent
commit
907881e859
  1. 8
      api/apiRoute.js
  2. 2
      pages/common/contract_list.vue
  3. 109
      pages/common/my_message.vue
  4. BIN
      static/images/common/jia_hao.png

8
api/apiRoute.js

@ -262,6 +262,14 @@ export default {
return res;
})
},
//销售端-好友关系列表
xs_chatGetChatFriendsList(data = {}) {
let url = '/chat/getChatFriendsList'
return http.get(url, data).then(res => {
return res;
})
},

2
pages/common/contract_list.vue

@ -101,7 +101,7 @@ export default {
let data = {...this.filteredData}
//判断是否还有数据
if(this.filteredData.page * this.filteredData.limit > this.filteredData.total){
if ((this.filteredData.page - 1) * this.filteredData.limit >= this.filteredData.total) {
this.loading = false
uni.showToast({
title: '暂无更多',

109
pages/common/my_message.vue

@ -24,9 +24,9 @@
>
<view class="left">
<image
v-if="v.type==2"
v-if="(['1','2','3'].includes(String(userType)))"
class="pic"
:src="(v.header ? $util.img(v.header) : `@/static/images/common/yong_hu.png`)"
src="@/static/images/common/yong_hu.png"
model="aspectFit"
></image>
@ -46,19 +46,27 @@
</template>
<script>
import apiRoute from '@/api/apiRoute.js';
import memberApi from '@/api/member.js';
import commonApi from '@/api/common.js';
import AQUplodeImgMulti from '@/components/AQ/AQUplodeImgMulti';
import AQTabber from "@/components/AQ/AQTabber"
export default {
components: {
AQTabber,
AQUplodeImgMulti,
},
data() {
return {
//筛选条件
filteredData:{
page:1,//当前页码
limit:10,//每页返回数据条数
total:10,//数据总条数
personnel_id:'',//员工人力资源表id(两个参数2选1)
customer_resources_id:'',//学生资源表id(两个参数2选1)
},
formData: {
images_arr: [],
images: '',
@ -68,6 +76,8 @@ export default {
//联系人列表
contactList:[],
userType:'',//获取用户类型|1=教练,2=销售,3=学员
from_type: '',//发送者类型|personnel=员工,customer=学生(客户)
}
},
onLoad() {
@ -75,16 +85,72 @@ export default {
onShow() {
this.init();
},
//下拉刷新
async onPullDownRefresh() {
//重置为第一页
await this.resetFilteredData()
await this.getList()
},
methods: {
//初始化
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()
},
//获取用户详情
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(){
let res = await commonApi.getContactList()
console.log('获取联系人列表', res)
let params = {...this.filteredData}
//判断是否还有数据
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) {
uni.showToast({
title: res.msg,
@ -92,7 +158,23 @@ export default {
})
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上传文件组件相关######
@ -153,10 +235,19 @@ export default {
//系统消息
this.openViewSysMsgList(e)
}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({
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}`
})
}

BIN
static/images/common/jia_hao.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 817 B

Loading…
Cancel
Save