no message

This commit is contained in:
kuaifan 2022-06-06 14:03:50 +08:00
parent 2f76e932b0
commit c5c9e19f76
9 changed files with 328 additions and 305 deletions

View File

@ -1,14 +1,16 @@
<template>
<Modal
:value="show"
:value="visible"
:mask="false"
:mask-closable="false"
:footer-hide="true"
:transition-names="['mobile-dialog', '']"
:transition-names="['', '']"
:beforeClose="onBeforeClose"
class-name="dialog-modal"
fullscreen>
<transition name="mobile-dialog">
<DialogWrapper v-if="windowSmall && dialogId > 0" :dialogId="dialogId" :beforeBack="onBeforeClose"/>
</transition>
</Modal>
</template>
@ -23,6 +25,7 @@ body {
padding: 0;
.ivu-modal-content {
background: transparent;
.ivu-modal-close {
display: none;
@ -49,6 +52,13 @@ export default {
name: "DialogModal",
components: {DialogWrapper},
data() {
return {
timer: null,
visible: false,
}
},
computed: {
...mapState(['dialogId']),
@ -57,6 +67,19 @@ export default {
}
},
watch: {
show(v) {
this.timer && clearTimeout(this.timer);
if (v) {
this.visible = true;
} else {
this.timer = setTimeout(_ => {
this.visible = false;
}, 300);
}
}
},
methods: {
onBeforeClose() {
return new Promise(_ => {

View File

@ -3,14 +3,14 @@
v-if="isReady"
class="dialog-wrapper"
:class="wrapperClass"
:style="wrapperStyle"
@drop.prevent="chatPasteDrag($event, 'drag')"
@dragover.prevent="chatDragOver(true, $event)"
@dragleave.prevent="chatDragOver(false, $event)"
@touchmove="onTouchmove">
<!--顶部导航-->
<div class="dialog-nav" :style="navStyle">
<slot name="head">
<div class="dialog-nav" :class="{completed:$A.dialogCompleted(dialogData)}">
<div class="nav-wrapper" :class="{completed:$A.dialogCompleted(dialogData)}">
<div class="dialog-back" @click="onBack">
<i class="taskfont">&#xe72d;</i>
<div v-if="msgUnreadOnly" class="back-num">{{msgUnreadOnly}}</div>
@ -66,6 +66,7 @@
</ETooltip>
</div>
</slot>
</div>
<!--消息列表-->
<DynamicScroller
@ -327,7 +328,7 @@ export default {
dialogDrag: false,
groupInfoShow: false,
wrapperStyle: {},
navStyle: {},
operateVisible: false,
operateHasText: false,
@ -364,7 +365,8 @@ export default {
'cacheDialogs',
'dialogMsgs',
'wsOpenNum',
'touchBackInProgress'
'touchBackInProgress',
'taskId',
]),
isReady() {
@ -510,8 +512,8 @@ export default {
windowScrollY(val) {
if ($A.isIos()) {
const {scrollE} = this.scrollInfo();
this.wrapperStyle = {
top: val + 'px'
this.navStyle = {
marginTop: val + 'px'
}
if (scrollE <= 10) {
this.$nextTick(_ => {
@ -751,6 +753,9 @@ export default {
if (!this.dialogData.group_info) {
return;
}
if (this.windowSmall) {
this.$store.dispatch("openDialog", 0);
}
this.goForward({name: 'manage-project', params: {projectId:this.dialogData.group_info.id}});
},
@ -758,6 +763,9 @@ export default {
if (!this.dialogData.group_info) {
return;
}
if (this.taskId > 0) {
this.$store.dispatch("openDialog", 0);
}
this.$store.dispatch("openTask", this.dialogData.group_info.id);
},

View File

@ -1,5 +1,5 @@
<template>
<DialogWrapper v-if="projectData.cacheParameter.chat" :dialog-id="projectData.dialog_id" class="project-dialog">
<DialogWrapper v-if="windowLarge && projectData.cacheParameter.chat" :dialog-id="projectData.dialog_id" class="project-dialog">
<template slot="head">
<div class="dialog-user">
<div class="member-head">
@ -14,7 +14,7 @@
</li>
</ul>
</div>
<div class="dialog-nav">
<div class="nav-wrapper">
<div class="dialog-title">
<h2>{{$L('群聊')}}</h2>
</div>

View File

@ -44,7 +44,7 @@
</div>
</Tooltip>
</li>
<li :class="['project-icon', projectData.cacheParameter.chat ? 'active' : '']" @click="toggleParameter('chat')">
<li :class="['project-icon', windowLarge && projectData.cacheParameter.chat ? 'active' : '']" @click="toggleParameter('chat')">
<Icon class="menu-icon" type="ios-chatbubbles" />
<Badge class="menu-badge" :count="msgUnread"></Badge>
</li>
@ -1420,6 +1420,11 @@ export default {
toggleParameter(data) {
if (data === 'completedTask') {
this.$store.dispatch("forgetTaskCompleteTemp", true);
} else if (data === 'chat') {
if (this.windowSmall) {
this.$store.dispatch('openDialog', this.projectData.dialog_id)
return;
}
}
this.$store.dispatch('toggleProjectParameter', data);
},

View File

@ -554,6 +554,7 @@ export default {
'taskContents',
'taskFiles',
'taskPriority',
'dialogId',
]),
projectName() {
@ -1111,6 +1112,9 @@ export default {
this.msgRecord = {};
this.msgFile = [];
this.msgText = "";
if (this.dialogId > 0) {
this.$store.dispatch("openTask", 0);
}
this.$store.dispatch('openDialog', data.dialog_id)
} else {
this.sendDialogMsg();

View File

@ -157,6 +157,7 @@ body.dark-mode-reverse {
.dialog-wrapper {
.dialog-nav {
.nav-wrapper {
.dialog-block {
.dialog-avatar {
.icon-avatar {
@ -175,6 +176,7 @@ body.dark-mode-reverse {
}
}
}
}
.dialog-scroller {
.dialog-item {
.dialog-view {

View File

@ -18,6 +18,9 @@
}
.dialog-nav {
width: 100%;
.nav-wrapper {
display: flex;
align-items: center;
padding: 0 22px;
@ -190,6 +193,7 @@
display: none;
}
}
}
.dialog-scroller {
flex: 1;
@ -1038,11 +1042,12 @@
@media (max-width: 768px) {
.dialog-wrapper {
background-color: #f8f8f8;
.dialog-nav {
.nav-wrapper {
height: 52px;
padding: 0;
justify-content: center;
background-color: #f8f8f8;
&.completed {
&:after {
@ -1110,11 +1115,13 @@
}
}
}
}
.dialog-scroller {
padding-right: 14px;
padding-left: 14px;
overscroll-behavior: none;
user-select: none;
background-color: #ffffff;
.dialog-item {
.dialog-view {

View File

@ -64,22 +64,8 @@
}
}
.dialog-nav {
.nav-wrapper {
padding: 0 20px;
}
}
@media (max-width: 768px) {
.project-dialog {
.dialog-user {
margin-top: 16px;
padding: 0 12px;
.member-list {
display: none;
}
}
.dialog-nav {
padding: 0 12px;
height: 64px;
}
}
}

View File

@ -18,18 +18,6 @@
}
}
@media (max-width: 768px) {
.page-project {
.project-dialog {
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
max-width: none;
}
}
}
@media (max-height: 700px) {
.page-project {
.project-panel {