2022-09-29 09:41:02 +08:00
|
|
|
<template>
|
|
|
|
|
<section class="AppOpenChat">
|
2022-09-29 10:39:41 +08:00
|
|
|
<AiLoading tips="正在处理..."/>
|
2022-09-29 09:41:02 +08:00
|
|
|
</section>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-09-29 10:39:41 +08:00
|
|
|
import {mapActions, mapState} from "vuex"
|
2022-09-29 09:41:02 +08:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "AppOpenChat",
|
|
|
|
|
appName: "创建群聊",
|
2022-09-29 10:39:41 +08:00
|
|
|
computed: {
|
|
|
|
|
...mapState(['user'])
|
|
|
|
|
},
|
2022-09-29 09:41:02 +08:00
|
|
|
data() {
|
2022-09-29 10:39:41 +08:00
|
|
|
return {
|
|
|
|
|
users: {}
|
|
|
|
|
}
|
2022-09-29 09:41:02 +08:00
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
...mapActions(['injectJWeixin']),
|
2022-09-29 10:39:41 +08:00
|
|
|
getUsers() {
|
|
|
|
|
return Promise.all([
|
|
|
|
|
this.$http.post("/app/wxcp/wxuser/list", null, {params: {listType: 0}}).then(res => {
|
|
|
|
|
if (res?.data) {
|
|
|
|
|
return this.users.userIds = res.data.records?.map(e => e.id)
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
this.$http.post("/app/wxcp/wxcustomer/list", null, {
|
|
|
|
|
params: {
|
|
|
|
|
wxUserId: this.user.wxUserId
|
|
|
|
|
}
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res?.data) {
|
|
|
|
|
return this.users.externalUserIds = res.data.records?.map(e => e.id)
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
}
|
2022-09-29 09:41:02 +08:00
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.injectJWeixin("openEnterpriseChat").then(() => this.$confirm("确定创建省志愿者活动专用群聊?"))
|
2022-09-29 10:39:41 +08:00
|
|
|
.then(this.getUsers).then(() => {
|
2022-09-29 09:41:02 +08:00
|
|
|
wx.openEnterpriseChat({
|
2022-09-29 09:43:56 +08:00
|
|
|
userIds: "18507227517;AiXianLing",
|
2022-09-29 09:41:02 +08:00
|
|
|
externalUserIds: "wmGBFVDgAAj_krfwaThRm-RRAq9rBeaQ",
|
2022-09-29 10:39:41 +08:00
|
|
|
groupName: "省志愿者活动专用群",
|
|
|
|
|
...this.users,
|
2022-09-29 09:41:02 +08:00
|
|
|
})
|
|
|
|
|
}).catch(() => 0)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.AppOpenChat {
|
|
|
|
|
}
|
|
|
|
|
</style>
|