mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-25 08:41:52 +08:00
mp:修复 WxMaterialSelect 组件的音乐 tab,无法选择图片素材报错
This commit is contained in:
parent
0499226c3d
commit
3654afedcc
@ -137,7 +137,7 @@
|
||||
</el-row>
|
||||
</div>
|
||||
<el-dialog title="选择图文" :visible.sync="dialogNewsVisible" width="90%" append-to-body>
|
||||
<WxMaterialSelect :objData="objData" @selectMaterial="selectMaterial" :newsType="newsType"></WxMaterialSelect>
|
||||
<wx-material-select :objData="objData" @selectMaterial="selectMaterial" :newsType="newsType" />
|
||||
</el-dialog>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
@ -158,7 +158,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog title="选择图片" :visible.sync="dialogThumbVisible" width="80%" append-to-body>
|
||||
<wx-material-select :objData="{type:'image'}" @selectMaterial="selectMaterial" />
|
||||
<wx-material-select :objData="{type:'image', accountId: objData.accountId}" @selectMaterial="selectMaterial" />
|
||||
</el-dialog>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
@ -176,13 +176,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { getPage, getMaterialVideo } from '@/api/wxmp/wxmaterial'
|
||||
import {getAccessToken} from '@/utils/auth'
|
||||
import WxNews from '@/views/mp/components/wx-news/main.vue'
|
||||
import WxMaterialSelect from '@/views/mp/components/wx-material-select/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 { getAccessToken } from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
name: "wxReplySelect",
|
||||
components: {
|
||||
@ -206,15 +206,6 @@
|
||||
tempPlayerObj: {
|
||||
type: '2'
|
||||
},
|
||||
tableData: [],
|
||||
page: {
|
||||
total: 0, // 总页数
|
||||
currentPage: 1, // 当前页数
|
||||
pageSize: 20, // 每页显示多少条
|
||||
ascs:[],//升序字段
|
||||
descs:[]//降序字段
|
||||
},
|
||||
tableLoading: false,
|
||||
|
||||
tempObj: new Map().set( // 临时缓存,切换消息类型的 tab 的时候,可以保存对应的数据;
|
||||
this.objData.type, // 消息类型
|
||||
@ -259,7 +250,6 @@
|
||||
return true;
|
||||
},
|
||||
beforeVoiceUpload(file){
|
||||
this.tableLoading = true
|
||||
// 校验格式
|
||||
const isType = file.type === 'audio/mp3'
|
||||
|| file.type === 'audio/mpeg'
|
||||
@ -464,25 +454,6 @@
|
||||
// 覆盖缓存
|
||||
this.tempObj.set(this.objData.type, Object.assign({}, this.objData));
|
||||
},
|
||||
getPage(page, params) {
|
||||
this.tableLoading = true
|
||||
// getPage(Object.assign({
|
||||
// current: page.currentPage,
|
||||
// size: page.pageSize,
|
||||
// type:this.objData.type
|
||||
// }, params)).then(response => {
|
||||
// this.tableData = response.data.items
|
||||
// this.page.total = response.data.totalCount
|
||||
// this.page.currentPage = page.currentPage
|
||||
// this.page.pageSize = page.pageSize
|
||||
// this.tableLoading = false
|
||||
// })
|
||||
},
|
||||
sizeChange(val) {
|
||||
this.page.currentPage = 1
|
||||
this.page.pageSize = val
|
||||
this.getPage(this.page)
|
||||
},
|
||||
/**
|
||||
* 输入时,缓存每次 objData 到 tempObj 中
|
||||
*
|
||||
|
@ -116,7 +116,7 @@ SOFTWARE.
|
||||
<div class="select-item" v-if="tempObj && tempObj.content && tempObj.content.articles">
|
||||
<WxNews :objData="tempObj.content.articles"></WxNews>
|
||||
<el-row class="ope-row">
|
||||
<el-button type="danger" icon="el-icon-delete" circle @click="deleteTempObj"></el-button>
|
||||
<el-button type="danger" icon="el-icon-delete" circle @click="deleteTempObj" />
|
||||
</el-row>
|
||||
</div>
|
||||
<div v-if="!tempObj.content || !tempObj.content.articles">
|
||||
@ -183,12 +183,10 @@ export default {
|
||||
nameMaxLength: 0, // 菜单名称最大长度;1 级是 4 字符;2 级是 7 字符;
|
||||
showConfigureContent: true, // 是否展示配置内容;如果有子菜单,就不显示配置内容
|
||||
hackResetWxReplySelect: false, // 重置 WxReplySelect 组件
|
||||
|
||||
tempObj: {}, // 右边临时变量,作为中间值牵引关系
|
||||
tempSelfObj: { // 一些临时值放在这里进行判断,如果放在 tempObj,由于引用关系,menu 也会多了多余的参数
|
||||
},
|
||||
visible2: false, //素材内容 "选择素材"按钮弹框显示隐藏
|
||||
tableData:[], //素材内容弹框数据,
|
||||
dialogNewsVisible: false, // 跳转图文时的素材选择弹窗
|
||||
menuOptions: [{
|
||||
value: 'view',
|
||||
label: '跳转网页'
|
||||
@ -220,7 +218,6 @@ export default {
|
||||
value: 'location_select',
|
||||
label: '选择地理位置'
|
||||
}],
|
||||
dialogNewsVisible: false,
|
||||
|
||||
// 公众号账号列表
|
||||
accounts: [],
|
||||
@ -357,13 +354,13 @@ export default {
|
||||
if (!item.children || item.children.length <= 0) {
|
||||
this.$set( item, 'children',[])
|
||||
this.$delete( item, 'type')
|
||||
this.$delete( item, 'menuKey')
|
||||
this.$delete( item, 'miniProgramAppId')
|
||||
this.$delete( item, 'miniProgramPagePath')
|
||||
this.$delete( item, 'url')
|
||||
this.$delete( item, 'reply')
|
||||
// TODO 芋艿:需要搞的属性弄下
|
||||
|
||||
this.$delete( item, 'key')
|
||||
this.$delete( item, 'article_id')
|
||||
this.$delete( item, 'textContent')
|
||||
this.showConfigureContent = false
|
||||
@ -470,14 +467,7 @@ export default {
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
// TODO 芋艿:未归类
|
||||
|
||||
deleteTempObj(){
|
||||
this.$delete(this.tempObj,'repName')
|
||||
this.$delete(this.tempObj,'repUrl')
|
||||
this.$delete(this.tempObj,'content')
|
||||
},
|
||||
// ======================== 菜单编辑(素材选择) ========================
|
||||
openMaterial() {
|
||||
this.dialogNewsVisible = true
|
||||
},
|
||||
@ -495,6 +485,11 @@ export default {
|
||||
item.content.articles = item.content.articles.slice(0,1)
|
||||
this.tempObj.content = item.content
|
||||
},
|
||||
deleteTempObj() {
|
||||
this.$delete(this.tempObj,'repName')
|
||||
this.$delete(this.tempObj,'repUrl')
|
||||
this.$delete(this.tempObj,'content')
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user