2025-09-12 17:23:03 +08:00
|
|
|
|
<template>
|
2025-09-16 16:05:34 +08:00
|
|
|
|
<view class="message-container">
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 可滚动的内容区域 -->
|
2025-09-28 09:21:15 +08:00
|
|
|
|
<view class="content-container">
|
2025-10-09 15:13:48 +08:00
|
|
|
|
<view>
|
2025-10-10 14:16:01 +08:00
|
|
|
|
<view id="fixedHeadId" style="padding: 32rpx 32rpx 0;" class="u-m-b-20">
|
2025-10-09 15:13:48 +08:00
|
|
|
|
<view class="head-box1">
|
|
|
|
|
|
<view class="title">
|
|
|
|
|
|
容讯聊天室
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="icon">
|
|
|
|
|
|
<image class="icon-img" src="/static/icon/search.png" mode=""></image>
|
|
|
|
|
|
<image class="icon-img2" src="/static/icon/Bookmark.png" mode=""></image>
|
|
|
|
|
|
</view>
|
2025-09-16 16:05:34 +08:00
|
|
|
|
</view>
|
2025-10-09 15:13:48 +08:00
|
|
|
|
<view class="head-box2">
|
2025-10-09 17:19:28 +08:00
|
|
|
|
<view class="item" @click="handleNavigateTo">
|
2025-10-09 15:13:48 +08:00
|
|
|
|
<view class="box-img">
|
|
|
|
|
|
<image class="img" src="/static/message/system.png" mode=""></image>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="title">
|
|
|
|
|
|
系统消息
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="item">
|
|
|
|
|
|
<view class="box-img">
|
|
|
|
|
|
<image class="img" src="/static/message/customer.png" mode=""></image>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="title">
|
|
|
|
|
|
客户消息
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="item">
|
|
|
|
|
|
<view class="box-img">
|
|
|
|
|
|
<image class="img" src="/static/message/order.png" mode=""></image>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="title">
|
|
|
|
|
|
订单通知
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="item">
|
|
|
|
|
|
<view class="box-img">
|
|
|
|
|
|
<image class="img" src="/static/message/process.png" mode=""></image>
|
2025-09-28 09:21:15 +08:00
|
|
|
|
</view>
|
2025-10-09 15:13:48 +08:00
|
|
|
|
<view class="title">
|
|
|
|
|
|
项目进度
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
2025-10-10 14:16:01 +08:00
|
|
|
|
<!-- 全部/已投资/未读/不感兴趣 -->
|
|
|
|
|
|
<!-- <view class="menu-list">
|
2025-09-28 09:21:15 +08:00
|
|
|
|
<view class="menu-item" v-for="(item,index) in menuList" @click="handleMenuChange(index)">
|
|
|
|
|
|
<view class="menu-title">{{item.name + '(' + item.count +')'}}
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<image class="menu-icon"
|
|
|
|
|
|
:src="currentMenu==index?'/static/icon/Chevron down.png':'/static/icon/Chevron right Menu.png'"
|
|
|
|
|
|
mode=""></image>
|
|
|
|
|
|
</view>
|
2025-10-10 14:16:01 +08:00
|
|
|
|
</view> -->
|
2025-09-16 16:05:34 +08:00
|
|
|
|
</view>
|
2025-10-09 15:13:48 +08:00
|
|
|
|
|
2025-10-10 14:16:01 +08:00
|
|
|
|
<scroll-view scroll-y="true" class="message-list" :style="'height:'+height+'px'"
|
|
|
|
|
|
@scrolltolower="loadData">
|
|
|
|
|
|
<view class="message-item" v-for="(item, index) in messageList">
|
2025-10-09 17:19:28 +08:00
|
|
|
|
<u-swipe-action bgColor="#F8FBFF" :index="item.groupId" class="other-program"
|
|
|
|
|
|
@content-click="handleChat(item)" v-if="item.program.linkmanId !== params.userId"
|
2025-10-09 15:13:48 +08:00
|
|
|
|
:options="options">
|
|
|
|
|
|
<view class="item-name title-wrap">
|
|
|
|
|
|
{{ item.program.name}}
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="item-company">
|
|
|
|
|
|
{{'负责公司:' + item.program.company }}
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<!-- <view class="item-date">
|
|
|
|
|
|
{{ item.program.startDate + "至" + item.program.endDate }}
|
|
|
|
|
|
</view> -->
|
|
|
|
|
|
<view class="item-unread" v-if="item.userUnread.length!=0">
|
2025-10-10 14:16:01 +08:00
|
|
|
|
消息未读: {{item.userUnread.length}}
|
2025-10-09 15:13:48 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</u-swipe-action>
|
2025-10-09 17:19:28 +08:00
|
|
|
|
<u-swipe-action bgColor="#F8FBFF" class="my-program" @content-click="handleChat(item)" v-else
|
|
|
|
|
|
:options="options">
|
2025-10-09 15:13:48 +08:00
|
|
|
|
<view class="item-name title-wrap">
|
|
|
|
|
|
{{ item.program.name}}
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="item-company">
|
|
|
|
|
|
{{'咨询人:' + maskPhoneNumber(item.user.username) }}
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<view class="item-unread" v-if="item.chargeUnread.length!=0">
|
2025-10-10 14:16:01 +08:00
|
|
|
|
消息未读: {{item.chargeUnread.length}}
|
2025-10-09 15:13:48 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</u-swipe-action>
|
2025-09-28 09:21:15 +08:00
|
|
|
|
</view>
|
2025-10-10 14:16:01 +08:00
|
|
|
|
<u-loadmore :status="status" color="#fff" />
|
2025-10-09 17:19:28 +08:00
|
|
|
|
<view class="placeholder-box"></view>
|
2025-09-28 09:21:15 +08:00
|
|
|
|
</scroll-view>
|
2025-09-16 16:05:34 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
2025-09-12 17:23:03 +08:00
|
|
|
|
|
2025-09-16 16:05:34 +08:00
|
|
|
|
<Tabbar id="tabbarId"></Tabbar>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
2025-09-12 17:23:03 +08:00
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2025-09-16 16:05:34 +08:00
|
|
|
|
import { ref, computed, getCurrentInstance } from 'vue';
|
|
|
|
|
|
import {
|
2025-09-18 09:52:30 +08:00
|
|
|
|
onReady, onPullDownRefresh
|
2025-09-16 16:05:34 +08:00
|
|
|
|
} from '@dcloudio/uni-app';
|
|
|
|
|
|
import { onReady as onUniReady } from '@dcloudio/uni-app';
|
2025-09-28 09:21:15 +08:00
|
|
|
|
import { groupAPI } from '../../api/group';
|
2025-10-09 15:13:48 +08:00
|
|
|
|
import { getUserInfo, maskPhoneNumber } from '../../util/common';
|
2025-09-16 16:05:34 +08:00
|
|
|
|
const instance = getCurrentInstance();
|
|
|
|
|
|
|
|
|
|
|
|
const height = ref(0)
|
|
|
|
|
|
|
|
|
|
|
|
const loadHeight = () => {
|
|
|
|
|
|
uni.getSystemInfo({
|
|
|
|
|
|
success(res) {
|
|
|
|
|
|
let screenHeight = res.screenHeight
|
|
|
|
|
|
uni.createSelectorQuery().in(instance.proxy).select("#tabbarId").boundingClientRect((data : any) => {
|
2025-10-09 17:19:28 +08:00
|
|
|
|
height.value = screenHeight - data.height
|
2025-09-28 09:21:15 +08:00
|
|
|
|
}).exec()
|
|
|
|
|
|
uni.createSelectorQuery().in(instance.proxy).select("#fixedHeadId").boundingClientRect((data : any) => {
|
|
|
|
|
|
height.value = height.value - data.height
|
2025-09-16 16:05:34 +08:00
|
|
|
|
}).exec()
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 搜索
|
|
|
|
|
|
const keyword = ref('')
|
2025-10-10 14:16:01 +08:00
|
|
|
|
|
2025-10-09 17:19:28 +08:00
|
|
|
|
// 系统消息
|
|
|
|
|
|
const handleNavigateTo = () => {
|
|
|
|
|
|
uni.navigateTo({
|
2025-10-10 14:16:01 +08:00
|
|
|
|
url: '/pages/message/systemMessage'
|
2025-10-09 17:19:28 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
2025-09-16 16:05:34 +08:00
|
|
|
|
|
|
|
|
|
|
// 小菜单切换
|
|
|
|
|
|
const menuList = ref([{
|
|
|
|
|
|
name: '全部',
|
|
|
|
|
|
count: 5
|
|
|
|
|
|
}, {
|
|
|
|
|
|
name: '已投资',
|
|
|
|
|
|
count: 5
|
|
|
|
|
|
}, {
|
|
|
|
|
|
name: '未读',
|
|
|
|
|
|
count: 0
|
|
|
|
|
|
}, {
|
|
|
|
|
|
name: '不感兴趣',
|
|
|
|
|
|
count: 5
|
|
|
|
|
|
}])
|
|
|
|
|
|
// 当前小菜单
|
|
|
|
|
|
const currentMenu = ref(0)
|
|
|
|
|
|
// 切换小菜单
|
|
|
|
|
|
const handleMenuChange = (val) => {
|
|
|
|
|
|
currentMenu.value = val
|
|
|
|
|
|
}
|
2025-09-12 17:23:03 +08:00
|
|
|
|
|
2025-10-10 14:16:01 +08:00
|
|
|
|
// 进入聊天
|
|
|
|
|
|
const handleChat = (item) => {
|
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
|
url: '/pages/message/chat?groupId=' + item.groupId
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-09 15:13:48 +08:00
|
|
|
|
// 消息
|
2025-09-16 17:57:04 +08:00
|
|
|
|
const messageList = ref([])
|
2025-09-28 17:30:20 +08:00
|
|
|
|
const user = ref()
|
|
|
|
|
|
const size = 10
|
|
|
|
|
|
const params = ref({
|
|
|
|
|
|
page: 1,
|
|
|
|
|
|
size: size,
|
|
|
|
|
|
userId: '',
|
|
|
|
|
|
customerId: '',
|
|
|
|
|
|
})
|
2025-10-10 14:16:01 +08:00
|
|
|
|
const pages = ref(0)
|
|
|
|
|
|
const status = ref('loadmore')
|
2025-10-09 15:13:48 +08:00
|
|
|
|
const options = [
|
|
|
|
|
|
{
|
|
|
|
|
|
text: '收藏',
|
|
|
|
|
|
style: {
|
|
|
|
|
|
backgroundColor: '#007aff'
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
text: '删除',
|
|
|
|
|
|
style: {
|
|
|
|
|
|
backgroundColor: '#dd524d'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2025-09-28 09:21:15 +08:00
|
|
|
|
|
|
|
|
|
|
const loadData = () => {
|
2025-10-10 14:16:01 +08:00
|
|
|
|
if (status.value == 'nomore') return
|
2025-09-28 17:30:20 +08:00
|
|
|
|
groupAPI.getList(params.value).then((res) => {
|
2025-10-10 14:16:01 +08:00
|
|
|
|
pages.value = res.data.pages
|
|
|
|
|
|
messageList.value = messageList.value.concat(res.data.list)
|
|
|
|
|
|
params.value.page++
|
|
|
|
|
|
if (params.value.page > pages.value) {
|
|
|
|
|
|
status.value = 'nomore'
|
|
|
|
|
|
}
|
2025-09-28 09:21:15 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onPullDownRefresh(async () => {
|
2025-10-10 14:16:01 +08:00
|
|
|
|
// 重新刷新,将参数初始化
|
|
|
|
|
|
params.value.page = 1
|
|
|
|
|
|
messageList.value = []
|
|
|
|
|
|
status.value = 'loadmore'
|
|
|
|
|
|
loadData()
|
2025-09-18 09:52:30 +08:00
|
|
|
|
uni.stopPullDownRefresh()
|
|
|
|
|
|
})
|
2025-09-16 16:05:34 +08:00
|
|
|
|
|
|
|
|
|
|
onUniReady(() => {
|
|
|
|
|
|
loadHeight()
|
2025-09-28 17:30:20 +08:00
|
|
|
|
user.value = getUserInfo()
|
|
|
|
|
|
params.value.userId = user.value.id
|
2025-09-28 09:21:15 +08:00
|
|
|
|
loadData()
|
2025-09-16 16:05:34 +08:00
|
|
|
|
})
|
2025-09-12 17:23:03 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
2025-09-16 16:05:34 +08:00
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
.message-container {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
|
|
|
|
/* 内容滚动区域 */
|
|
|
|
|
|
.content-container {
|
2025-10-09 15:13:48 +08:00
|
|
|
|
// background: linear-gradient(180deg, #2F75F9 0%, #F0F3FF 34.13%);
|
|
|
|
|
|
background: linear-gradient(270deg, #659CFF 0%, #2D75FB 50%, #659CFF 100%);
|
2025-09-16 16:05:34 +08:00
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
2025-10-09 15:13:48 +08:00
|
|
|
|
.head-box1 {
|
|
|
|
|
|
padding-top: 60rpx;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
2025-09-16 16:05:34 +08:00
|
|
|
|
|
2025-10-09 15:13:48 +08:00
|
|
|
|
.title {
|
|
|
|
|
|
font-family: SF Pro;
|
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
font-style: Bold;
|
|
|
|
|
|
font-size: 40rpx;
|
|
|
|
|
|
leading-trim: NONE;
|
|
|
|
|
|
line-height: 48rpx;
|
|
|
|
|
|
letter-spacing: 0%;
|
|
|
|
|
|
color: #FFFFFF;
|
|
|
|
|
|
}
|
2025-09-16 16:05:34 +08:00
|
|
|
|
|
2025-10-09 15:13:48 +08:00
|
|
|
|
.icon {
|
2025-09-16 16:05:34 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
2025-10-09 15:13:48 +08:00
|
|
|
|
.icon-img {
|
|
|
|
|
|
width: 34rpx;
|
|
|
|
|
|
height: 34rpx;
|
|
|
|
|
|
margin-right: 20rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.icon-img2 {
|
2025-09-16 16:05:34 +08:00
|
|
|
|
width: 48rpx;
|
|
|
|
|
|
height: 48rpx;
|
|
|
|
|
|
}
|
2025-10-09 15:13:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-10-09 17:19:28 +08:00
|
|
|
|
|
2025-10-09 15:13:48 +08:00
|
|
|
|
.head-box2 {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-around;
|
|
|
|
|
|
margin-top: 20rpx;
|
2025-09-16 16:05:34 +08:00
|
|
|
|
|
2025-10-09 15:13:48 +08:00
|
|
|
|
.item {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
|
|
.box-img {
|
|
|
|
|
|
.img {
|
|
|
|
|
|
width: 68rpx;
|
|
|
|
|
|
height: 68rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
|
|
margin-top: 10rpx;
|
|
|
|
|
|
font-family: Work Sans;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
font-style: Regular;
|
|
|
|
|
|
font-size: 26rpx;
|
2025-09-16 16:05:34 +08:00
|
|
|
|
leading-trim: NONE;
|
2025-10-09 15:13:48 +08:00
|
|
|
|
line-height: 100%;
|
|
|
|
|
|
letter-spacing: -2%;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
color: #fff;
|
2025-09-16 16:05:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.menu-list {
|
|
|
|
|
|
margin-top: 20rpx;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-around;
|
|
|
|
|
|
|
|
|
|
|
|
.menu-item {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
|
|
.menu-title {
|
|
|
|
|
|
font-family: SF Pro;
|
|
|
|
|
|
font-weight: 30;
|
|
|
|
|
|
font-style: Expanded Ultralight;
|
|
|
|
|
|
font-size: 24rpx;
|
|
|
|
|
|
leading-trim: NONE;
|
|
|
|
|
|
line-height: 42rpx;
|
|
|
|
|
|
letter-spacing: 0%;
|
|
|
|
|
|
color: #000;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.menu-icon {
|
|
|
|
|
|
width: 22rpx;
|
|
|
|
|
|
height: 22rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-16 17:57:04 +08:00
|
|
|
|
.message-list {
|
2025-10-10 14:16:01 +08:00
|
|
|
|
margin-top: 20rpx;
|
2025-09-12 17:23:03 +08:00
|
|
|
|
|
2025-09-16 17:57:04 +08:00
|
|
|
|
.message-item {
|
2025-10-09 15:13:48 +08:00
|
|
|
|
|
2025-09-16 16:05:34 +08:00
|
|
|
|
// border: 1px solid #000;
|
2025-10-10 14:16:01 +08:00
|
|
|
|
.other-program {
|
2025-10-09 15:13:48 +08:00
|
|
|
|
padding: 20rpx 0rpx 20rpx 20rpx;
|
|
|
|
|
|
background-color: #F8FBFF;
|
2025-10-10 14:16:01 +08:00
|
|
|
|
border-bottom: 2rpx solid #f1f4ff;
|
|
|
|
|
|
|
|
|
|
|
|
.item-unread{
|
|
|
|
|
|
color: red;
|
|
|
|
|
|
}
|
2025-10-09 15:13:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.my-program {
|
|
|
|
|
|
padding: 20rpx 0rpx 20rpx 20rpx;
|
|
|
|
|
|
background-color: #F8FBFF;
|
|
|
|
|
|
border-bottom: 2rpx solid #f1f4ff;
|
2025-10-10 14:16:01 +08:00
|
|
|
|
|
|
|
|
|
|
.item-unread{
|
|
|
|
|
|
color: red;
|
|
|
|
|
|
}
|
2025-10-09 15:13:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-16 16:05:34 +08:00
|
|
|
|
}
|
2025-10-10 14:16:01 +08:00
|
|
|
|
|
|
|
|
|
|
.placeholder-box {
|
2025-10-09 17:19:28 +08:00
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 50rpx;
|
|
|
|
|
|
}
|
2025-09-16 16:05:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|