群标签

This commit is contained in:
liuye
2023-05-24 18:01:09 +08:00
parent 1ac5605e06
commit dcbb58bdc1
3 changed files with 99 additions and 37 deletions

View File

@@ -3,11 +3,11 @@
<AiTopFixed>
<div class="header-flex">
<div class="item">
<h3>100</h3>
<h3>{{totalInfo['已打标签']}}</h3>
<p>已打标签</p>
</div>
<div class="item">
<h3>100</h3>
<h3>{{totalInfo['未打标签']}}</h3>
<p>未打标签</p>
</div>
</div>
@@ -18,7 +18,7 @@
</AiPagePicker>
</div>
</AiTopFixed>
<div class="list-content">
<div class="list-content" v-if="list.length">
<div class="item" v-for="(item, index) in list" :key="index">
<div class="item-content" @click="viewList(index)">
<div class="label">{{item.name}}</div>
@@ -29,11 +29,12 @@
<div class="item-list" v-if="activeIndex == index">
<div class="row" v-for="(row, indexs) in item.tagList" :key="indexs" @click="toGrouping(row)">
<div class="row-label">{{row.name}}</div>
<div class="row-value">50</div>
<div class="row-value">{{row.groupCount}}</div>
</div>
</div>
</div>
</div>
<AiEmpty v-else/>
</div>
</template>
@@ -44,10 +45,9 @@
data() {
return {
deptList: [],
current: 1,
pages: 2,
list: [],
activeIndex: null
activeIndex: null,
totalInfo: {}
}
},
computed: {
@@ -56,27 +56,36 @@
onLoad() {
this.deptList = [{name: this.user.departName, id: this.user.departId}]
this.getList()
this.getTotal()
uni.$on('updateGroup', () => {
this.getList()
this.getTotal()
})
},
onShow() {
document.title = '群标签'
},
methods: {
getListInit() {
this.current = 1
this.pages = 2
this.getList()
this.getTotal()
},
getList() {
if(this.current > this.pages) return
this.$http.post(`/app/wxcp/wxgroupchattag/listAll?current=${this.current}`).then(res=> {
this.$http.post(`/app/wxcp/wxgroupchattag/listAllByDeptId?departId=${this.deptList[0].id}`).then(res=> {
if(res?.data) {
this.list = this.current == 1? res.data.records : [...this.list,...res.data.records]
this.pages = res.data.pages
this.list = res.data
}
})
},
getTotal() {
this.$http.post(`/app/wxcp/wxgroupchattag/simpleStatistics?departId=${this.deptList[0].id}`).then(res=> {
if(res?.data) {
this.totalInfo = res.data
}
})
},
toGrouping(row) {
uni.navigateTo({url: `./groupGrouping?name=${row.name}&id=${row.taggroupId}`})
uni.navigateTo({url: `./groupGrouping?name=${row.name}&tagId=${row.id}&departId=${this.deptList[0].id}`})
},
viewList(index) {
if(this.activeIndex == index) {
@@ -85,10 +94,6 @@
this.activeIndex = index
}
},
onReachBottom() {
this.current ++
this.getList()
}
}
</script>

View File

@@ -5,7 +5,7 @@
search-icon-color="#999" color="#333" height="58" @search="getListInit" @clear="getListInit">
</u-search>
</AiTopFixed>
<div class="list-content">
<div class="list-content" v-if="list.length">
<div class="item" v-for="(item, index) in list" :key="index">
<img :src="item.qrCode" alt="" class="group-img">
<div class="item-right">
@@ -17,6 +17,7 @@
</div>
</div>
</div>
<AiEmpty v-else/>
<AiAdd @add="add"/>
</div>
</template>
@@ -30,9 +31,10 @@
keyword: '',
titleName: '',
tagId: '',
departId: '',
current: 1,
pages: 2,
list: []
list: [],
}
},
computed: {
@@ -40,8 +42,12 @@
},
onLoad(option) {
this.titleName = option.name
this.tagId = option.id
this.getListInit()
this.tagId = option.tagId
this.departId = option.departId
this.getList()
uni.$on('updateGroup', () => {
this.getListInit()
})
},
onShow() {
document.title = this.titleName
@@ -54,10 +60,10 @@
},
getList() {
if(this.current > this.pages) return
this.$http.post(`/app/wxcp/wxgroup/list?current=${this.current}&groupName=${this.keyword}&size=10`).then(res=> {
this.$http.post(`/app/wxcp/wxgroupchattag/queryGroupByTagId?tagId=${this.tagId}&departId=${this.departId}&name=${this.keyword}&current=${this.current}`).then(res=> {
if(res?.data) {
this.list = this.current == 1? res.data.records : [...this.list,...res.data.records]
this.pages = res.data.pages
this.list = this.current == 1 ? res.data.records : [...this.list, ...rs,data.records]
this.pages = res.data.total
}
})
},
@@ -72,8 +78,8 @@
})
},
add() {
uni.navigateTo({url: `./groupList`})
}
uni.navigateTo({url: `./groupList?tagId=${this.tagId}&departId=${this.departId}`})
},
},
onReachBottom() {
this.current ++

View File

@@ -5,16 +5,18 @@
search-icon-color="#999" color="#333" height="58" @search="getListInit" @clear="getListInit">
</u-search>
</AiTopFixed>
<div class="list-content">
<div class="item" v-for="(item, index) in 20" :key="index">
<img src="./imgs/xz.png" alt="" class="choose-img" @click="checkClick(index)">
<div class="list-content" v-if="list.length">
<div class="item" v-for="(item, index) in list" :key="index">
<img src="./imgs/xzh.png" alt="" class="choose-img" v-if="item.isCheck" @click="checkClick(index)">
<img src="./imgs/xz.png" alt="" class="choose-img" v-else @click="checkClick(index)">
<div class="item-right">
<img src="./imgs/user-img.png" alt="">
<p>222222{{index}}</p>
<p>{{item.name}}</p>
</div>
</div>
</div>
<div class="footer">
<AiEmpty v-else/>
<div class="footer" @click="confirm">
<div>确定</div>
</div>
</div>
@@ -26,27 +28,76 @@
appName: '群列表',
data() {
return {
tagId: '',
departId: '',
current: 1,
pages: 2,
list: [],
keyword: ''
}
},
computed: {
...mapState(['user']),
},
onLoad(option) {
this.tagId = option.tagId
this.departId = option.departId
this.getList()
},
onShow() {
document.title = '群列表'
},
methods: {
getTotal() {
this.$http.post(`/app/appwxuserfamiliarityrate/wxTopStatistics`).then(res=> {
getListInit() {
this.current = 1
this.pages = 2
this.getList()
},
getList() {
if(this.current > this.pages) return
this.$http.post(`/app/wxcp/wxgroupchattag/queryGroupByDeptId?tagId=${this.tagId}&departId=${this.departId}&name=${this.keyword}`).then(res=> {
if(res?.data) {
this.form = {...res.data}
res.data.records.map((item) => {
item.isCheck = false
})
this.list = this.current == 1 ? res.data.records : [...this.list, ...rs,data.records]
this.pages = res.data.total
}
})
},
checkClick(index) {
this.list[index].isCheck = !this.list[index].isCheck
},
confirm() {
var ids = []
this.list.map((item) => {
if(item.isCheck) {
ids.push(item.id)
}
})
if(!ids.length) {
return this.$u.toast('请选择群')
}
var tagIds = [this.tagId]
this.$http.post(`/app/wxcp/wxgroupchattag/markTagForWeb`, {
tagIds: tagIds,
groupIds: ids,
type: 0
}).then(res=> {
if(res.code == 0) {
uni.$emit('updateGroup')
this.$u.toast('提交成功')
setTimeout(() => {
uni.navigateBack()
}, 1000)
}
})
}
},
onReachBottom() {
this.current++
this.getList()
}
}
</script>