省志愿者demo根据用户自己抓取外部联系人和用户调试成功
This commit is contained in:
@@ -22,18 +22,18 @@ export default {
|
|||||||
...mapActions(['injectJWeixin']),
|
...mapActions(['injectJWeixin']),
|
||||||
getUsers() {
|
getUsers() {
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
this.$http.post("/app/wxcp/wxuser/list", null, {params: {listType: 0}}).then(res => {
|
// this.$http.post("/app/wxcp/wxuser/list", null, {params: {listType: 0}}).then(res => {
|
||||||
if (res?.data) {
|
// if (res?.data) {
|
||||||
return this.users.userIds = res.data.records?.map(e => e.id)
|
// return this.users.userIds = res.data.records?.map(e => e.id).join(";")
|
||||||
}
|
// }
|
||||||
}),
|
// }),
|
||||||
this.$http.post("/app/wxcp/wxcustomer/list", null, {
|
this.$http.post("/app/wxcp/wxcustomer/list", null, {
|
||||||
params: {
|
params: {
|
||||||
wxUserId: this.user.wxUserId
|
wxUserId: this.user.wxUserId
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
return this.users.externalUserIds = res.data.records?.map(e => e.id)
|
return this.users.externalUserIds = res.data.records?.filter(e => e.type == 1)?.map(e => e.id).join(";")
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
])
|
])
|
||||||
@@ -43,8 +43,8 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.injectJWeixin("openEnterpriseChat").then(() => this.$confirm("确定创建省志愿者活动专用群聊?"))
|
this.injectJWeixin("openEnterpriseChat").then(() => this.$confirm("确定创建省志愿者活动专用群聊?"))
|
||||||
.then(this.getUsers).then(() => {
|
.then(this.getUsers).then(() => {
|
||||||
|
console.log(this.users)
|
||||||
wx.openEnterpriseChat({
|
wx.openEnterpriseChat({
|
||||||
userIds: "18507227517;AiXianLing",
|
|
||||||
externalUserIds: "wmGBFVDgAAj_krfwaThRm-RRAq9rBeaQ",
|
externalUserIds: "wmGBFVDgAAj_krfwaThRm-RRAq9rBeaQ",
|
||||||
groupName: "省志愿者活动专用群",
|
groupName: "省志愿者活动专用群",
|
||||||
...this.users,
|
...this.users,
|
||||||
|
|||||||
Reference in New Issue
Block a user