协同宣发
This commit is contained in:
@@ -3,14 +3,14 @@
|
||||
<div class="checkedBox">
|
||||
<div class="item" v-for="(item,index) in checkList" :key="index" @click="checkBtn(item)">
|
||||
<div class="left">
|
||||
<icon type="success" size="18" v-if="item.checked"/>
|
||||
<icon type="circle" size="18" v-else />
|
||||
<icon type="success" size="18" v-if="item.value == sendScope"/>
|
||||
<icon type="circle" size="18" v-if="item.value != sendScope" />
|
||||
<div class="title">{{ item.name }}</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 == '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>
|
||||
@@ -39,21 +39,41 @@ export default {
|
||||
sendScope: '0',
|
||||
girdListIds: [],
|
||||
deptListIds: [],
|
||||
wxGroups: [],
|
||||
groupNames: [],
|
||||
wxGroups: [], // 居民群,居民,朋友圈
|
||||
sex: '',
|
||||
// groupList: [], // 居民
|
||||
// executorList: [], // 朋友圈
|
||||
ResidentTags: [],
|
||||
ResidentTagsRemove: [],
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
checkBtn(e) {
|
||||
this.checkList.forEach(v=> v.checked = false)
|
||||
e.checked = true
|
||||
// this.checkList.forEach(v=> v.checked = false)
|
||||
// e.checked = true
|
||||
|
||||
if(e.value == '1' || e.value == '2') {
|
||||
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() {
|
||||
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)
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
@@ -64,6 +84,7 @@ export default {
|
||||
}, 4000)
|
||||
|
||||
},
|
||||
// 群发居民群
|
||||
getWxGroups() {
|
||||
this.$http.post(`/app/appmasssendingtask/queryWxGroups?sendScope=${this.sendScope}`,
|
||||
{
|
||||
@@ -72,26 +93,68 @@ export default {
|
||||
if (res.code === 0) {
|
||||
this.wxGroups = res.data
|
||||
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)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 群发朋友圈
|
||||
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) {
|
||||
this.sendType = o.type;
|
||||
document.title = "选择发送范围"
|
||||
// this.checkList.forEach(i=> {
|
||||
// return {
|
||||
// name: i.name,
|
||||
// value: i.value,
|
||||
// checked: this.sendScope.find(v=>(i.value==v))
|
||||
// }
|
||||
// })
|
||||
},
|
||||
onShow() {
|
||||
this.sendScope = uni.getStorageSync('sendScope') || ''
|
||||
this.girdListIds = uni.getStorageSync('girdSelect').map(e=>e.id) || []
|
||||
this.deptListIds = uni.getStorageSync('deptList').map(v=>v.id) || []
|
||||
const girdArr = uni.getStorageSync('girdSelect')
|
||||
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')
|
||||
// console.log(this.startTime, '哈哈哈哈');
|
||||
this.endTime = uni.getStorageSync('endTime')
|
||||
// else if(this.sendType == 'CircleOfFriends') {
|
||||
// this.circleTags = uni.getStorageSync('circleTags') // 朋友圈包含
|
||||
// this.circleTagsRemove = uni.getStorageSync('circleTagsRemove') // 朋友圈剔除
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user