素材
This commit is contained in:
@@ -161,6 +161,7 @@ export default {
|
||||
uni.removeStorageSync('startTime')
|
||||
uni.removeStorageSync('endTime')
|
||||
uni.removeStorageSync('selectDeptUser')
|
||||
uni.removeStorageSync('checkedList')
|
||||
this.$dict.load('mstStatus').then(() => {
|
||||
this.getList()
|
||||
})
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
<div class="fodder_add" @click="showUpload = true"><u-icon name="plus" color="#CCD0D3" size="32"></u-icon></div>
|
||||
<div class="fodder_title">添加素材</div>
|
||||
</div>
|
||||
<div class="fodder_file" v-for="(item, index) in files" :key="index">
|
||||
<!-- 本地素材 -->
|
||||
<div class="fodder_file" v-for="(item, index) in files" :key="item.id">
|
||||
<div class="item">
|
||||
<div class="images">
|
||||
<img src="https://cdn.cunwuyun.cn/dvcp/h5/file.png" alt="">
|
||||
@@ -44,7 +45,20 @@
|
||||
<div class="name">{{ item.name }}</div>
|
||||
<div class="size">{{ item.fileSizeStr }}</div>
|
||||
</div>
|
||||
<div class="remove" @click="remove" style="color: #f72c27">删除</div>
|
||||
<div class="remove" @click="remove(index)" style="color: #f72c27">删除</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 素材库 -->
|
||||
<div class="fodder_file" v-for="(item, index) in checkedList" :key="item.id">
|
||||
<div class="item">
|
||||
<div class="images">
|
||||
<img src="https://cdn.cunwuyun.cn/dvcp/h5/file.png" alt="">
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="name">{{ item.title }}</div>
|
||||
<div class="size">{{ item.fileSizeStr }}</div>
|
||||
</div>
|
||||
<div class="remove" @click="removeSucai(index)" style="color: #f72c27">删除</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -96,7 +110,7 @@
|
||||
<img class="text_left" src="https://cdn.cunwuyun.cn/dvcp/announce/avatar.png" />
|
||||
<div class="text_right">{{ content }}</div>
|
||||
</div>
|
||||
|
||||
<!-- 本地素材 -->
|
||||
<div class="file_content" v-for="item in files" :key="item.id">
|
||||
<img class="text_left" src="https://cdn.cunwuyun.cn/dvcp/announce/avatar.png" />
|
||||
<img class="only_pic" :src="item.url" alt="" v-if="['.jpg', '.jpeg','.png'].indexOf(getExtension(item.name)) !== -1">
|
||||
@@ -112,9 +126,22 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- 素材库 -->
|
||||
<div class="file_content" v-for="item in checkedList" :key="item.id">
|
||||
<img class="text_left" src="https://cdn.cunwuyun.cn/dvcp/announce/avatar.png" />
|
||||
<img class="only_pic" :src="item.imgPicUrl" alt="" v-if="item.type==1">
|
||||
<video controls class="only_video" :src="item.fileUrl" v-if="item.type == 4"></video>
|
||||
<div class="text_right file_right" v-if="['0','2','3','5'].includes(item.type)">
|
||||
<div class="cont_left">
|
||||
<h4>{{ item.title }}</h4>
|
||||
<p v-if="['1', '4', '3'].includes(item.type)">{{ item.fileSizeStr }}</p>
|
||||
<p v-if="item.type==5">{{ item.linkUrl }}</p>
|
||||
</div>
|
||||
<div class="cont_right">
|
||||
<img :src="sucaiIcon[item.type]" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="exit" @click="showPopup = false">退出预览</div>
|
||||
@@ -327,6 +354,15 @@ export default {
|
||||
circleTagsRemove: [], // 朋友圈剔除
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
checkedList: [],
|
||||
sucaiIcon: [
|
||||
'https://cdn.cunwuyun.cn/dvcp/announce/ic-script.png',
|
||||
'https://cdn.cunwuyun.cn/dvcp/announce/ic-picture.png',
|
||||
'https://cdn.cunwuyun.cn/dvcp/announce/ic-routine.png',
|
||||
'https://cdn.cunwuyun.cn/dvcp/announce/ic-document.png',
|
||||
'https://cdn.cunwuyun.cn/dvcp/announce/ic-video.png',
|
||||
'https://cdn.cunwuyun.cn/dvcp/announce/ic-web.png',
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -371,12 +407,8 @@ export default {
|
||||
return name.substring(name.lastIndexOf('.'))
|
||||
},
|
||||
|
||||
getExamines(e) {
|
||||
console.log(e);
|
||||
},
|
||||
|
||||
uploadBtn(type) {
|
||||
let count = 9 - (this.files?.length || 0)
|
||||
let count = 9 - (this.files?.length || 0) - (this.checkedList?.length || 0)
|
||||
if(count > 0){
|
||||
let params = {
|
||||
count,
|
||||
@@ -423,6 +455,7 @@ export default {
|
||||
uni.chooseFile(params)
|
||||
} else {
|
||||
uni.navigateTo({url: `./fodderList?type=${this.type}&msgType=${type}`})
|
||||
this.showUpload = false
|
||||
}
|
||||
} else {
|
||||
this.$u.toast(`不能超过9个`)
|
||||
@@ -464,6 +497,12 @@ export default {
|
||||
|
||||
remove(index) {
|
||||
this.files.splice(index, 1)
|
||||
|
||||
},
|
||||
|
||||
removeSucai(index) {
|
||||
this.checkedList.splice(index, 1)
|
||||
uni.setStorageSync("checkedList", this.checkedList)
|
||||
},
|
||||
|
||||
choiceTime(e) {
|
||||
@@ -497,7 +536,7 @@ export default {
|
||||
]
|
||||
this.form.contents.push(...firstContent)
|
||||
// 图片
|
||||
const picUrl = this.files.filter(i=> ['.jpg','.jpeg','.png'].indexOf(this.getExtension(i.name)) == 1).map(e=>{
|
||||
const picUrl = this.files.filter(i=> ['.jpg','.jpeg','.png'].indexOf(this.getExtension(i.name)) !== -1).map(e=>{
|
||||
return {
|
||||
imgPicUrl: e.url,
|
||||
msgType: '1',
|
||||
@@ -506,7 +545,7 @@ export default {
|
||||
})
|
||||
this.form.contents.push(...picUrl)
|
||||
// 视频
|
||||
const video = this.files.filter(i=> ['.mp4'].indexOf(this.getExtension(i.name)) == 1).map(e=>{
|
||||
const video = this.files.filter(i=> ['.mp4'].indexOf(this.getExtension(i.name)) !== -1).map(e=>{
|
||||
return {
|
||||
imgPicUrl: e.url,
|
||||
msgType: '2',
|
||||
@@ -524,6 +563,10 @@ export default {
|
||||
})
|
||||
this.form.contents.push(...files)
|
||||
|
||||
if(this.checkedList.length) {
|
||||
this.form.contents.push(...this.checkedList)
|
||||
}
|
||||
|
||||
if(this.type=='Residents' || this.type=='CircleOfFriends') {
|
||||
this.forms.contents = this.form.contents
|
||||
this.forms.taskTitle = this.form.taskTitle
|
||||
@@ -609,6 +652,7 @@ export default {
|
||||
uni.removeStorageSync('startTime')
|
||||
uni.removeStorageSync('endTime')
|
||||
uni.removeStorageSync('selectDeptUser')
|
||||
uni.removeStorageSync('checkedList')
|
||||
},
|
||||
|
||||
},
|
||||
@@ -694,6 +738,10 @@ export default {
|
||||
}
|
||||
})
|
||||
})
|
||||
uni.$on("fodder",()=> {
|
||||
this.checkedList = uni.getStorageSync('checkedList')
|
||||
})
|
||||
this.checkedList = uni.getStorageSync('checkedList')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -142,8 +142,8 @@ export default {
|
||||
this.webpage = res.data.contents.filter(v=> v.msgType == 4)
|
||||
this.miniapp = res.data.contents.filter(v=> v.msgType == 5)
|
||||
this.approver = res.data.examines
|
||||
this.resSum = res.data.groupList.reduce((pre, cur) => pre + cur.customerCount, 0)
|
||||
this.cirSum = res.data.executorList.reduce((pre, cur) => pre + cur.customerCount, 0)
|
||||
this.resSum = res.data.groupList?.reduce((pre, cur) => pre + cur.customerCount, 0)
|
||||
this.cirSum = res.data.executorList?.reduce((pre, cur) => pre + cur.customerCount, 0)
|
||||
// if(res.data.status==1) { // 拒绝
|
||||
// this.approver = res.data.examines.filter(e=> e.examineStatus == 2)
|
||||
// } else { // 通过
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="fodderList">
|
||||
<AiTopFixed class="search-box">
|
||||
<u-search placeholder="素材名称" v-model="title" :clearabled="false" :animation="false"></u-search>
|
||||
<u-search placeholder="素材名称" v-model="title" :clearabled="false" @search="getList()" :animation="false"></u-search>
|
||||
</AiTopFixed>
|
||||
<div class="card" v-for="(item,index) in list" :key="index">
|
||||
<div class="left">
|
||||
@@ -13,7 +13,7 @@
|
||||
<!-- 图片 -->
|
||||
<div class="files" v-if="type == 1">
|
||||
<div class="pics ">
|
||||
<img :src="item.imgPicUrl" alt="">
|
||||
<img :src="item.pictureUrl" alt="">
|
||||
</div>
|
||||
<div class="files-r">
|
||||
<div class="title">{{ item.title }}</div>
|
||||
@@ -23,11 +23,11 @@
|
||||
<!-- 小程序 -->
|
||||
<div class="files" v-if="type == 2">
|
||||
<div class="pic">
|
||||
<img src="./images/files.png" alt="">
|
||||
<img :src="item.pictureUrl" alt="">
|
||||
</div>
|
||||
<div class="files-r">
|
||||
<div class="files-r align">
|
||||
<div class="title">{{ item.title }}</div>
|
||||
<div class="mar-top info">www.baidu.com</div>
|
||||
<!-- <div class="mar-top info">www.baidu.com</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- 文件 -->
|
||||
@@ -43,7 +43,7 @@
|
||||
<!-- 视频 -->
|
||||
<div class="files" v-if="type == 4">
|
||||
<div class="pic">
|
||||
<img :src="item.pictureUrl" alt="">
|
||||
<img src="https://cdn.cunwuyun.cn/dvcp/announce/ic-video.png" alt="">
|
||||
</div>
|
||||
<div class="files-r">
|
||||
<div class="title">{{ item.title }}</div>
|
||||
@@ -53,17 +53,18 @@
|
||||
<!-- 网页 -->
|
||||
<div class="files" v-if="type == 5">
|
||||
<div class="pic">
|
||||
<img src="./images/files.png" alt="">
|
||||
<img :src="item.pictureUrl" alt="">
|
||||
</div>
|
||||
<div class="files-r">
|
||||
<div class="title">百度一下你就知道</div>
|
||||
<!-- <div class="mar-top info">www.baidu.com</div> -->
|
||||
<div class="title">{{ item.title }}</div>
|
||||
<div class="mar-top info">{{ item.linkUrl }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right" @click="itemCheck(item)">
|
||||
<img src="./images/xz.png" v-if="item.isChecked" alt="">
|
||||
<img src="./images/xzh.png" v-else alt="">
|
||||
<img src="./images/xzh.png" v-if="item.isChecked" alt="">
|
||||
<img src="./images/xz.png" v-else alt="">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="subBtn" @click="submit">
|
||||
@@ -109,7 +110,7 @@ export default {
|
||||
},
|
||||
itemCheck(e) {
|
||||
e.isChecked = !!!e.isChecked
|
||||
if (e.isChecked) {
|
||||
if (e.isChecked == true) {
|
||||
this.checkedList.push(e)
|
||||
} else {
|
||||
let index = this.checkedList.findIndex(item=> item.id==e.id)
|
||||
@@ -118,7 +119,6 @@ export default {
|
||||
uni.setStorageSync('checkedList', this.checkedList)
|
||||
},
|
||||
submit() {
|
||||
// this.checkList = this.list.map()
|
||||
if (!this.checkedList.length) {
|
||||
return this.$u.toast(`请选择${this.typeArr[this.mstType]}`)
|
||||
}
|
||||
@@ -221,6 +221,9 @@ export default {
|
||||
.files-r {
|
||||
width: calc(100% - 120px);
|
||||
}
|
||||
.align {
|
||||
align-self: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
.right {
|
||||
|
||||
Reference in New Issue
Block a user