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

View File

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

View File

@ -1,5 +1,5 @@
<template> <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"> <template slot="head">
<div class="dialog-user"> <div class="dialog-user">
<div class="member-head"> <div class="member-head">
@ -14,7 +14,7 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="dialog-nav"> <div class="nav-wrapper">
<div class="dialog-title"> <div class="dialog-title">
<h2>{{$L('群聊')}}</h2> <h2>{{$L('群聊')}}</h2>
</div> </div>

View File

@ -44,7 +44,7 @@
</div> </div>
</Tooltip> </Tooltip>
</li> </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" /> <Icon class="menu-icon" type="ios-chatbubbles" />
<Badge class="menu-badge" :count="msgUnread"></Badge> <Badge class="menu-badge" :count="msgUnread"></Badge>
</li> </li>
@ -1420,6 +1420,11 @@ export default {
toggleParameter(data) { toggleParameter(data) {
if (data === 'completedTask') { if (data === 'completedTask') {
this.$store.dispatch("forgetTaskCompleteTemp", true); 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); this.$store.dispatch('toggleProjectParameter', data);
}, },

View File

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

View File

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

View File

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

View File

@ -64,22 +64,8 @@
} }
} }
.dialog-nav { .dialog-nav {
.nav-wrapper {
padding: 0 20px; 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) { @media (max-height: 700px) {
.page-project { .page-project {
.project-panel { .project-panel {