Browse Source

留言修改

master
wangmingyong@163.com 4 weeks ago
parent
commit
48c299e354
  1. 11
      zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementChat.vue
  2. 50
      zdxt-web-client/zdxt-efcode-enterprise-app/src/views/enterprise/enforcement/enforcementChat.vue
  3. 41
      zdxt-web-client/zdxt-efcode-enterprise-app/src/views/enterprise/law/lawServiceDetail.vue

11
zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementChat.vue

@ -51,8 +51,8 @@
@touchmove="onTouchMove"
>
<div class="msg-sender">{{ msg.msgFrom === 0 ? (msg.bureauDeptName || useCommon.bureauUnitName || '执法单位') : msg.userName }}</div>
<span>{{ msg.content }}</span>
<div class="msg-sender">{{ msg.msgFrom === 0 ? (msg.bureauDeptName || '执法单位') : msg.userName }}</div>
<span v-html="msg.content"></span>
</div>
</div>
<div v-if="msg.msgFrom === 0" class="msg-avatar right-avatar"></div>
@ -124,9 +124,6 @@ const route = useRoute();
const { useCommon } = $globalStore;
// ========== ==========
const noticeId = route.query.noticeId|| '';
const bureauDeptName = ref(route.query.bureauDeptName || '深圳司法局');
const contactPerson = ref(route.query.contactPerson || '付明明 周昂');
const noticeTitle = ref(route.query.title || '安全生产检查');
// ========== ==========
const messageList = ref([]);
// ========== ==========
@ -309,7 +306,7 @@ const sendMessage = () => {
const now = new Date();
const timeStr = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`;
const selfAvatar='';
const newMsg = {
id: Date.now(),
sender: 'self',
@ -317,6 +314,7 @@ const sendMessage = () => {
time: timeStr,
avatar: selfAvatar,
isRecalled: false,
msgFrom: 0,
};
messageList.value.push(newMsg);
@ -338,7 +336,6 @@ const sendMessage = () => {
messageList.value.pop();
});
}
//
nextTick(() => {
scrollToBottom();

50
zdxt-web-client/zdxt-efcode-enterprise-app/src/views/enterprise/enforcement/enforcementChat.vue

@ -38,12 +38,7 @@
:class="{ 'self': msg.sender === 'self' }"
>
<!-- 对方头像在左 -->
<img
v-if="msg.sender === 'other'"
:src="msg.avatar"
class="avatar"
alt="avatar"
/>
<div v-if="msg.msgFrom === 0" class="msg-avatar left-avatar"></div>
<div class="message-content">
<div
@ -61,17 +56,19 @@
@touchend="onTouchEnd"
@touchmove="onTouchMove"
>
{{ msg.content }}
<div class="msg-sender">{{ msg.msgFrom === 0 ? (msg.bureauDeptName || useCommon.bureauUnitName || '执法单位') : msg.userName }}</div>
<span>{{ msg.content }}</span>
</div>
</div>
<!-- 自己头像在右 -->
<img
<div v-if="msg.msgFrom === 1" class="msg-avatar right-avatar"></div>
<!-- <img
v-if="msg.sender === 'self'"
:src="msg.avatar"
class="avatar"
alt="avatar"
/>
/> -->
</div>
</div>
</div>
@ -133,13 +130,7 @@ const { useCommon } = $globalStore;
// ========== ==========
const noticeId = ref(route.query.id || '');
const bureauDeptName = ref(route.query.bureauDeptName || '深圳司法局');
const contactPerson = ref(route.query.contactPerson || '付明明 周昂');
const noticeTitle = ref(route.query.title || '安全生产检查');
// ========== ==========
const selfAvatar = 'https://placehold.co/40x40/447bf5/fff?text=我';
const otherAvatar = 'https://placehold.co/40x40/999/fff?text=官';
// ========== ==========
const messageList = ref([]);
@ -163,8 +154,10 @@ const fetchMessageList = () => {
sender: isSelf ? 'self' : 'other',
content: item.message,
time:item.createTime|| '',
avatar: isSelf ? selfAvatar : otherAvatar,
isRecalled: item.isRecalled || false,
msgFrom: item.msgFrom || 0,
userName: item.userName || '',
bureauDeptName: item.bureauDeptName || '',
};
});
@ -365,17 +358,17 @@ const sendMessage = () => {
if (res.code === 200) {
const now = new Date();
const timeStr = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`;
const selfAvatar='';
messageList.value.push({
id: res.data?.id || Date.now(),
sender: 'self',
content: text,
time: timeStr,
avatar: selfAvatar,
msgFrom: 1,
isRecalled: false,
});
inputMessage.value = '';
//
nextTick(() => {
scrollToBottom();
@ -517,6 +510,7 @@ const onMoreClick = () => {
text-align: center;
border-radius: 0.08rem;
}
.msg-sender { color: #ccc; }
}
/* ===== 长按/右击菜单 ===== */
@ -635,4 +629,24 @@ const onMoreClick = () => {
opacity: 0.8;
}
}
.msg-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
font-weight: 600;
color: #fff;
flex-shrink: 0;
}
.left-avatar {
background: linear-gradient(135deg, #f5a623, #f7c948);
}
.right-avatar {
background: linear-gradient(135deg, #1890ff, #0b63d1);
}
</style>

41
zdxt-web-client/zdxt-efcode-enterprise-app/src/views/enterprise/law/lawServiceDetail.vue

@ -1,17 +1,17 @@
<template>
<div class="law-service-detail-page">
<!-- 顶部导航栏 -->
<van-nav-bar
<!-- <van-nav-bar
title="涉企普法"
left-text="关闭"
left-arrow
@click-left="onClickLeft"
>
> -->
<!-- <template #right>
<van-icon name="filter-o" size="20" @click="onFilterClick" />
<van-icon name="search" size="20" style="margin-left: 12px;" @click="onSearchClick" />
</template> -->
</van-nav-bar>
<!-- </van-nav-bar> -->
<!-- 内容区域 -->
<div class="detail-content">
@ -206,6 +206,7 @@ const previewImage = (index) => {
font-size: 0.37rem;
color: #333;
line-height: 1.8;
overflow: hidden;
p {
text-indent: 2em;
@ -234,10 +235,13 @@ const previewImage = (index) => {
}
img {
max-width: 100%;
height: auto;
max-width: 100% !important;
width: auto !important;
height: auto !important;
border-radius: 0.15rem;
margin: 0.2rem 0;
display: block;
object-fit: contain;
}
a {
@ -271,7 +275,8 @@ const previewImage = (index) => {
margin-top: 0.2rem;
border-radius: 0.15rem;
overflow: hidden;
background: #f5f5f5;
background: #fbfdff;
position: relative;
}
.detail-iframe {
@ -279,4 +284,28 @@ const previewImage = (index) => {
height: 500px;
background: #fff;
}
.copy-link-btn {
position: absolute;
bottom: 0.3rem;
right: 0.3rem;
display: flex;
align-items: center;
gap: 0.1rem;
padding: 0.15rem 0.3rem;
background: rgba(0, 0, 0, 0.6);
color: #fff;
font-size: 0.28rem;
border-radius: 0.2rem;
cursor: pointer;
z-index: 10;
:deep(.van-icon) {
color: #fff;
}
&:active {
background: rgba(0, 0, 0, 0.8);
}
}
</style>

Loading…
Cancel
Save