mp:增加【语音】【视频】的素材选择

This commit is contained in:
YunaiV 2023-01-12 16:53:13 +08:00
parent 188d880239
commit 331af28fe7
3 changed files with 78 additions and 54 deletions

View File

@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date;
@ApiModel("管理后台 - 公众号素材 Response VO") @ApiModel("管理后台 - 公众号素材 Response VO")
@Data @Data
public class MpMaterialRespVO { public class MpMaterialRespVO {
@ -39,4 +41,8 @@ public class MpMaterialRespVO {
private String title; private String title;
@ApiModelProperty(value = "视频素材的描述", example = "我是介绍", notes = "只有【永久素材】使用") @ApiModelProperty(value = "视频素材的描述", example = "我是介绍", notes = "只有【永久素材】使用")
private String introduction; private String introduction;
@ApiModelProperty(value = "创建时间", required = true)
private Date createTime;
} }

View File

@ -23,45 +23,59 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getMaterialPage"/> @pagination="getMaterialPage"/>
</div> </div>
<div v-else-if="objData.type == 'voice'"> <!-- 类型语音 -->
<!-- TODO 芋艿需要翻译 --> <div v-else-if="objData.type === 'voice'">
<!-- <avue-crud ref="crud"--> <!-- 列表 -->
<!-- :page="page"--> <el-table v-loading="loading" :data="list">
<!-- :data="tableData"--> <el-table-column label="编号" align="center" prop="mediaId" />
<!-- :table-loading="tableLoading"--> <el-table-column label="名字" align="center" prop="name" />
<!-- :option="tableOptionVoice"--> <el-table-column label="语音" align="center">
<!-- @on-load="getPage"--> <template v-slot="scope">
<!-- @size-change="sizeChange"--> <wx-voice-player :url="scope.row.url" />
<!-- @refresh-change="refreshChange">--> </template>
<!-- <template slot-scope="scope"--> </el-table-column>
<!-- slot="menu">--> <el-table-column label="上传时间" align="center" prop="createTime" width="180">
<!-- <el-button type="text"--> <template v-slot="scope">
<!-- icon="el-icon-circle-plus"--> <span>{{ parseTime(scope.row.createTime) }}</span>
<!-- size="small"--> </template>
<!-- plain--> </el-table-column>
<!-- @click="selectMaterial(scope.row)">选择</el-button>--> <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<!-- </template>--> <template v-slot="scope">
<!-- </avue-crud>--> <el-button size="mini" type="text" icon="el-icon-circle-plus"
@click="selectMaterial(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getMaterialPage"/>
</div> </div>
<div v-else-if="objData.type == 'video'"> <div v-else-if="objData.type === 'video'">
<!-- TODO 芋艿需要翻译 --> <!-- 列表 -->
<!-- <avue-crud ref="crud"--> <el-table v-loading="loading" :data="list">
<!-- :page="page"--> <el-table-column label="编号" align="center" prop="mediaId" />
<!-- :data="tableData"--> <el-table-column label="标题" align="center" prop="title" />
<!-- :table-loading="tableLoading"--> <el-table-column label="介绍" align="center" prop="introduction" />
<!-- :option="tableOptionVideo"--> <el-table-column label="视频" align="center">
<!-- @on-load="getPage"--> <template v-slot="scope">
<!-- @size-change="sizeChange"--> <wx-video-player :url="scope.row.url" />
<!-- @refresh-change="refreshChange">--> </template>
<!-- <template slot-scope="scope"--> </el-table-column>
<!-- slot="menu">--> <el-table-column label="上传时间" align="center" prop="createTime" width="180">
<!-- <el-button type="text"--> <template v-slot="scope">
<!-- icon="el-icon-circle-plus"--> <span>{{ parseTime(scope.row.createTime) }}</span>
<!-- size="small"--> </template>
<!-- plain--> </el-table-column>
<!-- @click="selectMaterial(scope.row)">选择</el-button>--> <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<!-- </template>--> <template v-slot="scope">
<!-- </avue-crud>--> <el-button size="mini" type="text" icon="el-icon-circle-plus"
@click="selectMaterial(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getMaterialPage"/>
</div> </div>
<div v-else-if="objData.type == 'news'"> <div v-else-if="objData.type == 'news'">
<div class="waterfall" v-loading="loading"> <div class="waterfall" v-loading="loading">
@ -95,6 +109,8 @@
// import { tableOptionVoice } from '@/const/crud/wxmp/wxmaterial_voice' // import { tableOptionVoice } from '@/const/crud/wxmp/wxmaterial_voice'
// import { tableOptionVideo } from '@/const/crud/wxmp/wxmaterial_video' // import { tableOptionVideo } from '@/const/crud/wxmp/wxmaterial_video'
import WxNews from '@/views/mp/components/wx-news/main.vue'; import WxNews from '@/views/mp/components/wx-news/main.vue';
import WxVoicePlayer from '@/views/mp/components/wx-voice-play/main.vue';
import WxVideoPlayer from '@/views/mp/components/wx-video-play/main.vue';
import { getMaterialPage } from "@/api/mp/material"; import { getMaterialPage } from "@/api/mp/material";
// import {getPage as getPageNews} from '@/api/wxmp/wxfreepublish' // import {getPage as getPageNews} from '@/api/wxmp/wxfreepublish'
// import {getPage as getPageNewsDraft} from '@/api/wxmp/wxdraft' // import {getPage as getPageNewsDraft} from '@/api/wxmp/wxdraft'
@ -102,7 +118,9 @@
export default { export default {
name: "wxMaterialSelect", name: "wxMaterialSelect",
components: { components: {
WxNews WxNews,
WxVoicePlayer,
WxVideoPlayer
}, },
props: { props: {
objData: { objData: {

View File

@ -19,7 +19,7 @@
<!-- 情况一已经选择好素材或者上传好图片 --> <!-- 情况一已经选择好素材或者上传好图片 -->
<div class="select-item" v-if="objData.url"> <div class="select-item" v-if="objData.url">
<img class="material-img" :src="objData.url"> <img class="material-img" :src="objData.url">
<p class="item-name" v-if="objData.repName">{{objData.repName}}</p> <!-- TODO 芋艿永久素材name 字段 --> <p class="item-name" v-if="objData.name">{{objData.name}}</p>
<el-row class="ope-row"> <el-row class="ope-row">
<el-button type="danger" icon="el-icon-delete" circle @click="deleteObj"></el-button> <el-button type="danger" icon="el-icon-delete" circle @click="deleteObj"></el-button>
</el-row> </el-row>
@ -54,7 +54,7 @@
<span slot="label"><i class="el-icon-phone"></i> 语音</span> <span slot="label"><i class="el-icon-phone"></i> 语音</span>
<el-row> <el-row>
<div class="select-item2" v-if="objData.url"> <div class="select-item2" v-if="objData.url">
<p class="item-name">{{objData.repName}}</p> <!-- TODO 芋艿永久素材name 字段 --> <p class="item-name">{{objData.name}}</p>
<div class="item-infos"> <div class="item-infos">
<wx-voice-player :url="objData.url" /> <wx-voice-player :url="objData.url" />
</div> </div>
@ -315,22 +315,17 @@
this.objData.content = tempObjItem.content ? tempObjItem.content : null this.objData.content = tempObjItem.content ? tempObjItem.content : null
this.objData.mediaId = tempObjItem.mediaId ? tempObjItem.mediaId : null this.objData.mediaId = tempObjItem.mediaId ? tempObjItem.mediaId : null
this.objData.url = tempObjItem.url ? tempObjItem.url : null this.objData.url = tempObjItem.url ? tempObjItem.url : null
this.objData.name = tempObjItem.url ? tempObjItem.name : null
// TODO // TODO
// this.objData.repName = tempObjItem.repName ? tempObjItem.repName : null
// this.objData.repMediaId = tempObjItem.repMediaId ? tempObjItem.repMediaId : null
// this.objData.repDesc = tempObjItem.repDesc ? tempObjItem.repDesc : null // this.objData.repDesc = tempObjItem.repDesc ? tempObjItem.repDesc : null
return; return;
} }
// objData // objData
this.objData.content = undefined;
this.objData.mediaId = undefined; this.objData.mediaId = undefined;
this.objData.url = undefined; this.objData.url = undefined;
this.objData.content = undefined; this.objData.name = undefined;
// this.$delete(this.objData,'repName')
// this.$delete(this.objData,'repMediaId')
// this.$delete(this.objData,'mediaId')
// this.$delete(this.objData,'url')
// this.$delete(this.objData,'content') // TODO
// this.$delete(this.objData,'repDesc') // this.$delete(this.objData,'repDesc')
}, },
/** /**
@ -357,12 +352,16 @@
tempObjItem.hqMusicUrl = this.objData.hqMusicUrl tempObjItem.hqMusicUrl = this.objData.hqMusicUrl
} else if (this.objData.type === 'image' } else if (this.objData.type === 'image'
|| this.objData.type === 'voice') { || this.objData.type === 'voice') {
tempObjItem.mediaId = item.mediaId; tempObjItem.mediaId = item.mediaId
this.objData.mediaId = item.mediaId this.objData.mediaId = item.mediaId
tempObjItem.url = item.url; if (item.url) {
this.objData.url = item.url tempObjItem.url = item.url;
// tempObjItem.repName = item.name this.objData.url = item.url;
// this.objData.repName = item.name } else { // 使 $delete vue
this.$delete(this.objData, 'url');
}
tempObjItem.name = item.name
this.objData.name = item.name
} else if (this.objData.type === 'video') { } else if (this.objData.type === 'video') {
// getMaterialVideo({ // getMaterialVideo({
// mediaId:item.mediaId // mediaId:item.mediaId
@ -401,6 +400,7 @@
this.dialogThumbVisible = false this.dialogThumbVisible = false
}, },
deleteObj() { deleteObj() {
console.log('删除!');
if (this.objData.type === 'news') { if (this.objData.type === 'news') {
// TODO // TODO
} else if(this.objData.type === 'image' } else if(this.objData.type === 'image'