Browse Source

img-error/时长

dev
xuhuajiao 3 years ago
parent
commit
c3f4f38467
  1. 13
      src/assets/styles/adminIndex.scss
  2. 12
      src/views/components/MyAlbum.vue
  3. 13
      src/views/components/ThemeGalleryList.vue
  4. 6
      src/views/device/index.vue
  5. 34
      src/views/immediateRelease/index.vue
  6. 4
      src/views/materialContent/materialList/index.vue

13
src/assets/styles/adminIndex.scss

@ -241,7 +241,10 @@ img[src=""],img:not([src]){opacity:0;}
border: 1px solid #f0f0f0;
border-radius: 6px;
margin: 0 10px 10px 0;
.img_box{
width: 100%;
height: 148px;
}
img {
display: block;
width: 164px;
@ -414,6 +417,10 @@ img[src=""],img:not([src]){opacity:0;}
border-radius: 4px;
overflow: hidden;
margin: 0 24px 24px 0;
.img_box{
width: 100%;
height: 100%;
}
img {
position: relative;
display: block;
@ -635,4 +642,8 @@ img[src=""],img:not([src]){opacity:0;}
}
}
}
.img_box{
background: url(~@/assets/images/menu_bg_02.png) no-repeat #fff;
background-size: cover;
}
// end

12
src/views/components/MyAlbum.vue

@ -108,7 +108,7 @@ import UploadCover from './upload_cover'
export default {
name: 'ThemeGalleryList',
components: { UploadCover },
inject: ['selectContVisible'],
// inject: ['selectContVisible'],
filters: {
getSeconds(s) {
return getSeconds(s)
@ -151,8 +151,8 @@ export default {
img_path: '',
name: '',
orga_id: ''
},
selectContVisible2: 0
}
// selectContVisible2: 0
}
},
computed: {
@ -173,9 +173,9 @@ export default {
document.addEventListener('click', this.hiddenFolderActiveClick)
},
methods: {
addThemeToAlbum() {
this.$emit('test', this.selectContVisible2)
},
// addThemeToAlbum() {
// this.$emit('test', this.selectContVisible2)
// },
breadcrumbToAlbum() {
this.$router.push('/theme')
this.getMyAlbum()

13
src/views/components/ThemeGalleryList.vue

@ -17,8 +17,9 @@
<!-- 主题库list -->
<div v-for="(item, index) in themeGalleryList" :key="index" :class="['theme_item', {'set_radio': !item.img_path && item.material_type == 2}, { 'item_multi': selectedListId.includes(item.material_id) }]">
<!-- :onerror="defaultImg" -->
<img v-if="item.img_path || item.material_type == 1" :src="item.img_path" alt />
<div v-if="!item.img_path && item.material_type == 1 " class="error_img"></div>
<div class="img_box">
<img v-if="item.img_path || item.material_type == 1" :src="item.img_path" alt />
</div>
<div v-if="!item.img_path && item.material_type == 2" class="radio_img"></div>
<div v-if="showItemInfo" class="item_format">
<span class="item_type">{{ item.deposit_url | getFileFormat }}</span>
@ -73,10 +74,6 @@ export default {
showItemInfo: {
type: Boolean,
required: true
},
isLayer: {
type: Boolean,
required: true
}
},
data() {
@ -102,8 +99,8 @@ export default {
themeGalleryList: [], //
selectedListId: [],
selectInFolderid: [], // ID
selectedMaterial: [], //
selectContVisible: false
selectedMaterial: [] //
// selectContVisible: false
}
},
computed: {

6
src/views/device/index.vue

@ -100,11 +100,13 @@
<div class="file_name">{{ items.bgm_name }}</div>
</div> -->
<div v-for="(item, i) in items.show_materials" :key="'list-'+i" class="material_item item_cont">
<img v-if="item.img_path || item.material_type == 1" :src="item.img_path" alt />
<div class="img_box">
<img v-if="item.img_path || item.material_type == 1" :src="item.img_path" alt />
</div>
<div v-if="!item.img_path && item.material_type == 2" class="radio_img"></div>
<div class="item_format">
<span class="item_type">{{ item.deposit_url | getFileFormat }}</span>
<span v-if="item.material_type !== '0'" class="item_time">{{ item.duration | getSeconds }}</span>
<!-- <span v-if="item.material_type !== '0'" class="item_time">{{ item.duration | getSeconds }}</span> -->
</div>
<div class="file_name">{{ item.material_name }}</div>
<div v-if="item.bgm_name && item.material_type == 0" class="bgm_name">背景音乐:{{ item.bgm_name }}</div>

34
src/views/immediateRelease/index.vue

@ -66,7 +66,7 @@
<el-col class="step_form">
<div class="step_select">
<div>已选内容 {{ selectTotal }}</div>
<div>内容总时长{{ selectTotalTime }}s</div>
<div>内容总时长{{ selectTotalTime | getSeconds }}</div>
<div>添加BGM<el-button class="step_select_audio" type="primary" round @click="selectAudioCont(0,-1)">选择文件</el-button>
</div>
</div>
@ -164,7 +164,7 @@
<div class="upload_layer">
<el-dialog title="请选择播放内容" :close-on-click-modal="false" :visible.sync="listEditVisible">
<div class="total_time">
内容总时长3m15s
内容总时长{{ selectTotalTime | getSeconds }}
</div>
<div v-for="(item, index) in selectedEditData" :key="index" class="edit_material">
<div class="edit_img">
@ -412,6 +412,7 @@ export default {
this.selectedMaterial = []
this.selectedMaterial = JSON.parse(localStorage.getItem('selectedMaterial'))
this.getSelectTotal()
this.getSelectTimeTotal()
},
mounted() {
if (this.$route.path === '/release') {
@ -438,14 +439,31 @@ export default {
}
})
this.selectTotal = this.selectedMaterial.length + result.length
console.log(this.selectedMaterial)
console.log(this.selectedMaterial.length)
console.log(result.length)
}
},
getSelectTimeTotal() {
if (this.selectedMaterial) {
const imgTimeTotal = []
this.selectedMaterial.forEach(item => {
if (item.material_type == 0) {
if (item.showTime) {
imgTimeTotal.push(parseInt(item.showTime))
} else {
imgTimeTotal.push(parseInt(15))
}
} else {
imgTimeTotal.push(parseInt(item.duration))
}
})
this.selectTotalTime = imgTimeTotal.reduce((a, b) => {
return a + b
}, 0)
}
},
saveEdit() {
this.listEditVisible = false
this.getSelectTotal()
this.getSelectTimeTotal()
},
// release_id
editRelease() {
@ -513,6 +531,7 @@ export default {
}
})
this.getSelectTotal()
this.getSelectTimeTotal()
}
})
// list
@ -728,6 +747,8 @@ export default {
})
}
// localStorage.setItem('selectedMaterial', JSON.stringify(this.selectedMaterial))
this.getSelectTotal()
this.getSelectTimeTotal()
},
//
clickMaterialItem(id, item) {
@ -820,6 +841,7 @@ export default {
this.selectedMaterial.push(this.audioListData[index])
}
this.getSelectTotal()
this.getSelectTimeTotal()
// localStorage.setItem('selectedMaterial', JSON.stringify(this.selectedMaterial))
} else {
this.selectedEditData[this.thisEditIndex].showAudioName = this.audioListData[index].material_name
@ -918,7 +940,9 @@ export default {
})
}
// localStorage.setItem('selectedMaterial', JSON.stringify(this.selectedMaterial))
console.log(this.selectedMaterial)
this.getSelectTotal()
this.getSelectTimeTotal()
this.mulitText = '多选'
},
// -

4
src/views/materialContent/materialList/index.vue

@ -26,7 +26,9 @@
</div>
<!-- 素材库list -->
<div v-for="(item, index) in materialList" :key="'list-'+index" :class="['material_item', 'item_cont', { 'item_multi': selectedListId.includes(item.material_id) }]">
<img v-if="item.img_path || item.material_type == 1" :src="item.img_path" :onerror="defaultImg" alt />
<div v-if="item.img_path || item.material_type == 1" class="img_box">
<img :src="item.img_path" :onerror="defaultImg" alt />
</div>
<div v-if="!item.img_path && item.material_type == 2" class="radio_img"></div>
<div class="item_format">
<span class="item_type">{{ item.deposit_url | getFileFormat }}</span>

Loading…
Cancel
Save