Commit 2069bb0f by xinla

H5获取客户id等

1 parent 70d724b9
...@@ -383,57 +383,59 @@ export default { ...@@ -383,57 +383,59 @@ export default {
}) })
let entry = undefined let entry = undefined
let _this = this let _this = this
wx.invoke('getContext', {}, function(res) { try {
if (res.err_msg == 'getContext:ok') { wx.invoke('getContext', {}, function(res) {
entry = res.entry //返回进入H5页面的入口类型,目前有normal、contact_profile、single_chat_tools、group_chat_tools if (res.err_msg == 'getContext:ok') {
if ( entry = res.entry //返回进入H5页面的入口类型,目前有normal、contact_profile、single_chat_tools、group_chat_tools
![ if (
'single_chat_tools', ![
'group_chat_tools', 'single_chat_tools',
'contact_profile', 'group_chat_tools',
].includes(entry) 'contact_profile',
) { ].includes(entry)
// _this.$toast.clear() ) {
_this.$toast('入口错误:' + entry) // _this.$toast.clear()
return _this.$toast('入口错误:' + entry)
} return
}
wx.invoke('getCurExternalContact', {}, function(resContact) { wx.invoke('getCurExternalContact', {}, function(resContact) {
if (resContact.err_msg == 'getCurExternalContact:ok') { if (resContact.err_msg == 'getCurExternalContact:ok') {
this.externalUserid = resContact.userId //返回当前外部联系人userId _this.externalUserid = resContact.userId //返回当前外部联系人userId
// 获取客户详细信息 // 获取客户详细信息
getCustomerInfo({ getCustomerInfo({
externalUserid: this.externalUserid, externalUserid: _this.externalUserid,
userid: this.userId, userid: _this.userId,
})
.then(({ data }) => {
_this.$toast.clear()
console.log(data)
_this.$dialog({
message: '获取客户失败:' + JSON.stringify(data),
})
}) })
.catch((err) => { .then(({ data }) => {
_this.$toast.clear() _this.$toast.clear()
console.log(err) _this.$dialog({
_this.$dialog({ message: '获取客户成功:' + JSON.stringify(data),
message: '获取客户失败:' + JSON.stringify(err), })
})
.catch((err) => {
_this.$toast.clear()
_this.$dialog({
message: '获取客户失败:' + JSON.stringify(err),
})
}) })
} else {
_this.$toast.clear()
//错误处理
_this.$dialog({
message: '获取客户id失败:' + JSON.stringify(resContact),
}) })
} else { }
_this.$toast.clear() })
//错误处理 } else {
_this.$dialog({ _this.$toast.clear()
message: '获取客户id失败:' + JSON.stringify(resContact), //错误处理
}) _this.$dialog({ message: '进入失败:' + JSON.stringify(res) })
} }
}) })
} else { } catch (err) {
_this.$toast.clear() _this.$dialog({ message: 'err' + JSON.stringify(err) })
//错误处理 }
_this.$dialog({ message: '进入失败:' + JSON.stringify(res) })
}
})
}, },
// 添加代办 // 添加代办
// 表单提交 // 表单提交
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!