Commit 1f1dc90c by panjiangyi
parents 15b87e11 1afba5a5
...@@ -207,7 +207,7 @@ export default class ChatList extends Vue { ...@@ -207,7 +207,7 @@ export default class ChatList extends Vue {
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.chat-list-con { .chat-list-con {
.title { .title {
padding-left: 20px; padding-left: 20px;
......
...@@ -178,7 +178,7 @@ export default class ChatRoom extends Vue { ...@@ -178,7 +178,7 @@ export default class ChatRoom extends Vue {
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.room-title { .room-title {
font-size: 16px; font-size: 16px;
padding: 0 20px; padding: 0 20px;
...@@ -270,7 +270,7 @@ export default class ChatRoom extends Vue { ...@@ -270,7 +270,7 @@ export default class ChatRoom extends Vue {
} }
} }
.chat-area { .chat-area {
$input-height: 130px; --input-height: 130px;
.chat-messages { .chat-messages {
height: calc(100% - 130px + 1px); height: calc(100% - 130px + 1px);
...@@ -278,7 +278,7 @@ export default class ChatRoom extends Vue { ...@@ -278,7 +278,7 @@ export default class ChatRoom extends Vue {
} }
.chat-input { .chat-input {
height: $input-height; height: var(--input-height);
} }
} }
.order-info-con { .order-info-con {
......
...@@ -46,7 +46,7 @@ export default class Chat extends Vue { ...@@ -46,7 +46,7 @@ export default class Chat extends Vue {
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.chat-dialog-con { .chat-dialog-con {
/deep/ .el-dialog__header { /deep/ .el-dialog__header {
display: none; display: none;
......
...@@ -3,15 +3,14 @@ ...@@ -3,15 +3,14 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Model, Vue } from "vue-property-decorator" import { Component, Model, Vue } from "vue-property-decorator";
;
import { FileType, getSvg } from "./file-controller"; import { FileType, getSvg } from "./file-controller";
@Component({ components: {} }) @Component({ components: {} })
export default class FileIcon extends Vue { export default class FileIcon extends Vue {
@Model("update") @Model("update")
private value!: FileType private value!: FileType;
private get audio() { private get audio() {
return this.value === FileType.Audio; return this.value === FileType.Audio;
...@@ -67,7 +66,7 @@ export default class FileIcon extends Vue { ...@@ -67,7 +66,7 @@ export default class FileIcon extends Vue {
} }
</script> </script>
<style lang="scss"> <style lang="less" scoped>
.file-icon { .file-icon {
margin-left: 10px; margin-left: 10px;
......
...@@ -36,10 +36,10 @@ import { Component, Model, Prop, Vue } from "vue-property-decorator"; ...@@ -36,10 +36,10 @@ import { Component, Model, Prop, Vue } from "vue-property-decorator";
@Component({ components: {} }) @Component({ components: {} })
export default class ImagePreview extends Vue { export default class ImagePreview extends Vue {
@Model("update") @Model("update")
private value!: boolean private value!: boolean;
@Prop() @Prop()
private file!: { name: string; url: string } private file!: { name: string; url: string };
private style: { private style: {
"max-height": number | string; "max-height": number | string;
...@@ -47,12 +47,11 @@ export default class ImagePreview extends Vue { ...@@ -47,12 +47,11 @@ export default class ImagePreview extends Vue {
} = { } = {
"max-height": "300px", "max-height": "300px",
"max-width": "600px", "max-width": "600px",
} };
private close() { private close() {
setTimeout( setTimeout(
() => () => (this.style = { "max-height": "300px", "max-width": "600px" }),
(this.style = { "max-height": "300px", "max-width": "600px" }),
300 300
); );
this.$emit("update", false); this.$emit("update", false);
...@@ -71,7 +70,7 @@ export default class ImagePreview extends Vue { ...@@ -71,7 +70,7 @@ export default class ImagePreview extends Vue {
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.preview-title { .preview-title {
font-size: 18px; font-size: 18px;
color: #333; color: #333;
......
...@@ -430,7 +430,7 @@ export default class Message extends Vue { ...@@ -430,7 +430,7 @@ export default class Message extends Vue {
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.message-con { .message-con {
margin: 20px 0; margin: 20px 0;
......
...@@ -37,18 +37,25 @@ ...@@ -37,18 +37,25 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Model, Prop, Ref, Vue, Watch } from "vue-property-decorator"; import {
Component,
Model,
Prop,
Ref,
Vue,
Watch,
} from "vue-property-decorator";
@Component({ components: {} }) @Component({ components: {} })
export default class VideoPreview extends Vue { export default class VideoPreview extends Vue {
@Model("update") @Model("update")
private value!: boolean private value!: boolean;
@Prop() @Prop()
private file!: { name: string; url: string } private file!: { name: string; url: string };
@Ref("video") @Ref("video")
private video!: HTMLVideoElement private video!: HTMLVideoElement;
private style: { private style: {
"max-height": number | string; "max-height": number | string;
...@@ -56,12 +63,11 @@ export default class VideoPreview extends Vue { ...@@ -56,12 +63,11 @@ export default class VideoPreview extends Vue {
} = { } = {
"max-height": "800px", "max-height": "800px",
"max-width": "800px", "max-width": "800px",
} };
private close() { private close() {
setTimeout( setTimeout(
() => () => (this.style = { "max-height": "300px", "max-width": "600px" }),
(this.style = { "max-height": "300px", "max-width": "600px" }),
300 300
); );
this.$emit("update", false); this.$emit("update", false);
...@@ -90,7 +96,7 @@ export default class VideoPreview extends Vue { ...@@ -90,7 +96,7 @@ export default class VideoPreview extends Vue {
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.preview-title { .preview-title {
font-size: 18px; font-size: 18px;
color: #333; color: #333;
......
...@@ -138,7 +138,7 @@ export default class WhoReadList extends Vue { ...@@ -138,7 +138,7 @@ export default class WhoReadList extends Vue {
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.who-read-list { .who-read-list {
::before { ::before {
content: ""; content: "";
......
...@@ -88,4 +88,4 @@ export default class ChatCreator extends Vue { ...@@ -88,4 +88,4 @@ export default class ChatCreator extends Vue {
} }
} }
</script> </script>
<style lang="scss" scoped></style> <style lang="less" scoped></style>
...@@ -512,7 +512,7 @@ export default class Input extends Vue { ...@@ -512,7 +512,7 @@ export default class Input extends Vue {
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.input-wrap { .input-wrap {
position: relative; position: relative;
padding-left: 20px; padding-left: 20px;
......
...@@ -14,9 +14,7 @@ ...@@ -14,9 +14,7 @@
<div :key="item.id" class="message-template"> <div :key="item.id" class="message-template">
<div <div
v-if=" v-if="
item.id > 0 && item.id > 0 && messageTimestampDictionary[item.id] && item.msg
messageTimestampDictionary[item.id] &&
item.msg
" "
class="text-center text-hint timestamp" class="text-center text-hint timestamp"
> >
...@@ -35,10 +33,7 @@ ...@@ -35,10 +33,7 @@
</el-scrollbar> </el-scrollbar>
<image-preview v-model="preview" :file="imagePreview"></image-preview> <image-preview v-model="preview" :file="imagePreview"></image-preview>
<video-preview <video-preview v-model="previewVideo" :file="videoPreview"></video-preview>
v-model="previewVideo"
:file="videoPreview"
></video-preview>
</div> </div>
</template> </template>
...@@ -57,34 +52,34 @@ import { ChatStore, chatStore } from "@/customer-service/store/model"; ...@@ -57,34 +52,34 @@ import { ChatStore, chatStore } from "@/customer-service/store/model";
@Component({ components: { message, ImagePreview, VideoPreview } }) @Component({ components: { message, ImagePreview, VideoPreview } })
export default class MessageList extends Vue { export default class MessageList extends Vue {
@chatStore.Getter(ChatStore.STATE_CHAT_MSG_HISTORY) @chatStore.Getter(ChatStore.STATE_CHAT_MSG_HISTORY)
private readonly historyMessage!: ChatStore.STATE_CHAT_MSG_HISTORY private readonly historyMessage!: ChatStore.STATE_CHAT_MSG_HISTORY;
@chatStore.Getter(ChatStore.STATE_CHAT_SENDING_MESSAGES) @chatStore.Getter(ChatStore.STATE_CHAT_SENDING_MESSAGES)
private readonly sendingMessages!: ChatStore.STATE_CHAT_SENDING_MESSAGES private readonly sendingMessages!: ChatStore.STATE_CHAT_SENDING_MESSAGES;
@chatStore.State(ChatStore.STATE_CHAT_CURRENT_CHAT_ID) @chatStore.State(ChatStore.STATE_CHAT_CURRENT_CHAT_ID)
private readonly chatId!: ChatStore.STATE_CHAT_CURRENT_CHAT_ID private readonly chatId!: ChatStore.STATE_CHAT_CURRENT_CHAT_ID;
@chatStore.State(ChatStore.STATE_CURRENT_CHAT_INITING) @chatStore.State(ChatStore.STATE_CURRENT_CHAT_INITING)
private readonly chatIniting!: ChatStore.STATE_CURRENT_CHAT_INITING private readonly chatIniting!: ChatStore.STATE_CURRENT_CHAT_INITING;
@chatStore.Action(ChatStore.ACTION_GET_CHAT_MESSAGES_BEFORE_SPECIFIC_ID) @chatStore.Action(ChatStore.ACTION_GET_CHAT_MESSAGES_BEFORE_SPECIFIC_ID)
private readonly getLastPageMsg!: ChatStore.ACTION_GET_CHAT_MESSAGES_BEFORE_SPECIFIC_ID private readonly getLastPageMsg!: ChatStore.ACTION_GET_CHAT_MESSAGES_BEFORE_SPECIFIC_ID;
@chatStore.Action(ChatStore.ACTION_GET_CHAT_MESSAGES_AFTER_SPECIFIC_ID) @chatStore.Action(ChatStore.ACTION_GET_CHAT_MESSAGES_AFTER_SPECIFIC_ID)
private readonly getNextPageMsg!: ChatStore.ACTION_GET_CHAT_MESSAGES_AFTER_SPECIFIC_ID private readonly getNextPageMsg!: ChatStore.ACTION_GET_CHAT_MESSAGES_AFTER_SPECIFIC_ID;
@chatStore.Action(ChatStore.ACTION_CLEAR_CURRENT_CHAT_DATA) @chatStore.Action(ChatStore.ACTION_CLEAR_CURRENT_CHAT_DATA)
private readonly clearChatId!: ChatStore.ACTION_CLEAR_CURRENT_CHAT_DATA private readonly clearChatId!: ChatStore.ACTION_CLEAR_CURRENT_CHAT_DATA;
@chatStore.Mutation(ChatStore.MUTATION_SAVE_FUNC_SCROLL_TO_BOTTOM) @chatStore.Mutation(ChatStore.MUTATION_SAVE_FUNC_SCROLL_TO_BOTTOM)
private readonly saveScrollToBottomFunc!: ChatStore.MUTATION_SAVE_FUNC_SCROLL_TO_BOTTOM private readonly saveScrollToBottomFunc!: ChatStore.MUTATION_SAVE_FUNC_SCROLL_TO_BOTTOM;
@chatStore.Mutation(ChatStore.MUTATION_CLEAR_FUNC_SCROLL_TO_BOTTOM) @chatStore.Mutation(ChatStore.MUTATION_CLEAR_FUNC_SCROLL_TO_BOTTOM)
private readonly clearScrollToBottomFunc!: ChatStore.MUTATION_CLEAR_FUNC_SCROLL_TO_BOTTOM private readonly clearScrollToBottomFunc!: ChatStore.MUTATION_CLEAR_FUNC_SCROLL_TO_BOTTOM;
@Prop({ default: "circle" }) @Prop({ default: "circle" })
private shape!: string private shape!: string;
private get messages() { private get messages() {
if (this.historyMessage) { if (this.historyMessage) {
...@@ -104,20 +99,20 @@ export default class MessageList extends Vue { ...@@ -104,20 +99,20 @@ export default class MessageList extends Vue {
} }
// 添加时间戳的最大间隔消息数 // 添加时间戳的最大间隔消息数
private readonly timeLimit = 48 private readonly timeLimit = 48;
private scroll2EndWhenMessageLoaded = false private scroll2EndWhenMessageLoaded = false;
private preview = false private preview = false;
private imagePreview = {} private imagePreview = {};
private previewVideo = false private previewVideo = false;
private videoPreview = {} private videoPreview = {};
@Ref("message-scrollbar") @Ref("message-scrollbar")
private scollbarElement!: Vue & { private scollbarElement!: Vue & {
update: () => void; update: () => void;
} };
private get scollWrapper(): HTMLElement | null { private get scollWrapper(): HTMLElement | null {
return this.scollbarElement?.$el?.firstChild as HTMLElement; return this.scollbarElement?.$el?.firstChild as HTMLElement;
...@@ -168,9 +163,9 @@ export default class MessageList extends Vue { ...@@ -168,9 +163,9 @@ export default class MessageList extends Vue {
return dic; return dic;
} }
private loading = false private loading = false;
private loadingOld = false private loadingOld = false;
private loadingNew = false private loadingNew = false;
public created() { public created() {
this.handleScrollWrapper(); this.handleScrollWrapper();
...@@ -234,7 +229,7 @@ export default class MessageList extends Vue { ...@@ -234,7 +229,7 @@ export default class MessageList extends Vue {
this.loadingNew = false; this.loadingNew = false;
} }
private handleScroll!: () => void private handleScroll!: () => void;
private handleScrollWrapper() { private handleScrollWrapper() {
let oldScrollTop = 0; let oldScrollTop = 0;
this.handleScroll = () => { this.handleScroll = () => {
...@@ -353,7 +348,7 @@ export default class MessageList extends Vue { ...@@ -353,7 +348,7 @@ export default class MessageList extends Vue {
} }
</script> </script>
<style lang="scss" scoped> <style lang="less" scoped>
.message-list { .message-list {
padding: 0 20px; padding: 0 20px;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment