Files
dvcp_v2_wxcp_app/src/apps/AppOpenChat/AppOpenChat.vue

62 lines
1.5 KiB
Vue
Raw Normal View History

2022-09-29 09:41:02 +08:00
<template>
<section class="AppOpenChat">
<AiLoading tips="正在处理..."/>
2022-09-29 14:57:46 +08:00
<AiConsole show/>
2022-09-29 09:41:02 +08:00
</section>
</template>
<script>
import {mapActions, mapState} from "vuex"
2022-09-29 09:41:02 +08:00
export default {
name: "AppOpenChat",
appName: "创建群聊",
computed: {
...mapState(['user'])
},
2022-09-29 09:41:02 +08:00
data() {
return {
users: {}
}
2022-09-29 09:41:02 +08:00
},
methods: {
...mapActions(['injectJWeixin']),
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).join(";")
// }
// }),
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?.filter(e => e.type == 1)?.map(e => e.id).join(";")
}
}),
])
}
2022-09-29 09:41:02 +08:00
},
created() {
this.injectJWeixin("openEnterpriseChat").then(() => this.$confirm("确定创建省志愿者活动专用群聊?"))
.then(this.getUsers).then(() => {
console.log(this.users)
2022-09-29 09:41:02 +08:00
wx.openEnterpriseChat({
externalUserIds: "wmGBFVDgAAj_krfwaThRm-RRAq9rBeaQ",
groupName: "省志愿者活动专用群",
...this.users,
2022-09-29 09:41:02 +08:00
})
}).catch(() => 0)
}
}
</script>
<style lang="scss" scoped>
.AppOpenChat {
}
</style>