Browse Source

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

master
王泽彦 10 months 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; 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} 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 this.loading = false
uni.showToast({ uni.showToast({
title: '暂无更多', title: '暂无更多',

109
pages/common/my_message.vue

@ -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(21)
customer_resources_id:'',//id(21)
},
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}`
}) })
} }

BIN
static/images/common/jia_hao.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 817 B

Loading…
Cancel
Save