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. 11
      src/views/components/ThemeGalleryList.vue
  4. 4
      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: 1px solid #f0f0f0;
border-radius: 6px; border-radius: 6px;
margin: 0 10px 10px 0; margin: 0 10px 10px 0;
.img_box{
width: 100%;
height: 148px;
}
img { img {
display: block; display: block;
width: 164px; width: 164px;
@ -414,6 +417,10 @@ img[src=""],img:not([src]){opacity:0;}
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
margin: 0 24px 24px 0; margin: 0 24px 24px 0;
.img_box{
width: 100%;
height: 100%;
}
img { img {
position: relative; position: relative;
display: block; 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 // end

12
src/views/components/MyAlbum.vue

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

11
src/views/components/ThemeGalleryList.vue

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

4
src/views/device/index.vue

@ -100,11 +100,13 @@
<div class="file_name">{{ items.bgm_name }}</div> <div class="file_name">{{ items.bgm_name }}</div>
</div> --> </div> -->
<div v-for="(item, i) in items.show_materials" :key="'list-'+i" class="material_item item_cont"> <div v-for="(item, i) in items.show_materials" :key="'list-'+i" class="material_item item_cont">
<div class="img_box">
<img v-if="item.img_path || item.material_type == 1" :src="item.img_path" alt /> <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="!item.img_path && item.material_type == 2" class="radio_img"></div>
<div class="item_format"> <div class="item_format">
<span class="item_type">{{ item.deposit_url | getFileFormat }}</span> <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>
<div class="file_name">{{ item.material_name }}</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> <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"> <el-col class="step_form">
<div class="step_select"> <div class="step_select">
<div>已选内容 {{ selectTotal }}</div> <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>添加BGM<el-button class="step_select_audio" type="primary" round @click="selectAudioCont(0,-1)">选择文件</el-button>
</div> </div>
</div> </div>
@ -164,7 +164,7 @@
<div class="upload_layer"> <div class="upload_layer">
<el-dialog title="请选择播放内容" :close-on-click-modal="false" :visible.sync="listEditVisible"> <el-dialog title="请选择播放内容" :close-on-click-modal="false" :visible.sync="listEditVisible">
<div class="total_time"> <div class="total_time">
内容总时长3m15s
内容总时长{{ selectTotalTime | getSeconds }}
</div> </div>
<div v-for="(item, index) in selectedEditData" :key="index" class="edit_material"> <div v-for="(item, index) in selectedEditData" :key="index" class="edit_material">
<div class="edit_img"> <div class="edit_img">
@ -412,6 +412,7 @@ export default {
this.selectedMaterial = [] this.selectedMaterial = []
this.selectedMaterial = JSON.parse(localStorage.getItem('selectedMaterial')) this.selectedMaterial = JSON.parse(localStorage.getItem('selectedMaterial'))
this.getSelectTotal() this.getSelectTotal()
this.getSelectTimeTotal()
}, },
mounted() { mounted() {
if (this.$route.path === '/release') { if (this.$route.path === '/release') {
@ -438,14 +439,31 @@ export default {
} }
}) })
this.selectTotal = this.selectedMaterial.length + result.length 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() { saveEdit() {
this.listEditVisible = false this.listEditVisible = false
this.getSelectTotal() this.getSelectTotal()
this.getSelectTimeTotal()
}, },
// release_id // release_id
editRelease() { editRelease() {
@ -513,6 +531,7 @@ export default {
} }
}) })
this.getSelectTotal() this.getSelectTotal()
this.getSelectTimeTotal()
} }
}) })
// list // list
@ -728,6 +747,8 @@ export default {
}) })
} }
// localStorage.setItem('selectedMaterial', JSON.stringify(this.selectedMaterial)) // localStorage.setItem('selectedMaterial', JSON.stringify(this.selectedMaterial))
this.getSelectTotal()
this.getSelectTimeTotal()
}, },
// //
clickMaterialItem(id, item) { clickMaterialItem(id, item) {
@ -820,6 +841,7 @@ export default {
this.selectedMaterial.push(this.audioListData[index]) this.selectedMaterial.push(this.audioListData[index])
} }
this.getSelectTotal() this.getSelectTotal()
this.getSelectTimeTotal()
// localStorage.setItem('selectedMaterial', JSON.stringify(this.selectedMaterial)) // localStorage.setItem('selectedMaterial', JSON.stringify(this.selectedMaterial))
} else { } else {
this.selectedEditData[this.thisEditIndex].showAudioName = this.audioListData[index].material_name this.selectedEditData[this.thisEditIndex].showAudioName = this.audioListData[index].material_name
@ -918,7 +940,9 @@ export default {
}) })
} }
// localStorage.setItem('selectedMaterial', JSON.stringify(this.selectedMaterial)) // localStorage.setItem('selectedMaterial', JSON.stringify(this.selectedMaterial))
console.log(this.selectedMaterial)
this.getSelectTotal() this.getSelectTotal()
this.getSelectTimeTotal()
this.mulitText = '多选' this.mulitText = '多选'
}, },
// - // -

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

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

Loading…
Cancel
Save