企业微信h5页面调用selectEnterpriseContact 接口的问题?
selectEnterpriseContact(selectedDepartmentIds) {
let _that = this
console.log(`selectedDepartmentIds`, selectedDepartmentIds)
wx.invoke("selectEnterpriseContact", {
"fromDepartmentId": -1,// 必填,表示打开的通讯录从指定的部门开始展示,-1表示自己所在部门开始, 0表示从最上层开始
"mode": "multi",// 必填,选择模式,single表示单选,multi表示多选
"type": ["department"],// 必填,选择限制类型,指定department、user中的一个或者多个
"selectedDepartmentIds": selectedDepartmentIds,// 非必填,已选部门ID列表。用于多次选人时可重入,single模式下请勿填入多个id
// "selectedUserIds": []// 非必填,已选用户ID列表。用于多次选人时可重入,single模式下请勿填入多个id
}, function (res) {
console.log(res)
// _that.selectedDepartmentIds = []
if (res.err_msg == "selectEnterpriseContact:ok") {
if (typeof res.result == 'string') {
res.result = JSON.parse(res.result) //由于目前各个终端尚未完全兼容,需要开发者额外判断result类型以保证在各个终端的兼容性
}
var selectedDepartmentList = res.result.departmentList;// 已选的部门列表
if (selectedDepartmentList.length > 0) {
_that.selectedDepartmentIds.length = 0
}
for (var i = 0; i < selectedDepartmentList.length; i++) {
var department = selectedDepartmentList[i];
var departmentId = department.id;// 已选的单个部门ID
var departemntName = department.name;// 已选的单个部门名称
_that.selectedDepartmentIds.push(departmentId)
}
_that.selectedDepartmentList = selectedDepartmentList
_that.formData.depname = _that.selectedDepartmentIds.join(',')
}
});
},
回填selectedDepartmentIds在mac端正常,可是在windows系统下就无效了,同样的代码