This commit is contained in:
shijingjing
2023-03-07 17:26:16 +08:00
parent ef8de12263
commit da5601e784
2 changed files with 172 additions and 35 deletions

View File

@@ -113,6 +113,8 @@
</div> </div>
</div> </div>
</div> </div>
<div class="footer"> <div class="footer">
<div class="exit" @click="showPopup = false">退出预览</div> <div class="exit" @click="showPopup = false">退出预览</div>
@@ -124,12 +126,15 @@
<div class="uploadPopup"> <div class="uploadPopup">
<div class="upload_card" v-for="(item,index) in uploadList" :key="index"> <div class="upload_card" v-for="(item,index) in uploadList" :key="index">
<div class="upload_item">{{ item.title }}</div> <div class="upload_item">{{ item.title }}</div>
<div class="upload_list"> <scroll-view scroll-x="">
<div class="list_item" v-for="(e, i) in item.list" :key="i" @click="uploadBtn(e.msgType)"> <div class="upload_list">
<img :src="e.icon" alt=""> <div class="lists_item" v-for="(e, i) in item.list" :key="i" @click="uploadBtn(e.msgType)">
<span>{{ e.name }}</span> <img :src="e.icon" alt="">
<span>{{ e.name }}</span>
</div>
</div> </div>
</div> </scroll-view>
</div> </div>
<div class="btnCancel" @click="showUpload = false">取消</div> <div class="btnCancel" @click="showUpload = false">取消</div>
</div> </div>
@@ -213,45 +218,104 @@ export default {
}, },
flag: false, flag: false,
uploadList: [ uploadList: [
{
title: '从素材库上传',
list: [
{
icon: 'https://cdn.cunwuyun.cn/dvcp/announce/ic-script.png',
name: '话术',
msgType: '0'
},
{
icon: 'https://cdn.cunwuyun.cn/dvcp/announce/ic-picture.png',
name: '图片',
msgType: '1'
},
{
icon: 'https://cdn.cunwuyun.cn/dvcp/announce/ic-video.png',
name: '视频',
msgType: '4'
},
{
icon: 'https://cdn.cunwuyun.cn/dvcp/announce/ic-document.png',
name: '文件',
msgType: '3'
},
{
icon: 'https://cdn.cunwuyun.cn/dvcp/announce/ic-routine.png',
name: '小程序',
msgType: '2'
},
{
icon: 'https://cdn.cunwuyun.cn/dvcp/announce/ic-web.png',
name: '网页',
msgType: '5'
},
]
},
{ {
title: '从本地上传', title: '从本地上传',
list: [ list: [
{ {
icon: 'https://cdn.cunwuyun.cn/dvcp/announce/img.png', icon: 'https://cdn.cunwuyun.cn/dvcp/announce/ic-picture.png',
name: '图片', name: '图片',
msgType: 'image' msgType: 'image'
}, },
{ {
icon: 'https://cdn.cunwuyun.cn/dvcp/announce/video.png', icon: 'https://cdn.cunwuyun.cn/dvcp/announce/ic-video.png',
name: '视频', name: '视频',
msgType: 'video' msgType: 'video'
}, },
{ {
icon: 'https://cdn.cunwuyun.cn/dvcp/announce/folder.png', icon: 'https://cdn.cunwuyun.cn/dvcp/announce/ic-document.png',
name: '文件', name: '文件',
msgType: 'file' msgType: 'file'
} },
] ]
} }
], ],
uploadCircle: [ uploadCircle: [
{
title: '从素材库上传',
list: [
{
icon: 'https://cdn.cunwuyun.cn/dvcp/announce/ic-script.png',
name: '话术',
msgType: '0'
},
{
icon: 'https://cdn.cunwuyun.cn/dvcp/announce/ic-picture.png',
name: '图片',
msgType: '1'
},
{
icon: 'https://cdn.cunwuyun.cn/dvcp/announce/ic-video.png',
name: '视频',
msgType: '4'
},
{
icon: 'https://cdn.cunwuyun.cn/dvcp/announce/ic-web.png',
name: '网页',
msgType: '5'
},
]
},
{ {
title: '从本地上传', title: '从本地上传',
list: [ list: [
{ {
icon: 'https://cdn.cunwuyun.cn/dvcp/announce/img.png', icon: 'https://cdn.cunwuyun.cn/dvcp/announce/ic-picture.png',
name: '图片', name: '图片',
msgType: 'image' msgType: 'image'
}, },
{ {
icon: 'https://cdn.cunwuyun.cn/dvcp/announce/video.png', icon: 'https://cdn.cunwuyun.cn/dvcp/announce/ic-video.png',
name: '视频', name: '视频',
msgType: 'video' msgType: 'video'
}, },
] ]
} }
], ],
// upload: [],
midiaIds: [], midiaIds: [],
sum: null, sum: null,
// 筛选条件 // 筛选条件
@@ -357,6 +421,8 @@ export default {
uni.chooseVideo(params) uni.chooseVideo(params)
} else if(type == 'file') { } else if(type == 'file') {
uni.chooseFile(params) uni.chooseFile(params)
} else {
uni.navigateTo({url: `./fodderList?type=${this.type}&msgType=${type}`})
} }
} else { } else {
this.$u.toast(`不能超过9个`) this.$u.toast(`不能超过9个`)
@@ -864,24 +930,23 @@ export default {
} }
.uploadPopup { .uploadPopup {
width: 100%;
background: #F7F7F7; background: #F7F7F7;
.upload_card { .upload_card {
padding: 32px 32px 0 32px; padding: 32px 32px 0 32px;
box-sizing: border-box; box-sizing: border-box;
overflow-x: scroll;
.upload_item { .upload_item {
margin-bottom: 32px; margin-bottom: 32px;
} }
.upload_list { .upload_list {
overflow-x: scroll;
display: flex;
.list_item {
text-align: center; text-align: center;
width: 106px; width: 106px;
height: 140px; height: 140px;
display: flex;
flex-wrap: nowrap;
.lists_item {
margin-right: 48px; margin-right: 48px;
img { img {
display: inline-block; display: inline-block;

View File

@@ -1,31 +1,34 @@
<template> <template>
<div class="fodderList"> <div class="fodderList">
<AiTopFixed class="search-box"> <AiTopFixed class="search-box">
<u-search placeholder="素材名称" v-model="keyword" :clearabled="false" :animation="false"></u-search> <u-search placeholder="素材名称" v-model="title" :clearabled="false" :animation="false"></u-search>
</AiTopFixed> </AiTopFixed>
<div class="card-box"> <div class="card-box">
<div class="card"> <div class="card" v-for="(item,index) in list" :key="index">
<div class="left"> <div class="left">
<!-- <div> <div v-if="type == 0">
<div class="title">Q: 中卫汇通客服解决</div> <div class="title">{{ item.title }}</div>
<div class="info">很快就都看不出可不能虚不能会计学女款你辛苦v,nvknkvnxkvnj</div> <div class="info">{{ item.content }}</div>
</div> --> </div>
<div class="files"> <!-- <div class="files">
<div class="pic"> <div class="pic">
<img src="./images/files.png" alt=""> <img src="./images/files.png" alt="">
</div> </div>
<div> <div class="files-r">
<div class="title">百度一下你就知道</div> <div class="title">百度一下你就知道</div>
<div class="mar-top info">www.baidu.com</div> <div class="mar-top info">www.baidu.com</div>
</div> </div>
</div> </div> -->
</div> </div>
<div class="right"> <div class="right" @click="item.isChecked = !item.isChecked">
<!-- <img src="./images/xzh.png" alt=""> --> <img src="./images/xz.png" v-if="item.isChecked" alt="">
<img src="./images/xz.png" alt=""> <img src="./images/xzh.png" v-else alt="">
</div> </div>
</div> </div>
</div> </div>
<div class="subBtn" @click="submit">
<div>确定选择</div>
</div>
</div> </div>
</template> </template>
@@ -35,21 +38,67 @@ export default {
name: "fodderList", name: "fodderList",
data() { data() {
return { return {
keyword: '', mstType: null,
current: 1,
title: '',
type: '',
list: [],
checkedList: [],
typeArr: ['话术','图片','小程序','文件','视频','网页']
} }
}, },
methods: { methods: {
getList() {
this.$http.post(`/app/appmaterialinfo/listByMST`,null,{
params: {
mstType: this.mstType,
current: this.current,
title: this.title,
type: this.type,
}
}).then(res=> {
if(res?.data) {
this.list = res.data.records.map(e=> {
return {
...e,
isChecked: this.checkedList.map(i=> i.id==e.id),
}
})
}
})
},
submit() {
if (!this.checkedList.length) {
return this.$u.toast(`请选择${this.typeArr[this.mstType]}`)
}
uni.$emit("fodder", [this.selected])
uni.setStorageSync('checkedList', this.checkedList)
uni.navigateBack()
}
}, },
onShow() { onLoad(o) {
if(o.type == 'CircleOfFriends') {
this.mstType = 1
} else if(o.type == 'Residents') {
this.mstType = 2
} else if (o.type == 'ResidentsGroup') {
this.mstType = 0
}
this.type = o.msgType
this.checkedList = uni.getStorageSync('checkedList') || []
this.getList()
}, },
onReachBottom() {
this.current ++
this.getList()
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.fodderList { .fodderList {
padding-bottom: 120px;
box-sizing: border-box;
.card-box { .card-box {
background: #fff; background: #fff;
padding: 24px 32px; padding: 24px 32px;
@@ -101,6 +150,9 @@ export default {
height: 100%; height: 100%;
} }
} }
.files-r {
width: 100%;
}
} }
} }
.right { .right {
@@ -113,6 +165,26 @@ export default {
} }
} }
} }
.subBtn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 118px;
background: #f4f8fb;
div {
width: 192px;
height: 80px;
line-height: 80px;
text-align: center;
background: #1365dd;
border-radius: 4px;
font-size: 32px;
color: #fff;
margin: 20px 34px 0 0;
float: right;
}
}
} }
</style> </style>