Introducing new features. 优化视频消息和语音消息

This commit is contained in:
aeizzz 2023-03-03 10:36:07 +08:00
parent 83730dec1c
commit 606f918cf7
6 changed files with 32 additions and 17 deletions

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1677809803390" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2360" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M891.2 326.4l-121.6 69.6v-144c0-33.6-27.2-60.8-60.8-60.8h-560c-33.6 0-60.8 27.2-60.8 60.8v545.6c0 33.6 27.2 60.8 60.8 60.8h560.8c33.6 0 60.8-27.2 60.8-60.8v-144l121.6 69.6c20 12 45.6-3.2 45.6-26.4v-344c-0.8-23.2-25.6-37.6-46.4-26.4z m-188.8 464H156V260h545.6v530.4z m166.4-157.6L770.4 576V475.2l98.4-56.8v214.4z" p-id="2361"></path><path d="M426.4 600c-0.8 0.8-1.6 1.6-1.6 2.4-5.6 8-10.4 16.8-16.8 24.8-7.2 10.4-16 20.8-25.6 29.6-8 7.2-16.8 13.6-27.2 17.6-6.4 2.4-13.6 3.2-20.8 2.4-6.4-0.8-12-4-16.8-8.8-6.4-5.6-11.2-12.8-15.2-20.8-3.2-6.4-7.2-13.6-9.6-20-3.2-8-7.2-16.8-9.6-25.6-3.2-10.4-6.4-20-9.6-30.4-3.2-10.4-5.6-21.6-8-32-2.4-8.8-4-17.6-5.6-26.4-1.6-8-2.4-16-4-24-0.8-6.4-1.6-13.6-2.4-20 0-2.4 0-4-0.8-6.4-0.8-12-0.8-24 0-35.2 0.8-9.6 2.4-18.4 6.4-27.2s9.6-16 18.4-20.8c7.2-4 14.4-4.8 21.6-3.2 8.8 1.6 16.8 5.6 24.8 11.2 8.8 6.4 16 13.6 23.2 20.8 8 8.8 15.2 17.6 22.4 27.2 8 10.4 15.2 21.6 22.4 32.8 9.6 15.2 18.4 30.4 28 45.6 2.4 3.2 4 6.4 5.6 10.4 0 0.8 0.8 0.8 0.8 1.6 2.4-4 4.8-7.2 7.2-11.2 10.4-17.6 21.6-35.2 33.6-52.8 10.4-15.2 20.8-30.4 32.8-44.8 8-9.6 16-18.4 25.6-25.6 7.2-5.6 14.4-10.4 23.2-12.8 12-4 23.2-2.4 33.6 6.4 5.6 4.8 9.6 10.4 12 16.8 3.2 8 4.8 16 6.4 24 1.6 12 0.8 23.2 0 35.2-0.8 7.2-0.8 13.6-2.4 20.8-1.6 12-3.2 23.2-5.6 35.2-1.6 8-3.2 16.8-5.6 24.8l-7.2 28.8c-2.4 8.8-5.6 18.4-8.8 27.2-4 12.8-9.6 25.6-15.2 37.6-4 8-8 16-12.8 23.2-4 5.6-8.8 10.4-14.4 14.4-6.4 4.8-14.4 5.6-22.4 4.8-12-1.6-21.6-7.2-31.2-14.4-11.2-8.8-20.8-20-29.6-32-6.4-8.8-12.8-18.4-18.4-28 0.8-1.6 0-2.4-0.8-3.2z m139.2-156.8c-0.8-5.6-0.8-11.2-1.6-16.8l-2.4-9.6c-0.8-3.2-3.2-4-6.4-2.4-1.6 0.8-2.4 1.6-4 2.4-7.2 4.8-12.8 11.2-18.4 16.8-12.8 13.6-23.2 28.8-33.6 44-9.6 14.4-18.4 28.8-27.2 43.2-7.2 12-14.4 24-21.6 35.2-3.2 4.8-3.2 4.8 0 10.4 4.8 9.6 10.4 19.2 16.8 28.8 8 12.8 16.8 24.8 28 35.2 2.4 2.4 5.6 4.8 8.8 7.2 4 2.4 8 1.6 10.4-2.4 0-0.8 0.8-0.8 0.8-1.6 6.4-9.6 10.4-20.8 15.2-31.2l9.6-26.4c2.4-6.4 4-12.8 5.6-19.2 3.2-12.8 6.4-24.8 9.6-37.6 2.4-9.6 4-20 5.6-29.6 1.6-8 2.4-15.2 3.2-23.2 0.8-8 1.6-16 1.6-23.2z m-160 117.6c-0.8-0.8-0.8-2.4-1.6-3.2-4-6.4-7.2-12.8-11.2-19.2-8.8-14.4-17.6-29.6-26.4-44-8.8-14.4-18.4-28.8-28.8-42.4-8-11.2-16.8-21.6-27.2-31.2-3.2-3.2-6.4-5.6-9.6-8-3.2-2.4-6.4-1.6-8 2.4-0.8 1.6-1.6 3.2-1.6 4.8-0.8 4.8-1.6 10.4-1.6 15.2-0.8 10.4 0.8 21.6 1.6 32 0.8 8.8 2.4 17.6 4 27.2 1.6 10.4 4 20.8 6.4 31.2 2.4 9.6 4.8 20 7.2 29.6 3.2 10.4 6.4 20.8 9.6 32 4 12 8 23.2 13.6 34.4 2.4 4 4.8 8.8 7.2 12.8 1.6 3.2 5.6 4.8 9.6 2.4 3.2-2.4 7.2-4.8 10.4-8 10.4-9.6 18.4-20 25.6-32 5.6-8 10.4-16 15.2-24.8 1.6-2.4 3.2-6.4 5.6-11.2z" p-id="2362"></path></svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1677809829053" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3364" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M873.066667 533.333333h-39.466667c-4.202667 0-8.256 0.576-12.266667 1.237334V433.066667C821.333333 264.853333 682.56 128 512 128S202.666667 264.853333 202.666667 433.066667v101.504A75.434667 75.434667 0 0 0 190.378667 533.333333H150.954667A76.373333 76.373333 0 0 0 74.666667 609.6v210.133333A76.373333 76.373333 0 0 0 150.954667 896h39.445333a76.373333 76.373333 0 0 0 76.288-76.266667V433.066667C266.666667 300.138667 376.725333 192 512 192s245.333333 108.138667 245.333333 241.066667v386.666666A76.352 76.352 0 0 0 833.6 896h39.466667a76.352 76.352 0 0 0 76.266666-76.266667v-210.133333A76.373333 76.373333 0 0 0 873.066667 533.333333zM202.666667 714.666667v105.066666a12.288 12.288 0 0 1-12.288 12.266667H150.954667a12.288 12.288 0 0 1-12.288-12.266667v-210.133333c0-6.762667 5.504-12.266667 12.288-12.266667h39.445333c6.762667 0 12.266667 5.504 12.266667 12.266667V714.666667z m682.666666 105.066666a12.288 12.288 0 0 1-12.266666 12.266667h-39.466667a12.288 12.288 0 0 1-12.266667-12.266667v-210.133333c0-6.762667 5.504-12.266667 12.266667-12.266667h39.466667c6.762667 0 12.266667 5.504 12.266666 12.266667v210.133333z" fill="#232323" p-id="3365"></path><path d="M682.666667 578.666667h-85.333334c-12.394667 0-23.658667 7.168-28.949333 18.368l-9.472 20.138666-52.501333-125.546666c-5.056-12.074667-17.642667-19.477333-30.101334-19.648a32.021333 32.021333 0 0 0-29.376 20.736l-32.362666 85.930666H341.333333a32 32 0 1 0 0 64h95.381334a32 32 0 0 0 29.952-20.736l11.776-31.274666 49.216 117.696c4.885333 11.669333 16.170667 19.349333 28.821333 19.648h0.704a32 32 0 0 0 28.949333-18.368l31.530667-66.965334H682.666667a32 32 0 0 0 0-63.978666z" fill="#232323" p-id="3366"></path></svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -81,7 +81,10 @@ const handleUploadSuccess = (response, file, fileList) => {
emit("success",response, file, fileList)
}
const submit = () => {
fileUpload.value.submit()
return new Promise(resolve => {
fileUpload.value.submit()
resolve('')
})
}
defineExpose({

View File

@ -1,6 +1,6 @@
<template>
<el-dialog title="选择图文" v-model="visible"
:close-on-click-modal="false" draggable>
:close-on-click-modal="false" draggable width="80%">
<div v-if="objData.type === 'image'">
<div class="waterfall" v-loading="state.loading">
<div class="waterfall-item" v-for="item in state.dataList" :key="item.mediaId">
@ -80,11 +80,7 @@
class-name="small-padding fixed-width"
>
<template v-slot="scope">
<el-button
icon="el-icon-circle-plus"
@click="selectMaterial(scope.row)"
>选择</el-button
>
<el-button @click="selectMaterial(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
@ -159,6 +155,7 @@ const openDialog = (data: any) => {
state.queryForm.type = data.type
state.queryForm.appId = data.accountId
objData.type = data.type
objData.accountId = data.accountId
visible.value = true
getDataList()
}

View File

@ -42,16 +42,14 @@
<a target="_blank" :href="item.repUrl"><img :src="item.repUrl" style="width: 100px"></a>
</div>
<div v-if="item.repType === 'voice'">
{{item}}
<!-- <WxVoicePlayer :obj-data="item"></WxVoicePlayer>-->
<img :src="WxVoice" style="width: 100px" @click="loadVideo(item)">
<el-button link @click="loadVideo(item)"></el-button>
</div>
<div v-if="item.repType === 'video'" style="text-align: center">
{{item}}
<!-- <WxVideoPlayer :obj-data="item"></WxVideoPlayer>-->
<img :src="WxVideo" style="width: 100px" @click="loadVideo(item)">
</div>
<div v-if="item.repType === 'shortvideo'" style="text-align: center">
{{item}}
<!-- <WxVideoPlayer :obj-data="item"></WxVideoPlayer>-->
<img :src="WxVideo" style="width: 100px" @click="loadVideo(item)">
</div>
<div v-if="item.repType === 'location'">
<el-link
@ -99,12 +97,16 @@
<script setup lang="ts" name="wx-msg">
import { fetchList,addObj } from '/@/api/mp/wx-fans-msg'
import {useMessage} from "/@/hooks/message";
import WxVideo from '/@/assets/icon/wx-video.svg'
import WxVoice from '/@/assets/icon/wx-voice.svg'
import {getMaterialVideo} from "/@/api/mp/wx-material";
const WxReply = defineAsyncComponent(() => import("../wx-reply/index.vue"))
const WxNews = defineAsyncComponent(() => import("../wx-news/index.vue"))
const NameAvatar = defineAsyncComponent(() => import("/@/components/NameAvatar/index.vue"))
const visible = ref(false)
// loading
@ -181,6 +183,17 @@ const getData = () => {
})
}
const loadVideo = (item) => {
getMaterialVideo({
mediaId: item.repMediaId,
appId: item.appId
}).then(response => {
const data = response.data
window.open(data.downUrl,'target','');
})
}
const loadingMore = () => {
page.currentPage = page.currentPage + 1
getData()

View File

@ -80,7 +80,7 @@
<el-button type="primary" @click="handleAddVideo">新建</el-button>
</div>
<el-dialog title="新建视频" v-model="dialogVideoVisible">
<wx-file-upload @success="getDataList" :uploadData="uploadData" auto-upload="false" ref="uploadFileVideo" :type="['video/mp4']"></wx-file-upload>
<wx-file-upload @success="getDataList" :uploadData="uploadData" :auto-upload="false" ref="uploadFileVideo" :type="['video/mp4']"></wx-file-upload>
<el-form
ref="uploadForm"
:model="uploadData"
@ -275,9 +275,9 @@ const subVideo = () => {
if (!valid) {
return false
}
uploadFileVideo.value.submit()
}).finally(() => {
dialogVideoVisible.value = false
uploadFileVideo.value.submit().then(() => {
dialogVideoVisible.value = false
})
})
}