This commit is contained in:
liuye
2022-09-13 15:31:09 +08:00
9 changed files with 266 additions and 123 deletions

View File

@@ -8,7 +8,7 @@
<u-search v-model="keyword" :clearabled="true" placeholder="请输入素材名称" :show-action="false" bg-color="#F5F5F5" search-icon-color="#ccc" color="#666" height="58" @search="getList" @clear="handerClear"></u-search> <u-search v-model="keyword" :clearabled="true" placeholder="请输入素材名称" :show-action="false" bg-color="#F5F5F5" search-icon-color="#ccc" color="#666" height="58" @search="getList" @clear="handerClear"></u-search>
</div> </div>
</AiTopFixed> </AiTopFixed>
<div class="list"> <div class="playList">
<div class="item" v-for="(item, index) in list" :key="index" @click="toDetail(item)" > <div class="item" v-for="(item, index) in list" :key="index" @click="toDetail(item)" >
<div class="left"> <div class="left">
<p>{{ item.sourceName }}</p> <p>{{ item.sourceName }}</p>
@@ -129,7 +129,7 @@ export default {
} }
} }
} }
.list{ .playList{
padding-left: 32px; padding-left: 32px;
background-color: #fff; background-color: #fff;
.item{ .item{

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="list"> <div class="buildingList">
<AiTopFixed> <AiTopFixed>
<u-search placeholder="小区名称" :show-action="false" v-model="title" @search="current=1,getList()"/> <u-search placeholder="小区名称" :show-action="false" v-model="title" @search="current=1,getList()"/>
</AiTopFixed> </AiTopFixed>
@@ -27,7 +27,7 @@
import {mapState} from 'vuex' import {mapState} from 'vuex'
export default { export default {
name: "buildingList",
data() { data() {
return { return {
title: '', title: '',
@@ -97,8 +97,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.list { .buildingList {
padding-bottom: 20px; padding-bottom: 20px;
.list-content { .list-content {
padding: 32px 32px 0; padding: 32px 32px 0;
background-color: #F5F5F5; background-color: #F5F5F5;

View File

@@ -135,6 +135,19 @@ export default {
tabClick(item,index) { tabClick(item,index) {
this.tabIndex = index; this.tabIndex = index;
this.sendType = item.value this.sendType = item.value
uni.clearStorageSync('userSelect')
uni.clearStorageSync('wxGroupsUser')
uni.clearStorageSync('girdSelect')
uni.clearStorageSync('deptList')
uni.clearStorageSync('sendScope')
uni.clearStorageSync('ResidentTags')
uni.clearStorageSync('ResidentTagsRemove')
uni.clearStorageSync('circleTags')
uni.clearStorageSync('circleTagsRemove')
this.$dict.load('mstStatus').then(() => {
this.getList()
})
}, },
toDetail(item) { toDetail(item) {
uni.navigateTo({url: `./cooperationDetail?id=${item.id}&time=${item.createTime}`}) uni.navigateTo({url: `./cooperationDetail?id=${item.id}&time=${item.createTime}`})
@@ -145,13 +158,20 @@ export default {
this.getList() this.getList()
}, },
getList() { getList() {
this.$http.post(`/app/appmasssendingtask/list`, null, { let url = ''
if(this.tabIndex==0) {
url = `/app/appmasssendingtask/list`
} else if(this.tabIndex==1 || this.tabIndex==2) {
url = `/app/whchatmomentstask/list`
}
this.$http.post(url, null, {
params: { params: {
current: this.current, current: this.current,
taskTitle: this.taskTitle, taskTitle: this.taskTitle,
startTime: this.start, startTime: this.start,
endTime: this.end, endTime: this.end,
createUserId: this.createUserId, createUserId: this.createUserId,
status: this.status
} }
}).then(res=> { }).then(res=> {
if(res?.data) { if(res?.data) {
@@ -203,7 +223,7 @@ export default {
}, },
onShow() { onShow() {
document.title = '协同宣发' document.title = '协同宣发'
this.$dict.load(['mstStatus']).then(() => { this.$dict.load('mstStatus').then(() => {
this.list = [] this.list = []
this.current = 1 this.current = 1
this.getList() this.getList()

View File

@@ -139,14 +139,13 @@ export default {
type: '', type: '',
form: { form: {
taskTitle: '', taskTitle: '',
wxGroups: [], // 发送范围
contents: [], // 发送内容 contents: [], // 发送内容
enableExamine: '0', // 是否需要审批 0否 1是 enableExamine: '0', // 是否需要审批 0否 1是
examines: [], // 审批人 examines: [], // 审批人
choiceTime: '', // 定时发送时间 choiceTime: '', // 定时发送时间
sendScope: '', // 0全部居民群、1按部门选择、2按网格选择 sendScope: '', // 0全部居民群、1按部门选择、2按网格选择
sendType: '0', // 0立即发送、1定时发送 sendType: '0', // 0立即发送、1定时发送
wxGroups: [ wxGroups: [ // 发送范围
{ {
corpId: "ww596787bb70f08288", corpId: "ww596787bb70f08288",
errorCode: null, errorCode: null,
@@ -179,6 +178,19 @@ export default {
} }
], // 送达居民群 ], // 送达居民群
}, },
forms: {
taskTitle: '',
taskType: '',
executorList: [], // 任务执行人集合(群发朋友圈的执行人)
groupList: [], // 添加人集合
contentList: [], // 发送内容
enableExamine: '0', // 是否需要审批 0否 1是
examineList: [], // 审批人
choiceTime: '', // 定时发送时间
sendScope: '', // 0全部居民群、1按部门选择、2按网格选择
sendType: '0', // 0立即发送、1定时发送
gender: '', // 性别0-女、1-男、2-全部
},
enableExamine: false, enableExamine: false,
isTimedTask: false, isTimedTask: false,
content: '', content: '',
@@ -334,6 +346,7 @@ export default {
this.form.choiceTime = e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second this.form.choiceTime = e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second
}, },
confirm() { confirm() {
if(this.flag) return if(this.flag) return
// 文本 // 文本
@@ -371,6 +384,10 @@ export default {
} }
}) })
this.form.contents.push(...files) this.form.contents.push(...files)
if(this.type=='Residents' || this.type=='CircleOfFriends') {
this.forms.contentList = this.form.contents
}
if(!this.form.taskTitle) { if(!this.form.taskTitle) {
return this.$u.toast('请输入任务名称') return this.$u.toast('请输入任务名称')
@@ -384,23 +401,45 @@ export default {
return this.$u.toast("请输入发送内容") return this.$u.toast("请输入发送内容")
} }
if(this.enableExamine) { if(this.enableExamine) { // 是否需要审批0否、1
if(!this.form.examines.length) { if(!this.form.examines.length) {
return this.$u.toast("请选择审批人") return this.$u.toast("请选择审批人")
} else { } else {
this.form.enableExamine = '1' this.form.examineList = this.form.examineList
} }
this.form.enableExamine = 1
this.forms.enableExamine = 1
} else {
this.form.enableExamine = 0
this.forms.enableExamine = 0
this.form.examineList = []
this.form.examineList = []
} }
if(this.isTimedTask) { if(this.isTimedTask) { // 发送类型0立即发送、1定时发送
this.form.sendType = 1
this.forms.sendType = 1
if(!this.form.choiceTime.length) { if(!this.form.choiceTime.length) {
return this.$u.toast("请选择发送时间") return this.$u.toast("请选择发送时间")
} else if (new Date(this.form.choiceTime).getTime() < Date.now()) { } else if (new Date(this.form.choiceTime).getTime() < Date.now()) {
return this.$u.toast('定时发送时间不得早于当前时间') return this.$u.toast('定时发送时间不得早于当前时间')
} }
this.forms.choiceTime = this.form.choiceTime
} else {
this.form.sendType = 0
this.forms.sendType = 0
this.forms.choiceTime = ''
this.form.choiceTime = ''
} }
this.flag = true this.flag = true
this.$http.post(`/app/appmasssendingtask/addOrUpdate`, { ...this.form }).then(res=>{
let formData = {}
if(this.type=='Residents' || this.type=='CircleOfFriends') {
formData = this.forms
} else if(this.type=='ResidentsGroup') {
formData = this.form
}
this.$http.post(`/app/appmasssendingtask/addOrUpdate`, { ...formData }).then(res=>{
if(res?.code ==0) { if(res?.code ==0) {
this.flag = false this.flag = false
this.$u.toast("新增成功") this.$u.toast("新增成功")
@@ -409,8 +448,7 @@ export default {
}).catch((err)=>{ }).catch((err)=>{
this.flag = false this.flag = false
this.$u.toast(err) this.$u.toast(err)
}) })
}, },
getDeptUser() { getDeptUser() {
@@ -418,10 +456,10 @@ export default {
fromDepartmentId: 0, fromDepartmentId: 0,
mode: "multi", mode: "multi",
type: ["user"], type: ["user"],
selectedUserIds: this.userList?.map(e => e.id) selectedUserIds: this.form.examineList?.map(e => e.id)
}).then((res)=>{ }).then((res)=>{
if(res?.userList) { if(res?.userList) {
this.userList = res.userList this.form.examineList = res.userList
} }
} }
).catch((err) => { ).catch((err) => {
@@ -432,10 +470,24 @@ export default {
onLoad(o) { onLoad(o) {
this.type = o.type; this.type = o.type;
document.title = this.type=='ResidentsGroup'? "群发居民群": this.type=='Residents'? "群发居民": "群发朋友圈" document.title = this.type=='ResidentsGroup'? "群发居民群": this.type=='Residents'? "群发居民": "群发朋友圈"
if(this.type=='Residents') {
this.forms.taskType = 1
} else if(this.type=='CircleOfFriends') {
this.forms.taskType = 0
}
}, },
onShow() { onShow() {
this.form.wxGroups = uni.getStorageSync('wxGroupsUser') || [] // this.form.wxGroups = uni.getStorageSync('wxGroupsUser') || []
this.form.sendScope = uni.getStorageSync('sendScope') this.form.sendScope = uni.getStorageSync('sendScope')
if(this.type=='Residents') {
this.forms.taskType = 1
this.forms.groupList = this.form.wxGroups
} else if(this.type=='CircleOfFriends') {
this.forms.taskType = 0
this.forms.executorList = this.form.wxGroups
}
this.forms.taskTitle = this.form.taskTitle
} }
} }
</script> </script>

View File

@@ -3,27 +3,39 @@
<div class="item"> <div class="item">
<div>添加人</div> <div>添加人</div>
<div @click="selectUser"> <div @click="selectUser">
<span v-if="selectedUser.length || deptListArr.length">已选择{{ selectedUser.length || deptListArr.length }} <!-- <span v-if="selectedUser.length || deptListArr.length">已选择{{ selectedUser.length || deptListArr.length }}
<span v-if="selectedUser.length">个网格</span><span v-if="deptListArr.length">个部门</span></span> <span v-if="selectedUser.length">个网格</span><span v-if="deptListArr.length">个部门</span></span> -->
<div v-if="type == 1" style="display: inline-block;">
<span v-if="deptListArr.length">已选择{{ deptListArr.length }}个部门</span>
<span class="color_gray" v-else>请选择</span>
</div>
<div v-if="type == 2" style="display: inline-block;">
<span v-if="selectedUser.length">已选择{{ selectedUser.length }}个网格</span>
<span class="color_gray" v-else>请选择</span>
</div>
<u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</div>
</div>
<div class="item" v-if="['Residents', 'CircleOfFriends'].includes(sendType)">
<div>包含标签</div>
<div @click="toTagsList(0)">
<span v-if="circleTags.length || ResidentTags.length">已选择{{ circleTags.length || ResidentTags.length }}个标签</span>
<span class="color_gray" v-else>请选择</span> <span class="color_gray" v-else>请选择</span>
<u-icon name="arrow-right" color="#CCD0D3"></u-icon> <u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</div> </div>
</div> </div>
<div class="item" v-if="['Residents', 'CircleOfFriends'].includes(sendType)">
<div>包含标签</div>
<div @click="toTagsList(0)">
<span class="color_gray">请选择</span>
<u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</div>
</div>
<div class="item" v-if="['Residents', 'CircleOfFriends'].includes(sendType)"> <div class="item" v-if="['Residents', 'CircleOfFriends'].includes(sendType)">
<div>剔除标签</div> <div>剔除标签</div>
<div @click="toTagsList(1)"> <div @click="toTagsList(1)">
<span class="color_gray">请选择</span> <span v-if="circleTagsRemove.length || ResidentTagsRemove.length">已剔除{{ circleTagsRemove.length || ResidentTagsRemove.length }}个标签</span>
<span class="color_gray" v-else>请选择</span>
<u-icon name="arrow-right" color="#CCD0D3"></u-icon> <u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</div> </div>
</div> </div>
<div class="item" v-if="['Residents', 'CircleOfFriends'].includes(sendType)">
<div class="item" v-if="['Residents'].includes(sendType)">
<div>添加时间</div> <div>添加时间</div>
<div @click="showCalendar = true"> <div @click="showCalendar = true">
<span v-if="!startTime.length && !endTime.length" class="color_gray">请选择</span> <span v-if="!startTime.length && !endTime.length" class="color_gray">请选择</span>
@@ -31,7 +43,8 @@
<u-icon name="arrow-right" color="#CCD0D3"></u-icon> <u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</div> </div>
</div> </div>
<div class="items" v-if="['Residents', 'CircleOfFriends'].includes(sendType)">
<div class="items" v-if="['Residents'].includes(sendType)">
<div>性别</div> <div>性别</div>
<div class="sex"> <div class="sex">
<span :class="sex == 0? 'active':''" @click="sex = 0">全部</span> <span :class="sex == 0? 'active':''" @click="sex = 0">全部</span>
@@ -59,10 +72,14 @@ export default {
showCalendar: false, showCalendar: false,
startTime: '', startTime: '',
endTime: '', endTime: '',
sex: "0", sex: 0, // 性别0-女、1-男、2-全部
userList: [], userList: [],
deptListArr: [], deptListArr: [],
selectedUser: [] selectedUser: [],
circleTags: [], // 朋友圈包含标签
circleTagsRemove: [], // 朋友圈剔除标签
ResidentTags: [], // 居民包含标签
ResidentTagsRemove: [], // 居民剔除标签
} }
}, },
methods: { methods: {
@@ -92,22 +109,20 @@ export default {
}) })
}, },
// 选择包含、剔除的标签 0包含 1剔除
toTagsList(e) { toTagsList(e) {
uni.navigateTo({url: `./tagsList?type=${e}`}) uni.navigateTo({url: `./tagsList?type=${e}&sendType=${this.sendType}`})
}, },
// 选包含标签
// selectTags() {},
// 选剔除标签
// deleteTags() {},
// 选时间范围 // 选时间范围
selectDate(e) { selectDate(e) {
this.startTime = e.startDate this.startTime = e.startDate
this.endTime = e.endDate this.endTime = e.endDate
}, },
submit() { submit() {
uni.setStorageSync('gender',this.sex)
uni.setStorageSync('startTime', this.startTime)
uni.setStorageSync('endTime', this.endTime)
uni.setStorageSync('deptList',this.deptListArr) uni.setStorageSync('deptList',this.deptListArr)
uni.navigateBack() uni.navigateBack()
} }
@@ -118,8 +133,22 @@ export default {
document.title = this.type == 1? '按部门选择':'按网格选择' document.title = this.type == 1? '按部门选择':'按网格选择'
}, },
onShow() { onShow() {
// 网格或者部门
this.selectedUser = uni.getStorageSync('girdSelect') this.selectedUser = uni.getStorageSync('girdSelect')
this.deptListArr = uni.getStorageSync('deptList') this.deptListArr = uni.getStorageSync('deptList')
// 添加时间
this.startTime = uni.getStorageSync('startTime')
this.endTime = uni.getStorageSync('endTime')
// 标签
if(this.sendType == 'Residents') {
this.ResidentTags = uni.getStorageSync('ResidentTags') // 居民包含
this.ResidentTagsRemove = uni.getStorageSync('ResidentTagsRemove') // 居民剔除
} else if(this.sendType == 'CircleOfFriends') {
this.circleTags = uni.getStorageSync('circleTags') // 朋友圈包含
this.circleTagsRemove = uni.getStorageSync('circleTagsRemove') // 朋友圈剔除
}
// 性别
this.sex = uni.getStorageSync('gender')
} }
} }

View File

@@ -69,6 +69,7 @@ export default {
if(!this.selected.userId) { if(!this.selected.userId) {
return this.$u.toast('请选择创建人') return this.$u.toast('请选择创建人')
} }
uni.$emit("pagePicker:custom", [this.selected])
uni.setStorageSync('userSelect', this.selected) uni.setStorageSync('userSelect', this.selected)
uni.navigateBack() uni.navigateBack()
}, },

View File

@@ -3,14 +3,14 @@
<div class="checkedBox"> <div class="checkedBox">
<div class="item" v-for="(item,index) in checkList" :key="index" @click="checkBtn(item)"> <div class="item" v-for="(item,index) in checkList" :key="index" @click="checkBtn(item)">
<div class="left"> <div class="left">
<icon type="success" size="18" v-if="item.checked"/> <icon type="success" size="18" v-if="item.value == sendScope"/>
<icon type="circle" size="18" v-else /> <icon type="circle" size="18" v-if="item.value != sendScope" />
<div class="title">{{ item.name }}</div> <div class="title">{{ item.name }}</div>
</div> </div>
<div class="right" v-if="item.vlaue != '0'"> <div class="right" v-if="item.value != 0">
<div v-if="item.value == '1' && deptSelect.length">已选择{{ deptSelect.length }}个部门</div> <div v-if="item.value == '1' && deptSelect.length">已选择{{ deptSelect.length }}个部门</div>
<div v-if="item.value == '2' && girdSelect.length">已选择{{ girdSelect.length }}个网格</div> <div v-if="item.value == '2' && girdSelect.length">已选择{{ girdSelect.length }}个网格</div>
<u-icon name="arrow-right" color="#CCD0D3"></u-icon> <u-icon name="arrow-right" color="#CCD0D3" ></u-icon>
</div> </div>
</div> </div>
</div> </div>
@@ -36,24 +36,41 @@ export default {
sendType: '', sendType: '',
deptSelect: [], deptSelect: [],
girdSelect: [], girdSelect: [],
sendScope: '0', sendScope: 0,
girdListIds: [], girdListIds: [],
deptListIds: [], deptListIds: [],
wxGroups: [], wxGroups: [], // 居民群,居民,朋友圈
groupNames: [], sex: '',
ResidentTags: [],
ResidentTagsRemove: [],
startTime: '',
endTime: '',
} }
}, },
methods: { methods: {
checkBtn(e) { checkBtn(e) {
this.checkList.forEach(v=> v.checked = false) // this.checkList.forEach(v=> v.checked = false)
e.checked = true // e.checked = true
if(e.value == '1' || e.value == '2') { if(e.value == '1' || e.value == '2') {
uni.navigateTo({url: `./scopedSelect?type=${e.value}&sendType=${this.sendType}`}) uni.navigateTo({url: `./scopedSelect?type=${e.value}&sendType=${this.sendType}`})
} }
this.sendScope = e.value this.sendScope = e.value;
uni.setStorageSync('sendScope', this.sendScope)
// uni.clearStorageSync('ResidentTags')
// uni.clearStorageSync('ResidentTagsRemove')
// uni.clearStorageSync('circleTags')
// uni.clearStorageSync('circleTagsRemove')
}, },
submit() { submit() {
this.getWxGroups() if(this.sendType == 'ResidentsGroup') {
this.getWxGroups()
} else if(this.sendType == 'Residents') {
this.getResidents()
} else if(this.sendType == 'CircleOfFriends') {
this.getCircleOfFriends()
}
uni.setStorageSync('sendScope', this.sendScope) uni.setStorageSync('sendScope', this.sendScope)
setTimeout(() => { setTimeout(() => {
uni.navigateBack({ uni.navigateBack({
@@ -61,37 +78,84 @@ export default {
uni.$emit('predictUser', this.wxGroups) uni.$emit('predictUser', this.wxGroups)
} }
}) })
}, 4000) }, 1000)
}, },
// 群发居民群
getWxGroups() { getWxGroups() {
this.$http.post(`/app/appmasssendingtask/queryWxGroups?sendScope=${this.sendScope}`, this.$http.post(`/app/appmasssendingtask/queryWxGroups?sendScope=${this.sendScope}`,
{ {
filterCriteria: this.girdListIds.join(',') || this.deptListIds.join(',') filterCriteria: this.girdListIds.join(',') || this.deptListIds.join(',')
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.wxGroups = res.data this.wxGroups = res.data
uni.setStorageSync('wxGroupsUser', this.wxGroups) uni.setStorageSync('wxGroupsUser', this.wxGroups)
console.log(this.wxGroups,res.data);
} }
}) })
}, },
// 群发居民
getResidents() {
const tags = this.ResidentTags.join(',')
const removeTags = this.ResidentTagsRemove.join(',')
this.$http.post(`/app/whchatmomentstask/getCustomerGroups?sendScope=${this.sendScope}&addFromTime=${this.startTime}&addEndTime=${this.endTime}&gender=${this.sex}&filteTags=${tags}&excludeFilterTags=${removeTags}`,
{
filterCriteria: this.girdListIds.join(',') || this.deptListIds.join(','),
}).then(res => {
if (res.code === 0) {
// this.groupList = res.data
// uni.setStorageSync('groupList', this.groupList)
this.wxGroups = res.data
uni.setStorageSync('wxGroupsUser', this.wxGroups)
}
})
},
// const array1 = [{name:'zs',num: 1},{name:'zls',num: 5},{name:'azs',num: 4}]
// const sum = array1.reduce((pre, cur) => pre + cur.num, 0)
// console.log(sum)
// 群发朋友圈
getCircleOfFriends() {
this.$http.post(`/app/whchatmomentstask/getExecutors?sendScope=${this.sendScope}`,
{
filterCriteria: this.girdListIds.join(',') || this.deptListIds.join(',')
}).then(res => {
if (res.code === 0) {
// this.executorList = res.data
// uni.setStorageSync('executorList', this.executorList)
this.wxGroups = res.data
uni.setStorageSync('wxGroupsUser', this.wxGroups)
}
})
}
}, },
onLoad(o) { onLoad(o) {
this.sendType = o.type; this.sendType = o.type;
document.title = "选择发送范围" document.title = "选择发送范围"
// this.checkList.forEach(i=> {
// return {
// name: i.name,
// value: i.value,
// checked: this.sendScope.find(v=>(i.value==v))
// }
// })
}, },
onShow() { onShow() {
this.sendScope = uni.getStorageSync('sendScope') || '' this.sendScope = uni.getStorageSync('sendScope') || ''
this.girdListIds = uni.getStorageSync('girdSelect').map(e=>e.id) || [] const girdArr = uni.getStorageSync('girdSelect')
this.deptListIds = uni.getStorageSync('deptList').map(v=>v.id) || [] if(girdArr.length) {
this.girdListIds = girdArr.map(e=>e.id)
}
const deptArr = uni.getStorageSync('deptList')
if(deptArr.length) {
this.deptListIds = deptArr.map(v=>v.id)
}
this.sex = uni.getStorageSync('gender')
// 标签
if(this.sendType == 'Residents') {
this.ResidentTags = uni.getStorageSync('ResidentTags') // 居民包含
this.ResidentTagsRemove = uni.getStorageSync('ResidentTagsRemove') // 居民剔除
}
// 时间
this.startTime = uni.getStorageSync('startTime')
this.endTime = uni.getStorageSync('endTime')
// else if(this.sendType == 'CircleOfFriends') {
// this.circleTags = uni.getStorageSync('circleTags') // 朋友圈包含
// this.circleTagsRemove = uni.getStorageSync('circleTagsRemove') // 朋友圈剔除
// }
} }
} }
</script> </script>

View File

@@ -23,67 +23,17 @@ export default {
name: "tagsList", name: "tagsList",
data() { data() {
return { return {
subTags: [ sendType: '',
{ subTags: [],
id: "1",
name: "第一组",
tagList: [
{
id: "1.1",
name: "介绍的",
},
{
id: "1.2",
name: "介绍的啊塑胶地板",
},
{
id: "1.3",
name: "介绍的",
},
{
id: "1.4",
name: "介绍的啊啊啊啊啊啊啊啊",
},
{
id: "1.5",
name: "介绍的啊啊啊",
},
{
id: "1.6",
name: "介绍的红红火火恍恍惚惚或或或或或或或或或或或或红红火火恍恍惚惚或或或或或或或",
},
{
id: "1.7",
name: "介绍的红红火火恍恍惚惚或或或或或或或或或或或或红红火火恍恍惚惚或或或或或或或",
},
]
},
{
id: "2",
name: "第二组",
tagList: [
{
id: "2.2",
name: "的范德萨发",
}
]
}
],
checked: [], checked: [],
list: [] type: '',
} }
}, },
methods: { methods: {
getTags() { getTags() {
this.$http.post(`/app/wxcp/wxcorptag/listAll`).then(res => { this.$http.post(`/app/wxcp/wxcorptag/listAll?current=1&size=3000`).then(res => {
if (res?.data) { if (res?.data) {
console.log(res); this.subTags = res.data.records
// this.subTags = res.data.map(item => {
// return {
// dictName: item.name,
// dictValue: item.id
// }
// })
} }
}) })
}, },
@@ -101,20 +51,47 @@ export default {
return this.$u.toast('请选择标签') return this.$u.toast('请选择标签')
} }
const list = this.list.filter(v => { // const list = this.subTags.filter(v => {
return this.checked.includes(v.id) // return this.checked.includes(v.id)
}) // })
uni.$emit('onChecked', list)
if(this.sendType == 'Residents') {
if(this.type == '0') { // 居民包含
uni.setStorageSync('ResidentTags', this.checked)
} else if(this.type == '1') { // 居民剔除
uni.setStorageSync('ResidentTagsRemove', this.checked)
}
} else if(this.sendType == 'CircleOfFriends') {
if(this.type == '0') { // 朋友圈包含
uni.setStorageSync('circleTags', this.checked)
} else if(this.type == '1') { // 朋友圈剔除
uni.setStorageSync('circleTagsRemove', this.checked)
}
}
uni.navigateBack() uni.navigateBack()
} }
}, },
onShow() { onShow() {
this.getTags() this.getTags()
this.checked = []
if(this.sendType == 'Residents') {
if(this.type == 0) { // 居民包含
this.checked = uni.getStorageSync('ResidentTags') || []
} else { // 居民剔除
this.checked = uni.getStorageSync('ResidentTagsRemove') || []
}
} else if(this.sendType == 'CircleOfFriends') {
if(this.type == 0) { // 朋友圈包含
this.checked = uni.getStorageSync('circleTags') || []
} else { // 朋友圈剔除
this.checked = uni.getStorageSync('circleTagsRemove') || []
}
}
}, },
onLoad(o) { onLoad(o) {
document.title = o.type ==0? '包含标签': '剔除标签' document.title = o.type ==0? '包含标签': '剔除标签'
this.sendType = o.sendType
this.type = o.type
} }
} }
</script> </script>

View File

@@ -68,7 +68,6 @@ export default {
if(!this.selected.userId) { if(!this.selected.userId) {
return this.$u.toast('请选择创建人') return this.$u.toast('请选择创建人')
} }
uni.$emit("pagePicker:custom", [this.selected])
uni.setStorageSync('userSelect', this.selected) uni.setStorageSync('userSelect', this.selected)
uni.navigateBack() uni.navigateBack()
}, },