|
@@ -29,8 +29,20 @@
|
|
/>
|
|
/>
|
|
</template>
|
|
</template>
|
|
<template v-else-if="item.message_type === messageItem[2].message_type">
|
|
<template v-else-if="item.message_type === messageItem[2].message_type">
|
|
- <video :src="item._file_url"></video>
|
|
|
|
|
|
+ <div class="avatar">T</div>
|
|
|
|
+ <VideoShow
|
|
|
|
+ :file-id="item.file_id"
|
|
|
|
+ :stop-play="stopPlay"
|
|
|
|
+ @pauseOtherAudio="pauseOtherAudio"
|
|
|
|
+ @changeStopPlay="changeStopPlay"
|
|
|
|
+ />
|
|
</template>
|
|
</template>
|
|
|
|
+ <svg-icon
|
|
|
|
+ class-name="delete"
|
|
|
|
+ class="display-none"
|
|
|
|
+ icon-class="delete-current"
|
|
|
|
+ @click="deleteMessageItem(i)"
|
|
|
|
+ />
|
|
</li>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
</template>
|
|
</template>
|
|
@@ -60,7 +72,7 @@
|
|
:key="icon"
|
|
:key="icon"
|
|
:class="['press-sound', icon]"
|
|
:class="['press-sound', icon]"
|
|
@mousedown="() => curRecord === audioAndVideo[0].type && startRecording()"
|
|
@mousedown="() => curRecord === audioAndVideo[0].type && startRecording()"
|
|
- @click="() => (curRecord === audioAndVideo[1].type ? changVisible_video(true) : '')"
|
|
|
|
|
|
+ @click="() => (curRecord === audioAndVideo[1].type ? changVisible_video(true, { fn: getVideoData }) : '')"
|
|
@mouseup="() => curRecord === audioAndVideo[0].type && closeRecording()"
|
|
@mouseup="() => curRecord === audioAndVideo[0].type && closeRecording()"
|
|
>
|
|
>
|
|
<svg-icon :icon-class="icon" class-name="button-icon" />
|
|
<svg-icon :icon-class="icon" class-name="button-icon" />
|
|
@@ -78,6 +90,7 @@ import { taskData, messageItem } from '../../data/TaskData';
|
|
import { fileUploadPrimordial } from '@/api/app.js';
|
|
import { fileUploadPrimordial } from '@/api/app.js';
|
|
|
|
|
|
import AudioShow from './AudioShow.vue';
|
|
import AudioShow from './AudioShow.vue';
|
|
|
|
+import VideoShow from './VideoShow.vue';
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
listName: {
|
|
listName: {
|
|
@@ -107,10 +120,7 @@ let curTemplateData =
|
|
|
|
|
|
let message_list = ref(curTemplateData.message_list);
|
|
let message_list = ref(curTemplateData.message_list);
|
|
|
|
|
|
-const { changVisible_video } = inject('visible_video');
|
|
|
|
-
|
|
|
|
-const { stopPlay, changeStopPlay, pauseOtherAudio } = inject('stopPlay');
|
|
|
|
-
|
|
|
|
|
|
+// 文本
|
|
let text = ref('');
|
|
let text = ref('');
|
|
function sendMessage() {
|
|
function sendMessage() {
|
|
message_list.value.push(Object.assign({}, messageItem[0], { text: text.value }));
|
|
message_list.value.push(Object.assign({}, messageItem[0], { text: text.value }));
|
|
@@ -118,6 +128,10 @@ function sendMessage() {
|
|
}
|
|
}
|
|
|
|
|
|
let { curRecord, selectRecord } = useRecordingPageData();
|
|
let { curRecord, selectRecord } = useRecordingPageData();
|
|
|
|
+
|
|
|
|
+const { stopPlay, changeStopPlay, pauseOtherAudio } = inject('stopPlay');
|
|
|
|
+
|
|
|
|
+// 录音
|
|
let { startRecording, closeRecording, isRecording, blob } = soundRecording();
|
|
let { startRecording, closeRecording, isRecording, blob } = soundRecording();
|
|
|
|
|
|
watch(blob, (newVal) => {
|
|
watch(blob, (newVal) => {
|
|
@@ -133,6 +147,18 @@ watch(blob, (newVal) => {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+// 录影
|
|
|
|
+const { changVisible_video } = inject('visible_video');
|
|
|
|
+
|
|
|
|
+function getVideoData(data) {
|
|
|
|
+ message_list.value.push(data);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 删除信息列表项
|
|
|
|
+function deleteMessageItem(i) {
|
|
|
|
+ message_list.value.splice(i, 1);
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -140,7 +166,7 @@ $tip-color: #999;
|
|
|
|
|
|
// 消息框
|
|
// 消息框
|
|
.message-box {
|
|
.message-box {
|
|
- height: 230px;
|
|
|
|
|
|
+ min-height: 230px;
|
|
padding: 16px 0;
|
|
padding: 16px 0;
|
|
background-color: #f4f4f4;
|
|
background-color: #f4f4f4;
|
|
border: 1px solid $border-color;
|
|
border: 1px solid $border-color;
|
|
@@ -156,10 +182,11 @@ $tip-color: #999;
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|
|
padding: 0 16px;
|
|
padding: 0 16px;
|
|
- overflow: auto;
|
|
|
|
|
|
|
|
&-item {
|
|
&-item {
|
|
display: flex;
|
|
display: flex;
|
|
|
|
+ column-gap: 16px;
|
|
|
|
+ align-items: center;
|
|
white-space: pre-wrap;
|
|
white-space: pre-wrap;
|
|
|
|
|
|
.text {
|
|
.text {
|
|
@@ -188,9 +215,11 @@ $tip-color: #999;
|
|
&:not(:first-child) {
|
|
&:not(:first-child) {
|
|
margin-top: 22px;
|
|
margin-top: 22px;
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
- display: flex;
|
|
|
|
- column-gap: 16px;
|
|
|
|
|
|
+ &:hover .delete {
|
|
|
|
+ display: block;
|
|
|
|
+ cursor: pointer;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|