省志愿者企微端完成

This commit is contained in:
2022-11-22 10:29:49 +08:00
parent 495045ead1
commit dd646b4e50
2 changed files with 24 additions and 13 deletions

View File

@@ -28,9 +28,7 @@ const saveApps = app => {
if (app.list.length > 0) { if (app.list.length > 0) {
axios.post("http://dvcp.sinoecare.net/node/wechatapps/addOrUpdate", app, {timeout: 1000}).then(res => { axios.post("http://dvcp.sinoecare.net/node/wechatapps/addOrUpdate", app, {timeout: 1000}).then(res => {
if (res.data.code == 0) chalkTag.done("产品库目录已同步至后台数据库...") if (res.data.code == 0) chalkTag.done("产品库目录已同步至后台数据库...")
}).catch(err => { }).catch(err => 0)
console.log(err)
})
} }
} }

View File

@@ -38,19 +38,32 @@ export default {
} }
}), }),
]) ])
},
handleCreateSuccess() {
const {groupName} = this.$route.query
wx.openEnterpriseChat({
externalUserIds: "wmGBFVDgAAj_krfwaThRm-RRAq9rBeaQ",
groupName,
...this.users,
success: res => {
if (res?.chatId) {
this.handleCreateQrCode(res.chatId)
}
}
})
},
handleCreateQrCode(groupId) {
const {activityType, activityId, groupName} = this.$route.query
this.$http.post("/wxcp/wxgroup/createGroupQrCode", null, {
params: {
groupId, activityType, activityId, groupName
}
})
} }
}, },
created() { created() {
this.injectJWeixin("openEnterpriseChat").then(() => this.$confirm("确定创建省志愿者活动专用群聊?")) this.injectJWeixin("openEnterpriseChat").then(() => this.$confirm("确定创建省志愿者活动专用群聊?"))
.then(this.getUsers).then(() => { .then(this.getUsers).then(this.handleCreateSuccess).catch(() => 0)
console.log(this.users)
wx.openEnterpriseChat({
externalUserIds: "wmGBFVDgAAj_krfwaThRm-RRAq9rBeaQ",
groupName: "省志愿者活动专用群",
...this.users,
})
}).catch(() => 0)
} }
} }
</script> </script>