mp:支持 wx-reply 发送音乐消息

This commit is contained in:
YunaiV 2023-01-12 09:06:25 +08:00
parent 90e0ebc20f
commit 32f152cc27

View File

@ -111,7 +111,7 @@
<div v-if="!objData.content"> <div v-if="!objData.content">
<el-row style="text-align: center"> <el-row style="text-align: center">
<el-col :span="24" class="col-select2"> <el-col :span="24" class="col-select2">
<el-button type="success" @click="openMaterial">{{newsType == '1' ? '选择已发布图文' : '选择草稿箱图文'}}<i class="el-icon-circle-check el-icon--right"></i></el-button> <el-button type="success" @click="openMaterial">{{newsType === '1' ? '选择已发布图文' : '选择草稿箱图文'}}<i class="el-icon-circle-check el-icon--right"></i></el-button>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@ -125,18 +125,11 @@
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<div class="thumb-div"> <div class="thumb-div">
<img style="width: 100px" v-if="objData.repThumbUrl" :src="objData.repThumbUrl"> <img style="width: 100px" v-if="objData.thumbMediaUrl" :src="objData.thumbMediaUrl">
<i v-else class="el-icon-plus avatar-uploader-icon"></i> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
<div class="thumb-but"> <div class="thumb-but">
<el-upload <el-upload :action="actionUrl" :headers="headers" multiple :limit="1" :file-list="fileList" :data="uploadData"
:action="actionUrl" :before-upload="beforeThumbImageUpload" :on-success="handleUploadSuccess">
:headers="headers"
multiple
:limit="1"
:on-success="handleUploadSuccess"
:file-list="fileList"
:before-upload="beforeThumbImageUpload"
:data="uploadData">
<el-button slot="trigger" size="mini" type="text">本地上传</el-button> <el-button slot="trigger" size="mini" type="text">本地上传</el-button>
<el-button size="mini" type="text" @click="openMaterial" style="margin-left: 5px">素材库选择</el-button> <el-button size="mini" type="text" @click="openMaterial" style="margin-left: 5px">素材库选择</el-button>
</el-upload> </el-upload>
@ -147,15 +140,15 @@
</el-dialog> </el-dialog>
</el-col> </el-col>
<el-col :span="18"> <el-col :span="18">
<el-input v-model="objData.repName" placeholder="请输入标题"></el-input> <el-input v-model="objData.title" placeholder="请输入标题" @input="inputContent" />
<div style="margin: 20px 0;"></div> <div style="margin: 20px 0;"></div>
<el-input v-model="objData.repDesc" placeholder="请输入描述"></el-input> <el-input v-model="objData.description" placeholder="请输入描述" @input="inputContent" />
</el-col> </el-col>
</el-row> </el-row>
<div style="margin: 20px 0;"></div> <div style="margin: 20px 0;"></div>
<el-input v-model="objData.url" placeholder="请输入音乐链接"></el-input> <el-input v-model="objData.musicUrl" placeholder="请输入音乐链接"></el-input>
<div style="margin: 20px 0;"></div> <div style="margin: 20px 0;"></div>
<el-input v-model="objData.repHqUrl" placeholder="请输入高质量音乐链接"></el-input> <el-input v-model="objData.hqMusicUrl" placeholder="请输入高质量音乐链接"></el-input>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</template> </template>
@ -165,7 +158,7 @@
import WxNews from '@/views/mp/components/wx-news/main.vue' import WxNews from '@/views/mp/components/wx-news/main.vue'
// import WxMaterialSelect from '@/components/wx-material-select/main.vue' // import WxMaterialSelect from '@/components/wx-material-select/main.vue'
import WxVoicePlayer from '@/views/mp/components/wx-voice-play/main.vue'; import WxVoicePlayer from '@/views/mp/components/wx-voice-play/main.vue';
import {getAccessToken, getToken} from '@/utils/auth' import {getAccessToken} from '@/utils/auth'
export default { export default {
name: "wxReplySelect", name: "wxReplySelect",
@ -349,30 +342,26 @@
// tempObjItem // tempObjItem
let tempObjItem = {} let tempObjItem = {}
tempObjItem.type = this.objData.type;
// tempObjItem.repMediaId = item.mediaId // TODO if (this.objData.type === 'music') { //
// tempObjItem.content = item.content // TODO tempObjItem.thumbMediaId = item.mediaId
this.objData.thumbMediaId = item.mediaId
// this.objData.repMediaId = item.mediaId tempObjItem.thumbMediaUrl = item.url
this.objData.mediaId = item.mediaId this.objData.thumbMediaUrl = item.url
this.objData.content = item.content // titleintroductionmusicUrlhqMusicUrl
if (this.objData.type === 'music') { tempObjItem.title = this.objData.title
tempObjItem.repThumbMediaId = item.mediaId tempObjItem.introduction = this.objData.introduction
tempObjItem.repThumbUrl = item.url tempObjItem.musicUrl = this.objData.musicUrl
this.objData.repThumbMediaId = item.mediaId tempObjItem.hqMusicUrl = this.objData.hqMusicUrl
this.objData.repThumbUrl = item.url } else if (this.objData.type === 'image'
this.dialogThumbVisible = false // TODO || this.objData.type === 'voice') {
} else{
tempObjItem.type = this.objData.type;
tempObjItem.mediaId = item.mediaId; tempObjItem.mediaId = item.mediaId;
tempObjItem.url = item.url;
// tempObjItem.repName = item.name
// tempObjItem.url = item.url
// this.objData.repName = item.name
this.objData.mediaId = item.mediaId this.objData.mediaId = item.mediaId
tempObjItem.url = item.url;
this.objData.url = item.url this.objData.url = item.url
} // tempObjItem.repName = item.name
if(this.objData.type == 'video'){ // this.objData.repName = item.name
} else if (this.objData.type === 'video') {
// getMaterialVideo({ // getMaterialVideo({
// mediaId:item.mediaId // mediaId:item.mediaId
// }).then(response => { // }).then(response => {
@ -407,6 +396,7 @@
this.dialogImageVisible = false this.dialogImageVisible = false
this.dialogVoiceVisible = false this.dialogVoiceVisible = false
this.dialogVideoVisible = false this.dialogVideoVisible = false
this.dialogThumbVisible = false
}, },
deleteObj() { deleteObj() {
if (this.objData.type === 'news') { if (this.objData.type === 'news') {
@ -417,8 +407,6 @@
this.$delete(this.objData, 'mediaId') this.$delete(this.objData, 'mediaId')
} else if(this.objData.type === 'video') { } else if(this.objData.type === 'video') {
// TODO // TODO
} else if(this.objData.type === 'music') {
// TODO
} }
}, },
getPage(page, params) { getPage(page, params) {